diff --git a/app/serializers/ApiModel.scala b/app/serializers/ApiModel.scala index 1d6016fa..231843bb 100644 --- a/app/serializers/ApiModel.scala +++ b/app/serializers/ApiModel.scala @@ -159,6 +159,7 @@ object ApiModel { groupAdmin: Boolean, admin: Boolean, expert: Boolean, + observableOrganisations: List[String], managingOrganisations: List[String], managingAreas: List[String], ) @@ -214,6 +215,8 @@ object ApiModel { groupAdmin = user.groupAdminRoleName.nonEmpty, admin = user.adminRoleName.nonEmpty, expert = user.expert, + observableOrganisations = + user.observableOrganisationIds.flatMap(Organisation.byId).map(_.shortName).sorted, managingOrganisations = user.managingOrganisationIds.flatMap(Organisation.byId).map(_.shortName).sorted, managingAreas = user.managingAreaIds.flatMap(Area.fromId).map(_.toString).sorted, diff --git a/typescript/src/users.ts b/typescript/src/users.ts index a20aefa9..fc19ef28 100644 --- a/typescript/src/users.ts +++ b/typescript/src/users.ts @@ -304,6 +304,14 @@ if (window.document.getElementById(usersTableId)) { formatter: "html", width: 200, }, + { + title: "Organismes observés", + field: "permissions.observableOrganisations", + sorter: "string", + headerFilter: "input", + width: 200, + accessorDownload: joinWithCommaDownload, + }, { title: "Organismes en charge", field: "permissions.managingOrganisations",