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;
-<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">
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();
icons = Icons;
hasOrchestrator = false;
+ showDocPanel = false;
devices: Array<InventoryDevice> = [];
ngOnInit() {
this.orchService.status().subscribe((status) => {
this.hasOrchestrator = status.available;
+ this.showDocPanel = !status.available;
if (status.available) {
this.getInventory();
}
-<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"
component.getDaemons(new CdTableFetchDataContext(() => {}));
expect(component.daemons.length).toBe(3);
});
+
+ it('should not display doc panel if orchestrator is available', () => {
+ expect(component.showDocPanel).toBeFalsy();
+ });
});
columns: CdTableColumn[] = [];
hasOrchestrator = false;
+ showDocPanel = false;
private daemonsTable: TableComponent;
private daemonsTableTplsSub: Subscription;
this.orchService.status().subscribe((data: { available: boolean }) => {
this.hasOrchestrator = data.available;
+ this.showDocPanel = !data.available;
});
}
-<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"
component.getServices(new CdTableFetchDataContext(() => {}));
expect(component.services.length).toBe(2);
});
+
+ it('should not display doc panel if orchestrator is available', () => {
+ expect(component.showDocPanel).toBeFalsy();
+ });
});
@Input() hiddenColumns: string[] = [];
permissions: Permissions;
+ showDocPanel = false;
checkingOrchestrator = true;
hasOrchestrator = false;
this.orchService.status().subscribe((status) => {
this.hasOrchestrator = status.available;
+ this.showDocPanel = !status.available;
});
}