gnunet-svn
[Top][All Lists]
Advanced

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

[reclaim-ui] 391/459: fix requested attribute


From: gnunet
Subject: [reclaim-ui] 391/459: fix requested attribute
Date: Fri, 11 Jun 2021 23:28:03 +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 4c9e10a2323744c36ba1725ec4db75d29383d2cb
Author: Martin Schanzenbach <schanzen@gnunet.org>
AuthorDate: Wed Dec 30 15:27:26 2020 +0900

    fix requested attribute
---
 src/app/edit-identity/edit-identity.component.html | 12 +++++++++---
 src/app/edit-identity/edit-identity.component.ts   |  6 ++++++
 2 files changed, 15 insertions(+), 3 deletions(-)

diff --git a/src/app/edit-identity/edit-identity.component.html 
b/src/app/edit-identity/edit-identity.component.html
index 82a5aa6..39d7f15 100644
--- a/src/app/edit-identity/edit-identity.component.html
+++ b/src/app/edit-identity/edit-identity.component.html
@@ -129,21 +129,27 @@
           </div>
           <div class="col-sm" style="display:flex;">
             <div style="flex:1;">
-              <input *ngIf="!isClaimCred(newRequestedAttribute)" 
placeholder="{{ getMessage('Value') }}" 
[(ngModel)]="newRequestedAttribute.value">
+              <input *ngIf="!isClaimCred(newRequestedAttribute) && 
!isClaimCredentialRequested(newRequestedAttribute)"
+              placeholder="{{ getMessage('Value') }}" 
[(ngModel)]="newRequestedAttribute.value">
               <select class="custom-select"
-                *ngIf="newRequestedAttribute.credential !== '' && 
isClaimCred(newRequestedAttribute)" 
(change)="newRequestedAttribute.value=$event.target.value">
+                      *ngIf="isClaimCredentialRequested(newRequestedAttribute) 
&& credentials.length > 0" 
(change)="newRequestedAttribute.value=$event.target.value">
                 <option [value]="getZeroId()" >{{ 
getMessage("edit_identity_html@selectClaim") }}</option>
                 <option *ngFor="let claim of 
credentialValuesForClaim(newRequestedAttribute)" value={{claim.name}}>
                 {{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>
             <div style="float:right;" *ngIf="credentials.length > 0">
               <select class="custom-select"
                 [(ngModel)]="newRequestedAttribute.credential"
 
                 
(change)="newRequestedAttribute.credential=$event.target.value; 
newRequestedAttribute.flag = ($event.target.value == '') ? '0' : '1'" >
-                <option value="">{{ 
getMessage("edit_identity_html@selfissued") }}</option>
+                <option 
*ngIf="!isClaimCredentialRequested(newRequestedAttribute)"
+                [value]="getZeroId()">{{ 
getMessage("edit_identity_html@selfissued") }}</option>
                 <option *ngFor="let cred of credentials" value={{cred.id}}>
                 {{getIssuerName(cred)}}
                 </option>
diff --git a/src/app/edit-identity/edit-identity.component.ts 
b/src/app/edit-identity/edit-identity.component.ts
index 2c52cdb..df71408 100644
--- a/src/app/edit-identity/edit-identity.component.ts
+++ b/src/app/edit-identity/edit-identity.component.ts
@@ -245,6 +245,12 @@ export class EditIdentityComponent implements OnInit {
       const attribute = new Attribute('', '', this.getZeroId(), '', 'STRING', 
'');
       attribute.flag = '0';
       attribute.name = claim;
+      if (this.isClaimCredentialRequested(attribute)) {
+        attribute.flag = '1';
+        if (this.credentials.length > 0) {
+          attribute.credential = this.credentials[0].id;
+        }
+      }
       if (this.oidcService.isStandardProfileClaim(attribute)) {
         this.missingProfileClaims.push(attribute);
       } else if (this.oidcService.isStandardEmailClaim(attribute)) {

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