Skip to content
Snippets Groups Projects
Commit fa577764 authored by Rémi PAILHAREY's avatar Rémi PAILHAREY :fork_knife_plate:
Browse files

feat: improved accessibility on progress bars

parent c4ebf67f
No related branches found
No related tags found
2 merge requests!846V3.1.0 (sans impression),!813feat: improved accessibility on progress bars
......@@ -4,4 +4,5 @@ export enum formType {
personaloffer,
account,
register,
orientation,
}
......@@ -3,10 +3,9 @@
<p *ngIf="formType === formTypeEnum.profile">Création du profil</p>
<p *ngIf="formType === formTypeEnum.structure">Création de la structure</p>
<p *ngIf="formType === formTypeEnum.personaloffer">Création d'offre d’accompagnements</p>
<p *ngIf="formType === formTypeEnum.orientation">Orientation d'un bénéficiaire</p>
<div class="container">
<label for="progressForm" [ngClass]="{ validate: currentPage === nbSteps }"
>{{ progressStatus > 100 ? 100 : (progressStatus | number: '1.0-0') }}%
</label>
<label for="progressForm" [ngClass]="{ validate: currentPage === nbSteps }">{{ progressStatus }}% </label>
<progress
id="progressForm"
max="100"
......
......@@ -17,7 +17,8 @@ export class ProgressBarComponent implements OnChanges {
ngOnChanges(changes: SimpleChanges): void {
if (changes.currentPage) {
this.progressStatus = ((this.currentPage + 1) / this.nbSteps) * 100;
const rounded = Math.round(((this.currentPage + 1) / this.nbSteps) * 100);
this.progressStatus = Math.min(rounded, 100);
}
}
}
<div class="orientation">
<h1 class="visually-hidden">Orientation</h1>
<app-progress-bar [currentPage]="currentStep" [nbSteps]="nbSteps" />
<app-progress-bar [currentPage]="currentStep" [nbSteps]="nbSteps" [formType]="formType.orientation" />
<div class="container" [ngClass]="{ 'no-max-width': fullScreen }">
<app-needs-selection
*ngIf="currentStep === null"
......
......@@ -17,6 +17,7 @@ import { Module } from '../../structure-list/models/module.model';
import { SearchService } from '../../structure-list/services/search.service';
import { OrientationUtils } from '../../utils/orientationUtils';
import { Utils } from '../../utils/utils';
import { formType } from '../form-view/formType.enum';
import {
AppointmentSteps,
FiltersSteps,
......@@ -65,6 +66,7 @@ export class OrientationFormViewComponent implements OnInit, AfterContentChecked
public orientator: FormGroup<StructureOrientator>;
// Enum
public needEnum = NeedsType;
public formType = formType;
// Global
public needType: NeedsType;
public indicatorNeedType: NeedsType;
......
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