From abbfc03a87e29cc435206c16478a88b0e68fa993 Mon Sep 17 00:00:00 2001
From: Marlene Simondant <msimondant@grandlyon.com>
Date: Mon, 17 Mar 2025 09:39:36 +0100
Subject: [PATCH] Add structure icon

---
 .../orientations-table.component.ts               |  2 +-
 src/app/services/orientation.service.ts           | 15 +++++++++++++++
 2 files changed, 16 insertions(+), 1 deletion(-)

diff --git a/src/app/profile/dashboard/orientations-table/orientations-table.component.ts b/src/app/profile/dashboard/orientations-table/orientations-table.component.ts
index 7818cb220..c50e5fcc0 100644
--- a/src/app/profile/dashboard/orientations-table/orientations-table.component.ts
+++ b/src/app/profile/dashboard/orientations-table/orientations-table.component.ts
@@ -10,7 +10,7 @@ export class OrientationsTableComponent {
   constructor(public orientationService: OrientationService) {}
 
   @Input() orientations: any[];
-  @Input() type?: string;
+  @Input() from?: string;
 
   public orientationSeen(): void {
     // TODO : changer le status de l'orientation => A traiter (acknowledged)
diff --git a/src/app/services/orientation.service.ts b/src/app/services/orientation.service.ts
index fc5fff594..1ef8fc6ed 100644
--- a/src/app/services/orientation.service.ts
+++ b/src/app/services/orientation.service.ts
@@ -7,6 +7,8 @@ import { IOrientation } from '../form/orientation-form-view/interfaces/orientati
 import { Structure } from '../models/structure.model';
 import { User } from '../models/user.model';
 import { Action, Status, Type } from '../profile/dashboard/orientation.enum';
+import { StructureCategoryEnum } from '../shared/enum/structureCategory.enum';
+import { StructureCategoryIconEnum } from '../shared/enum/structureCategoryIcon.enum';
 
 type AllowedColor = 'white' | 'black' | 'red' | 'blue' | 'dark-blue' | 'grey' | 'green' | 'light-green';
 @Injectable({
@@ -113,4 +115,17 @@ export class OrientationService {
   private getProperty(category: keyof typeof this.enumMap, slug: string, property: string): string {
     return this.enumMap[category]?.[slug as keyof (typeof this.enumMap)[typeof category]]?.[property] || '';
   }
+
+  public getStructureTypeIcon(category): StructureCategoryIconEnum {
+    switch (category) {
+      case StructureCategoryEnum.public:
+        return StructureCategoryIconEnum.public;
+      case StructureCategoryEnum.private:
+        return StructureCategoryIconEnum.private;
+      case StructureCategoryEnum.privateLucrative:
+        return StructureCategoryIconEnum.privateLucrative;
+      default:
+        return StructureCategoryIconEnum.public;
+    }
+  }
 }
-- 
GitLab