Skip to content

Commit

Permalink
Drive shortname limited to 45 characters. Conditional existing option…
Browse files Browse the repository at this point in the history
… for personal dropbox in request forms.
  • Loading branch information
warrickct committed Nov 26, 2020
1 parent 50818c0 commit 402d22e
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ <h3>Do you want to request new storage or update existing storage?</h3>
<mat-radio-group fxLayout="column" fxLayoutGap="1em" formControlName="requestType">
<mat-radio-button value="New">New</mat-radio-button>
<mat-radio-button value="Existing">Existing</mat-radio-button>
<mat-radio-button *ngIf="requestTypeForm.controls.requestType.value === 'Existing' || requestTypeForm.controls.requestType.value === 'New - Dropbox'" value="New - Dropbox">Existing - Personal Dropbox</mat-radio-button>
<mat-error *ngIf="requestTypeForm.controls.requestType.invalid && requestTypeClicked">* Please choose an
option</mat-error>
</mat-radio-group>
Expand Down Expand Up @@ -109,7 +110,7 @@ <h3>Is there anything else you would like to tell us?</h3>
</mat-step>

<mat-step [editable]="isEditable" [stepControl]="projectForm"
*ngIf="requestTypeForm.controls.requestType.value === 'New'">
*ngIf="requestTypeForm.controls.requestType.value === 'New' || requestTypeForm.controls.requestType.value === 'New - Dropbox'">
<form [formGroup]="projectForm" novalidate>
<ng-template matStepLabel>General Information</ng-template>

Expand Down Expand Up @@ -185,7 +186,7 @@ <h3>Please choose at least one FOR code from the Australian and New Zealand Stan
</mat-step>

<mat-step [editable]="isEditable" [stepControl]="dataInfoForm"
*ngIf="requestTypeForm.controls.requestType.value === 'New'">
*ngIf="requestTypeForm.controls.requestType.value === 'New' || requestTypeForm.controls.requestType.value === 'New - Dropbox' ">
<form [formGroup]="dataInfoForm" novalidate>
<ng-template matStepLabel>Data Information</ng-template>

Expand Down Expand Up @@ -216,10 +217,10 @@ <h3>
GDC-data)?
</h3>
<mat-form-field floatLabel="never" class="no-floating-label input-full-width">
<input matInput placeholder="Short name" formControlName="shortName" type="text" />
<input matInput placeholder="Short name" formControlName="shortName" type="text"/>
<mat-hint align="start">Avoid generic names like <i>my-project</i> or
<i>my-data</i></mat-hint>
<mat-error *ngIf="dataInfoForm.controls.shortName.invalid">* Please enter a short name</mat-error>
<mat-error *ngIf="dataInfoForm.controls.shortName.invalid">* Please enter a short name containing less than 45 characters</mat-error>
</mat-form-field>
</div>

Expand Down Expand Up @@ -435,7 +436,7 @@ <h3>Please provide a list of University of Auckland people who require access</h
</mat-step>

<mat-step [editable]="isEditable" [stepControl]="dataSizeForm"
*ngIf="requestTypeForm.controls.requestType.value === 'New'">
*ngIf="requestTypeForm.controls.requestType.value === 'New' || requestTypeForm.controls.requestType.value === 'New - Dropbox' ">
<form [formGroup]="dataSizeForm" novalidate>
<ng-template matStepLabel>Data Size</ng-template>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@ export class RequestStorageComponent implements OnInit, OnDestroy, CanComponentD
this.dataInfoForm = this.formBuilder.group({
dataRequirements: new FormControl(undefined),
dataRequirementsOther: new FormControl(undefined),
shortName: new FormControl(undefined, [Validators.required]),
shortName: new FormControl(undefined, [Validators.required, Validators.maxLength(45)]),
projectMembers: this.projectMembers
});

Expand Down

0 comments on commit 402d22e

Please sign in to comment.