From d90d352a86f5a1d51e5a526656d934ff8c0c0269 Mon Sep 17 00:00:00 2001 From: Cillian O'Ruanaidh Date: Fri, 16 Dec 2022 12:55:28 +0000 Subject: [PATCH] Remove unused showMore angular directive --- .../admin/index_utils/directives/show_more.js.coffee | 12 ------------ .../javascripts/templates/admin/show_more.html.haml | 3 --- app/views/admin/customers/index.html.haml | 1 - .../admin/variant_overrides/_show_more.html.haml | 1 - 4 files changed, 17 deletions(-) delete mode 100644 app/assets/javascripts/admin/index_utils/directives/show_more.js.coffee delete mode 100644 app/assets/javascripts/templates/admin/show_more.html.haml diff --git a/app/assets/javascripts/admin/index_utils/directives/show_more.js.coffee b/app/assets/javascripts/admin/index_utils/directives/show_more.js.coffee deleted file mode 100644 index a6e4efa333..0000000000 --- a/app/assets/javascripts/admin/index_utils/directives/show_more.js.coffee +++ /dev/null @@ -1,12 +0,0 @@ -angular.module("admin.indexUtils").component 'showMore', - templateUrl: 'admin/show_more.html' - bindings: - data: "=" - limit: "=" - increment: "=" - -# For now, this component is not being used. -# Something about binding "data" to a variable on the parent scope that is continually refreshed by -# being assigned within an ng-repeat means that we get $digest iteration errors. Seems to be solved -# by using the new "as" syntax for ng-repeat to assign and alias the outcome of the filters, but this -# has the limitation of not being able to be limited AFTER the assignment has been made, which we need diff --git a/app/assets/javascripts/templates/admin/show_more.html.haml b/app/assets/javascripts/templates/admin/show_more.html.haml deleted file mode 100644 index 6bb35e63c8..0000000000 --- a/app/assets/javascripts/templates/admin/show_more.html.haml +++ /dev/null @@ -1,3 +0,0 @@ -%div{ ng: { show: "data.length > limit" } } - %input{ type: 'button', value: t(:show_more), ng: { click: 'limit = limit + increment' } } - %input{ type: 'button', value: t(:show_all_with_more, num: '{{ data.length - limit }}'), ng: { click: 'limit = data.length' } } diff --git a/app/views/admin/customers/index.html.haml b/app/views/admin/customers/index.html.haml index 1124120693..3bacae5a4e 100644 --- a/app/views/admin/customers/index.html.haml +++ b/app/views/admin/customers/index.html.haml @@ -102,7 +102,6 @@ %td.actions %a{ 'ng-click' => "deleteCustomer(customer)", :class => "delete-customer icon-trash no-text" } - -# %show-more.text-center{ data: "filteredCustomers", limit: "customerLimit", increment: "20" } %div.text-center{ ng: { show: "filteredCustomers.length > customerLimit" } } %input{ type: 'button', value: t(:show_more), ng: { click: 'customerLimit = customerLimit + 20' } } %input{ type: 'button', value: t(:show_all_with_more, num: '{{ filteredCustomers.length - customerLimit }}'), ng: { click: 'customerLimit = filteredCustomers.length' } } diff --git a/app/views/admin/variant_overrides/_show_more.html.haml b/app/views/admin/variant_overrides/_show_more.html.haml index 2c2daacad6..a6414a6d52 100644 --- a/app/views/admin/variant_overrides/_show_more.html.haml +++ b/app/views/admin/variant_overrides/_show_more.html.haml @@ -1,4 +1,3 @@ --# %show-more.text-center{ data: "filteredProducts", limit: "productLimit", increment: "10" } .text-center{ ng: { show: "filteredProducts.length > productLimit" } } %input{ type: 'button', value: t(:show_more), ng: { click: 'productLimit = productLimit + 10' } }