From 1b2b4c06202bc721240e180f106edb699617b973 Mon Sep 17 00:00:00 2001 From: Okke Harsta Date: Mon, 15 Jul 2024 16:32:32 +0200 Subject: [PATCH] Formatting --- client/src/pages/RoleForm.js | 6 +++--- server/src/main/java/access/manage/Manage.java | 8 +++----- 2 files changed, 6 insertions(+), 8 deletions(-) diff --git a/client/src/pages/RoleForm.js b/client/src/pages/RoleForm.js index 729afaf4..301615c1 100644 --- a/client/src/pages/RoleForm.js +++ b/client/src/pages/RoleForm.js @@ -78,9 +78,9 @@ export const RoleForm = () => { if (user.superUser) { setProviders(providersToOptions(res[newRole ? 0 : 1])); } else if (user.institutionAdmin) { - setProviders(providersToOptions(distinctValues(user.applications - .concat(user.userRoles.map(userRole => userRole.role.applicationMaps) - .flat()), "id"))); + setProviders(providersToOptions(distinctValues(user.applications.concat( + user.userRoles.map(userRole => userRole.role.applicationMaps).flat() + ), "id"))); } else { setProviders(providersToOptions(distinctValues(user.userRoles .map(userRole => userRole.role.applicationMaps).flat(), "id"))); diff --git a/server/src/main/java/access/manage/Manage.java b/server/src/main/java/access/manage/Manage.java index 64c4971e..d4a044aa 100644 --- a/server/src/main/java/access/manage/Manage.java +++ b/server/src/main/java/access/manage/Manage.java @@ -43,7 +43,7 @@ default Map transformProvider(Map provider) { Map metaDataFields = (Map) data.get("metaDataFields"); //Can't use Map.of as values can be null Map application = new HashMap<>(); - //Due to the different API's we are using, the result sometimes contains an "_id" and sometimes an "manageId" + //Due to the different API's we are using, the result sometimes contains an "_id" and sometimes an "id" Object id = provider.get("id"); if (id != null) { application.put("id", id); @@ -138,10 +138,8 @@ default Map enrichInstitutionAdmin(String organizationGUID) { Map claims = new HashMap<>(); claims.put(INSTITUTION_ADMIN, true); claims.put(ORGANIZATION_GUID, organizationGUID); - List> applications = providersByInstitutionalGUID(organizationGUID); - claims.put(APPLICATIONS, applications); - Optional> identityProvider = identityProviderByInstitutionalGUID(organizationGUID); - claims.put(INSTITUTION, identityProvider.orElse(null)); + claims.put(APPLICATIONS, providersByInstitutionalGUID(organizationGUID)); + claims.put(INSTITUTION, identityProviderByInstitutionalGUID(organizationGUID).orElse(null)); return claims; }