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

Commit

Permalink
fix(vm-creation): Error in VM creation when affinity group contains c… (
Browse files Browse the repository at this point in the history
#633)

* fix(vm-creation): Error in VM creation when affinity group contains commas

* fix(vm-creation): Error in VM creation when affinity group contains commas - fixes after code review
  • Loading branch information
HeyRoach committed Oct 27, 2017
1 parent 5d81359 commit 47280ac
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 3 deletions.
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]$"
[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

0 comments on commit 47280ac

Please sign in to comment.