gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[reclaim-ui] 393/459: display all missing claims


From: gnunet
Subject: [reclaim-ui] 393/459: display all missing claims
Date: Fri, 11 Jun 2021 23:28:05 +0200

This is an automated email from the git hooks/post-receive script.

martin-schanzenbach pushed a commit to branch master
in repository reclaim-ui.

commit 9f7d439e87b6de23741dbc272311414419329386
Author: Martin Schanzenbach <schanzen@gnunet.org>
AuthorDate: Wed Dec 30 16:03:44 2020 +0900

    display all missing claims
---
 src/app/edit-identity/edit-identity.component.html | 10 ++++-----
 src/app/edit-identity/edit-identity.component.ts   | 25 +++++++++++++++++++++-
 src/locales/de/messages.json                       |  1 +
 3 files changed, 30 insertions(+), 6 deletions(-)

diff --git a/src/app/edit-identity/edit-identity.component.html 
b/src/app/edit-identity/edit-identity.component.html
index 5368cce..56ade45 100644
--- a/src/app/edit-identity/edit-identity.component.html
+++ b/src/app/edit-identity/edit-identity.component.html
@@ -111,18 +111,18 @@
 
       </div>
 
-      <p *ngIf="missingNonStandardClaims.length > 0"
+      <p *ngIf="getMissingClaims().length > 0"
         class="card-subtitle mb-4"> 
{{getMessage("edit_identity_html@addRequestedMissingClaim")}}</p>
-      <div *ngIf="missingNonStandardClaims.length > 0"
+      <div *ngIf="getMissingClaims().length > 0"
         class="table pb-1">
         <!-- Add standard attribute -->
         <div class="row mb-3"
              [class.alert-danger]="isInConflict(newRequestedAttribute)">
           <div class="col-sm">
             <select class="custom-select"
-              (change)="newRequestedAttribute.name=$event.target.value">
+              (change)="setNewRequestedAttribute($event.target.value)">
               <option value="" >{{ 
getMessage("edit_identity_html@selectAttribute") }}</option>
-              <option *ngFor="let claim of missingNonStandardClaims" 
value={{claim.name}}>
+              <option *ngFor="let claim of getMissingClaims()" value={{claim}}>
                 {{getDescription(claim)}}
               </option>
             </select>
@@ -140,7 +140,7 @@
               </select>
               <div class="alert alert-warning"
                 *ngIf="(credentials.length == 0) && 
isClaimCredentialRequested(newRequestedAttribute)">
-                {{ getMessage("edit_identity_html@credentialRequested") }}
+                {{ getMessage("edit_identity_html@credentialRequired") }}
               </div>
             </div>
             <div style="float:right;" *ngIf="credentials.length > 0">
diff --git a/src/app/edit-identity/edit-identity.component.ts 
b/src/app/edit-identity/edit-identity.component.ts
index 2de41e0..0a5bc84 100644
--- a/src/app/edit-identity/edit-identity.component.ts
+++ b/src/app/edit-identity/edit-identity.component.ts
@@ -779,4 +779,27 @@ export class EditIdentityComponent implements OnInit {
     claims = claims.concat(this.missingPhoneClaims);
     return claims;
   }
-}
+
+  getMissingClaims() {
+    var sClaims = this.getMissingStandardClaims();
+    let claims = [];
+    for (let sClaim of sClaims) {
+      if (this.isClaimRequested(sClaim)) {
+        claims.push(sClaim);
+      }
+    }
+    claims = claims.concat(this.missingNonStandardClaims);
+    return claims;
+  }
+
+  setNewRequestedAttribute(attr: Attribute) {
+    this.newRequestedAttribute.name = attr.name;
+    this.newRequestedAttribute.flag = '0';
+    if (this.isClaimCredentialRequested(attr)) {
+      this.newRequestedAttribute.flag = '1';
+      if (this.credentials.length > 0) {
+        this.newRequestedAttribute.credential = this.credentials[0].id;
+      }
+    }
+  }
+  }
diff --git a/src/locales/de/messages.json b/src/locales/de/messages.json
index d4bd7e5..c78b023 100644
--- a/src/locales/de/messages.json
+++ b/src/locales/de/messages.json
@@ -57,6 +57,7 @@
     "edit_identity_html@addRequestedMissingClaim": "Angefragte, aber fehlende 
Attribute:",
     "edit_identity_html@importInfo": "Deine E-Mail-Addresse deutet darauf hin, 
dass Du Attribute eines externen Kontos bei ``{{ISSUERNAME}}´´ importieren 
kannst.",
     "edit_identity_html@linkAccount": "Attribute importieren",
+    "edit_identity_html@credentialRequired": "Dieses Attribut benötigt eine 
Attestierung aber Du hast noch keine.",
     "edit_identity_html@standardScopes": "Die unten stehenden Attribute 
entsprechen den standard \"scopes\" von OpenID Connect:\n``profile'', 
``email'', ``phone'' and ``address''.",
     "edit_identity_html@selfissued": "Selbst ausgestellt",
     "edit_identity_html@importFrom": "Von ``{{ISSUERNAME}}´´ importieren",

-- 
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]