@@ -42,6 +42,7 @@ import { RgwMultisiteWizardComponent } from '../rgw-multisite-wizard/rgw-multisi
4242import { RgwMultisiteSyncPolicyComponent } from '../rgw-multisite-sync-policy/rgw-multisite-sync-policy.component' ;
4343import { ModalCdsService } from '~/app/shared/services/modal-cds.service' ;
4444import { RgwMultisiteService } from '~/app/shared/api/rgw-multisite.service' ;
45+ import { CdForm } from '~/app/shared/forms/cd-form' ;
4546
4647const 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