]> git.proxmox.com Git - ceph.git/blobdiff - ceph/src/pybind/mgr/dashboard/frontend/src/app/shared/components/form-button-panel/form-button-panel.component.ts
update ceph source to reef 18.2.1
[ceph.git] / ceph / src / pybind / mgr / dashboard / frontend / src / app / shared / components / form-button-panel / form-button-panel.component.ts
index fa0483b182d8c60caf8c8c74f08219b1eaeee3f5..17f6001146f0361db2515a4af5ff0dc7a6fe95c0 100644 (file)
@@ -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();
   }