Skip to content
Snippets Groups Projects
Commit 1b7109cc authored by Paulina Nogal's avatar Paulina Nogal
Browse files

aria implementation

parent 4dc09d59
No related branches found
No related tags found
No related merge requests found
Pipeline #36508 passed
Showing
with 57 additions and 25 deletions
...@@ -47,6 +47,7 @@ ...@@ -47,6 +47,7 @@
cdkFocusInitial cdkFocusInitial
id="keyword-field" id="keyword-field"
matInput matInput
aria-label="Keyword, number"
placeholder="Keyword, number" placeholder="Keyword, number"
formControlName="search" formControlName="search"
value=""/> value=""/>
......
...@@ -28,6 +28,7 @@ ...@@ -28,6 +28,7 @@
<input <input
cdkFocusInitial cdkFocusInitial
matInput matInput
aria-label="Plan name"
placeholder="Name" placeholder="Name"
formControlName="planName" formControlName="planName"
cdkFocusInitial/> cdkFocusInitial/>
...@@ -41,6 +42,7 @@ ...@@ -41,6 +42,7 @@
<input <input
cdkFocusInitial cdkFocusInitial
matInput matInput
aria-label="Plan name"
placeholder="Name" placeholder="Name"
formControlName="planName" formControlName="planName"
cdkFocusInitial/> cdkFocusInitial/>
......
...@@ -16,7 +16,6 @@ ...@@ -16,7 +16,6 @@
>clear</i> >clear</i>
</button> </button>
</mat-toolbar> </mat-toolbar>
<mat-dialog-content id="note-dialog" class="mat-typography dialog-with-toolbar"> <mat-dialog-content id="note-dialog" class="mat-typography dialog-with-toolbar">
<div fxLayout="column" fxLayoutAlign="none" fxLayoutGap="10px"> <div fxLayout="column" fxLayoutAlign="none" fxLayoutGap="10px">
<div id="note-content"> <div id="note-content">
...@@ -28,11 +27,11 @@ ...@@ -28,11 +27,11 @@
matInput matInput
mat-autosize="true" mat-autosize="true"
resizeToFitContent resizeToFitContent
aria-label="Note input"
placeholder="i.e. Studying abroad"> placeholder="i.e. Studying abroad">
</textarea> </textarea>
<mat-hint align="start"> <mat-hint align="start">
<strong Note can be up to {{ MAX_LENGTH }} characters long
>Your note can be up to {{ MAX_LENGTH }} characters long</strong>
</mat-hint> </mat-hint>
<mat-hint align="end" *ngIf="form.value.textarea?.length > 0"> <mat-hint align="end" *ngIf="form.value.textarea?.length > 0">
{{ form.value.textarea.length }} / {{ MAX_LENGTH }} {{ form.value.textarea.length }} / {{ MAX_LENGTH }}
...@@ -44,8 +43,8 @@ ...@@ -44,8 +43,8 @@
<button <button
mat-button mat-button
class="btn-secondary" class="btn-secondary"
mat-dialog-close aria-label="Cancel"
aria-label="Close note dialog"> mat-dialog-close>
Cancel Cancel
</button> </button>
<button <button
......
...@@ -3,6 +3,9 @@ ...@@ -3,6 +3,9 @@
mat-form-field { mat-form-field {
display: block; display: block;
} }
.mat-dialog-content {
padding-bottom: 4px;
}
} }
#delete-note-section { #delete-note-section {
......
...@@ -15,7 +15,7 @@ ...@@ -15,7 +15,7 @@
[cdkDragDisabled]="mobileView.matches" [cdkDragDisabled]="mobileView.matches"
[cdkDragData]="course"> [cdkDragData]="course">
<div class="course-wrapper-inner"> <div class="course-wrapper-inner">
<cse-course-item [course]="course" type="saved" class="course-favorite"></cse-course-item> <cse-course-item [course]="course" type="saved" class="course-favorite" aria-describedby="saved-courses"></cse-course-item>
</div> </div>
</div> </div>
......
...@@ -94,7 +94,7 @@ ...@@ -94,7 +94,7 @@
Course details Course details
</button> </button>
<button mat-menu-item [matMenuTriggerFor]="academicYearsGroup" aria-label="Select to move this course to a different term"> <button mat-menu-item [matMenuTriggerFor]="academicYearsGroup" aria-label="Select to move this course to a different term">
Move Move to
</button> </button>
<mat-menu #academicYearsGroup="matMenu" class="course-item-submenu"> <mat-menu #academicYearsGroup="matMenu" class="course-item-submenu">
<ng-template matMenuContent> <ng-template matMenuContent>
...@@ -123,15 +123,14 @@ ...@@ -123,15 +123,14 @@
</mat-menu> </mat-menu>
</div> </div>
<div *ngIf="disabled" fxLayout="row" fxLayoutAlign="end center"> <div *ngIf="disabled" fxLayout="row" fxLayoutAlign="end center">
<p>{{ course.grade || '&nbsp;' }}</p> <p attr.aria-label="grade {{ course.grade }}">{{ course.grade || '&nbsp;' }}</p>
</div> </div>
<div fxLayout="row" fxLayoutAlign="end center"> <div fxLayout="row" fxLayoutAlign="end center">
<p *ngIf="type !== 'saved'" <p *ngIf="type !== 'saved'"
class="course-credits" class="course-credits"
cdkFocusRegionEnd cdkFocusRegionEnd>
aria-label="Total number of credits in term">
<ng-container *ngIf="course.credits !== undefined || course.creditRange !== undefined"> <ng-container *ngIf="course.credits !== undefined || course.creditRange !== undefined">
{{ course.credits ? course.credits : course.creditRange }} Cr <span attr.aria-label="{{ course.credits ? course.credits : course.creditRange }} credits">{{ course.credits ? course.credits : course.creditRange }} Cr</span>
</ng-container> </ng-container>
</p> </p>
</div> </div>
......
...@@ -57,8 +57,9 @@ ...@@ -57,8 +57,9 @@
</mat-panel-title> </mat-panel-title>
</mat-expansion-panel-header> </mat-expansion-panel-header>
<div> <div>
<button mat-button class="sidenav-link-btn" (click)="print()"> <button mat-button aria-label="Print degree plan" class="sidenav-link-btn" (click)="print()">
<i <i
aria-hidden="true"
class="material-icons" class="material-icons"
alt="Print plan" alt="Print plan"
matTooltip="Print plan" matTooltip="Print plan"
...@@ -80,8 +81,9 @@ ...@@ -80,8 +81,9 @@
</svg> </svg>
Download PDF Download PDF
</a> </a>
<button mat-button class="sidenav-link-btn" (click)="onCreatePlanClick()"> <button mat-button aria-label="Add degree plan" class="sidenav-link-btn" (click)="onCreatePlanClick()">
<i <i
aria-hidden="true"
class="material-icons" class="material-icons"
alt="Add degree plan" alt="Add degree plan"
matTooltip="Add degree plan" matTooltip="Add degree plan"
...@@ -89,7 +91,7 @@ ...@@ -89,7 +91,7 @@
>add_box</i> >add_box</i>
Add Degree Plan Add Degree Plan
</button> </button>
<button mat-button class="sidenav-link-btn" (click)="onAddAcademicYear()"> <button mat-button aria-label="Add academic year" class="sidenav-link-btn" (click)="onAddAcademicYear()">
<svg <svg
aria-labelledby="addAcademicYearTitle addAcademicYearDesc" aria-labelledby="addAcademicYearTitle addAcademicYearDesc"
role="img" role="img"
......
<ng-template #enrolled> <ng-template #enrolled id="enrolled-courses">
<div class="course-list-wrapper"> <div class="course-list-wrapper">
<div class="course-list"> <div class="course-list">
<div class="course-list-inner"> <div class="course-list-inner">
...@@ -12,6 +12,7 @@ ...@@ -12,6 +12,7 @@
</ng-container> </ng-container>
<cse-course-item <cse-course-item
aria-describedby="enrolled-courses"
*ngFor="let course of enrolledCourses" *ngFor="let course of enrolledCourses"
type="course" type="course"
[disabled]="true" [disabled]="true"
...@@ -24,7 +25,7 @@ ...@@ -24,7 +25,7 @@
</div> </div>
</ng-template> </ng-template>
<ng-template #planned> <ng-template #planned id="planned-courses">
<div class="course-list-wrapper"> <div class="course-list-wrapper">
<div <div
class="course-list" class="course-list"
...@@ -58,6 +59,7 @@ ...@@ -58,6 +59,7 @@
*ngFor="let course of plannedCourses" *ngFor="let course of plannedCourses"
> >
<cse-course-item <cse-course-item
aria-describedby="planned-courses"
type="course" type="course"
[course]="course" [course]="course"
[era]="(term$ | async).era" [era]="(term$ | async).era"
...@@ -71,6 +73,7 @@ ...@@ -71,6 +73,7 @@
<div class="add-new-wrapper" *ngIf="(term$ | async).era !== 'past'"> <div class="add-new-wrapper" *ngIf="(term$ | async).era !== 'past'">
<button <button
mat-raised-button mat-raised-button
attr.aria-label="Add course to {{ termCode | getTermDescription }}"
class="add-course-button" class="add-course-button"
(click)="openCourseSearch()" (click)="openCourseSearch()"
> >
...@@ -92,13 +95,13 @@ ...@@ -92,13 +95,13 @@
class="term-header" class="term-header"
fxLayoutAlign="space-between center" fxLayoutAlign="space-between center"
> >
<h2 tabindex="0" class="term-description">{{ termCode | getTermDescription }}</h2> <h3 tabindex="0" class="term-description">{{ termCode | getTermDescription }}</h3>
<div fxLayout="row" fxLayoutAlign="space-between center"> <div fxLayout="row" fxLayoutAlign="space-between center">
<p class="text-right semi-bold credits"> <p class="text-right semi-bold credits">
<span *ngIf="visibleCredits === 'planned'"> <span *ngIf="visibleCredits === 'planned'" attr.aria-label="{{ plannedCredits }} credits">
{{ plannedCredits }} Cr {{ plannedCredits }} Cr
</span> </span>
<span *ngIf="visibleCredits === 'enrolled'"> <span *ngIf="visibleCredits === 'enrolled'" attr.aria-label="{{ enrolledCredits }} credits">
{{ enrolledCredits }} Cr {{ enrolledCredits }} Cr
</span> </span>
</p> </p>
...@@ -164,10 +167,10 @@ ...@@ -164,10 +167,10 @@
<!-- If this term is an active term --> <!-- If this term is an active term -->
<ng-container *ngIf="(term$ | async).era === 'active'"> <ng-container *ngIf="(term$ | async).era === 'active'">
<mat-tab-group (selectedTabChange)="changeVisibleCredits($event)" [selectedIndex]="0"> <mat-tab-group (selectedTabChange)="changeVisibleCredits($event)" [selectedIndex]="0">
<mat-tab [label]="'In Progress (' + enrolledCourses.length + ')'"> <mat-tab [label]="'In Progress (' + enrolledCourses.length + ')'" aria-label="In progress courses">
<ng-container cdkFocusinitial *ngTemplateOutlet="enrolled"></ng-container> <ng-container cdkFocusinitial *ngTemplateOutlet="enrolled"></ng-container>
</mat-tab> </mat-tab>
<mat-tab [label]="'Cart (' + plannedCourses.length + ')'"> <mat-tab [label]="'Cart (' + plannedCourses.length + ')'" aria-label="Cart courses">
<ng-container cdkFocusinitial *ngTemplateOutlet="planned"></ng-container> <ng-container cdkFocusinitial *ngTemplateOutlet="planned"></ng-container>
</mat-tab> </mat-tab>
</mat-tab-group> </mat-tab-group>
...@@ -176,10 +179,10 @@ ...@@ -176,10 +179,10 @@
<!-- If this term is a past term --> <!-- If this term is a past term -->
<ng-container *ngIf="(term$ | async).era === 'past'"> <ng-container *ngIf="(term$ | async).era === 'past'">
<mat-tab-group (selectedTabChange)="changeVisibleCredits($event)" [selectedIndex]="0"> <mat-tab-group (selectedTabChange)="changeVisibleCredits($event)" [selectedIndex]="0">
<mat-tab [label]="'Completed (' + enrolledCourses.length + ')'"> <mat-tab [label]="'Completed (' + enrolledCourses.length + ')'" aria-label="Completed courses">
<ng-container cdkFocusinitial *ngTemplateOutlet="enrolled"></ng-container> <ng-container cdkFocusinitial *ngTemplateOutlet="enrolled"></ng-container>
</mat-tab> </mat-tab>
<mat-tab [label]="'Cart (' + plannedCourses.length + ')'"> <mat-tab [label]="'Cart (' + plannedCourses.length + ')'" aria-label="Cart courses">
<ng-container cdkFocusinitial *ngTemplateOutlet="planned"></ng-container> <ng-container cdkFocusinitial *ngTemplateOutlet="planned"></ng-container>
</mat-tab> </mat-tab>
</mat-tab-group> </mat-tab-group>
......
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
(closed)="collapseYear()"> (closed)="collapseYear()">
<mat-expansion-panel-header> <mat-expansion-panel-header>
<mat-panel-title> <mat-panel-title>
{{ yearCode | academicYearState }} <h2>{{ yearCode | academicYearState }}</h2>
</mat-panel-title> </mat-panel-title>
</mat-expansion-panel-header> </mat-expansion-panel-header>
<div <div
......
...@@ -33,6 +33,7 @@ ...@@ -33,6 +33,7 @@
matInput matInput
mat-autosize="true" mat-autosize="true"
resizeToFitContent resizeToFitContent
aria-label="Input text"
[placeholder]="inputName"/> [placeholder]="inputName"/>
<mat-hint align="end" *ngIf="maxLength"> <mat-hint align="end" *ngIf="maxLength">
{{ inputForm.value.value.length }} / {{ maxLength }} {{ inputForm.value.value.length }} / {{ maxLength }}
......
...@@ -124,6 +124,24 @@ body { ...@@ -124,6 +124,24 @@ body {
outline: -webkit-focus-ring-color auto 5px; outline: -webkit-focus-ring-color auto 5px;
} }
.mat-hint {
font-size: 14px;
}
.mat-form-field.mat-form-field-invalid {
.mat-form-field-ripple {
background-color: #0479a8 !important;
}
.mat-form-field-label {
color: #0479a8;
}
}
.mat-warn .mat-input-element,
.mat-form-field-invalid .mat-input-element {
caret-color: #0479a8;
}
.mat-icon, .mat-icon,
.mat-icon-button, .mat-icon-button,
.material-icons, .material-icons,
...@@ -173,11 +191,15 @@ body { ...@@ -173,11 +191,15 @@ body {
} }
.mat-expansion-panel-header { .mat-expansion-panel-header {
font-size: 18px;
&:focus { &:focus {
outline: 2px solid #5e9ed6 !important; outline: 2px solid #5e9ed6 !important;
outline: -webkit-focus-ring-color auto 5px !important; outline: -webkit-focus-ring-color auto 5px !important;
} }
h2 {
font-size: 18px;
font-weight: 400;
margin: 0px;
}
} }
// Menus styles // Menus styles
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment