diff --git a/corehq/apps/prototype/static/prototype/js/data_cleaning.js b/corehq/apps/prototype/static/prototype/js/data_cleaning.js index c4e365b83e2b..ae3f543448f2 100644 --- a/corehq/apps/prototype/static/prototype/js/data_cleaning.js +++ b/corehq/apps/prototype/static/prototype/js/data_cleaning.js @@ -36,9 +36,6 @@ hqDefine("prototype/js/data_cleaning",[ if (evt.detail.elt.dataset.refreshTable) { htmx.trigger(evt.detail.elt.dataset.refreshTable, 'refreshTable'); } - if (evt.detail.elt.dataset.refreshEdit) { - htmx.trigger(evt.detail.elt.dataset.refreshEdit, 'refreshEdit'); - } }); document.body.addEventListener('htmx:beforeSend', function (evt) { if (evt.detail.elt.dataset.selectAll) { diff --git a/corehq/apps/prototype/templates/prototype/data_cleaning/partials/buttons/apply_edits_button.html b/corehq/apps/prototype/templates/prototype/data_cleaning/partials/buttons/apply_edits_button.html deleted file mode 100644 index dedd5eb714c7..000000000000 --- a/corehq/apps/prototype/templates/prototype/data_cleaning/partials/buttons/apply_edits_button.html +++ /dev/null @@ -1,21 +0,0 @@ -{% load i18n %} -{% load django_tables2 %} -{% load hq_shared_tags %} - -
- - {% trans "Edits" %}: - -
diff --git a/corehq/apps/prototype/templates/prototype/data_cleaning/partials/columns/editable_column.html b/corehq/apps/prototype/templates/prototype/data_cleaning/partials/columns/editable_column.html index be61e3d8df9c..dd761a6c032a 100644 --- a/corehq/apps/prototype/templates/prototype/data_cleaning/partials/columns/editable_column.html +++ b/corehq/apps/prototype/templates/prototype/data_cleaning/partials/columns/editable_column.html @@ -1,9 +1,12 @@ {% load django_tables2 %} +{% load hq_shared_tags %}
+ cellValue: "{% if edited_value %}{{ edited_value }}{% else %}{{ value }}{% endif %}" }' + {% if update_edit %} + x-init="$dispatch('updateApplyEditsButton', {{ table.has_edits|BOOL }})" + {% endif %}>
diff --git a/corehq/apps/prototype/templates/prototype/data_cleaning/partials/tables/table_with_status_bar.html b/corehq/apps/prototype/templates/prototype/data_cleaning/partials/tables/table_with_status_bar.html index 983a7bfe4479..351f7506665d 100644 --- a/corehq/apps/prototype/templates/prototype/data_cleaning/partials/tables/table_with_status_bar.html +++ b/corehq/apps/prototype/templates/prototype/data_cleaning/partials/tables/table_with_status_bar.html @@ -68,7 +68,20 @@
{% endif %} - {% include "prototype/data_cleaning/partials/buttons/apply_edits_button.html" %} +
+ + {% trans "Edits" %}: + +
{{ block.super }} diff --git a/corehq/apps/prototype/views/data_cleaning/tables.py b/corehq/apps/prototype/views/data_cleaning/tables.py index 461d35f82b04..2d911b689995 100644 --- a/corehq/apps/prototype/views/data_cleaning/tables.py +++ b/corehq/apps/prototype/views/data_cleaning/tables.py @@ -198,6 +198,7 @@ def get_cell_context_data(self, request): def render_table_cell_response(self, request, *args, **kwargs): context = self.get_cell_context_data(request) + context['update_edit'] = True self.template_name = self.get_column().template_name return self.render_htmx_partial_response( request, self.get_column().template_name, context @@ -228,16 +229,3 @@ def edit_cell_value(self, request, *args, **kwargs): del all_rows[self.record_id][edited_slug] data_store.set(all_rows) return self.render_table_cell_response(request, *args, **kwargs) - - @hx_action('post') - def refresh_apply_edits_button(self, request, *args, **kwargs): - context = {} - table = config.RequestConfig(request).configure( - self.table_class(data=[]) - ) - context[self.get_context_table_name(table)] = table - return self.render_htmx_partial_response( - request, - "prototype/data_cleaning/partials/buttons/apply_edits_button.html", - context - )