From: Nizamudeen A Date: Thu, 3 Dec 2020 12:44:04 +0000 (+0530) Subject: mgr/dashboard: Fix for misleading "Orchestrator is not available" error X-Git-Tag: v15.2.9~93^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=refs%2Fpull%2F38598%2Fhead;p=ceph.git mgr/dashboard: Fix for misleading "Orchestrator is not available" error When switching between options, in the Services and Inventory page sometimes it shows "Orchestrator not available" error which appears for 2-3 second and then disappears and shows the normal page. This commit fixes that. Fixes: https://tracker.ceph.com/issues/48448 Signed-off-by: Nizamudeen A (cherry picked from commit b2b42a1e6e161125519380900ed14737d51dae01) Conflicts: src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/inventory/inventory.component.html src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/inventory/inventory.component.ts src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/services/services.component.html src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/services/services.component.ts - Fixed some minor conflicts due to frontend code divergence in master vs. octopus; --- diff --git a/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/inventory/inventory.component.html b/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/inventory/inventory.component.html index 70a0d0ef50e..f246411486c 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/inventory/inventory.component.html +++ b/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/inventory/inventory.component.html @@ -1,4 +1,4 @@ - + Devices
diff --git a/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/inventory/inventory.component.spec.ts b/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/inventory/inventory.component.spec.ts index 8ef14bc6d76..360aac4cea5 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/inventory/inventory.component.spec.ts +++ b/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/inventory/inventory.component.spec.ts @@ -43,6 +43,10 @@ describe('InventoryComponent', () => { expect(component).toBeTruthy(); }); + it('should not display doc panel if orchestrator is available', () => { + expect(component.showDocPanel).toBeFalsy(); + }); + describe('after ngOnInit', () => { it('should load devices', () => { fixture.detectChanges(); diff --git a/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/inventory/inventory.component.ts b/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/inventory/inventory.component.ts index da0f1a541a1..d70c70ecd2e 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/inventory/inventory.component.ts +++ b/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/inventory/inventory.component.ts @@ -16,6 +16,7 @@ export class InventoryComponent implements OnChanges, OnInit { icons = Icons; hasOrchestrator = false; + showDocPanel = false; devices: Array = []; @@ -24,6 +25,7 @@ export class InventoryComponent implements OnChanges, OnInit { ngOnInit() { this.orchService.status().subscribe((status) => { this.hasOrchestrator = status.available; + this.showDocPanel = !status.available; if (status.available) { this.getInventory(); } diff --git a/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/services/service-daemon-list/service-daemon-list.component.html b/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/services/service-daemon-list/service-daemon-list.component.html index 078ac04d42e..025ae8ac84e 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/services/service-daemon-list/service-daemon-list.component.html +++ b/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/services/service-daemon-list/service-daemon-list.component.html @@ -1,4 +1,4 @@ - + { component.getDaemons(new CdTableFetchDataContext(() => {})); expect(component.daemons.length).toBe(3); }); + + it('should not display doc panel if orchestrator is available', () => { + expect(component.showDocPanel).toBeFalsy(); + }); }); diff --git a/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/services/service-daemon-list/service-daemon-list.component.ts b/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/services/service-daemon-list/service-daemon-list.component.ts index 43cf10de322..a08181d2a1d 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/services/service-daemon-list/service-daemon-list.component.ts +++ b/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/services/service-daemon-list/service-daemon-list.component.ts @@ -46,6 +46,7 @@ export class ServiceDaemonListComponent implements OnInit, OnChanges, AfterViewI columns: CdTableColumn[] = []; hasOrchestrator = false; + showDocPanel = false; private daemonsTable: TableComponent; private daemonsTableTplsSub: Subscription; @@ -125,6 +126,7 @@ export class ServiceDaemonListComponent implements OnInit, OnChanges, AfterViewI this.orchService.status().subscribe((data: { available: boolean }) => { this.hasOrchestrator = data.available; + this.showDocPanel = !data.available; }); } diff --git a/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/services/services.component.html b/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/services/services.component.html index 11174d3849d..db3bd8548ea 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/services/services.component.html +++ b/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/services/services.component.html @@ -1,4 +1,4 @@ - + { component.getServices(new CdTableFetchDataContext(() => {})); expect(component.services.length).toBe(2); }); + + it('should not display doc panel if orchestrator is available', () => { + expect(component.showDocPanel).toBeFalsy(); + }); }); diff --git a/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/services/services.component.ts b/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/services/services.component.ts index 8890ff5531e..ecccb9031e2 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/services/services.component.ts +++ b/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/services/services.component.ts @@ -28,6 +28,7 @@ export class ServicesComponent extends ListWithDetails implements OnChanges, OnI @Input() hiddenColumns: string[] = []; permissions: Permissions; + showDocPanel = false; checkingOrchestrator = true; hasOrchestrator = false; @@ -93,6 +94,7 @@ export class ServicesComponent extends ListWithDetails implements OnChanges, OnI this.orchService.status().subscribe((status) => { this.hasOrchestrator = status.available; + this.showDocPanel = !status.available; }); }