-
Notifications
You must be signed in to change notification settings - Fork 244
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[UI] Make sure form validation displays non-valid fields as red in all forms #7064
Merged
openshift-merge-robot
merged 10 commits into
redhat-developer:main
from
rm3l:7054-ui-form-validation-should-display-non-valid-fields-as-red-in-all-forms
Sep 5, 2023
Merged
Changes from 8 commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
cc7a1b1
Add validation to multi-container component
rm3l 3b3ee9c
Add validation to multi-key-value component
rm3l 25e2d3f
Add validation to multi-text component
rm3l f3f0e1d
Add validation to select-container component
rm3l 1657316
Add validation to volume-mounts component
rm3l c3e6cc3
Add error helper message for invalid volume size quantities
rm3l 59276cb
Fix Cypress tests
rm3l b35c5ca
Generate static UI
rm3l 9177d76
fixup! Add error helper message for invalid volume size quantities
rm3l 7055b6e
Generate static UI
rm3l File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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.2218559ad9edb268.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.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure why, but I had to make Cypress forcibly bypass some checks with
force: true
. Otherwise, Cypress would complain that the element was covered by another one: