]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
mgr/dashboard: Fix for misleading "Orchestrator is not available" error 38598/head
authorNizamudeen A <nia@redhat.com>
Thu, 3 Dec 2020 12:44:04 +0000 (18:14 +0530)
committerLaura Paduano <lpaduano@suse.com>
Thu, 17 Dec 2020 14:00:13 +0000 (15:00 +0100)
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 <nia@redhat.com>
(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;

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.spec.ts
src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/inventory/inventory.component.ts
src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/services/service-daemon-list/service-daemon-list.component.html
src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/services/service-daemon-list/service-daemon-list.component.spec.ts
src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/services/service-daemon-list/service-daemon-list.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.spec.ts
src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/services/services.component.ts

index 70a0d0ef50e1a3eab1d2c48170d58f8ba569a7b7..f246411486c4b9c7c86cf6bc0d3b3ceeeecb8a2a 100644 (file)
@@ -1,4 +1,4 @@
-<cd-orchestrator-doc-panel *ngIf="!hasOrchestrator"></cd-orchestrator-doc-panel>
+<cd-orchestrator-doc-panel *ngIf="showDocPanel"></cd-orchestrator-doc-panel>
 <ng-container *ngIf="hasOrchestrator">
   <legend i18n>Devices</legend>
   <div class="row">
index 8ef14bc6d7686e8a139aa70120b890b12a691432..360aac4cea54043c15eb2ddf4baef4184fe70605 100644 (file)
@@ -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();
index da0f1a541a14071a98cecdc015fa137207d0e27e..d70c70ecd2ea445a37b9cbd5ef22c0d900a463e7 100644 (file)
@@ -16,6 +16,7 @@ export class InventoryComponent implements OnChanges, OnInit {
   icons = Icons;
 
   hasOrchestrator = false;
+  showDocPanel = false;
 
   devices: Array<InventoryDevice> = [];
 
@@ -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();
       }
index 078ac04d42ed0badfa3ba1e2c7d9591bd8082f9e..025ae8ac84e0603696d5c2f4fe78ed4b2019287e 100644 (file)
@@ -1,4 +1,4 @@
-<cd-orchestrator-doc-panel *ngIf="!hasOrchestrator"></cd-orchestrator-doc-panel>
+<cd-orchestrator-doc-panel *ngIf="showDocPanel"></cd-orchestrator-doc-panel>
 <cd-table *ngIf="hasOrchestrator"
           #daemonsTable
           [data]="daemons"
index 207a4fb5a3444ab6dd91b35dd3bff98439698bd6..f8539a2716cf260e03dd9b0a3f4d8ec618107dca 100644 (file)
@@ -111,4 +111,8 @@ describe('ServiceDaemonListComponent', () => {
     component.getDaemons(new CdTableFetchDataContext(() => {}));
     expect(component.daemons.length).toBe(3);
   });
+
+  it('should not display doc panel if orchestrator is available', () => {
+    expect(component.showDocPanel).toBeFalsy();
+  });
 });
index 43cf10de322ac46fee6b15bfdc1cf01a3195ce85..a08181d2a1d7cd2086d4989a89f413a57901a5f6 100644 (file)
@@ -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;
     });
   }
 
index 11174d3849d045ba7f03cf1b593f10c4b5d984a5..db3bd8548ea889cd09853f3957021a6a022f40c6 100644 (file)
@@ -1,4 +1,4 @@
-<cd-orchestrator-doc-panel *ngIf="!hasOrchestrator"></cd-orchestrator-doc-panel>
+<cd-orchestrator-doc-panel *ngIf="showDocPanel"></cd-orchestrator-doc-panel>
 <ng-container *ngIf="hasOrchestrator">
   <cd-table [data]="services"
             [columns]="columns"
index 347cfa1b00e18e103087798c5700cafc68382169..71740ef836777c6f5f670b64df496b2cbce9bfda 100644 (file)
@@ -90,4 +90,8 @@ describe('ServicesComponent', () => {
     component.getServices(new CdTableFetchDataContext(() => {}));
     expect(component.services.length).toBe(2);
   });
+
+  it('should not display doc panel if orchestrator is available', () => {
+    expect(component.showDocPanel).toBeFalsy();
+  });
 });
index 8890ff5531ed1a0d95448e88f6cd3fee19724e20..ecccb9031e2b4ac352cb23c04687edca488fc8d7 100644 (file)
@@ -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;
     });
   }