Skip to content

Commit 0852902

Browse files
committed
Application details - attributes & privacy
1 parent d48ae59 commit 0852902

File tree

4 files changed

+125
-44
lines changed

4 files changed

+125
-44
lines changed

client/src/locale/en.js

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -686,8 +686,21 @@ const en = {
686686
none: "None",
687687
interfedSource: "Federation source",
688688
registrationInfo: "This application provider is available in SURFconext through <a href='https://support.surfconext.nl/edugain' target='_blank' rel='noopener noreferrer'>eduGAIN</a>. " +
689-
"The application provider is registered by the following federation: <a href='{{url}}' target='_blank' rel='noopener noreferrer'>{{url}}</a>."
690-
689+
"The application provider is registered by the following federation: <a href='{{url}}' target='_blank' rel='noopener noreferrer'>{{url}}</a>.",
690+
noArp: "This application will receive all attirbutes that are released by the identity provider",
691+
noMotivation: "No motivation",
692+
noPrivacyInfo: "No information supplied",
693+
source: "Source: ",
694+
arpSources: {
695+
eduid: "EduID Identity Provider",
696+
idp: "Your IdP",
697+
invite: "SURF Invite",
698+
manage: "SURF Manage",
699+
orcid: "ORCID organization",
700+
sabrest: "SURF SAB",
701+
voot: "SURF Memberships",
702+
institution: "Your IdP"
703+
}
691704
},
692705
connect: {
693706
title: "How to connect",

client/src/pages/ApplicationDetail.jsx

Lines changed: 50 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,13 @@ import PlaceHolderImage from "@surfnet/sds/icons/placeholder-image.svg";
99
import ArrowLeftIcon from "@surfnet/sds/icons/functional-icons/arrow-left-2.svg";
1010
import {APPLICATION_LINKS, providerDescription, providerName, providerOrganizationName} from "../utils/Manage.js";
1111
import {isEmpty, stopEvent} from "../utils/Utils.js";
12+
import {useAppStore} from "../stores/AppStore.js";
1213

1314
const ApplicationDetail = () => {
1415

1516
const navigate = useNavigate();
1617
const {manageType, manageId} = useParams();
17-
18+
const {arp, privacy} = useAppStore(state => state);
1819
const [loading, setLoading] = useState(true);
1920
const [serviceProvider, setServiceProvider] = useState([]);
2021
const [showAttributes, setShowAttributes] = useState(false);
@@ -65,6 +66,10 @@ const ApplicationDetail = () => {
6566
setShowPrivacy(true);
6667
}
6768

69+
const findArpEntry = urn => {
70+
return arp.attributes.find(attr => attr.urn === urn);
71+
}
72+
6873
return (
6974
<div className="application-detail-container">
7075
<div className="application-detail-header-container">
@@ -104,15 +109,57 @@ const ApplicationDetail = () => {
104109
{!showAttributes && <a href="/" onClick={toggleShowAttributes}>
105110
{I18n.t("applicationDetail.details")}
106111
</a>}
107-
112+
{showAttributes && <div className="arp-attributes">
113+
{!serviceProvider.data.arp.enabled &&
114+
<p>{I18n.t("applicationDetail.noArp")}</p>
115+
}
116+
{serviceProvider.data.arp.enabled &&
117+
<>
118+
{Object.entries(serviceProvider.data.arp.attributes).map(entry => {
119+
const attribute = findArpEntry(entry[0]);
120+
//ARP entries only have one value / source
121+
const value = entry[1][0];
122+
const source = I18n.t(`applicationDetail.arpSources.${value.source}`);
123+
return (
124+
<div className="attribute">
125+
<span
126+
className="attr-name">{attribute.friendlyNames[I18n.locale]}</span>
127+
{!isEmpty(value.motivation) &&
128+
<span className="attr-motivation">{value.motivation}</span>}
129+
{isEmpty(value.motivation) && <span
130+
className="attr-motivation">{I18n.t("applicationDetail.noMotivation")}</span>}
131+
<span className="attr-source">
132+
{`${entry[0]} - ${I18n.t("applicationDetail.source")} ${source}`}
133+
</span>
134+
</div>
135+
);
136+
})}
137+
</>
138+
}
139+
</div>}
108140
</div>
109141
<div className="details-panel">
110142
<p className="title">{I18n.t("applicationDetail.privacy")}</p>
111143
<p>{I18n.t("applicationDetail.privacyInfo")}</p>
112144
{!showPrivacy && <a href="/" onClick={toggleShowPrivacy}>
113145
{I18n.t("applicationDetail.details")}
114146
</a>}
115-
147+
{showPrivacy && <div className="privacy-questions">
148+
{privacy.map(item => {
149+
const question = item[`info_${I18n.locale}`];
150+
const strippedQuestion = question.substring(question.indexOf(" ") + 1);
151+
const answer = metaData[item.manage]
152+
return (
153+
<div className="privacy-question">
154+
<span className="priv-name">{strippedQuestion}</span>
155+
{isEmpty(answer) && <span
156+
className="priv-answer">{I18n.t("applicationDetail.noPrivacyInfo")}</span>}
157+
{!isEmpty(answer) && <span className="priv-answer">{answer}</span>}
158+
</div>
159+
);
160+
}
161+
)}
162+
</div>}
116163
</div>
117164
</div>
118165
<div className="right">
@@ -160,7 +207,6 @@ const ApplicationDetail = () => {
160207
/>
161208
</div>
162209
)}
163-
164210
</div>
165211
</div>
166212
</div>

client/src/pages/ApplicationDetail.scss

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,12 +99,34 @@ div.application-detail-container {
9999
display: flex;
100100
flex-direction: column;
101101
gap: 2px;
102+
102103
p.title {
103104
font-weight: 600;
104105
}
105106
}
106107
}
107108

109+
.arp-attributes, .privacy-questions {
110+
display: flex;
111+
flex-direction: column;
112+
margin-top: 25px;
113+
gap: 25px;
114+
115+
.attribute, .privacy-question {
116+
display: flex;
117+
flex-direction: column;
118+
119+
.attr-name, .priv-name {
120+
font-weight: 600;
121+
}
122+
123+
.attr-source, .priv-answer {
124+
font-style: italic;
125+
color: var(--sds--color--gray--500);
126+
}
127+
}
128+
}
129+
108130
.right {
109131
margin-left: auto;
110132
max-width: 35%;

server/src/main/resources/metadata/ARP.json

Lines changed: 38 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -164,8 +164,8 @@
164164
"nl": "Description of the attribute"
165165
},
166166
"friendlyNames": {
167-
"en": "Entitlements",
168-
"nl": "Entitlements"
167+
"en": "Principal name",
168+
"nl": "Principal naam"
169169
},
170170
"example": "j.doe@harderwijkuniversity"
171171
},
@@ -177,8 +177,8 @@
177177
"nl": "Memberships or teams with which the user is associated."
178178
},
179179
"friendlyNames": {
180-
"en": "Entitlements",
181-
"nl": "Entitlements"
180+
"en": "Memberships",
181+
"nl": "Lidmaatschappen"
182182
},
183183
"example": "administrators",
184184
"overrideSource": "voot"
@@ -191,8 +191,8 @@
191191
"nl": "SURF Authorities for the user."
192192
},
193193
"friendlyNames": {
194-
"en": "Entitlements",
195-
"nl": "Entitlements"
194+
"en": "Autorizations",
195+
"nl": "Autorisaties"
196196
},
197197
"example": "Instellingsbevoegde"
198198
},
@@ -204,8 +204,8 @@
204204
"nl": "Description of the attribute"
205205
},
206206
"friendlyNames": {
207-
"en": "Entitlements",
208-
"nl": "Entitlements"
207+
"en": "Display name",
208+
"nl": "Display naam"
209209
},
210210
"example": "John Doe"
211211
},
@@ -217,8 +217,8 @@
217217
"nl": "Description of the attribute"
218218
},
219219
"friendlyNames": {
220-
"en": "Entitlements",
221-
"nl": "Entitlements"
220+
"en": "First name",
221+
"nl": "Voornaam"
222222
},
223223
"example": "John"
224224
},
@@ -230,8 +230,8 @@
230230
"nl": "Description of the attribute"
231231
},
232232
"friendlyNames": {
233-
"en": "Entitlements",
234-
"nl": "Entitlements"
233+
"en": "Common name",
234+
"nl": "Naam"
235235
},
236236
"example": "Johnathan Doe"
237237
},
@@ -243,8 +243,8 @@
243243
"nl": "Description of the attribute"
244244
},
245245
"friendlyNames": {
246-
"en": "Entitlements",
247-
"nl": "Entitlements"
246+
"en": "Last name",
247+
"nl": "Achternaam"
248248
},
249249
"example": "Doe"
250250
},
@@ -256,8 +256,8 @@
256256
"nl": "Description of the attribute"
257257
},
258258
"friendlyNames": {
259-
"en": "Entitlements",
260-
"nl": "Entitlements"
259+
"en": "Mail",
260+
"nl": "E-mail"
261261
},
262262
"example": "j.doe@harderwijkuniversity"
263263
},
@@ -269,8 +269,8 @@
269269
"nl": "Departments, teams, or faculties with which the user is associated within the issuing institution."
270270
},
271271
"friendlyNames": {
272-
"en": "Entitlements",
273-
"nl": "Entitlements"
272+
"en": "IdP unit name",
273+
"nl": "IdP unit naam"
274274
},
275275
"example": "teachers"
276276
},
@@ -282,8 +282,8 @@
282282
"nl": "The type of organization of the identity provider"
283283
},
284284
"friendlyNames": {
285-
"en": "Entitlements",
286-
"nl": "Entitlements"
285+
"en": "IdP Organization type",
286+
"nl": "IdP Organisatie type"
287287
},
288288
"example": "teachers"
289289
},
@@ -295,8 +295,8 @@
295295
"nl": "The unique personal code"
296296
},
297297
"friendlyNames": {
298-
"en": "Entitlements",
299-
"nl": "Entitlements"
298+
"en": "IdP Unique code",
299+
"nl": "IdP unieke code"
300300
},
301301
"example": "9d2f6e4a-7b1f-***"
302302
},
@@ -308,8 +308,8 @@
308308
"nl": "Orcid ID"
309309
},
310310
"friendlyNames": {
311-
"en": "Entitlements",
312-
"nl": "Entitlements"
311+
"en": "Orcid ID",
312+
"nl": "Orcid ID"
313313
},
314314
"example": "9d2f6e4a-7b1f-***"
315315
},
@@ -321,8 +321,8 @@
321321
"nl": "EckID"
322322
},
323323
"friendlyNames": {
324-
"en": "Entitlements",
325-
"nl": "Entitlements"
324+
"en": "EckID",
325+
"nl": "EckID"
326326
},
327327
"example": "9d2f6e4a-7b1f-***"
328328
},
@@ -334,21 +334,21 @@
334334
"nl": "eduID"
335335
},
336336
"friendlyNames": {
337-
"en": "Entitlements",
338-
"nl": "Entitlements"
337+
"en": "eduID",
338+
"nl": "eduID"
339339
},
340340
"example": "9d2f6e4a-7b1f-***"
341341
},
342342
{
343343
"name": "surfCrmID",
344344
"urn": "urn:mace:surf.nl:attribute-def:surf-crm-id",
345345
"info": {
346-
"en": "eduID",
347-
"nl": "eduID"
346+
"en": "SURF CRM Id",
347+
"nl": "SURF CRM Id"
348348
},
349349
"friendlyNames": {
350-
"en": "Entitlements",
351-
"nl": "Entitlements"
350+
"en": "SURF CRM Id",
351+
"nl": "SURF CRM Id"
352352
},
353353
"example": "9d2f6e4a-7b1f-***"
354354
},
@@ -360,8 +360,8 @@
360360
"nl": "preferredLanguage"
361361
},
362362
"friendlyNames": {
363-
"en": "Entitlements",
364-
"nl": "Entitlements"
363+
"en": "Preferred Language",
364+
"nl": "Taal voorkeur"
365365
},
366366
"example": "en"
367367
},
@@ -373,8 +373,8 @@
373373
"nl": "Subject identifier"
374374
},
375375
"friendlyNames": {
376-
"en": "Entitlements",
377-
"nl": "Entitlements"
376+
"en": "Subject identifier",
377+
"nl": "Subject identifier"
378378
},
379379
"example": "admin@example.com"
380380
},
@@ -386,8 +386,8 @@
386386
"nl": "UID"
387387
},
388388
"friendlyNames": {
389-
"en": "Entitlements",
390-
"nl": "Entitlements"
389+
"en": "UID",
390+
"nl": "UID"
391391
},
392392
"example": "urn:collab:person:example.com:admin"
393393
}

0 commit comments

Comments
 (0)