mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-24 17:32:15 +00:00
[ADF-4441] Save button should be disabled when form fields are invalid (#4817)
* [ADF-4441] Save button should be disabled when form inputs are invalid, Refactored disable custom outcome buttons unit tests * [ADF-4441] add missing space * [ADF-4441] Refactor failing unit tests * [ADF-4441] Added documentation for disableSaveButton property
This commit is contained in:
committed by
Eugenio Romano
parent
3e1092d7bf
commit
4ea656e537
@@ -48,6 +48,10 @@ export abstract class FormBaseComponent {
|
||||
@Input()
|
||||
disableCompleteButton: boolean = false;
|
||||
|
||||
/** If true then the `Save` outcome button is shown but it will be disabled. */
|
||||
@Input()
|
||||
disableSaveButton: boolean = false;
|
||||
|
||||
/** If true then the `Start Process` outcome button is shown but it will be disabled. */
|
||||
@Input()
|
||||
disableStartProcessButton: boolean = false;
|
||||
@@ -116,9 +120,8 @@ export abstract class FormBaseComponent {
|
||||
}
|
||||
|
||||
if (outcome) {
|
||||
// Make 'Save' button always available
|
||||
if (outcome.name === FormOutcomeModel.SAVE_ACTION) {
|
||||
return true;
|
||||
return this.disableSaveButton ? false : this.form.isValid;
|
||||
}
|
||||
if (outcome.name === FormOutcomeModel.COMPLETE_ACTION) {
|
||||
return this.disableCompleteButton ? false : this.form.isValid;
|
||||
|
Reference in New Issue
Block a user