From f96bd51344cae12ac0bba8467b88e1da9a26bf39 Mon Sep 17 00:00:00 2001 From: Gaetan Craig-Riou Date: Tue, 25 Jul 2023 14:29:29 +1000 Subject: [PATCH] Rework form to allow displaying the save bar when no result When filtering by a tag, and then removing the tag on the filtered customers, it let us show the save bar once the last customer has been removed from the filtered list. --- app/views/admin/customers/index.html.haml | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/app/views/admin/customers/index.html.haml b/app/views/admin/customers/index.html.haml index 3bacae5a4e..e0e2aaf02c 100644 --- a/app/views/admin/customers/index.html.haml +++ b/app/views/admin/customers/index.html.haml @@ -39,16 +39,15 @@ %h1 = t :loading_customers - .row{ :class => "sixteen columns alpha", 'ng-show' => '!RequestMonitor.loading && filteredCustomers.length == 0'} - %h1#no_results - =t :no_customers_found - - .row.margin-bottom-50{ ng: { show: "!RequestMonitor.loading && filteredCustomers.length > 0" } } + .row.margin-bottom-50{ ng: { show: "!RequestMonitor.loading" } } %form{ name: "customers_form" } + %h1#no_results{ 'ng-show' => '!RequestMonitor.loading && filteredCustomers.length == 0' } + =t :no_customers_found + %save-bar{ dirty: "customers_form.$dirty", persist: "false" } %input.red{ type: "button", value: t(:save_changes), ng: { click: "submitAll(customers_form)" } } - %table.index#customers + %table.index#customers{ 'ng-show' => '!RequestMonitor.loading && filteredCustomers.length > 0' } %col.email{ width: "20%", 'ng-show' => 'columns.email.visible' } %col.first_name{ width: "20%", 'ng-show' => 'columns.first_name.visible' } %col.last_name{ width: "20%", 'ng-show' => 'columns.last_name.visible' }