diff --git a/src/app/form/form-view/formType.enum.ts b/src/app/form/form-view/formType.enum.ts index d5a7dd7dc763f9f220ef7cd86fadb3ff92ab87d5..41d8aa290b4579aad40ae8c1d2242d3fa48b1297 100644 --- a/src/app/form/form-view/formType.enum.ts +++ b/src/app/form/form-view/formType.enum.ts @@ -4,4 +4,5 @@ export enum formType { personaloffer, account, register, + orientation, } diff --git a/src/app/form/form-view/global-components/progress-bar/progress-bar.component.html b/src/app/form/form-view/global-components/progress-bar/progress-bar.component.html index 150f1370898a393952194579058764966a669c5f..cd798dd41dd8fa83d877f35c867e35899b38ed6a 100644 --- a/src/app/form/form-view/global-components/progress-bar/progress-bar.component.html +++ b/src/app/form/form-view/global-components/progress-bar/progress-bar.component.html @@ -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" diff --git a/src/app/form/form-view/global-components/progress-bar/progress-bar.component.ts b/src/app/form/form-view/global-components/progress-bar/progress-bar.component.ts index d53599f70898c130b5e9e2cc9db2b4da1e0c4a10..063c40ee99dabe89732de08b2eb41cf0c97df6f8 100644 --- a/src/app/form/form-view/global-components/progress-bar/progress-bar.component.ts +++ b/src/app/form/form-view/global-components/progress-bar/progress-bar.component.ts @@ -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); } } } diff --git a/src/app/form/orientation-form-view/orientation-form-view.component.html b/src/app/form/orientation-form-view/orientation-form-view.component.html index 80acf42d1198052407c7249ffad5000ec79ae607..067376c77260fe410cf55a8a0e03a0b32abb722a 100644 --- a/src/app/form/orientation-form-view/orientation-form-view.component.html +++ b/src/app/form/orientation-form-view/orientation-form-view.component.html @@ -1,6 +1,6 @@ <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" diff --git a/src/app/form/orientation-form-view/orientation-form-view.component.ts b/src/app/form/orientation-form-view/orientation-form-view.component.ts index 999edc2d605eb71b347f548022f7fc7a037bf86c..4b7c30c82b87988cda0cf81f5b4abef95f7c1688 100644 --- a/src/app/form/orientation-form-view/orientation-form-view.component.ts +++ b/src/app/form/orientation-form-view/orientation-form-view.component.ts @@ -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;