aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoranna wimbauer <anna.wibauer@gmx.de>2020-10-28 15:06:45 +0100
committeranna wimbauer <anna.wibauer@gmx.de>2020-10-28 15:06:45 +0100
commiteb25ce7792c2f47ad36703bc9359f1e9330c8b58 (patch)
tree6a2dcfcaa0cca0a5bc307f098204f725d5eb5b42
parent2a49fa6f37d8c61f0cb598c25d8ef4144aee002b (diff)
downloadreclaim-ui-eb25ce7792c2f47ad36703bc9359f1e9330c8b58.tar.gz
reclaim-ui-eb25ce7792c2f47ad36703bc9359f1e9330c8b58.zip
missing credential source
-rw-r--r--src/app/edit-identity/edit-identity.component.html17
-rw-r--r--src/app/edit-identity/edit-identity.component.ts4
-rw-r--r--src/locales/de/messages.json1
-rw-r--r--src/locales/en/messages.json1
4 files changed, 19 insertions, 4 deletions
diff --git a/src/app/edit-identity/edit-identity.component.html b/src/app/edit-identity/edit-identity.component.html
index 44f8b3d..b4cb3ac 100644
--- a/src/app/edit-identity/edit-identity.component.html
+++ b/src/app/edit-identity/edit-identity.component.html
@@ -190,13 +190,16 @@
190 </div> 190 </div>
191 191
192 <input *ngIf="claim.flag == '0'" placeholder="{{ getMessage('Value') }}" [(ngModel)]="claim.value"> 192 <input *ngIf="claim.flag == '0'" placeholder="{{ getMessage('Value') }}" [(ngModel)]="claim.value">
193 <select *ngIf="claim.flag == '1'" class="custom-select" 193 <select *ngIf="claim.flag == '1' && hasCredentialSources()" class="custom-select"
194 (change)="claim.credential=$event.target.value; " > 194 (change)="claim.credential=$event.target.value; " >
195 <option value="">{{ getMessage("edit_identity_html@selectSource") }}</option> 195 <option value="">{{ getMessage("edit_identity_html@selectSource") }}</option>
196 <option *ngFor="let cred of credentials" value={{cred.id}}> 196 <option *ngFor="let cred of credentials" value={{cred.id}}>
197 {{cred.name}} 197 {{cred.name}}
198 </option> 198 </option>
199 </select> 199 </select>
200 <div *ngIf="claim.flag == '1' && !hasCredentialSources()" class="alert alert-primary" role="alert">
201 {{ getMessage("edit_identity_html@noCredentialSource") }}
202 </div>
200 203
201 <select class="custom-select" 204 <select class="custom-select"
202 *ngIf="(claim.credential !== '') && (claim.flag == '1')" (change)="claim.value=$event.target.value"> 205 *ngIf="(claim.credential !== '') && (claim.flag == '1')" (change)="claim.value=$event.target.value">
@@ -231,16 +234,19 @@
231 <i *ngIf="isClaimRequested(missing)" class="fa fa-openid"></i><b> {{missing.name}}</b></div></div> 234 <i *ngIf="isClaimRequested(missing)" class="fa fa-openid"></i><b> {{missing.name}}</b></div></div>
232 <div class="col-sm"> 235 <div class="col-sm">
233 <input *ngIf="!isClaimCredentialRequested(missing)" placeholder="{{ getMessage('Value') }}" [(ngModel)]="missing.value"> 236 <input *ngIf="!isClaimCredentialRequested(missing)" placeholder="{{ getMessage('Value') }}" [(ngModel)]="missing.value">
234 <select *ngIf="isClaimCredentialRequested(missing)" class="custom-select" (change)="missing.credential=$event.target.value; "> 237 <select *ngIf="isClaimCredentialRequested(missing) && hasCredentialSources()" class="custom-select" (change)="missing.credential=$event.target.value; ">
235 <option value="">{{ getMessage("edit_identity_html@selectSource") }}</option> 238 <option value="">{{ getMessage("edit_identity_html@selectSource") }}</option>
236 <option *ngFor="let cred of credentials" value={{cred.id}}> 239 <option *ngFor="let cred of credentials" value={{cred.id}}>
237 {{cred.name}} 240 {{cred.name}}
238 </option> 241 </option>
239 </select> 242 </select>
243 <div *ngIf="isClaimCredentialRequested(missing) && !hasCredentialSources()" class="alert alert-primary" role="alert">
244 {{ getMessage("edit_identity_html@noCredentialSource") }}
245 </div>
240 246
241 <select *ngIf="isClaimCredentialRequested(missing) && missing.credential !== ''" class="custom-select" (change)="missing.value=$event.target.value"> 247 <select *ngIf="isClaimCredentialRequested(missing) && missing.credential !== ''" class="custom-select" (change)="missing.value=$event.target.value">
242 <option value="">{{ getMessage("edit_identity_html@selectClaim") }}</option> 248 <option value="">{{ getMessage("edit_identity_html@selectClaim") }}</option>
243 <option *ngFor="let claim of credentialValuesForCred(missing)" value={{claim.name}}> 249 <option *ngFor="let claim of credentialValuesForClaim(missing)" value={{claim.name}}>
244 {{claim.value}} <i>({{claim.name}})</i> 250 {{claim.value}} <i>({{claim.name}})</i>
245 </option> 251 </option>
246 </select> 252 </select>
@@ -296,13 +302,16 @@
296 </div> 302 </div>
297 </div> 303 </div>
298 <input *ngIf="newAttribute.flag == '0'" placeholder="{{ getMessage('Value') }}" [class.text-danger]="!attributeValueValid(newAttribute)" [(ngModel)]="newAttribute.value"> 304 <input *ngIf="newAttribute.flag == '0'" placeholder="{{ getMessage('Value') }}" [class.text-danger]="!attributeValueValid(newAttribute)" [(ngModel)]="newAttribute.value">
299 <select *ngIf="newAttribute.flag == '1'" class="custom-select" 305 <select *ngIf="newAttribute.flag == '1' && hasCredentialSources()" class="custom-select"
300 (change)="newAttribute.credential=$event.target.value; " > 306 (change)="newAttribute.credential=$event.target.value; " >
301 <option value="">{{ getMessage("edit_identity_html@selectSource") }}</option> 307 <option value="">{{ getMessage("edit_identity_html@selectSource") }}</option>
302 <option *ngFor="let cred of credentials" value={{cred.id}}> 308 <option *ngFor="let cred of credentials" value={{cred.id}}>
303 {{cred.name}} 309 {{cred.name}}
304 </option> 310 </option>
305 </select> 311 </select>
312 <div *ngIf="newAttribute.flag == '1' && !hasCredentialSources()" class="alert alert-primary" role="alert">
313 {{ getMessage("edit_identity_html@noCredentialSource") }}
314 </div>
306 315
307 <select class="custom-select" 316 <select class="custom-select"
308 *ngIf="newAttribute.credential !== '' && newAttribute.flag == '1'" (change)="newAttribute.value=$event.target.value"> 317 *ngIf="newAttribute.credential !== '' && newAttribute.flag == '1'" (change)="newAttribute.value=$event.target.value">
diff --git a/src/app/edit-identity/edit-identity.component.ts b/src/app/edit-identity/edit-identity.component.ts
index 9575af3..6ed4e24 100644
--- a/src/app/edit-identity/edit-identity.component.ts
+++ b/src/app/edit-identity/edit-identity.component.ts
@@ -483,6 +483,10 @@ export class EditIdentityComponent implements OnInit {
483 } 483 }
484 } 484 }
485 485
486 hasCredentialSources(){
487 return this.credentials.length > 0
488 }
489
486 //FIXME credentials need an issuer field 490 //FIXME credentials need an issuer field
487 getIssuer(attribute: Attribute) { 491 getIssuer(attribute: Attribute) {
488 for (let i = 0; i < this.credentials.length; i++) { 492 for (let i = 0; i < this.credentials.length; i++) {
diff --git a/src/locales/de/messages.json b/src/locales/de/messages.json
index f14d403..b999048 100644
--- a/src/locales/de/messages.json
+++ b/src/locales/de/messages.json
@@ -56,6 +56,7 @@
56 "edit_identity_html@plain": "Text", 56 "edit_identity_html@plain": "Text",
57 "edit_identity_html@credential": "Attestierung", 57 "edit_identity_html@credential": "Attestierung",
58 "edit_identity_html@selectSource": "Quelle der Attestierung", 58 "edit_identity_html@selectSource": "Quelle der Attestierung",
59 "edit_identity_html@noCredentialSource": "Du hast noch keine Attestierungsquellen",
59 "edit_identity_html@selectClaim": "Attestierung auswählen", 60 "edit_identity_html@selectClaim": "Attestierung auswählen",
60 "edit_identity_html@additionalInfo": "Mehr Informationen", 61 "edit_identity_html@additionalInfo": "Mehr Informationen",
61 "edit_identity_html@non_standardClaims": "Nicht-standartisierte attribute welche nicht explizit in OpenID Connect definiert sind.", 62 "edit_identity_html@non_standardClaims": "Nicht-standartisierte attribute welche nicht explizit in OpenID Connect definiert sind.",
diff --git a/src/locales/en/messages.json b/src/locales/en/messages.json
index 0feb9d0..42be71a 100644
--- a/src/locales/en/messages.json
+++ b/src/locales/en/messages.json
@@ -56,6 +56,7 @@
56 "edit_identity_html@plain": "Plain", 56 "edit_identity_html@plain": "Plain",
57 "edit_identity_html@credential": "Credential", 57 "edit_identity_html@credential": "Credential",
58 "edit_identity_html@selectSource": "Select credential source", 58 "edit_identity_html@selectSource": "Select credential source",
59 "edit_identity_html@noCredentialSource": "You haven't added any credential sources yet.",
59 "edit_identity_html@selectClaim": "Select claim", 60 "edit_identity_html@selectClaim": "Select claim",
60 "edit_identity_html@additionalInfo": "Additional information", 61 "edit_identity_html@additionalInfo": "Additional information",
61 "edit_identity_html@non_standardClaims": "Non-standard claims which are not explicitly covered in the OpenID Connect core specification.", 62 "edit_identity_html@non_standardClaims": "Non-standard claims which are not explicitly covered in the OpenID Connect core specification.",