diff --git a/src/app/form/form-view/profile-form/profile-structure-choice/profile-structure-choice.component.ts b/src/app/form/form-view/profile-form/profile-structure-choice/profile-structure-choice.component.ts index 673af8d5664d83b20b284534ec44c610f4ae1c92..6c615df2d76e7df7ba0e8746a583565e60af43a6 100644 --- a/src/app/form/form-view/profile-form/profile-structure-choice/profile-structure-choice.component.ts +++ b/src/app/form/form-view/profile-form/profile-structure-choice/profile-structure-choice.component.ts @@ -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 { diff --git a/src/app/profile/profile-structure/profile-structure.component.ts b/src/app/profile/profile-structure/profile-structure.component.ts index 50031c9c628c85dcfd4d3d1447cf5519ec8f9065..81dd77b9e8cb64ca76e9255470cf77f3ecf63b01 100644 --- a/src/app/profile/profile-structure/profile-structure.component.ts +++ b/src/app/profile/profile-structure/profile-structure.component.ts @@ -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'); } }