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:
@@ -69,10 +69,15 @@
|
||||
<mat-card-actions *ngIf="form.hasOutcomes()" class="adf-form-mat-card-actions">
|
||||
<ng-content select="adf-cloud-form-custom-outcomes"></ng-content>
|
||||
<ng-container *ngFor="let outcome of form.outcomes">
|
||||
<button *ngIf="outcome.isVisible" [id]="'adf-form-'+ outcome.name | formatSpace" [color]="getColorForOutcome(outcome.name)"
|
||||
mat-button [disabled]="!isOutcomeButtonEnabled(outcome)"
|
||||
<button
|
||||
*ngIf="outcome.isVisible"
|
||||
[id]="'adf-form-'+ outcome.name | formatSpace"
|
||||
[color]="getColorForOutcome(outcome.name)"
|
||||
mat-button
|
||||
[disabled]="!isOutcomeButtonEnabled(outcome)"
|
||||
[class.adf-form-hide-button]="!isOutcomeButtonVisible(outcome, form.readOnly)"
|
||||
(click)="onOutcomeClicked(outcome)">
|
||||
(click)="onOutcomeClicked(outcome)"
|
||||
>
|
||||
{{outcome.name | translate | uppercase }}
|
||||
</button>
|
||||
</ng-container>
|
||||
|
@@ -990,6 +990,20 @@ describe('FormCloudComponent', () => {
|
||||
expect(formComponent.isOutcomeButtonEnabled(saveOutcome)).toBeTruthy();
|
||||
});
|
||||
|
||||
it('should enable outcome with skip validation property, even if the form is not valid', () => {
|
||||
const formModel = new FormModel(cloudFormMock);
|
||||
formComponent.form = formModel;
|
||||
formModel.isValid = false;
|
||||
|
||||
const customOutcome = new FormOutcomeModel(new FormModel(), {
|
||||
id: FormCloudComponent.CUSTOM_OUTCOME_ID,
|
||||
name: 'Custom',
|
||||
skipValidation: true
|
||||
});
|
||||
|
||||
expect(formComponent.isOutcomeButtonEnabled(customOutcome)).toBeTruthy();
|
||||
});
|
||||
|
||||
it('should disable start process outcome button when disableStartProcessButton is true', () => {
|
||||
const formModel = new FormModel(cloudFormMock);
|
||||
formComponent.form = formModel;
|
||||
|
Reference in New Issue
Block a user