Skip to content

Commit 505f1a6

Browse files
authored
Merge pull request ceph#60626 from ivoalmeida/carbon-version-update
mgr/dashboard: update carbon-components-angular Reviewed-by: Afreen Misbah <[email protected]>
2 parents 9d79a06 + 1ba4562 commit 505f1a6

File tree

7 files changed

+40
-12
lines changed

7 files changed

+40
-12
lines changed

src/pybind/mgr/dashboard/frontend/package-lock.json

Lines changed: 5 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/pybind/mgr/dashboard/frontend/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@
6464
"@types/file-saver": "2.0.1",
6565
"async-mutex": "0.2.4",
6666
"bootstrap": "5.2.3",
67-
"carbon-components-angular": "5.25.1",
67+
"carbon-components-angular": "5.48.0",
6868
"chart.js": "4.4.0",
6969
"chartjs-adapter-moment": "1.0.1",
7070
"detect-browser": "5.2.0",

src/pybind/mgr/dashboard/frontend/src/app/ceph/block/mirroring/bootstrap-create-modal/bootstrap-create-modal.component.ts

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,12 @@
1-
import { Component, Inject, OnDestroy, OnInit, Optional } from '@angular/core';
1+
import {
2+
AfterViewInit,
3+
ChangeDetectorRef,
4+
Component,
5+
Inject,
6+
OnDestroy,
7+
OnInit,
8+
Optional
9+
} from '@angular/core';
210
import { UntypedFormControl, UntypedFormGroup, ValidatorFn, Validators } from '@angular/forms';
311

412
import { BaseModal } from 'carbon-components-angular';
@@ -17,7 +25,9 @@ import { TaskWrapperService } from '~/app/shared/services/task-wrapper.service';
1725
templateUrl: './bootstrap-create-modal.component.html',
1826
styleUrls: ['./bootstrap-create-modal.component.scss']
1927
})
20-
export class BootstrapCreateModalComponent extends BaseModal implements OnDestroy, OnInit {
28+
export class BootstrapCreateModalComponent
29+
extends BaseModal
30+
implements OnDestroy, OnInit, AfterViewInit {
2131
pools: any[] = [];
2232
token: string;
2333

@@ -28,13 +38,18 @@ export class BootstrapCreateModalComponent extends BaseModal implements OnDestro
2838
constructor(
2939
private rbdMirroringService: RbdMirroringService,
3040
private taskWrapper: TaskWrapperService,
41+
private changeDetectorRef: ChangeDetectorRef,
3142

3243
@Inject('siteName') @Optional() public siteName?: string
3344
) {
3445
super();
3546
this.createForm();
3647
}
3748

49+
ngAfterViewInit(): void {
50+
this.changeDetectorRef.detectChanges();
51+
}
52+
3853
createForm() {
3954
this.createBootstrapForm = new CdFormGroup({
4055
siteName: new UntypedFormControl('', {

src/pybind/mgr/dashboard/frontend/src/app/ceph/cephfs/cephfs-auth-modal/cephfs-auth-modal.component.ts

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,11 @@
1-
import { Component, Inject, OnInit, Optional } from '@angular/core';
1+
import {
2+
AfterViewInit,
3+
ChangeDetectorRef,
4+
Component,
5+
Inject,
6+
OnInit,
7+
Optional
8+
} from '@angular/core';
29
import { FormControl, Validators } from '@angular/forms';
310
import { OperatorFunction, Observable, of } from 'rxjs';
411
import { debounceTime, distinctUntilChanged, switchMap, catchError } from 'rxjs/operators';
@@ -19,7 +26,7 @@ const DEBOUNCE_TIMER = 300;
1926
templateUrl: './cephfs-auth-modal.component.html',
2027
styleUrls: ['./cephfs-auth-modal.component.scss']
2128
})
22-
export class CephfsAuthModalComponent extends CdForm implements OnInit {
29+
export class CephfsAuthModalComponent extends CdForm implements OnInit, AfterViewInit {
2330
subvolumeGroup: string;
2431
subvolume: string;
2532
isDefaultSubvolumeGroup = false;
@@ -58,6 +65,7 @@ export class CephfsAuthModalComponent extends CdForm implements OnInit {
5865
private cephfsService: CephfsService,
5966
private taskWrapper: TaskWrapperService,
6067
private modalService: ModalCdsService,
68+
private changeDetectorRef: ChangeDetectorRef,
6169

6270
@Optional() @Inject('fsName') public fsName: string,
6371
@Optional() @Inject('id') public id: number
@@ -67,6 +75,10 @@ export class CephfsAuthModalComponent extends CdForm implements OnInit {
6775
this.resource = $localize`access`;
6876
}
6977

78+
ngAfterViewInit(): void {
79+
this.changeDetectorRef.detectChanges();
80+
}
81+
7082
ngOnInit() {
7183
this.directoryStore.loadDirectories(this.id, '/', 3);
7284
this.createForm();

src/pybind/mgr/dashboard/frontend/src/app/ceph/pool/pool-form/pool-form.component.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,7 @@ export class PoolFormComponent extends CdForm implements OnInit {
167167
CdValidators.custom(
168168
'required',
169169
(rule: CrushRule) =>
170-
this.isReplicated && this.info.crush_rules_replicated.length > 0 && !rule
170+
this.isReplicated && this.info?.crush_rules_replicated?.length > 0 && !rule
171171
)
172172
]
173173
}),

src/pybind/mgr/dashboard/frontend/src/app/shared/datatable/table-key-value/table-key-value.component.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<div class="table-scroller">
22
<cd-table #table
3-
[data]="tableData"
3+
[data]="tableData || []"
44
[columns]="columns"
55
columnMode="flex"
66
[toolHeader]="false"

src/pybind/mgr/dashboard/frontend/src/app/shared/datatable/table/table.component.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -897,7 +897,7 @@ export class TableComponent implements AfterViewInit, OnInit, OnChanges, OnDestr
897897

898898
if (this.limit === 0) {
899899
this.model.currentPage = 1;
900-
this.model.pageLength = filteredData.length;
900+
this.model.pageLength = filteredData.length || 1;
901901
this._dataset.next(filteredData);
902902
return;
903903
}

0 commit comments

Comments
 (0)