Skip to content

Commit 8a7e670

Browse files
authored
Merge pull request ceph#60422 from rhcs-dashboard/modal-carbonized
mgr/dashboard: Replacing bootstrap modal service with cds modal service Reviewed-by: Afreen Misbah <[email protected]>
2 parents 7809b0e + 961757b commit 8a7e670

File tree

7 files changed

+18
-18
lines changed

7 files changed

+18
-18
lines changed

src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/prometheus/silence-list/silence-list.component.spec.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ import { TableActionsComponent } from '~/app/shared/datatable/table-actions/tabl
1313
import { NotificationType } from '~/app/shared/enum/notification-type.enum';
1414
import { Permission } from '~/app/shared/models/permissions';
1515
import { AuthStorageService } from '~/app/shared/services/auth-storage.service';
16-
import { ModalService } from '~/app/shared/services/modal.service';
16+
import { ModalCdsService } from '~/app/shared/services/modal-cds.service';
1717
import { NotificationService } from '~/app/shared/services/notification.service';
1818
import { SharedModule } from '~/app/shared/shared.module';
1919
import { configureTestBed, PermissionHelper } from '~/testing/unit-test-helper';
@@ -159,7 +159,7 @@ describe('SilenceListComponent', () => {
159159
const mockObservable = () => of([]);
160160
spyOn(component, 'refresh').and.callFake(mockObservable);
161161
spyOn(prometheusService, 'expireSilence').and.callFake(mockObservable);
162-
spyOn(TestBed.inject(ModalService), 'show').and.callFake((deletionClass, config) => {
162+
spyOn(TestBed.inject(ModalCdsService), 'show').and.callFake((deletionClass, config) => {
163163
return {
164164
componentInstance: Object.assign(new deletionClass(), config)
165165
};

src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/prometheus/silence-list/silence-list.component.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ import { Permission } from '~/app/shared/models/permissions';
1919
import { PrometheusRule } from '~/app/shared/models/prometheus-alerts';
2020
import { CdDatePipe } from '~/app/shared/pipes/cd-date.pipe';
2121
import { AuthStorageService } from '~/app/shared/services/auth-storage.service';
22-
import { ModalService } from '~/app/shared/services/modal.service';
22+
import { ModalCdsService } from '~/app/shared/services/modal-cds.service';
2323
import { NotificationService } from '~/app/shared/services/notification.service';
2424
import { PrometheusSilenceMatcherService } from '~/app/shared/services/prometheus-silence-matcher.service';
2525
import { URLBuilderService } from '~/app/shared/services/url-builder.service';
@@ -56,7 +56,7 @@ export class SilenceListComponent extends PrometheusListHelper {
5656
constructor(
5757
private authStorageService: AuthStorageService,
5858
private cdDatePipe: CdDatePipe,
59-
private modalService: ModalService,
59+
private modalService: ModalCdsService,
6060
private notificationService: NotificationService,
6161
private urlBuilder: URLBuilderService,
6262
private actionLabels: ActionLabelsI18n,

src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/upgrade/upgrade-progress/upgrade-progress.component.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import { NgbModalRef } from '@ng-bootstrap/ng-bootstrap';
55

66
import { Icons } from '~/app/shared/enum/icons.enum';
77
import { CriticalConfirmationModalComponent } from '~/app/shared/components/critical-confirmation-modal/critical-confirmation-modal.component';
8-
import { ModalService } from '~/app/shared/services/modal.service';
8+
import { ModalCdsService } from '~/app/shared/services/modal-cds.service';
99
import { Permission } from '~/app/shared/models/permissions';
1010
import { AuthStorageService } from '~/app/shared/services/auth-storage.service';
1111
import { UpgradeService } from '~/app/shared/api/upgrade.service';
@@ -37,7 +37,7 @@ export class UpgradeProgressComponent implements OnInit, OnDestroy {
3737
private authStorageService: AuthStorageService,
3838
private upgradeService: UpgradeService,
3939
private notificationService: NotificationService,
40-
private modalService: ModalService,
40+
private modalService: ModalCdsService,
4141
private summaryService: SummaryService,
4242
private router: Router,
4343
private refreshIntervalService: RefreshIntervalService

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

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ import { ErasureCodeProfile } from '~/app/shared/models/erasure-code-profile';
2828
import { Permission } from '~/app/shared/models/permissions';
2929
import { PoolFormInfo } from '~/app/shared/models/pool-form-info';
3030
import { AuthStorageService } from '~/app/shared/services/auth-storage.service';
31-
import { ModalService } from '~/app/shared/services/modal.service';
31+
import { ModalCdsService } from '~/app/shared/services/modal-cds.service';
3232
import { TaskWrapperService } from '~/app/shared/services/task-wrapper.service';
3333
import { SharedModule } from '~/app/shared/shared.module';
3434
import {
@@ -765,7 +765,7 @@ describe('PoolFormComponent', () => {
765765
it('should select the newly created rule', () => {
766766
expect(form.getValue('crushRule').rule_name).toBe('rep1');
767767
const name = 'awesomeRule';
768-
spyOn(TestBed.inject(ModalService), 'show').and.callFake(() => {
768+
spyOn(TestBed.inject(ModalCdsService), 'show').and.callFake(() => {
769769
return {
770770
componentInstance: {
771771
submitAction: of({ name })
@@ -828,7 +828,7 @@ describe('PoolFormComponent', () => {
828828
};
829829

830830
beforeEach(() => {
831-
modalSpy = spyOn(TestBed.inject(ModalService), 'show').and.callFake(
831+
modalSpy = spyOn(TestBed.inject(ModalCdsService), 'show').and.callFake(
832832
(deletionClass: any, initialState: any) => {
833833
deletion = Object.assign(new deletionClass(), initialState);
834834
return {
@@ -933,7 +933,7 @@ describe('PoolFormComponent', () => {
933933
spyOn(ecpService, 'list').and.callFake(() => of(infoReturn.erasure_code_profiles));
934934
expect(form.getValue('erasureProfile').name).toBe('ecp1');
935935
const name = 'awesomeProfile';
936-
spyOn(TestBed.inject(ModalService), 'show').and.callFake(() => {
936+
spyOn(TestBed.inject(ModalCdsService), 'show').and.callFake(() => {
937937
return {
938938
componentInstance: {
939939
submitAction: of({ name })
@@ -977,7 +977,7 @@ describe('PoolFormComponent', () => {
977977

978978
beforeEach(() => {
979979
deletion = undefined;
980-
modalSpy = spyOn(TestBed.inject(ModalService), 'show').and.callFake(
980+
modalSpy = spyOn(TestBed.inject(ModalCdsService), 'show').and.callFake(
981981
(comp: any, init: any) => {
982982
modal = modalServiceShow(comp, init);
983983
return modal;

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ import { PoolFormInfo } from '~/app/shared/models/pool-form-info';
3131
import { DimlessBinaryPipe } from '~/app/shared/pipes/dimless-binary.pipe';
3232
import { AuthStorageService } from '~/app/shared/services/auth-storage.service';
3333
import { FormatterService } from '~/app/shared/services/formatter.service';
34-
import { ModalService } from '~/app/shared/services/modal.service';
34+
import { ModalCdsService } from '~/app/shared/services/modal-cds.service';
3535
import { TaskWrapperService } from '~/app/shared/services/task-wrapper.service';
3636
import { CrushRuleFormModalComponent } from '../crush-rule-form-modal/crush-rule-form-modal.component';
3737
import { ErasureCodeProfileFormModalComponent } from '../erasure-code-profile-form/erasure-code-profile-form-modal.component';
@@ -95,7 +95,7 @@ export class PoolFormComponent extends CdForm implements OnInit {
9595
private dimlessBinaryPipe: DimlessBinaryPipe,
9696
private route: ActivatedRoute,
9797
private router: Router,
98-
private modalService: ModalService,
98+
private modalService: ModalCdsService,
9999
private poolService: PoolService,
100100
private authStorageService: AuthStorageService,
101101
private formatter: FormatterService,

src/pybind/mgr/dashboard/frontend/src/app/core/auth/user-form/user-form.component.spec.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,21 +16,21 @@ import { ComponentsModule } from '~/app/shared/components/components.module';
1616
import { LoadingPanelComponent } from '~/app/shared/components/loading-panel/loading-panel.component';
1717
import { CdFormGroup } from '~/app/shared/forms/cd-form-group';
1818
import { AuthStorageService } from '~/app/shared/services/auth-storage.service';
19-
import { ModalService } from '~/app/shared/services/modal.service';
2019
import { NotificationService } from '~/app/shared/services/notification.service';
2120
import { PasswordPolicyService } from '~/app/shared/services/password-policy.service';
2221
import { SharedModule } from '~/app/shared/shared.module';
2322
import { configureTestBed, FormHelper } from '~/testing/unit-test-helper';
2423
import { UserFormComponent } from './user-form.component';
2524
import { UserFormModel } from './user-form.model';
25+
import { ModalCdsService } from '~/app/shared/services/modal-cds.service';
2626

2727
describe('UserFormComponent', () => {
2828
let component: UserFormComponent;
2929
let form: CdFormGroup;
3030
let fixture: ComponentFixture<UserFormComponent>;
3131
let httpTesting: HttpTestingController;
3232
let userService: UserService;
33-
let modalService: ModalService;
33+
let modalService: ModalCdsService;
3434
let router: Router;
3535
let formHelper: FormHelper;
3636

@@ -67,7 +67,7 @@ describe('UserFormComponent', () => {
6767
form = component.userForm;
6868
httpTesting = TestBed.inject(HttpTestingController);
6969
userService = TestBed.inject(UserService);
70-
modalService = TestBed.inject(ModalService);
70+
modalService = TestBed.inject(ModalCdsService);
7171
router = TestBed.inject(Router);
7272
spyOn(router, 'navigate');
7373
fixture.detectChanges();

src/pybind/mgr/dashboard/frontend/src/app/core/auth/user-form/user-form.component.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ import { CdFormGroup } from '~/app/shared/forms/cd-form-group';
2222
import { CdValidators } from '~/app/shared/forms/cd-validators';
2323
import { CdPwdExpirationSettings } from '~/app/shared/models/cd-pwd-expiration-settings';
2424
import { AuthStorageService } from '~/app/shared/services/auth-storage.service';
25-
import { ModalService } from '~/app/shared/services/modal.service';
25+
import { ModalCdsService } from '~/app/shared/services/modal-cds.service';
2626
import { NotificationService } from '~/app/shared/services/notification.service';
2727
import { PasswordPolicyService } from '~/app/shared/services/password-policy.service';
2828
import { UserFormMode } from './user-form-mode.enum';
@@ -61,7 +61,7 @@ export class UserFormComponent extends CdForm implements OnInit {
6161
private authStorageService: AuthStorageService,
6262
private route: ActivatedRoute,
6363
public router: Router,
64-
private modalService: ModalService,
64+
private modalService: ModalCdsService,
6565
private roleService: RoleService,
6666
private userService: UserService,
6767
private notificationService: NotificationService,

0 commit comments

Comments
 (0)