Skip to content
Snippets Groups Projects
Commit 402cafed authored by Marlène SIMONDANT's avatar Marlène SIMONDANT
Browse files

Merge branch '159-creation-de-structure-deselection-d-une-structure-choisie' into 'dev'

feat/US159-unselect-structure

See merge request !421
parents e912b765 9c16644c
No related branches found
No related tags found
2 merge requests!425V2.1.1,!421feat/US159-unselect-structure
......@@ -24,6 +24,7 @@ export class ProfileStructureChoiceComponent implements OnInit {
public buttonTypeEnum = ButtonType;
public profileStructuresLink: string[] = [];
public profilePendingStructureLink: pendingStructureLink[] = [];
public itemSelected: string = null;
constructor(private structureService: StructureService, private profileService: ProfileService) {}
......@@ -54,9 +55,16 @@ export class ProfileStructureChoiceComponent implements OnInit {
if (structure.alreadySelected) {
return;
}
this.selectedStructureItem = structure;
this.structureForm.patchValue({ _id: structure._id, structureName: structure.structureName });
this.validateForm.emit();
this.itemSelected = this.itemSelected == structure._id ? null : structure._id;
if (this.itemSelected) {
this.selectedStructureItem = structure;
this.structureForm.patchValue({ _id: structure._id, structureName: structure.structureName });
this.validateForm.emit();
} else {
this.selectedStructureItem = null;
this.structureForm.patchValue({ _id: null, structureName: null });
this.validateForm.emit();
}
}
public isSelectedStructure(structure: Structure): boolean {
......
......@@ -137,7 +137,7 @@ export class ProfileStructureComponent implements OnInit {
}
public getFormattedDate(): string {
if (this.joinRequestDate) {
return DateTime.fromISO(this.joinRequestDate, { zone: 'Europe/Paris' }).toFormat('dd-MM-yyyy');
return DateTime.fromISO(this.joinRequestDate, { zone: 'Europe/Paris' }).toFormat('dd/MM/yyyy');
}
}
......
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