mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-24 17:32:15 +00:00
AAE-22720 Add a new "Skip validation" option in outcome properties (#9752)
* AAE-22720 Add a new "Skip validation" option in outcome properties * cr
This commit is contained in:
@@ -118,12 +118,15 @@ export abstract class FormBaseComponent {
|
||||
return outcomeName === FormBaseComponent.COMPLETE_OUTCOME_NAME ? FormBaseComponent.COMPLETE_BUTTON_COLOR : null;
|
||||
}
|
||||
|
||||
isOutcomeButtonEnabled(outcome: FormOutcomeModel): boolean {
|
||||
isOutcomeButtonEnabled(outcome?: FormOutcomeModel): boolean {
|
||||
if (this.form.readOnly) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (outcome) {
|
||||
if (outcome.skipValidation) {
|
||||
return true;
|
||||
}
|
||||
if (outcome.name === FormOutcomeModel.SAVE_ACTION) {
|
||||
return !this.disableSaveButton;
|
||||
}
|
||||
@@ -135,6 +138,7 @@ export abstract class FormBaseComponent {
|
||||
}
|
||||
return this.form.isValid;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@@ -15,20 +15,20 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
/* eslint-disable @angular-eslint/component-selector */
|
||||
/* eslint-disable @angular-eslint/component-selector */
|
||||
|
||||
import { FormWidgetModel } from './form-widget.model';
|
||||
import { WidgetVisibilityModel } from '../../../models/widget-visibility.model';
|
||||
|
||||
export class FormOutcomeModel extends FormWidgetModel {
|
||||
|
||||
static SAVE_ACTION: string = 'SAVE'; // Activiti 'Save' action name
|
||||
static COMPLETE_ACTION: string = 'COMPLETE'; // Activiti 'Complete' action name
|
||||
static START_PROCESS_ACTION: string = 'START PROCESS'; // Activiti 'Start Process' action name
|
||||
static SAVE_ACTION: string = 'SAVE'; // Activiti 'Save' action name
|
||||
static COMPLETE_ACTION: string = 'COMPLETE'; // Activiti 'Complete' action name
|
||||
static START_PROCESS_ACTION: string = 'START PROCESS'; // Activiti 'Start Process' action name
|
||||
|
||||
isSystem: boolean = false;
|
||||
isSelected: boolean = false;
|
||||
isVisible: boolean = true;
|
||||
skipValidation: boolean = false;
|
||||
visibilityCondition: WidgetVisibilityModel;
|
||||
|
||||
constructor(form: any, json?: any) {
|
||||
@@ -36,6 +36,7 @@ export class FormOutcomeModel extends FormWidgetModel {
|
||||
|
||||
if (json) {
|
||||
this.isSystem = json.isSystem ? true : false;
|
||||
this.skipValidation = json.skipValidation ?? false;
|
||||
this.isSelected = form && json.name === form.selectedOutcome ? true : false;
|
||||
this.visibilityCondition = new WidgetVisibilityModel(json.visibilityCondition);
|
||||
}
|
||||
|
Reference in New Issue
Block a user