Adapt changes in https://github.com/ceph/ceph/pull/37994.
- The preview button should not spin.
- The preview button should be enabled again after destroying the
preview modal.
Fixes: https://tracker.ceph.com/issues/48421
Signed-off-by: Kiefer Chang <kiefer.chang@suse.com>
</fieldset>
</div>
<div class="card-footer">
- <cd-form-button-panel (submitActionEvent)="submit()"
+ <cd-form-button-panel #previewButtonPanel
+ (submitActionEvent)="submit()"
[form]="form"
[disabled]="dataDeviceSelectionGroups.devices.length === 0"
[submitText]="actionLabels.PREVIEW"
import { InventoryDevice } from '~/app/ceph/cluster/inventory/inventory-devices/inventory-device.model';
import { OrchestratorService } from '~/app/shared/api/orchestrator.service';
-import { SubmitButtonComponent } from '~/app/shared/components/submit-button/submit-button.component';
+import { FormButtonPanelComponent } from '~/app/shared/components/form-button-panel/form-button-panel.component';
import { ActionLabelsI18n } from '~/app/shared/constants/app.constants';
import { Icons } from '~/app/shared/enum/icons.enum';
import { CdForm } from '~/app/shared/forms/cd-form';
@ViewChild('dbDeviceSelectionGroups')
dbDeviceSelectionGroups: OsdDevicesSelectionGroupsComponent;
- @ViewChild('previewButton')
- previewButton: SubmitButtonComponent;
+ @ViewChild('previewButtonPanel')
+ previewButtonPanel: FormButtonPanelComponent;
icons = Icons;
modalRef.componentInstance.submitAction.subscribe(() => {
this.router.navigate(['/osd']);
});
- this.previewButton.loading = false;
+ this.previewButtonPanel.submitButton.loading = false;
}
}
import { Location } from '@angular/common';
-import { Component, EventEmitter, Input, Output } from '@angular/core';
+import { Component, EventEmitter, Input, Output, ViewChild } from '@angular/core';
import { FormGroup, NgForm } from '@angular/forms';
import { ActionLabelsI18n } from '~/app/shared/constants/app.constants';
import { ModalService } from '~/app/shared/services/modal.service';
+import { SubmitButtonComponent } from '../submit-button/submit-button.component';
@Component({
selector: 'cd-form-button-panel',
styleUrls: ['./form-button-panel.component.scss']
})
export class FormButtonPanelComponent {
+ @ViewChild(SubmitButtonComponent)
+ submitButton: SubmitButtonComponent;
+
@Output()
submitActionEvent = new EventEmitter();
@Output()