Skip to content
Snippets Groups Projects
Commit cd96cd2f authored by Pierre Ecarlat's avatar Pierre Ecarlat
Browse files

referent numerique should also create a tag

parent fa4f7d05
No related branches found
No related tags found
1 merge request!947feat(admin): Add a checkbox for referents
Pipeline #116878 passed
......@@ -90,7 +90,7 @@ export class AnnuaireHeaderComponent implements OnInit, OnChanges {
.filter((module) => communeFilterChecked.includes(module.name))
.map((module) => ({ ...module, displayText: module.name, name: 'commune' }));
this.referentsOnly = referentsOnly === 'oui';
this.referentsOnly = referentsOnly == 'oui';
}
public onSearchSubmitted(value: string): void {
......@@ -138,6 +138,15 @@ export class AnnuaireHeaderComponent implements OnInit, OnChanges {
...this.territoryCheckedModules,
...this.communeCheckedModules,
];
if (this.referentsOnly) {
this.checkedModulesFilter.push({
id: 'referentsOnly',
name: 'referentsOnly',
displayText: 'Référent·es inclusion numérique',
disabled: false,
});
}
}
private applyFilter(page = 1): void {
......@@ -265,6 +274,12 @@ export class AnnuaireHeaderComponent implements OnInit, OnChanges {
}
public removeFilter(module: Module): void {
if (module.id === 'referentsOnly') {
this.referentsOnly = false;
this.applyFilter();
return;
}
const index: number = this.checkedModulesFilter.findIndex((m: Module) => m.id === module.id);
if (index !== -1) {
// update global list of checked filters
......
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