gnunet-svn
[Top][All Lists]
Advanced

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

[reclaim-ui] 284/459: attested values


From: gnunet
Subject: [reclaim-ui] 284/459: attested values
Date: Fri, 11 Jun 2021 23:26:16 +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 7dfc711c40d670266329117cae25cf8610fcc759
Author: Martin Schanzenbach <mschanzenbach@posteo.de>
AuthorDate: Fri Aug 7 20:25:04 2020 +0200

    attested values
---
 src/app/identity-list/identity-list.component.html |  4 ++--
 src/app/identity-list/identity-list.component.ts   | 19 +++++++++++++++++++
 2 files changed, 21 insertions(+), 2 deletions(-)

diff --git a/src/app/identity-list/identity-list.component.html 
b/src/app/identity-list/identity-list.component.html
index 426f173..61c000a 100644
--- a/src/app/identity-list/identity-list.component.html
+++ b/src/app/identity-list/identity-list.component.html
@@ -112,8 +112,8 @@
                 </div>
               </td>
               <td>
-                <div *ngIf="attribute.value.length <= 20" style="min-width: 
15em">{{attribute.value}}</div>
-                <div *ngIf="attribute.value.length > 20" style="min-width: 
15em">{{attribute.value.substring(0, 15)}}<span 
style="color:#eee">[...]</span></div>
+                <div *ngIf="getAttributeValue(attribute).length <= 20" 
style="min-width: 15em">{{getAttributeValue(attribute)}}</div>
+                <div *ngIf="getAttributeValue(attribute).length > 20" 
style="min-width: 15em">{{getAttributeValue(attribute).substring(0, 15)}}<span 
style="color:#eee">[...]</span></div>
               </td>
             </tr>
             <tr *ngIf="(openIdentity != identity) && 
hasLotsOfAttributes(identity)">
diff --git a/src/app/identity-list/identity-list.component.ts 
b/src/app/identity-list/identity-list.component.ts
index 2ea6e97..8793cd2 100644
--- a/src/app/identity-list/identity-list.component.ts
+++ b/src/app/identity-list/identity-list.component.ts
@@ -428,6 +428,25 @@ export class IdentityListComponent implements OnInit {
     return false;
   }
 
+  isClaimAttested(attribute: Attribute): boolean {
+    return attribute.flag === '1';
+  }
+
+  getAttributeValue(identity: Identity, attribute: Attribute): string {
+    if (!this.isClaimAttested(attribute)) { return attribute.value };
+    if (undefined === this.attestations[identity.pubkey]) { return '?'};
+    for (let attest of this.attestations[identity.pubkey]) {
+      if (attest.id == attribute.attestation) {
+        for (let attr of attest.attributes) {
+          if (attribute.value == attr.name) {
+            return attr.value;
+          }
+        }
+      }
+    }
+    return "?";
+  }
+
   isAttestation(attribute: Attribute) {
     if (attribute.flag === '1') {
       return true;

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