From 2a020fa6cc954463a46ba5c27b7c0947dc73c236 Mon Sep 17 00:00:00 2001 From: Wyatt Hoodes Date: Thu, 22 Aug 2019 14:16:15 -1000 Subject: [PATCH] data export: Fix sort feature regression. 02cfb47 removed a couple HTML tags that were being used to sort the table. We fix this, but disable filtering exports by marking the input type as `hidden`. We use this approach as it seems `list_render` doesn't like an undefined `opts.filter.element`, which is what happens if we simply remove the `filter` key. --- static/js/settings_exports.js | 6 +++--- static/templates/settings/data_exports_admin.hbs | 4 +++- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/static/js/settings_exports.js b/static/js/settings_exports.js index e307a97325..66fa7b139c 100644 --- a/static/js/settings_exports.js +++ b/static/js/settings_exports.js @@ -18,8 +18,8 @@ exports.populate_exports_table = function (exports) { } var exports_table = $('#admin_exports_table').expectOne(); - var exports_list = list_render.create(exports_table, exports, { - name: "admin-exports-list", + var exports_list = list_render.create(exports_table, Object.values(exports), { + name: "admin_exports_list", modifier: function (data) { if (data.export_data.deleted_timestamp === undefined) { return render_admin_export_list({ @@ -46,7 +46,7 @@ exports.populate_exports_table = function (exports) { }, }, parent_container: $("#data-exports").expectOne(), - }); + }).init(); exports_list.add_sort_function("user", function (a, b) { var a_name = people.get_full_name(a.acting_user_id).toLowerCase(); diff --git a/static/templates/settings/data_exports_admin.hbs b/static/templates/settings/data_exports_admin.hbs index 4c1ed8ea0f..1115e68dc2 100644 --- a/static/templates/settings/data_exports_admin.hbs +++ b/static/templates/settings/data_exports_admin.hbs @@ -28,7 +28,9 @@ {{/if}} -
+ +
{{t "Requesting user" }}