Skip to content
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

Update error messages #89

Draft
wants to merge 2 commits into
base: develop
Choose a base branch
from
Draft
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
18 changes: 15 additions & 3 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,11 @@
"@gov.au/buttons": "^3.0.4",
"@gov.au/callout": "^2.0.8",
"@gov.au/control-input": "^2.1.6",
"@gov.au/core": "^3.0.3",
"@gov.au/core": "latest",
"@gov.au/cta-link": "^2.1.4",
"@gov.au/direction-links": "^2.1.4",
"@gov.au/footer": "^2.1.6",
"@gov.au/form": "^0.1.3",
"@gov.au/grid-12": "^2.0.8",
"@gov.au/header": "^4.1.6",
"@gov.au/headings": "^2.0.8",
Expand Down
20 changes: 7 additions & 13 deletions src/app/layouts/general-question/general-question.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -13,29 +13,23 @@ <h2>About the cloud service</h2>

<div class="general-question">
<label for="serivceName" class="rationaleLabel">What is the name of the service?</label>
<input class="au-text-input au-text-input--block" name="serivceName" id="serivceName" type="text" [(ngModel)]="generalQuestion.ServiceName"
required #servicename="ngModel">
<div *ngIf="servicename.invalid && formSubmitted" role="alert" class="au-body au-page-alerts au-page-alerts--error">
<p>Please answer this question before continuing.</p>
</div>
<input [ngClass]="{'au-text-input au-text-input--block' : true, 'au-text-input--invalid' : servicename.invalid && formSubmitted, 'empty-required' : !(servicename.invalid && formSubmitted)}" name="serivceName" id="serivceName" type="text" [(ngModel)]="generalQuestion.ServiceName"
required #servicename="ngModel" aria-describedby="service-name-error" [attr.aria-invalid]="servicename.invalid && formSubmitted ? 'true' : 'false'">
<span *ngIf="servicename.invalid && formSubmitted" class="au-error-text" id="service-name-error">Enter your service name</span>
</div>

<div class="general-question">
<label for="numberOfUsers" class="rationaleLabel">How many users are expected to directly use the service?</label>
<input class="au-text-input au-text-input--block" name="numberOfUsers" id="numberOfUsers" type="text" [(ngModel)]="generalQuestion.NumberOfUsers"
<input class="au-text-input au-text-input--block" [ngClass]="{'au-text-input--invalid' : numberofusers.invalid && formSubmitted, 'empty-required' : !(numberofusers.invalid && formSubmitted)}" name="numberOfUsers" id="numberOfUsers" type="text" [(ngModel)]="generalQuestion.NumberOfUsers"
required #numberofusers="ngModel">
<div *ngIf="numberofusers.invalid && formSubmitted" role="alert" class="au-body au-page-alerts au-page-alerts--error">
<p>Please answer this question before continuing.</p>
</div>
<span *ngIf="numberofusers.invalid && formSubmitted" role="alert" class="au-error-text">Enter the expected number of uses</span>
</div>

<div class="general-question">
<label for="servicePurpose" class="rationaleLabel">What is your main reason for using this service?</label>
<textarea class="au-text-input au-text-input--block" name="servicePurpose" id="servicePurpose" [(ngModel)]="generalQuestion.ServicePurpose"
<textarea class="au-text-input au-text-input--block" [ngClass]="{'au-text-input--invalid' : servicepurpose.invalid && formSubmitted, 'empty-required' : !(servicepurpose.invalid && formSubmitted)}" name="servicePurpose" id="servicePurpose" [(ngModel)]="generalQuestion.ServicePurpose"
required #servicepurpose="ngModel"></textarea>
<div *ngIf="servicepurpose.invalid && formSubmitted" role="alert" class="au-body au-page-alerts au-page-alerts--error">
<p>Please answer this question before continuing.</p>
</div>
<span *ngIf="servicepurpose.invalid && formSubmitted" role="alert" class="au-error-text">Enter your service purpose</span>
</div>
<app-question-direction-button (goNextButtonClick)="goNext()"></app-question-direction-button>
</div>
Expand Down
12 changes: 3 additions & 9 deletions src/app/layouts/questions/questions.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,7 @@ <h3>{{currentQuestion.Quality}}</h3>
<span *ngIf="i===0">Low</span>
<span *ngIf="i===4">High</span>
</label>
<div *ngIf="showError" role="alert" class="au-body au-page-alerts au-page-alerts--error">
<p>Please answer this question before continuing.</p>
</div>
<span *ngIf="showError" role="alert" class="au-error-text">Please answer this question before continuing</span>
</div>
</div>
<div *ngSwitchCase="'XOR'">
Expand All @@ -36,9 +34,7 @@ <h3>{{currentQuestion.Quality}}</h3>
required>
<span class="au-control-input__text">{{ option }}</span>
</label>
<div *ngIf="showError" role="alert" class="au-body au-page-alerts au-page-alerts--error">
<p>Please answer this question before continuing.</p>
</div>
<span *ngIf="showError" role="alert" class="au-error-text">Please answer this question before continuing</span>
</div>
</div>
<div *ngSwitchCase="'OR'">
Expand All @@ -48,9 +44,7 @@ <h3>{{currentQuestion.Quality}}</h3>
[required]="checkValidity">
<span class="au-control-input__text">{{option.name}}</span>
</label>
<div *ngIf="showError" role="alert" class="au-body au-page-alerts au-page-alerts--error">
<p>Please answer this question before continuing.</p>
</div>
<span *ngIf="showError" role="alert" class="au-error-text">Please answer this question before continuing</span>
</div>
</div>
</div>
Expand Down
6 changes: 3 additions & 3 deletions src/styles/_core.scss
Original file line number Diff line number Diff line change
Expand Up @@ -270,9 +270,9 @@ label + textarea {
@include AU-space( margin-top, 0.5unit );
}

.au-text-input:invalid {
border-color: #808080;
background-color: #ffffff;
.empty-required {
border-color: #808080 !important;
background-color: #ffffff !important;
}

// Container fluid max width
Expand Down