Skip to content
This repository has been archived by the owner on Mar 25, 2023. It is now read-only.

fix(vm-creation): Error in VM creation when affinity group contains c… #633

Merged
merged 2 commits into from
Oct 27, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 10 additions & 1 deletion src/app/vm/vm-creation/vm-creation.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -54,11 +54,15 @@ <h5>{{ 'VM_PAGE.VM_CREATION.NAME' | translate }}</h5>
(ngModelChange)="displayNameChange($event)"
[placeholder]="'VM_PAGE.VM_CREATION.NAME' | translate"
pattern="^[a-zA-Z]{1}[a-zA-Z0-9\-]{0,61}[a-zA-Z0-9]$"
[maxlength]="maxEntityNameLength"
required
>
<mat-error *ngIf="takenName">
{{ 'VM_PAGE.VM_CREATION.THIS_NAME_IS_TAKEN' | translate }}
</mat-error>
<mat-hint align="end">
<cs-character-count [value]="formState.state.displayName" [maxLength]="maxEntityNameLength"></cs-character-count>
</mat-hint>
</mat-form-field>
</div>

Expand Down Expand Up @@ -153,16 +157,21 @@ <h5>{{ 'VM_PAGE.VM_CREATION.GROUP' | translate }}</h5>
</div>

<div>
<h5>{{ 'VM_PAGE.VM_CREATION.AFFINITY_GROUPS' | translate }}</h5>
<h5>{{ 'VM_PAGE.VM_CREATION.AFFINITY_GROUP' | translate }}</h5>
<mat-form-field floatPlaceholder="never">
<input
name="group"
matInput
pattern="[a-zA-Z]{1}[a-zA-Z0-9\-\_]{0,61}[a-zA-Z0-9]$"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we add a max length option to help user to understand why if they enter long affinity group name, save button is disabled?

[placeholder]="'VM_PAGE.VM_CREATION.NO_GROUP' | translate"
[matAutocomplete]="affinityGroups"
[maxlength]="maxEntityNameLength"
[(ngModel)]="formState.state.affinityGroup.name"
(ngModelChange)="affinityGroupChange($event)"
>
<mat-hint align="end">
<cs-character-count [value]="formState.state.affinityGroup.name" [maxLength]="maxEntityNameLength"></cs-character-count>
</mat-hint>
</mat-form-field>
<mat-autocomplete #affinityGroups>
<mat-option
Expand Down
1 change: 1 addition & 0 deletions src/app/vm/vm-creation/vm-creation.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ export class VmCreationComponent implements OnInit {
public progressLoggerController = new ProgressLoggerController();
public showOverlay = false;
public deploymentStopped = false;
public maxEntityNameLength = 63;
public loggerStageList: Array<ProgressLoggerMessage>;

public visibleAffinityGroups: Array<AffinityGroup>;
Expand Down
2 changes: 1 addition & 1 deletion src/i18n/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -476,7 +476,7 @@
"DISK_SIZE": "Disk size",
"GROUP": "Group",
"NO_GROUP": "No group",
"AFFINITY_GROUPS": "Affinity groups",
"AFFINITY_GROUP": "Affinity group",
"SECURITY_GROUPS": "Firewall rules",
"KEYBOARD_LAYOUT": "Keyboard layout",
"KB_US": "Standard (US) keyboard",
Expand Down
2 changes: 1 addition & 1 deletion src/i18n/ru.json
Original file line number Diff line number Diff line change
Expand Up @@ -477,7 +477,7 @@
"DISK_SIZE": "Размер диска",
"GROUP": "Группа",
"NO_GROUP": "Без группы",
"AFFINITY_GROUPS": "Аффинитетные группы",
"AFFINITY_GROUP": "Аффинитетная группа",
"SECURITY_GROUPS": "Брандмауэр",
"KEYBOARD_LAYOUT": "Раскладка клавиатуры",
"KB_US": "Standard (US) keyboard",
Expand Down