]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mgr/dashboard: Fix stale table actions 37756/head
authorTiago Melo <tmelo@suse.com>
Thu, 27 Aug 2020 17:31:48 +0000 (17:31 +0000)
committerTiago Melo <tmelo@suse.com>
Wed, 28 Oct 2020 18:04:43 +0000 (17:04 -0100)
If we don't emit the select event, the action button can become stale and not
update when the data changes.

This fixes a regression introduced in 31e9bbb9b308277d2f89390d5ff62f13457d69cb

Fixes: https://tracker.ceph.com/issues/47175
Signed-off-by: Tiago Melo <tmelo@suse.com>
(cherry picked from commit c9a73185a9d8348d0a5e72b76b6bcabd5ac34da8)

Conflicts:
        src/pybind/mgr/dashboard/frontend/src/app/shared/datatable/table/table.component.html
        src/pybind/mgr/dashboard/frontend/src/app/shared/datatable/table/table.component.ts
        One of the methods used still requires 1 parameter in nautilus

src/pybind/mgr/dashboard/frontend/src/app/shared/datatable/table/table.component.html
src/pybind/mgr/dashboard/frontend/src/app/shared/datatable/table/table.component.ts

index 292db1cb157b07e4d5dfd88c8a2145cb79a14454..616ba25001e4d01d7097ab67abbdeccfe10dd443 100644 (file)
@@ -87,7 +87,7 @@
                  [cssClasses]="paginationClasses"
                  [selectionType]="selectionType"
                  [selected]="selection.selected"
-                 (select)="onSelect()"
+                 (select)="onSelect($event)"
                  [sorts]="userConfig.sorts"
                  (sort)="changeSorting($event)"
                  [columns]="tableColumns"
index d85593c937c0a2de3721609a63855618d8d8f09d..57fa7aad76801503ce79dd5f83b3eecf4a489bd6 100644 (file)
@@ -451,7 +451,7 @@ export class TableComponent implements AfterContentChecked, OnInit, OnChanges, O
       return;
     }
     this.selection.selected = newSelected;
-    this.onSelect();
+    this.onSelect(this.selection);
   }
 
   onSelect($event: any) {
@@ -459,8 +459,8 @@ export class TableComponent implements AfterContentChecked, OnInit, OnChanges, O
     // https://github.com/swimlane/ngx-datatable/issues/899
     if (_.has($event, 'selected')) {
       this.selection.selected = $event['selected'];
-      this.updateSelection.emit(_.clone(this.selection));
     }
+    this.updateSelection.emit(_.clone(this.selection));
   }
 
   toggleColumn($event: any) {