gnunet-svn
[Top][All Lists]
Advanced

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

[reclaim-ui] 392/459: fix


From: gnunet
Subject: [reclaim-ui] 392/459: fix
Date: Fri, 11 Jun 2021 23:28:04 +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 93e28b3da45faba3141265fe4b9f8f679a710513
Author: Martin Schanzenbach <schanzen@gnunet.org>
AuthorDate: Wed Dec 30 15:44:04 2020 +0900

    fix
---
 src/app/edit-identity/edit-identity.component.html |  8 +--
 src/app/edit-identity/edit-identity.component.ts   | 63 +++++++++++-----------
 src/locales/en/messages.json                       |  1 +
 3 files changed, 37 insertions(+), 35 deletions(-)

diff --git a/src/app/edit-identity/edit-identity.component.html 
b/src/app/edit-identity/edit-identity.component.html
index 39d7f15..5368cce 100644
--- a/src/app/edit-identity/edit-identity.component.html
+++ b/src/app/edit-identity/edit-identity.component.html
@@ -138,10 +138,10 @@
                 {{claim.value}} <i>({{claim.name}})</i>
                 </option>
               </select>
-            </div>
-            <div class="alert alert-warning"
-              *ngIf="(credentials.length == 0) && 
isClaimCredentialRequested(newRequestedAttribute)">
-              {{ getMessage("edit_identity_html@selfissued") }}
+              <div class="alert alert-warning"
+                *ngIf="(credentials.length == 0) && 
isClaimCredentialRequested(newRequestedAttribute)">
+                {{ getMessage("edit_identity_html@credentialRequested") }}
+              </div>
             </div>
             <div style="float:right;" *ngIf="credentials.length > 0">
               <select class="custom-select"
diff --git a/src/app/edit-identity/edit-identity.component.ts 
b/src/app/edit-identity/edit-identity.component.ts
index df71408..2de41e0 100644
--- a/src/app/edit-identity/edit-identity.component.ts
+++ b/src/app/edit-identity/edit-identity.component.ts
@@ -91,7 +91,6 @@ export class EditIdentityComponent implements OnInit {
             if (ids[i].name == p['id']) {
               this.identity = ids[i];
               this.updateAttributes();
-              this.updateCredentials();
             }
           }
         });
@@ -167,36 +166,39 @@ export class EditIdentityComponent implements OnInit {
 
   private updateAttributes() {
     this.reclaimService.getAttributes(this.identity).subscribe(attributes => {
-      this.existingProfileClaims = this.bootstrapClaimArray 
(this.oidcService.getStandardProfileClaims());
-      this.existingEmailClaims = this.bootstrapClaimArray 
(this.oidcService.getStandardEmailClaims());
-      this.existingPhoneClaims = this.bootstrapClaimArray 
(this.oidcService.getStandardPhoneClaims());
-      this.existingAddressClaims = this.bootstrapClaimArray 
(this.oidcService.getStandardAddressClaims());
-      this.existingNonStandardClaims = [];
-      this.attributes = this.sortAttributes(attributes);
-      for (let attr of this.attributes) {
-        if (this.oidcService.isStandardProfileClaim(attr)) {
-          this.existingProfileClaims = 
this.updateClaimArray(this.existingProfileClaims, attr);
-        } else if (this.oidcService.isStandardEmailClaim(attr)) {
-          this.existingEmailClaims = 
this.updateClaimArray(this.existingEmailClaims, attr);
-        } else if (this.oidcService.isStandardAddressClaim(attr)) {
-          this.existingAddressClaims = 
this.updateClaimArray(this.existingAddressClaims, attr);
-        } else if (this.oidcService.isStandardPhoneClaim(attr)) {
-          this.existingPhoneClaims = 
this.updateClaimArray(this.existingPhoneClaims, attr);
-        } else {
-          this.existingNonStandardClaims.push(attr);
+      this.reclaimService.getCredentials(this.identity).subscribe(credentials 
=> {
+        this.credentials = credentials;
+        this.existingProfileClaims = this.bootstrapClaimArray 
(this.oidcService.getStandardProfileClaims());
+        this.existingEmailClaims = this.bootstrapClaimArray 
(this.oidcService.getStandardEmailClaims());
+        this.existingPhoneClaims = this.bootstrapClaimArray 
(this.oidcService.getStandardPhoneClaims());
+        this.existingAddressClaims = this.bootstrapClaimArray 
(this.oidcService.getStandardAddressClaims());
+        this.existingNonStandardClaims = [];
+        this.attributes = this.sortAttributes(attributes);
+        for (let attr of this.attributes) {
+          if (this.oidcService.isStandardProfileClaim(attr)) {
+            this.existingProfileClaims = 
this.updateClaimArray(this.existingProfileClaims, attr);
+          } else if (this.oidcService.isStandardEmailClaim(attr)) {
+            this.existingEmailClaims = 
this.updateClaimArray(this.existingEmailClaims, attr);
+          } else if (this.oidcService.isStandardAddressClaim(attr)) {
+            this.existingAddressClaims = 
this.updateClaimArray(this.existingAddressClaims, attr);
+          } else if (this.oidcService.isStandardPhoneClaim(attr)) {
+            this.existingPhoneClaims = 
this.updateClaimArray(this.existingPhoneClaims, attr);
+          } else {
+            this.existingNonStandardClaims.push(attr);
+          }
         }
-      }
-      this.existingProfileClaims = 
this.cleanupClaimArray(this.existingProfileClaims);
-      this.existingEmailClaims = 
this.cleanupClaimArray(this.existingEmailClaims);
-      this.existingPhoneClaims = 
this.cleanupClaimArray(this.existingPhoneClaims);
-      this.existingAddressClaims = 
this.cleanupClaimArray(this.existingAddressClaims);
-      this.updateMissingAttributes();
-      this.validateEmailForImport();
-      this.resetAttributes();
-    },
-    err => {
-      //this.errorInfos.push("Error retrieving attributes for ``" + 
identity.name + "''");
-      console.log(err);
+        this.existingProfileClaims = 
this.cleanupClaimArray(this.existingProfileClaims);
+        this.existingEmailClaims = 
this.cleanupClaimArray(this.existingEmailClaims);
+        this.existingPhoneClaims = 
this.cleanupClaimArray(this.existingPhoneClaims);
+        this.existingAddressClaims = 
this.cleanupClaimArray(this.existingAddressClaims);
+        this.updateMissingAttributes();
+        this.validateEmailForImport();
+        this.resetAttributes();
+      },
+      err => {
+        //this.errorInfos.push("Error retrieving attributes for ``" + 
identity.name + "''");
+        console.log(err);
+      });
     });
   }
 
@@ -661,7 +663,6 @@ export class EditIdentityComponent implements OnInit {
               this.importInProgress = false;
               this.oauthService.logOut();
               this.updateAttributes();
-              this.updateCredentials();
             })
           ).subscribe(res => {
             console.log("Finished attribute import.");
diff --git a/src/locales/en/messages.json b/src/locales/en/messages.json
index 4e8a1fa..617df70 100644
--- a/src/locales/en/messages.json
+++ b/src/locales/en/messages.json
@@ -57,6 +57,7 @@
     "edit_identity_html@addRequestedMissingClaim": "Requested but missing 
attributes:",
     "edit_identity_html@importInfo": "Your email address indicates that you 
may be able to import attributes from an external account at 
``{{ISSUERNAME}}´´.",
     "edit_identity_html@linkAccount": "Import attributes",
+    "edit_identity_html@credentialRequired": "This attribute requires an 
attestation but you do not have any credentials.",
     "edit_identity_html@standardScopes": "The attributes below correspond to 
the standard scopes of the\nOpenID Connect specification: ``profile'', 
``email'', ``phone'' and ``address''.",
     "edit_identity_html@selfissued": "Self-issued",
     "edit_identity_html@importFrom": "Try import from ``{{ISSUERNAME}}´´",

-- 
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]