]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
mgr/dashboard: Fix regression on table error handling
authorStephan Müller <smueller@suse.com>
Wed, 22 Jul 2020 14:00:32 +0000 (16:00 +0200)
committerStephan Müller <smueller@suse.com>
Wed, 29 Jul 2020 13:37:44 +0000 (15:37 +0200)
The regression was introduced by #35290 through the use of the new tab module
the pools and host listing got wrapped into the new usage, however they needed
to use the table as Viewchild and the table was static before, but it's now
dynamic. This resulted in an empty variable that wasn't filled with the
right table object. The calling of the ".reset()" was not possible
during an error case and produced an error in console trying to access
"reset" of undefined, by not calling "reset" the table get's stuck with an
rotating reload symbol.

Fixes: https://tracker.ceph.com/issues/46660
Signed-off-by: Stephan Müller <smueller@suse.com>
src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/hosts/hosts.component.ts
src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/osd/osd-list/osd-list.component.ts
src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/services/services.component.ts
src/pybind/mgr/dashboard/frontend/src/app/ceph/pool/pool-list/pool-list.component.ts

index d1bea0bdd52543746570e2d504d06eec105dda8c..259cf869151e194e288fc449829a7f46b3735509 100644 (file)
@@ -36,7 +36,7 @@ const BASE_URL = 'hosts';
   providers: [{ provide: URLBuilderService, useValue: new URLBuilderService(BASE_URL) }]
 })
 export class HostsComponent extends ListWithDetails implements OnInit {
-  @ViewChild(TableComponent, { static: true })
+  @ViewChild(TableComponent)
   table: TableComponent;
   @ViewChild('servicesTpl', { static: true })
   public servicesTpl: TemplateRef<any>;
index af298a9e5b16827ef97d20c69045ae6e1fa8e3e2..46a64e39e781bbc5620fec00cf1eca5a0170ffe8 100644 (file)
@@ -12,7 +12,6 @@ import { ConfirmationModalComponent } from '../../../../shared/components/confir
 import { CriticalConfirmationModalComponent } from '../../../../shared/components/critical-confirmation-modal/critical-confirmation-modal.component';
 import { FormModalComponent } from '../../../../shared/components/form-modal/form-modal.component';
 import { ActionLabelsI18n, URLVerbs } from '../../../../shared/constants/app.constants';
-import { TableComponent } from '../../../../shared/datatable/table/table.component';
 import { CellTemplate } from '../../../../shared/enum/cell-template.enum';
 import { Icons } from '../../../../shared/enum/icons.enum';
 import { NotificationType } from '../../../../shared/enum/notification-type.enum';
@@ -50,8 +49,6 @@ export class OsdListComponent extends ListWithDetails implements OnInit {
   markOsdConfirmationTpl: TemplateRef<any>;
   @ViewChild('criticalConfirmationTpl', { static: true })
   criticalConfirmationTpl: TemplateRef<any>;
-  @ViewChild(TableComponent, { static: true })
-  tableComponent: TableComponent;
   @ViewChild('reweightBodyTpl')
   reweightBodyTpl: TemplateRef<any>;
   @ViewChild('safeToDestroyBodyTpl')
index 4f83b0c944ca2a63e276efd5cfe3b94b5e36b6ee..48f5acc293d49cff206fec014d9a9aa5c2912f7d 100644 (file)
@@ -18,7 +18,7 @@ import { AuthStorageService } from '../../../shared/services/auth-storage.servic
   styleUrls: ['./services.component.scss']
 })
 export class ServicesComponent extends ListWithDetails implements OnChanges, OnInit {
-  @ViewChild(TableComponent)
+  @ViewChild(TableComponent, { static: true })
   table: TableComponent;
 
   @Input() hostname: string;
index eae76ef70c7f2fc2b36d8cbdcaa18017e065fecf..893a3a1689633c28f56b4b44c9fa98e2cd067783 100644 (file)
@@ -40,7 +40,7 @@ const BASE_URL = 'pool';
   styleUrls: ['./pool-list.component.scss']
 })
 export class PoolListComponent extends ListWithDetails implements OnInit {
-  @ViewChild(TableComponent, { static: true })
+  @ViewChild(TableComponent)
   table: TableComponent;
   @ViewChild('poolUsageTpl', { static: true })
   poolUsageTpl: TemplateRef<any>;