From 961757b59bf5ecab9637c39526fb8e396098b602 Mon Sep 17 00:00:00 2001 From: Dnyaneshwari Date: Tue, 22 Oct 2024 12:46:58 +0530 Subject: [PATCH] mgr/dashboard: Replacing bootstrap modal service with cds modal service Fixes: https://tracker.ceph.com/issues/68650 Signed-off-by: Dnyaneshwari talwekar --- .../silence-list/silence-list.component.spec.ts | 4 ++-- .../prometheus/silence-list/silence-list.component.ts | 4 ++-- .../upgrade-progress/upgrade-progress.component.ts | 4 ++-- .../ceph/pool/pool-form/pool-form.component.spec.ts | 10 +++++----- .../src/app/ceph/pool/pool-form/pool-form.component.ts | 4 ++-- .../core/auth/user-form/user-form.component.spec.ts | 6 +++--- .../src/app/core/auth/user-form/user-form.component.ts | 4 ++-- 7 files changed, 18 insertions(+), 18 deletions(-) diff --git a/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/prometheus/silence-list/silence-list.component.spec.ts b/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/prometheus/silence-list/silence-list.component.spec.ts index 3609467db1e36..47793509747c7 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/prometheus/silence-list/silence-list.component.spec.ts +++ b/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/prometheus/silence-list/silence-list.component.spec.ts @@ -13,7 +13,7 @@ import { TableActionsComponent } from '~/app/shared/datatable/table-actions/tabl import { NotificationType } from '~/app/shared/enum/notification-type.enum'; import { Permission } from '~/app/shared/models/permissions'; import { AuthStorageService } from '~/app/shared/services/auth-storage.service'; -import { ModalService } from '~/app/shared/services/modal.service'; +import { ModalCdsService } from '~/app/shared/services/modal-cds.service'; import { NotificationService } from '~/app/shared/services/notification.service'; import { SharedModule } from '~/app/shared/shared.module'; import { configureTestBed, PermissionHelper } from '~/testing/unit-test-helper'; @@ -159,7 +159,7 @@ describe('SilenceListComponent', () => { const mockObservable = () => of([]); spyOn(component, 'refresh').and.callFake(mockObservable); spyOn(prometheusService, 'expireSilence').and.callFake(mockObservable); - spyOn(TestBed.inject(ModalService), 'show').and.callFake((deletionClass, config) => { + spyOn(TestBed.inject(ModalCdsService), 'show').and.callFake((deletionClass, config) => { return { componentInstance: Object.assign(new deletionClass(), config) }; diff --git a/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/prometheus/silence-list/silence-list.component.ts b/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/prometheus/silence-list/silence-list.component.ts index c5734236e5f1c..7098e0027970f 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/prometheus/silence-list/silence-list.component.ts +++ b/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/prometheus/silence-list/silence-list.component.ts @@ -19,7 +19,7 @@ import { Permission } from '~/app/shared/models/permissions'; import { PrometheusRule } from '~/app/shared/models/prometheus-alerts'; import { CdDatePipe } from '~/app/shared/pipes/cd-date.pipe'; import { AuthStorageService } from '~/app/shared/services/auth-storage.service'; -import { ModalService } from '~/app/shared/services/modal.service'; +import { ModalCdsService } from '~/app/shared/services/modal-cds.service'; import { NotificationService } from '~/app/shared/services/notification.service'; import { PrometheusSilenceMatcherService } from '~/app/shared/services/prometheus-silence-matcher.service'; import { URLBuilderService } from '~/app/shared/services/url-builder.service'; @@ -56,7 +56,7 @@ export class SilenceListComponent extends PrometheusListHelper { constructor( private authStorageService: AuthStorageService, private cdDatePipe: CdDatePipe, - private modalService: ModalService, + private modalService: ModalCdsService, private notificationService: NotificationService, private urlBuilder: URLBuilderService, private actionLabels: ActionLabelsI18n, diff --git a/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/upgrade/upgrade-progress/upgrade-progress.component.ts b/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/upgrade/upgrade-progress/upgrade-progress.component.ts index 03bb6ed084dff..a04b457736586 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/upgrade/upgrade-progress/upgrade-progress.component.ts +++ b/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/upgrade/upgrade-progress/upgrade-progress.component.ts @@ -5,7 +5,7 @@ import { NgbModalRef } from '@ng-bootstrap/ng-bootstrap'; import { Icons } from '~/app/shared/enum/icons.enum'; import { CriticalConfirmationModalComponent } from '~/app/shared/components/critical-confirmation-modal/critical-confirmation-modal.component'; -import { ModalService } from '~/app/shared/services/modal.service'; +import { ModalCdsService } from '~/app/shared/services/modal-cds.service'; import { Permission } from '~/app/shared/models/permissions'; import { AuthStorageService } from '~/app/shared/services/auth-storage.service'; import { UpgradeService } from '~/app/shared/api/upgrade.service'; @@ -37,7 +37,7 @@ export class UpgradeProgressComponent implements OnInit, OnDestroy { private authStorageService: AuthStorageService, private upgradeService: UpgradeService, private notificationService: NotificationService, - private modalService: ModalService, + private modalService: ModalCdsService, private summaryService: SummaryService, private router: Router, private refreshIntervalService: RefreshIntervalService diff --git a/src/pybind/mgr/dashboard/frontend/src/app/ceph/pool/pool-form/pool-form.component.spec.ts b/src/pybind/mgr/dashboard/frontend/src/app/ceph/pool/pool-form/pool-form.component.spec.ts index caf8c0b6a71a6..811371329dbdf 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/ceph/pool/pool-form/pool-form.component.spec.ts +++ b/src/pybind/mgr/dashboard/frontend/src/app/ceph/pool/pool-form/pool-form.component.spec.ts @@ -28,7 +28,7 @@ import { ErasureCodeProfile } from '~/app/shared/models/erasure-code-profile'; import { Permission } from '~/app/shared/models/permissions'; import { PoolFormInfo } from '~/app/shared/models/pool-form-info'; import { AuthStorageService } from '~/app/shared/services/auth-storage.service'; -import { ModalService } from '~/app/shared/services/modal.service'; +import { ModalCdsService } from '~/app/shared/services/modal-cds.service'; import { TaskWrapperService } from '~/app/shared/services/task-wrapper.service'; import { SharedModule } from '~/app/shared/shared.module'; import { @@ -765,7 +765,7 @@ describe('PoolFormComponent', () => { it('should select the newly created rule', () => { expect(form.getValue('crushRule').rule_name).toBe('rep1'); const name = 'awesomeRule'; - spyOn(TestBed.inject(ModalService), 'show').and.callFake(() => { + spyOn(TestBed.inject(ModalCdsService), 'show').and.callFake(() => { return { componentInstance: { submitAction: of({ name }) @@ -828,7 +828,7 @@ describe('PoolFormComponent', () => { }; beforeEach(() => { - modalSpy = spyOn(TestBed.inject(ModalService), 'show').and.callFake( + modalSpy = spyOn(TestBed.inject(ModalCdsService), 'show').and.callFake( (deletionClass: any, initialState: any) => { deletion = Object.assign(new deletionClass(), initialState); return { @@ -933,7 +933,7 @@ describe('PoolFormComponent', () => { spyOn(ecpService, 'list').and.callFake(() => of(infoReturn.erasure_code_profiles)); expect(form.getValue('erasureProfile').name).toBe('ecp1'); const name = 'awesomeProfile'; - spyOn(TestBed.inject(ModalService), 'show').and.callFake(() => { + spyOn(TestBed.inject(ModalCdsService), 'show').and.callFake(() => { return { componentInstance: { submitAction: of({ name }) @@ -977,7 +977,7 @@ describe('PoolFormComponent', () => { beforeEach(() => { deletion = undefined; - modalSpy = spyOn(TestBed.inject(ModalService), 'show').and.callFake( + modalSpy = spyOn(TestBed.inject(ModalCdsService), 'show').and.callFake( (comp: any, init: any) => { modal = modalServiceShow(comp, init); return modal; 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 c1a54223dcce8..1cdbcccd647ce 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 @@ -31,7 +31,7 @@ import { PoolFormInfo } from '~/app/shared/models/pool-form-info'; import { DimlessBinaryPipe } from '~/app/shared/pipes/dimless-binary.pipe'; import { AuthStorageService } from '~/app/shared/services/auth-storage.service'; import { FormatterService } from '~/app/shared/services/formatter.service'; -import { ModalService } from '~/app/shared/services/modal.service'; +import { ModalCdsService } from '~/app/shared/services/modal-cds.service'; import { TaskWrapperService } from '~/app/shared/services/task-wrapper.service'; import { CrushRuleFormModalComponent } from '../crush-rule-form-modal/crush-rule-form-modal.component'; import { ErasureCodeProfileFormModalComponent } from '../erasure-code-profile-form/erasure-code-profile-form-modal.component'; @@ -95,7 +95,7 @@ export class PoolFormComponent extends CdForm implements OnInit { private dimlessBinaryPipe: DimlessBinaryPipe, private route: ActivatedRoute, private router: Router, - private modalService: ModalService, + private modalService: ModalCdsService, private poolService: PoolService, private authStorageService: AuthStorageService, private formatter: FormatterService, diff --git a/src/pybind/mgr/dashboard/frontend/src/app/core/auth/user-form/user-form.component.spec.ts b/src/pybind/mgr/dashboard/frontend/src/app/core/auth/user-form/user-form.component.spec.ts index 4f95ac1e26c42..943fc033ede05 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/core/auth/user-form/user-form.component.spec.ts +++ b/src/pybind/mgr/dashboard/frontend/src/app/core/auth/user-form/user-form.component.spec.ts @@ -16,13 +16,13 @@ import { ComponentsModule } from '~/app/shared/components/components.module'; import { LoadingPanelComponent } from '~/app/shared/components/loading-panel/loading-panel.component'; import { CdFormGroup } from '~/app/shared/forms/cd-form-group'; import { AuthStorageService } from '~/app/shared/services/auth-storage.service'; -import { ModalService } from '~/app/shared/services/modal.service'; import { NotificationService } from '~/app/shared/services/notification.service'; import { PasswordPolicyService } from '~/app/shared/services/password-policy.service'; import { SharedModule } from '~/app/shared/shared.module'; import { configureTestBed, FormHelper } from '~/testing/unit-test-helper'; import { UserFormComponent } from './user-form.component'; import { UserFormModel } from './user-form.model'; +import { ModalCdsService } from '~/app/shared/services/modal-cds.service'; describe('UserFormComponent', () => { let component: UserFormComponent; @@ -30,7 +30,7 @@ describe('UserFormComponent', () => { let fixture: ComponentFixture; let httpTesting: HttpTestingController; let userService: UserService; - let modalService: ModalService; + let modalService: ModalCdsService; let router: Router; let formHelper: FormHelper; @@ -67,7 +67,7 @@ describe('UserFormComponent', () => { form = component.userForm; httpTesting = TestBed.inject(HttpTestingController); userService = TestBed.inject(UserService); - modalService = TestBed.inject(ModalService); + modalService = TestBed.inject(ModalCdsService); router = TestBed.inject(Router); spyOn(router, 'navigate'); fixture.detectChanges(); diff --git a/src/pybind/mgr/dashboard/frontend/src/app/core/auth/user-form/user-form.component.ts b/src/pybind/mgr/dashboard/frontend/src/app/core/auth/user-form/user-form.component.ts index 1a0ddf35cc994..7c02b86eae058 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/core/auth/user-form/user-form.component.ts +++ b/src/pybind/mgr/dashboard/frontend/src/app/core/auth/user-form/user-form.component.ts @@ -22,7 +22,7 @@ import { CdFormGroup } from '~/app/shared/forms/cd-form-group'; import { CdValidators } from '~/app/shared/forms/cd-validators'; import { CdPwdExpirationSettings } from '~/app/shared/models/cd-pwd-expiration-settings'; import { AuthStorageService } from '~/app/shared/services/auth-storage.service'; -import { ModalService } from '~/app/shared/services/modal.service'; +import { ModalCdsService } from '~/app/shared/services/modal-cds.service'; import { NotificationService } from '~/app/shared/services/notification.service'; import { PasswordPolicyService } from '~/app/shared/services/password-policy.service'; import { UserFormMode } from './user-form-mode.enum'; @@ -61,7 +61,7 @@ export class UserFormComponent extends CdForm implements OnInit { private authStorageService: AuthStorageService, private route: ActivatedRoute, public router: Router, - private modalService: ModalService, + private modalService: ModalCdsService, private roleService: RoleService, private userService: UserService, private notificationService: NotificationService, -- 2.39.5