-
Notifications
You must be signed in to change notification settings - Fork 243
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[UI] Make sure form validation displays non-valid fields as red in al…
…l forms (#7064) * Add validation to multi-container component This covers the following forms: - Add commands when adding a Composite Command Co-authored-by: Philippe Martin <phmartin@redhat.com> * Add validation to multi-key-value component This covers the following forms: - Add Environment variables in Create Container - Add Deployment annotations in Create Container - Add Service annotations in Create Container Co-authored-by: Philippe Martin <phmartin@redhat.com> * Add validation to multi-text component This covers the following forms: - Add Command in Create Container - Add Args in Create Container - Add Args in Create Image Co-authored-by: Philippe Martin <phmartin@redhat.com> * Add validation to select-container component This covers the following forms: - Select or Create container in Add Exec Command - Select or create image component in Add Image Command - Select or create Resource in Add Apply command Co-authored-by: Philippe Martin <phmartin@redhat.com> * Add validation to volume-mounts component This covers the following forms: - Select or Create volume mount in Create container Co-authored-by: Philippe Martin <phmartin@redhat.com> * Add error helper message for invalid volume size quantities * Fix Cypress tests * Generate static UI * fixup! Add error helper message for invalid volume size quantities Co-authored-by: Philippe Martin <phmartin@redhat.com> * Generate static UI --------- Co-authored-by: Philippe Martin <phmartin@redhat.com>
- Loading branch information
Showing
14 changed files
with
230 additions
and
133 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
2 changes: 1 addition & 1 deletion
2
...piserver-impl/ui/main.4d8dc3ef32c88ca3.js → ...piserver-impl/ui/main.9400449aa2437590.js
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
9 changes: 5 additions & 4 deletions
9
ui/src/app/controls/multi-command/multi-command.component.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,15 @@ | ||
<h3>{{title}}</h3> | ||
<div class="group"> | ||
<span *ngFor="let command of commands; let i=index"> | ||
<span *ngFor="let control of form.controls; index as i"> | ||
<mat-form-field appearance="fill"> | ||
<mat-select [value]="command" (selectionChange)="onCommandChange(i, $event.value)"> | ||
<mat-label><span>Command</span></mat-label> | ||
<mat-select [formControl]="control"> | ||
<mat-option *ngFor="let commandElement of commandList" [value]="commandElement">{{commandElement}}</mat-option> | ||
</mat-select> | ||
</mat-form-field> | ||
</span> | ||
<button *ngIf="commands.length > 0" mat-icon-button (click)="addCommand()"> | ||
<button *ngIf="form.controls.length > 0" mat-icon-button (click)="addCommand('')"> | ||
<mat-icon class="tab-icon material-icons-outlined">add</mat-icon> | ||
</button> | ||
<button *ngIf="commands.length == 0" mat-flat-button (click)="addCommand()">{{addLabel}}</button> | ||
<button *ngIf="form.controls.length == 0" mat-flat-button (click)="addCommand('')">{{addLabel}}</button> | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
26 changes: 14 additions & 12 deletions
26
ui/src/app/controls/multi-key-value/multi-key-value.component.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,18 @@ | ||
<div class="group"> | ||
<span *ngFor="let entry of entries; let i=index"> | ||
<mat-form-field class="mid-width" appearance="outline"> | ||
<mat-label><span>Name</span></mat-label> | ||
<input [attr.data-cy]="dataCyPrefix+'-name-'+i" matInput [value]="entry.name" (change)="onKeyChange(i, $event)" (input)="onKeyChange(i, $event)"> | ||
</mat-form-field> | ||
<mat-form-field class="mid-width" appearance="outline"> | ||
<mat-label><span>Value</span></mat-label> | ||
<input [attr.data-cy]="dataCyPrefix+'-value-'+i" matInput [value]="entry.value" (change)="onValueChange(i, $event)" (input)="onValueChange(i, $event)"> | ||
</mat-form-field> | ||
</span> | ||
<button [attr.data-cy]="dataCyPrefix+'-plus'" *ngIf="entries.length > 0" mat-icon-button (click)="addEntry()"> | ||
<div *ngFor="let control of form.controls; index as i"> | ||
<ng-container [formGroup]="control"> | ||
<mat-form-field class="mid-width" appearance="outline"> | ||
<mat-label><span>Name</span></mat-label> | ||
<input [attr.data-cy]="dataCyPrefix+'-name-'+i" matInput formControlName="name"> | ||
</mat-form-field> | ||
<mat-form-field class="mid-width" appearance="outline"> | ||
<mat-label><span>Value</span></mat-label> | ||
<input [attr.data-cy]="dataCyPrefix+'-value-'+i" matInput formControlName="value"> | ||
</mat-form-field> | ||
</ng-container> | ||
</div> | ||
<button [attr.data-cy]="dataCyPrefix+'-plus'" *ngIf="form.controls.length > 0" mat-icon-button (click)="addEntry('', '')"> | ||
<mat-icon class="tab-icon material-icons-outlined">add</mat-icon> | ||
</button> | ||
<button [attr.data-cy]="dataCyPrefix+'-add'" *ngIf="entries.length == 0" mat-flat-button (click)="addEntry()">{{addLabel}}</button> | ||
<button [attr.data-cy]="dataCyPrefix+'-add'" *ngIf="form.controls.length == 0" mat-flat-button (click)="addEntry('', '')">{{addLabel}}</button> | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,13 @@ | ||
<h3 *ngIf="title">{{title}}</h3> | ||
<div class="group"> | ||
<span *ngFor="let text of texts; let i=index"> | ||
<span *ngFor="let control of form.controls; index as i"> | ||
<mat-form-field class="inline" appearance="outline"> | ||
<mat-label><span>{{label}}</span></mat-label> | ||
<input matInput [value]="text" (change)="onTextChange(i, $event)"> | ||
</mat-form-field> | ||
<input matInput [formControl]="control"> | ||
</mat-form-field> | ||
</span> | ||
<button *ngIf="texts.length > 0" mat-icon-button (click)="addText()"> | ||
<button *ngIf="form.controls.length > 0" mat-icon-button (click)="addText('')"> | ||
<mat-icon class="tab-icon material-icons-outlined">add</mat-icon> | ||
</button> | ||
<button *ngIf="texts.length == 0" mat-flat-button (click)="addText()">{{addLabel}}</button> | ||
<button *ngIf="form.controls.length == 0" mat-flat-button (click)="addText('')">{{addLabel}}</button> | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
ui/src/app/controls/select-container/select-container.component.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.