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:
Bartosz Sekula
2024-06-03 09:38:44 +02:00
committed by GitHub
parent f411754ede
commit 0ea35b1f12
4 changed files with 33 additions and 9 deletions

View File

@@ -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>

View File

@@ -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;