gnunet-svn
[Top][All Lists]
Advanced

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

[reclaim-ui] 301/459: more fixes


From: gnunet
Subject: [reclaim-ui] 301/459: more fixes
Date: Fri, 11 Jun 2021 23:26:33 +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 01d47c63de601ec9ebb30550f8b2364fa9474e57
Author: Martin Schanzenbach <mschanzenbach@posteo.de>
AuthorDate: Thu Aug 13 16:56:02 2020 +0200

    more fixes
---
 src/app/identity-list/identity-list.component.html |  2 +-
 src/app/identity-list/identity-list.component.ts   | 43 +++-------------------
 2 files changed, 7 insertions(+), 38 deletions(-)

diff --git a/src/app/identity-list/identity-list.component.html 
b/src/app/identity-list/identity-list.component.html
index 5054975..46f2d08 100644
--- a/src/app/identity-list/identity-list.component.html
+++ b/src/app/identity-list/identity-list.component.html
@@ -88,7 +88,7 @@
         <li *ngIf="isEmailRequested() && 
isEmailMissing(identity)">getEmailDescription()</li>
         <li *ngIf="isPhoneRequested() && 
isPhoneMissing(identity)">getPhoneDescription()</li>
         <li *ngIf="isAddressRequested() && 
isAddressMissing(identity)">getAddressDescription()</li>
-        <li *ngFor="let attr of getMissingClaims(identity)">{{attr}}<i 
*ngIf="isOptional(attr)"> (optional)</i></li>
+        <li *ngFor="let attr of getMissingClaims(identity)">{{attr.name}}<i 
*ngIf="isOptional(attr)"> (optional)</i></li>
       </ul>
       <button class="btn btn-primary" [routerLink]="['/edit-identity', 
identity.name]">
         <span class="fa fa-plus"></span> Edit identity
diff --git a/src/app/identity-list/identity-list.component.ts 
b/src/app/identity-list/identity-list.component.ts
index 75e09a0..5397243 100644
--- a/src/app/identity-list/identity-list.component.ts
+++ b/src/app/identity-list/identity-list.component.ts
@@ -27,7 +27,6 @@ export class IdentityListComponent implements OnInit {
   addressAttributes: any;
   requestedScopes: any;
   missingClaims: any;
-  optionalClaims: any;
   attributes: any;
   attestations: any;
   identities: Identity[];
@@ -56,7 +55,6 @@ export class IdentityListComponent implements OnInit {
     this.showConfirmDelete = null;
     this.requestedScopes = {};
     this.missingClaims = {};
-    this.optionalClaims = {};
     this.connected = false;
     this.modalOpened = false;
     if (undefined !== this.route.snapshot.queryParams["code"]) {
@@ -113,25 +111,15 @@ export class IdentityListComponent implements OnInit {
       }
     }
     this.missingClaims[identity.pubkey] = [];
-    this.optionalClaims[identity.pubkey] = [];
     for (let refscope of refscopes) {
       const attested = new Attribute('', '', '', '', 'STRING', '');
-      if (refscope[1] === true)
-      {
-        attested.name = refscope[0];
-        this.missingClaims[identity.pubkey].push(attested);
-      }
-      if (refscope[1] === false)
-      {
-        attested.name = refscope[0];
-        this.optionalClaims[identity.pubkey].push(attested);
-      }
+      attested.name = refscope[0];
+      this.missingClaims[identity.pubkey].push(attested);
     }
   }
 
   private updateAttestations(identity) {
     this.attestations[identity.pubkey] = [];
-    this.optionalClaims[identity.pubkey] = [];
     this.reclaimService.getAttestations(identity).subscribe(attestations => {
       if (attestations !== null) {
         this.attestations[identity.pubkey] = attestations;
@@ -254,15 +242,10 @@ export class IdentityListComponent implements OnInit {
   }
 
   getMissingClaims(identity) {
-    const arr = [];
-    let i = 0;
     if (undefined === this.missingClaims[identity.pubkey]) {
-      return arr;
-    }
-    for (i = 0; i < this.missingClaims[identity.pubkey].length; i++) {
-      arr.push(this.missingClaims[identity.pubkey][i].name);
+      return [];
     }
-    return arr;
+    return this.missingClaims[identity.pubkey];
   }
 
   isClaimRequested(identity, attribute) {
@@ -422,7 +405,7 @@ export class IdentityListComponent implements OnInit {
       }
       if (!found) {
         console.log(claim + " is missing");
-        return false;
+        return true;
       }
     }
     return false;
@@ -460,21 +443,6 @@ export class IdentityListComponent implements OnInit {
     return false; //FIXME actually handle this 
https://gitlab.com/voggenre/ui/commit/dd9b6656dee7dbf59809dcc9bc2508ee70d8afe6
   }
 
-  getOptionalClaims(identity) {
-    const arr = [];
-    let i = 0;
-    if (!this.inOpenIdFlow()) {
-      return [];
-    }
-    if (undefined === this.optionalClaims[identity.pubkey]) {
-      return [];
-    }
-    for (i = 0; i < this.optionalClaims[identity.pubkey].length; i++) {
-        arr.push(this.optionalClaims[identity.pubkey][i].name);
-    }
-    return arr;
-  }
-
   isOptional(attr: Attribute): boolean {
     if (undefined === attr) { return true };
     var claims = this.oidcService.getRequestedClaims();
@@ -486,6 +454,7 @@ export class IdentityListComponent implements OnInit {
     }
     return true;
   }
+
   toggleSharingInfo(id: Identity) {
     if (this.showSharingInfo === id) {
       this.showSharingInfo = '';

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