wf params form

This commit is contained in:
Michele Artini 2024-01-03 15:09:55 +01:00
parent 094044de98
commit 4427876763
3 changed files with 16 additions and 2 deletions

View File

@ -145,7 +145,7 @@
<mat-card-title>Aggregation Workflows</mat-card-title>
</mat-card-header>
<mat-card-content ng-if="wfs.length > 0">
<mat-card-content *ngIf="wfs.length > 0">
<table>
<thead>
<th align="left">Workflow</th>

View File

@ -192,7 +192,18 @@ export class WfConfDialog implements OnInit {
let validations: ValidatorFn[] = [];
if (p.required) { validations.push(Validators.required); }
if (p.type == 'number') { validations.push(Validators.pattern('^[0-9]*$')); }
this.wfConfFormStep3.addControl(p.name, new FormControl(this.data.userParams[p.name], validations));
if (p.name == 'dsId') {
this.wfConfFormStep3.addControl(p.name, new FormControl({ value: this.data.dsId, disabled: true }, validations));
} else if (p.name == 'apiId') {
this.wfConfFormStep3.addControl(p.name, new FormControl({ value: this.data.apiId, disabled: true }, validations));
} else if (this.data.userParams[p.name]) {
this.wfConfFormStep3.addControl(p.name, new FormControl(this.data.userParams[p.name], validations));
} else if (this.data.systemParams[p.name]) {
this.wfConfFormStep3.addControl(p.name, new FormControl({ value: this.data.systemParams[p.name], disabled: true }, validations));
} else {
this.wfConfFormStep3.addControl(p.name, new FormControl('', validations));
}
})
});
}

View File

@ -59,6 +59,7 @@
<!-- STEP 3 -->
<mat-step [stepControl]="wfConfFormStep3" label="Worflow Parameters">
<form [formGroup]="wfConfFormStep3">
<mat-form-field appearance="fill" floatLabel="always" style="width: 100%;" *ngFor="let p of wfParameters">
<mat-label>{{p.name}}</mat-label>
@ -70,10 +71,12 @@
</mat-select>
<mat-error *ngIf="wfConfFormStep3.get(p.name)?.invalid">Invalid value</mat-error>
</mat-form-field>
<div>
<button mat-stroked-button color="primary" matStepperPrevious>Back</button>
<button mat-stroked-button color="primary" matStepperNext>Next</button>
</div>
</form>
</mat-step>