Skip to content

Commit 89a7130

Browse files
authored
Merge pull request ceph#66116 from rhcs-dashboard/carbonized-multisite-zone
mgr/dashboard: Carbonized - Multisite Zone (Create and Edit) Reviewed-by: Nizamudeen A <[email protected]> Reviewed-by: Afreen Misbah <[email protected]> Reviewed-by: Naman Munet <[email protected]>
2 parents 3b600d6 + 1be7446 commit 89a7130

File tree

8 files changed

+385
-346
lines changed

8 files changed

+385
-346
lines changed

src/pybind/mgr/dashboard/frontend/src/app/ceph/rgw/rgw-multisite-details/rgw-multisite-details.component.ts

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ import { RgwMultisiteWizardComponent } from '../rgw-multisite-wizard/rgw-multisi
4242
import { RgwMultisiteSyncPolicyComponent } from '../rgw-multisite-sync-policy/rgw-multisite-sync-policy.component';
4343
import { ModalCdsService } from '~/app/shared/services/modal-cds.service';
4444
import { RgwMultisiteService } from '~/app/shared/api/rgw-multisite.service';
45+
import { CdForm } from '~/app/shared/forms/cd-form';
4546

4647
const BASE_URL = 'rgw/multisite/configuration';
4748

@@ -51,7 +52,7 @@ const BASE_URL = 'rgw/multisite/configuration';
5152
styleUrls: ['./rgw-multisite-details.component.scss'],
5253
changeDetection: ChangeDetectionStrategy.OnPush
5354
})
54-
export class RgwMultisiteDetailsComponent implements OnDestroy, OnInit {
55+
export class RgwMultisiteDetailsComponent extends CdForm implements OnDestroy, OnInit {
5556
private sub = new Subscription();
5657
@ViewChild('treeNodeTemplate') labelTpl: TemplateRef<any>;
5758
@ViewChild(RgwMultisiteSyncPolicyComponent) syncPolicyComp: RgwMultisiteSyncPolicyComponent;
@@ -140,12 +141,13 @@ export class RgwMultisiteDetailsComponent implements OnDestroy, OnInit {
140141
private rgwMultisiteService: RgwMultisiteService,
141142
private changeDetectionRef: ChangeDetectorRef
142143
) {
144+
super();
143145
this.permissions = this.authStorageService.getPermissions();
144146
}
145147

146148
openModal(entity: any | string, edit = false) {
147149
const entityName = edit ? entity?.data?.type : entity;
148-
const action = edit ? 'edit' : 'create';
150+
const action = edit ? this.actionLabels.EDIT : this.actionLabels.CREATE;
149151
const initialState = {
150152
resource: entityName,
151153
action: action,
@@ -154,14 +156,18 @@ export class RgwMultisiteDetailsComponent implements OnDestroy, OnInit {
154156
multisiteInfo: this.multisiteInfo
155157
};
156158
if (entityName === 'realm') {
157-
this.bsModalRef = this.cdsModalService.show(RgwMultisiteRealmFormComponent, initialState);
159+
this.cdsModalService.show(RgwMultisiteRealmFormComponent, initialState);
158160
} else if (entityName === 'zonegroup') {
159161
this.bsModalRef = this.modalService.show(RgwMultisiteZonegroupFormComponent, initialState, {
160162
size: 'lg'
161163
});
162164
} else {
163-
this.bsModalRef = this.modalService.show(RgwMultisiteZoneFormComponent, initialState, {
164-
size: 'lg'
165+
this.cdsModalService.show(RgwMultisiteZoneFormComponent, {
166+
resource: entityName,
167+
action: action,
168+
info: entity,
169+
defaultsInfo: this.defaultsInfo,
170+
multisiteInfo: this.multisiteInfo
165171
});
166172
}
167173
}

0 commit comments

Comments
 (0)