gnunet-svn
[Top][All Lists]
Advanced

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

[reclaim-ui] 187/459: add issuer display


From: gnunet
Subject: [reclaim-ui] 187/459: add issuer display
Date: Fri, 11 Jun 2021 23:24:39 +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 70eec9934322ebbc25719776688c70874886368a
Author: Schanzenbach, Martin <mschanzenbach@posteo.de>
AuthorDate: Fri Feb 7 18:43:33 2020 +0100

    add issuer display
---
 src/app/attestation.ts                                |  1 +
 .../edit-attestations.component.html                  | 10 +++++-----
 .../edit-attestations/edit-attestations.component.ts  |  2 +-
 src/app/edit-identity/edit-identity.component.html    |  2 +-
 src/app/edit-identity/edit-identity.component.ts      | 19 ++++++++++++++++++-
 5 files changed, 26 insertions(+), 8 deletions(-)

diff --git a/src/app/attestation.ts b/src/app/attestation.ts
index efd5012..a512c83 100644
--- a/src/app/attestation.ts
+++ b/src/app/attestation.ts
@@ -5,5 +5,6 @@ export class Attestation {
               public id: string,
               public value: string,
               public type: string,
+              public issuer: string,
               public attributes: Attribute[]) {}
 }
diff --git a/src/app/edit-attestations/edit-attestations.component.html 
b/src/app/edit-attestations/edit-attestations.component.html
index bcfff6b..075faad 100644
--- a/src/app/edit-attestations/edit-attestations.component.html
+++ b/src/app/edit-attestations/edit-attestations.component.html
@@ -11,11 +11,11 @@
     <table class="table pb-1" style="">
       <thead>
         <tr>
-          <th>Attestation Name</th>
-          <th>Attestation Type</th>
-          <th>Attestation Value</th>
+          <th>Name</th>
+          <th>Type</th>
+          <th>Value</th>
           <!--<th>Issuer</th>-->
-          <th>Attestation ID</th>
+          <th>Issuer</th>
         </tr>
       </thead>
       <tbody>
@@ -31,7 +31,7 @@
             <div style="min-width: 15em">
             </div>
 </td>-->
-          <td><div style="min-width: 15em">{{attestation.id}}</div></td>
+          <td><div style="min-width: 15em">{{attestation.issuer}}</div></td>
           <td>
             <button class="btn btn-primary"  
(click)="deleteAttestation(attestation)">
               <span class="fa fa-trash"></span>
diff --git a/src/app/edit-attestations/edit-attestations.component.ts 
b/src/app/edit-attestations/edit-attestations.component.ts
index 6281998..85116be 100644
--- a/src/app/edit-attestations/edit-attestations.component.ts
+++ b/src/app/edit-attestations/edit-attestations.component.ts
@@ -24,7 +24,7 @@ export class EditAttestationsComponent implements OnInit {
               private router: Router) { }
 
   ngOnInit() {
-    this.newAttestation = new Attestation('', '', '', '', []);
+    this.newAttestation = new Attestation('', '', '', '', '', []);
     this.identity = new Identity('','');
     this.attestations = [];
     this.activatedRoute.params.subscribe(p => {
diff --git a/src/app/edit-identity/edit-identity.component.html 
b/src/app/edit-identity/edit-identity.component.html
index 9d004d1..13609b5 100644
--- a/src/app/edit-identity/edit-identity.component.html
+++ b/src/app/edit-identity/edit-identity.component.html
@@ -62,7 +62,7 @@
             <td><div style="min-width: 15em">{{ attribute.name }}</div></td>
             <td>
               <input *ngIf="!isAttestation(attribute)" placeholder="Value" 
[(ngModel)]="attribute.value">
-              <span *ngIf="isAttestation(attribute)" >{{ attribute.value }} 
issued by {{ getIssuer(attribute) }} as ``{{ attribute.value }}''</span>
+              <span *ngIf="isAttestation(attribute)" >{{ 
getAttestedValue(attribute) }} issued by <i>{{ getIssuer(attribute) }}</i> as 
attribute for ``{{ attribute.value }}''</span>
             </td>
             <td>
               <button class="btn btn-primary" 
(click)="deleteAttribute(attribute)" *ngIf="!isAttestation(attribute)">
diff --git a/src/app/edit-identity/edit-identity.component.ts 
b/src/app/edit-identity/edit-identity.component.ts
index 9366c10..8a6f63a 100644
--- a/src/app/edit-identity/edit-identity.component.ts
+++ b/src/app/edit-identity/edit-identity.component.ts
@@ -589,7 +589,24 @@ export class EditIdentityComponent implements OnInit {
 
   //FIXME attestations need an issuer field
   getIssuer(attribute: Attribute) {
-    return "UNKNOWN";
+    for (let i = 0; i < this.attestations.length; i++) {
+      if (this.attestations[i].id == attribute.attestation) {
+        return this.attestations[i].issuer;
+      }
+    }
+  }
+
+  getAttestedValue(attribute: Attribute) {
+    for (let i = 0; i < this.attestations.length; i++) {
+      if (this.attestations[i].id == attribute.attestation) {
+        for (let j = 0; j < this.attestations[i].attributes.length; j++) {
+          if (attribute.value == this.attestations[i].attributes[j].name) {
+            return this.attestations[i].attributes[j].value;
+          }
+        }
+      }
+    }
+    return "?";
   }
 
   getFhGAttestation() {

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