Skip to content

Commit

Permalink
NAS-131244: Fix Roles card on datasets is missing "System Dataset" te…
Browse files Browse the repository at this point in the history
…xt (#10731)
  • Loading branch information
denysbutenko authored Sep 23, 2024
1 parent b23474a commit a012d4e
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 20 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,10 @@
[loading]="isLoading$ | async"
></ix-fake-progress-bar>
}
<ix-dataset-details-panel [dataset]="dataset"></ix-dataset-details-panel>
<ix-dataset-details-panel
[dataset]="dataset"
[systemDataset]="systemDataset()"
></ix-dataset-details-panel>
</div>
}
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,9 @@ describe('DatasetsManagementComponent', () => {
imports: [TreeModule, SearchInput1Component, EmptyComponent],
providers: [
mockAuth(),
mockWebSocket([mockCall('systemdataset.config', {} as SystemDatasetConfig)]),
mockWebSocket([
mockCall('systemdataset.config', { pool: 'Second Dataset' } as SystemDatasetConfig),
]),
mockProvider(DatasetTreeStore, {
datasets$,
error$,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ export class DatasetsManagementComponent implements OnInit, AfterViewInit, OnDes
selectedDataset$ = this.datasetStore.selectedDataset$;
@HostBinding('class.details-overlay') showMobileDetails = false;
isMobileView = false;
systemDataset: string;
systemDataset = toSignal(this.ws.call('systemdataset.config').pipe(map((config) => config.pool)));
isLoading = true;
subscription = new Subscription();
ixTreeHeaderWidth: number | null = null;
Expand Down Expand Up @@ -154,7 +154,6 @@ export class DatasetsManagementComponent implements OnInit, AfterViewInit, OnDes

ngOnInit(): void {
this.datasetStore.loadDatasets();
this.loadSystemDatasetConfig();
this.setupTree();
this.listenForRouteChanges();
this.listenForLoading();
Expand Down Expand Up @@ -183,21 +182,6 @@ export class DatasetsManagementComponent implements OnInit, AfterViewInit, OnDes
}
}

loadSystemDatasetConfig(): void {
this.ws
.call('systemdataset.config')
.pipe(
map((config) => config.pool),
untilDestroyed(this),
)
.subscribe({
next: (systemDataset) => {
this.systemDataset = systemDataset;
},
error: this.handleError,
});
}

listenForLoading(): void {
this.isLoading$.pipe(untilDestroyed(this)).subscribe((isLoading) => {
this.isLoading = isLoading;
Expand All @@ -214,7 +198,7 @@ export class DatasetsManagementComponent implements OnInit, AfterViewInit, OnDes
};

isSystemDataset(dataset: DatasetDetails): boolean {
return dataset.name.split('/').length === 1 && this.systemDataset === dataset.name;
return dataset.name.split('/').length === 1 && this.systemDataset() === dataset.name;
}

treeHeaderScrolled(): void {
Expand Down

0 comments on commit a012d4e

Please sign in to comment.