diff --git a/src/app/profile/dashboard/orientation-details/orientation-details.component.html b/src/app/profile/dashboard/orientation-details/orientation-details.component.html index 83acd9d93de822c0ea31811602d42b605074209f..0a403fdae29bd69504de14608e43f885b369f304 100644 --- a/src/app/profile/dashboard/orientation-details/orientation-details.component.html +++ b/src/app/profile/dashboard/orientation-details/orientation-details.component.html @@ -15,17 +15,43 @@ Il y a {{ this.orientationService.daysAgo(orientation.createdAt) }} jour(s) </div> </div> - <app-button class="hide-on-mobile" [label]="'Clôturer'" [variant]="'primaryBlack'" (action)="showModal()" /> - <!--app-button class="hide-on-mobile" [label]="'Modifier'" [variant]="'secondary'" /--> + <!--app-button class="hide-on-mobile" [label]="'Clôturer'" [variant]="'primaryBlack'" (action)="showModal()" /--> + <app-button + *ngIf="!isEditMode" + class="hide-on-mobile" + [label]="'Modifier'" + [variant]="'secondary'" + (action)="editOrientation()" + /> + <app-button + *ngIf="isEditMode" + class="hide-on-mobile" + [label]="'Enregistrer'" + [variant]="'primary'" + (action)="editOrientation()" + /> </div> <!-- Treatment info --> <section> <span class="secondary-header"> <h2>Traitement</h2> - <app-button class="hide-on-desktop" [label]="'Clôturer'" [variant]="'primaryBlack'" (action)="showModal()" /> - <!--app-button class="hide-on-desktop" [label]="'Modifier'" [variant]="'secondary'" /--></span - > + <!--app-button class="hide-on-desktop" [label]="'Clôturer'" [variant]="'primaryBlack'" (action)="showModal()" /--> + <app-button + *ngIf="!isEditMode" + class="hide-on-desktop" + [label]="'Modifier'" + [variant]="'secondary'" + (action)="editOrientation()" + /> + <app-button + *ngIf="isEditMode" + class="hide-on-desktop" + [label]="'Modifier'" + [variant]="'primary'" + (action)="editOrientation()" + /> + </span> <div class="content"> <div class="inline"> <app-svg-icon [iconClass]="'icon-20'" [folder]="'tags'" [icon]="'flag'" /> @@ -96,7 +122,9 @@ class="hide-on-mobile" [ariaLabel]="'Structure choisie : ' + orientation.structureChoice[0]?.structureName" [label]="orientation.structureChoice[0]?.structureName" - [iconName]="'structureCategory_private'" + [iconName]=" + this.orientationService.getStructureTypeIcon(orientation.structureChoice[0]?.structureType?.category) + " [type]="'entity light'" /> </p> @@ -116,7 +144,17 @@ </div> <div class="inline"> <app-svg-icon [iconClass]="'icon-20'" [folder]="'tags'" [icon]="'commentBlue'" /> - <p><span class="category-name">Commentaire :</span>TODO</p> + <p class="inline"> + <span class="category-name" id="processingCommentLabel">Commentaire :</span> + <ng-container *ngIf="!isEditMode">{{ orientation.processingComment || 'Non renseigné' }}</ng-container> + <app-textarea + *ngIf="isEditMode" + id="processingComment" + aria-labelledby="processingCommentLabel" + [value]="orientation.processingComment" + (valueChange)="setProcessingComment($event)" + /> + </p> </div> </div> </section> @@ -191,7 +229,9 @@ *ngIf="orientation.structureOrientator" [ariaLabel]="'Structure choisie : ' + orientation.structureOrientator.structureName" [label]="orientation.structureOrientator.structureName" - [iconName]="'structureCategory_private'" + [iconName]=" + this.orientationService.getStructureTypeIcon(orientation.structureOrientator.structureType?.category) + " [type]="'entity light'" /> </p> diff --git a/src/app/profile/dashboard/orientation-details/orientation-details.component.scss b/src/app/profile/dashboard/orientation-details/orientation-details.component.scss index ef78c70d6f2e957107254400a65cda4c82d1cf08..ae871024021a84f0567fc1dcd1016465b8c9262f 100644 --- a/src/app/profile/dashboard/orientation-details/orientation-details.component.scss +++ b/src/app/profile/dashboard/orientation-details/orientation-details.component.scss @@ -95,6 +95,9 @@ flex-direction: column; align-items: flex-start; } + app-textarea { + width: 400px; + } } } diff --git a/src/app/profile/dashboard/orientation-details/orientation-details.component.ts b/src/app/profile/dashboard/orientation-details/orientation-details.component.ts index d0e4ccc415a1f50cdcef743f7df405fd6e53b25e..3081e80ef1131c32aef103236e16b94ce2f3b7ec 100644 --- a/src/app/profile/dashboard/orientation-details/orientation-details.component.ts +++ b/src/app/profile/dashboard/orientation-details/orientation-details.component.ts @@ -21,6 +21,7 @@ export class OrientationDetailsComponent implements OnInit { public orientation; public isModalOpenned = false; public userProfile: User; + public isEditMode = false; ngOnInit(): void { this.route.params.subscribe((urlParams) => { @@ -59,8 +60,16 @@ export class OrientationDetailsComponent implements OnInit { } public setOrientationStatus(status): void { - // set status - console.log(status); + // TODO : patch status + } + + public editOrientation(): void { + // TODO : edit orientation + this.isEditMode = !this.isEditMode; + } + + public setProcessingComment(comment): void { + // TODO : patch comment } private patchOrientation(updatedFields): void {