Skip to content
Snippets Groups Projects
Commit a5232eb2 authored by Hugo SUBTIL's avatar Hugo SUBTIL
Browse files

feat(carto): add pmr handling for carto filtering and orientation

parent fe78a0b9
No related branches found
No related tags found
3 merge requests!418V2.1.0,!400V2.0,!230V2.0
......@@ -292,13 +292,9 @@ export class OrientationFormViewComponent implements OnInit, AfterContentChecked
if (this.isStructureListForm()) {
if (this.currentStep === StructuresListSteps.structureChoice) {
this.fullScreen = false;
this.currentStep--;
return;
}
if (this.currentStep === StructuresListSteps.structureOrientator) {
this.fullScreen = true;
this.currentStep--;
return;
}
}
......@@ -310,6 +306,7 @@ export class OrientationFormViewComponent implements OnInit, AfterContentChecked
}
if (this.currentStep > 0) {
this.currentStep--;
this.checkLastStep();
}
}
......
......@@ -22,7 +22,7 @@ export class OrientationStructureListComponent {
public radioChange(event: { name: string; value: boolean }): void {
const { name, value } = event;
this.form.get(name).setValue(value);
this.checkValidation();
this.manualySetOfPmr(event);
}
public checkValidation(event?: any): void {
......@@ -35,4 +35,16 @@ export class OrientationStructureListComponent {
}
this.validatePage.emit(event);
}
private manualySetOfPmr(event: { name: string; value: boolean }): void {
// Handle special PMR access case
if (event.name === 'pmrAccess') {
if (event.value) {
this.filters.push(new Filter('pmrAccess', 'True', 'PMR'));
} else {
this.filters = this.filters.filter((module) => module.name !== 'pmrAccess');
}
}
this.checkValidation();
}
}
......@@ -214,6 +214,18 @@
</button>
</ng-container>
<ng-container *ngIf="style === buttonTypeEnum.TertiaryRounded">
<button
class="btn-regular tertiary rounded"
type="{{ type }}"
(click)="doAction()"
[disabled]="disabled"
[ngClass]="extraClass"
>
<div>{{ text }}</div>
</button>
</ng-container>
<ng-container *ngIf="style === buttonTypeEnum.CheckButton">
<button
class="btn-regular tertiary rounded checkButton"
......
......@@ -6,6 +6,7 @@ export enum ButtonType {
SecondaryUltraWide,
SecondaryOnlyIcon,
Tertiary,
TertiaryRounded,
ButtonPhone,
Filter,
IconOnly,
......
......@@ -70,6 +70,23 @@
</div>
</li>
</div>
<!-- Manual add of access modality -->
<div *ngIf="c.id === categoryEnum.accessModality">
<li class="checkbox">
<div class="checkboxItem">
<label fxLayout="row" fxLayoutAlign="start center">
<input
type="checkbox"
[checked]="prmChecked"
[value]="'pmrAccess'"
(change)="onCheckboxChange($event, c.id, 'PMR')"
/>
<span class="customCheck customCheckPrimary"></span>
<div class="label">Accessible PMR</div>
</label>
</div>
</li>
</div>
</ul>
</div>
</div>
......
import { Component, EventEmitter, Input, OnChanges, OnInit, Output, SimpleChanges } from '@angular/core';
import { ButtonType } from '../../../shared/components/button/buttonType.enum';
import { CategoryEnum } from '../../../shared/enum/category.enum';
import { TypeModal } from '../../enum/typeModal.enum';
import { Category } from '../../models/category.model';
import { Module } from '../../models/module.model';
......@@ -20,10 +21,13 @@ export class ModalFilterComponent implements OnInit, OnChanges {
@Output() searchEvent = new EventEmitter();
@Output() closeEvent = new EventEmitter();
public buttonTypeEnum = ButtonType;
public categoryEnum = CategoryEnum;
// Checkbox variable
public checkedModules: Module[] = [];
public toggledCategories: string[] = [];
public prmChecked = false;
ngOnInit(): void {
// Manage checkbox
this.checkedModules = this.modules.slice();
......@@ -38,6 +42,11 @@ export class ModalFilterComponent implements OnInit, OnChanges {
// Management of the checkbox event (Check / Uncheck)
public onCheckboxChange(event, categ: string, text?: string): void {
const checkValue: string = event.target.value;
// Handle PMR access case
if (text === 'PMR') {
this.checkedModules.push(new Module('True', 'pmrAccess', 'PMR'));
return;
}
if (event.target.checked) {
this.checkedModules.push(new Module(checkValue, categ, text ? text : checkValue));
} else {
......
......@@ -133,7 +133,7 @@
</div>
<app-button
class="isntPhoneContent last-button"
[style]="buttonTypeEnum.Tertiary"
[style]="buttonTypeEnum.TertiaryRounded"
[text]="'Plus de filtres'"
fxLayout="row"
fxLayoutAlign="space-between center"
......
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