From: Ivo Almeida Date: Tue, 5 Nov 2024 16:19:09 +0000 (+0000) Subject: mgr/dashboard: update carbon-components-angular X-Git-Tag: v20.0.0~681^2 X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=refs%2Fpull%2F60626%2Fhead;p=ceph.git mgr/dashboard: update carbon-components-angular * update carbon-components-angular pkg to v5.48.0 * fixed change detection errors on unit tests * fixed pagination page length when limit is 0 and data is empty Fixes: https://tracker.ceph.com/issues/68837 Signed-off-by: Ivo Almeida --- diff --git a/src/pybind/mgr/dashboard/frontend/package-lock.json b/src/pybind/mgr/dashboard/frontend/package-lock.json index f2d4bbf06fac6..e03e594591663 100644 --- a/src/pybind/mgr/dashboard/frontend/package-lock.json +++ b/src/pybind/mgr/dashboard/frontend/package-lock.json @@ -30,7 +30,7 @@ "@types/file-saver": "2.0.1", "async-mutex": "0.2.4", "bootstrap": "5.2.3", - "carbon-components-angular": "5.25.1", + "carbon-components-angular": "5.48.0", "chart.js": "4.4.0", "chartjs-adapter-moment": "1.0.1", "detect-browser": "5.2.0", @@ -11223,9 +11223,9 @@ ] }, "node_modules/carbon-components-angular": { - "version": "5.25.1", - "resolved": "https://registry.npmjs.org/carbon-components-angular/-/carbon-components-angular-5.25.1.tgz", - "integrity": "sha512-v49djZmcHs47G7wzaS+SQUTqp+vErlHDc4ohbsx29Q+Jq1m6IJSaTUCN9GuQG/lLa7W1se0vS23TOToKwjIbcw==", + "version": "5.48.0", + "resolved": "https://registry.npmjs.org/carbon-components-angular/-/carbon-components-angular-5.48.0.tgz", + "integrity": "sha512-NZwpKBKgkgaR51S0Pm16MvashO4g8B+dzGeNE8l/RYRWXpVDLShR6YnBc80t2iMtTolxGiPwHmzpyMieVtIGLg==", "hasInstallScript": true, "dependencies": { "@carbon/icon-helpers": "10.37.0", @@ -11234,6 +11234,7 @@ "@floating-ui/dom": "1.6.3", "@ibm/telemetry-js": "^1.5.0", "flatpickr": "4.6.13", + "lodash-es": "4.17.21", "tslib": "2.3.0" }, "peerDependencies": { diff --git a/src/pybind/mgr/dashboard/frontend/package.json b/src/pybind/mgr/dashboard/frontend/package.json index 7443f42ea6a9b..b95a84df2b11e 100644 --- a/src/pybind/mgr/dashboard/frontend/package.json +++ b/src/pybind/mgr/dashboard/frontend/package.json @@ -64,7 +64,7 @@ "@types/file-saver": "2.0.1", "async-mutex": "0.2.4", "bootstrap": "5.2.3", - "carbon-components-angular": "5.25.1", + "carbon-components-angular": "5.48.0", "chart.js": "4.4.0", "chartjs-adapter-moment": "1.0.1", "detect-browser": "5.2.0", diff --git a/src/pybind/mgr/dashboard/frontend/src/app/ceph/block/mirroring/bootstrap-create-modal/bootstrap-create-modal.component.ts b/src/pybind/mgr/dashboard/frontend/src/app/ceph/block/mirroring/bootstrap-create-modal/bootstrap-create-modal.component.ts index ddd0a5dfecdb7..e5b55258d419b 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/ceph/block/mirroring/bootstrap-create-modal/bootstrap-create-modal.component.ts +++ b/src/pybind/mgr/dashboard/frontend/src/app/ceph/block/mirroring/bootstrap-create-modal/bootstrap-create-modal.component.ts @@ -1,4 +1,12 @@ -import { Component, Inject, OnDestroy, OnInit, Optional } from '@angular/core'; +import { + AfterViewInit, + ChangeDetectorRef, + Component, + Inject, + OnDestroy, + OnInit, + Optional +} from '@angular/core'; import { UntypedFormControl, UntypedFormGroup, ValidatorFn, Validators } from '@angular/forms'; import { BaseModal } from 'carbon-components-angular'; @@ -17,7 +25,9 @@ import { TaskWrapperService } from '~/app/shared/services/task-wrapper.service'; templateUrl: './bootstrap-create-modal.component.html', styleUrls: ['./bootstrap-create-modal.component.scss'] }) -export class BootstrapCreateModalComponent extends BaseModal implements OnDestroy, OnInit { +export class BootstrapCreateModalComponent + extends BaseModal + implements OnDestroy, OnInit, AfterViewInit { pools: any[] = []; token: string; @@ -28,6 +38,7 @@ export class BootstrapCreateModalComponent extends BaseModal implements OnDestro constructor( private rbdMirroringService: RbdMirroringService, private taskWrapper: TaskWrapperService, + private changeDetectorRef: ChangeDetectorRef, @Inject('siteName') @Optional() public siteName?: string ) { @@ -35,6 +46,10 @@ export class BootstrapCreateModalComponent extends BaseModal implements OnDestro this.createForm(); } + ngAfterViewInit(): void { + this.changeDetectorRef.detectChanges(); + } + createForm() { this.createBootstrapForm = new CdFormGroup({ siteName: new UntypedFormControl('', { diff --git a/src/pybind/mgr/dashboard/frontend/src/app/ceph/cephfs/cephfs-auth-modal/cephfs-auth-modal.component.ts b/src/pybind/mgr/dashboard/frontend/src/app/ceph/cephfs/cephfs-auth-modal/cephfs-auth-modal.component.ts index 8af55cd2dec34..435cdb9644fdf 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/ceph/cephfs/cephfs-auth-modal/cephfs-auth-modal.component.ts +++ b/src/pybind/mgr/dashboard/frontend/src/app/ceph/cephfs/cephfs-auth-modal/cephfs-auth-modal.component.ts @@ -1,4 +1,11 @@ -import { Component, Inject, OnInit, Optional } from '@angular/core'; +import { + AfterViewInit, + ChangeDetectorRef, + Component, + Inject, + OnInit, + Optional +} from '@angular/core'; import { FormControl, Validators } from '@angular/forms'; import { OperatorFunction, Observable, of } from 'rxjs'; import { debounceTime, distinctUntilChanged, switchMap, catchError } from 'rxjs/operators'; @@ -19,7 +26,7 @@ const DEBOUNCE_TIMER = 300; templateUrl: './cephfs-auth-modal.component.html', styleUrls: ['./cephfs-auth-modal.component.scss'] }) -export class CephfsAuthModalComponent extends CdForm implements OnInit { +export class CephfsAuthModalComponent extends CdForm implements OnInit, AfterViewInit { subvolumeGroup: string; subvolume: string; isDefaultSubvolumeGroup = false; @@ -58,6 +65,7 @@ export class CephfsAuthModalComponent extends CdForm implements OnInit { private cephfsService: CephfsService, private taskWrapper: TaskWrapperService, private modalService: ModalCdsService, + private changeDetectorRef: ChangeDetectorRef, @Optional() @Inject('fsName') public fsName: string, @Optional() @Inject('id') public id: number @@ -67,6 +75,10 @@ export class CephfsAuthModalComponent extends CdForm implements OnInit { this.resource = $localize`access`; } + ngAfterViewInit(): void { + this.changeDetectorRef.detectChanges(); + } + ngOnInit() { this.directoryStore.loadDirectories(this.id, '/', 3); this.createForm(); diff --git a/src/pybind/mgr/dashboard/frontend/src/app/ceph/pool/pool-form/pool-form.component.ts b/src/pybind/mgr/dashboard/frontend/src/app/ceph/pool/pool-form/pool-form.component.ts index 1cdbcccd647ce..ff5e20c6d5d95 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/ceph/pool/pool-form/pool-form.component.ts +++ b/src/pybind/mgr/dashboard/frontend/src/app/ceph/pool/pool-form/pool-form.component.ts @@ -167,7 +167,7 @@ export class PoolFormComponent extends CdForm implements OnInit { CdValidators.custom( 'required', (rule: CrushRule) => - this.isReplicated && this.info.crush_rules_replicated.length > 0 && !rule + this.isReplicated && this.info?.crush_rules_replicated?.length > 0 && !rule ) ] }), diff --git a/src/pybind/mgr/dashboard/frontend/src/app/shared/datatable/table-key-value/table-key-value.component.html b/src/pybind/mgr/dashboard/frontend/src/app/shared/datatable/table-key-value/table-key-value.component.html index b022f1551e88f..72ca4e47990ec 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/shared/datatable/table-key-value/table-key-value.component.html +++ b/src/pybind/mgr/dashboard/frontend/src/app/shared/datatable/table-key-value/table-key-value.component.html @@ -1,6 +1,6 @@