X-Git-Url: https://git.proxmox.com/?a=blobdiff_plain;f=ceph%2Fsrc%2Fpybind%2Fmgr%2Fdashboard%2Ffrontend%2Fsrc%2Fapp%2Fshared%2Fcomponents%2Fform-button-panel%2Fform-button-panel.component.ts;h=17f6001146f0361db2515a4af5ff0dc7a6fe95c0;hb=aee94f6923ba628a85d855d0c5316d0da78bfa2a;hp=fa0483b182d8c60caf8c8c74f08219b1eaeee3f5;hpb=27f45121cc74e31203777ad565f78d8aad9b92a2;p=ceph.git diff --git a/ceph/src/pybind/mgr/dashboard/frontend/src/app/shared/components/form-button-panel/form-button-panel.component.ts b/ceph/src/pybind/mgr/dashboard/frontend/src/app/shared/components/form-button-panel/form-button-panel.component.ts index fa0483b18..17f600114 100644 --- a/ceph/src/pybind/mgr/dashboard/frontend/src/app/shared/components/form-button-panel/form-button-panel.component.ts +++ b/ceph/src/pybind/mgr/dashboard/frontend/src/app/shared/components/form-button-panel/form-button-panel.component.ts @@ -1,6 +1,6 @@ import { Location } from '@angular/common'; -import { Component, EventEmitter, Input, Output, ViewChild } from '@angular/core'; -import { FormGroup, NgForm } from '@angular/forms'; +import { Component, EventEmitter, Input, OnInit, Output, ViewChild } from '@angular/core'; +import { UntypedFormGroup, NgForm } from '@angular/forms'; import { ActionLabelsI18n } from '~/app/shared/constants/app.constants'; import { ModalService } from '~/app/shared/services/modal.service'; @@ -11,7 +11,7 @@ import { SubmitButtonComponent } from '../submit-button/submit-button.component' templateUrl: './form-button-panel.component.html', styleUrls: ['./form-button-panel.component.scss'] }) -export class FormButtonPanelComponent { +export class FormButtonPanelComponent implements OnInit { @ViewChild(SubmitButtonComponent) submitButton: SubmitButtonComponent; @@ -21,7 +21,7 @@ export class FormButtonPanelComponent { backActionEvent = new EventEmitter(); @Input() - form: FormGroup | NgForm; + form: UntypedFormGroup | NgForm; @Input() showSubmit = true; @Input() @@ -31,9 +31,9 @@ export class FormButtonPanelComponent { @Input() btnClass = ''; @Input() - submitText: string = this.actionLabels.CREATE; + submitText?: string; @Input() - cancelText: string = this.actionLabels.CANCEL; + cancelText?: string; @Input() disabled = false; @@ -43,6 +43,11 @@ export class FormButtonPanelComponent { private modalService: ModalService ) {} + ngOnInit() { + this.submitText = this.submitText || this.actionLabels.CREATE; + this.cancelText = this.cancelText || this.actionLabels.CANCEL; + } + submitAction() { this.submitActionEvent.emit(); }