gnunet-svn
[Top][All Lists]
Advanced

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

[reclaim-ui] 397/459: fix address handling


From: gnunet
Subject: [reclaim-ui] 397/459: fix address handling
Date: Fri, 11 Jun 2021 23:28:09 +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 ca113f429c3ade27a5f9449f6975e9be1f7554b6
Author: Martin Schanzenbach <schanzen@gnunet.org>
AuthorDate: Wed Dec 30 20:55:21 2020 +0900

    fix address handling
---
 src/app/edit-identity/edit-identity.component.html | 116 +++++++++++----------
 src/app/edit-identity/edit-identity.component.ts   |   6 +-
 src/app/identity-list/identity-list.component.html |   8 +-
 src/locales/de/messages.json                       |   3 +-
 src/locales/en/messages.json                       |   3 +-
 5 files changed, 70 insertions(+), 66 deletions(-)

diff --git a/src/app/edit-identity/edit-identity.component.html 
b/src/app/edit-identity/edit-identity.component.html
index c3b7446..319da0b 100644
--- a/src/app/edit-identity/edit-identity.component.html
+++ b/src/app/edit-identity/edit-identity.component.html
@@ -23,12 +23,68 @@
   <div class="card-body" *ngIf="!importInProgress">
     <div>
       <h3 class="mb-2"> {{getMessage("edit_identity_html@addAttributes")}}</h3>
-      <p> {{getMessage("edit_identity_html@addStandardClaim")}} <span 
(click)="showGeneralInfo = !showGeneralInfo" class="fa 
fa-question-circle"></span></p>
+      <p *ngIf="getMissingClaims().length > 0"> 
{{getMessage("edit_identity_html@addRequestedMissingClaim")}} <span 
(click)="showMissingInfo = !showMissingInfo" class="fa 
fa-question-circle"></span></p>
+      <div class="alert alert-info fade show" *ngIf="showMissingInfo" >
+        {{getMessage("edit_identity_html@infoMissingClaims")}}
+      </div>
+
+      <div *ngIf="getMissingClaims().length > 0"
+        class="table pb-1">
+        <!-- Add standard attribute -->
+        <div class="row mb-3"
+             [class.alert-danger]="isInConflict(newRequestedAttribute)">
+          <div class="col-sm">
+            <select class="custom-select"
+              [ngModel]="newRequestedAttribute.name"
+              (change)="setNewRequestedAttribute($event.target.value)">
+              <option value="" >{{ 
getMessage("edit_identity_html@selectAttribute") }}</option>
+              <option *ngFor="let claim of getMissingClaims()" 
value={{claim.name}}>
+                {{getDescription(claim)}}
+              </option>
+            </select>
+          </div>
+          <div class="col-sm" style="display:flex;">
+            <div style="flex:1;">
+              <input *ngIf="!isClaimCred(newRequestedAttribute) && 
!isClaimCredentialRequested(newRequestedAttribute)"
+              placeholder="{{ getMessage('Value') }}" 
[(ngModel)]="newRequestedAttribute.value">
+              <select class="custom-select"
+                      *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 class="alert alert-warning"
+                *ngIf="(credentials.length == 0) && 
isClaimCredentialRequested(newRequestedAttribute)">
+                {{ getMessage("edit_identity_html@credentialRequired") }}
+              </div>
+            </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 
*ngIf="!isClaimCredentialRequested(newRequestedAttribute)"
+                [value]="getZeroId()">{{ 
getMessage("edit_identity_html@selfissued") }}</option>
+                <option *ngFor="let cred of credentials" value={{cred.id}}>
+                {{getIssuerName(cred)}}
+                </option>
+              </select>
+            </div>
+          </div>
+          <div class="col-sm">
+            <button [disabled]="!canAddAttribute(newRequestedAttribute)" 
class="btn btn-primary"  (click)="saveAttribute(newRequestedAttribute)">
+              <span class="fa fa-plus"></span>
+            </button>
+          </div>
+        </div>
+      </div>
+
+      <p *ngIf="getMissingClaims() == 0"> 
{{getMessage("edit_identity_html@addStandardClaim")}} <span 
(click)="showGeneralInfo = !showGeneralInfo" class="fa 
fa-question-circle"></span></p>
       <div class="alert alert-secondary fade show" *ngIf="showGeneralInfo" >
         {{getMessage("edit_identity_html@standardScopes")}}
       </div>
-
-      <div class="table pb-1">
+      <div class="table pb-1" *ngIf="getMissingClaims() == 0">
         <!-- Add standard attribute -->
         <div class="row mb-3"
              [class.alert-danger]="isInConflict(newStandardAttribute)">
@@ -111,60 +167,6 @@
 
       </div>
 
-      <p *ngIf="getMissingClaims().length > 0"
-        class="card-subtitle mb-4"> 
{{getMessage("edit_identity_html@addRequestedMissingClaim")}}</p>
-      <div *ngIf="getMissingClaims().length > 0"
-        class="table pb-1">
-        <!-- Add standard attribute -->
-        <div class="row mb-3"
-             [class.alert-danger]="isInConflict(newRequestedAttribute)">
-          <div class="col-sm">
-            <select class="custom-select"
-              [ngModel]="newRequestedAttribute.name"
-              (change)="setNewRequestedAttribute($event.target.value)">
-              <option value="" >{{ 
getMessage("edit_identity_html@selectAttribute") }}</option>
-              <option *ngFor="let claim of getMissingClaims()" 
value={{claim.name}}>
-                {{getDescription(claim)}}
-              </option>
-            </select>
-          </div>
-          <div class="col-sm" style="display:flex;">
-            <div style="flex:1;">
-              <input *ngIf="!isClaimCred(newRequestedAttribute) && 
!isClaimCredentialRequested(newRequestedAttribute)"
-              placeholder="{{ getMessage('Value') }}" 
[(ngModel)]="newRequestedAttribute.value">
-              <select class="custom-select"
-                      *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 class="alert alert-warning"
-                *ngIf="(credentials.length == 0) && 
isClaimCredentialRequested(newRequestedAttribute)">
-                {{ getMessage("edit_identity_html@credentialRequired") }}
-              </div>
-            </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 
*ngIf="!isClaimCredentialRequested(newRequestedAttribute)"
-                [value]="getZeroId()">{{ 
getMessage("edit_identity_html@selfissued") }}</option>
-                <option *ngFor="let cred of credentials" value={{cred.id}}>
-                {{getIssuerName(cred)}}
-                </option>
-              </select>
-            </div>
-          </div>
-          <div class="col-sm">
-            <button [disabled]="!canAddAttribute(newRequestedAttribute)" 
class="btn btn-primary"  (click)="saveAttribute(newRequestedAttribute)">
-              <span class="fa fa-plus"></span>
-            </button>
-          </div>
-        </div>
-      </div>
-
       <hr >
       <!-- All existing attributes -->
       <div *ngIf="attributes.length == 0"
diff --git a/src/app/edit-identity/edit-identity.component.ts 
b/src/app/edit-identity/edit-identity.component.ts
index f2521c6..f2a48fb 100644
--- a/src/app/edit-identity/edit-identity.component.ts
+++ b/src/app/edit-identity/edit-identity.component.ts
@@ -46,7 +46,7 @@ export class EditIdentityComponent implements OnInit {
   missingAddressClaims: Attribute[] = [];
   existingNonStandardClaims: Attribute[] = [];
   missingNonStandardClaims: Attribute[] = [];
-  showExtraInfo: boolean = false;
+  showMissingInfo: boolean = false;
   showGeneralInfo: boolean = false;
   claimInEdit: Attribute = null;
 
@@ -204,8 +204,8 @@ export class EditIdentityComponent implements OnInit {
 
   resetAttributes() {
     this.resetStandardAttribute(this.newStandardAttribute);
+    this.resetStandardAttribute(this.newRequestedAttribute);
     this.resetAttribute(this.newAttribute);
-    this.resetAttribute(this.newRequestedAttribute);
   }
 
   inOpenIdFlow() {
@@ -789,7 +789,7 @@ export class EditIdentityComponent implements OnInit {
       }
     }
     claims = claims.concat(this.missingNonStandardClaims);
-    return claims;
+    return this.sortAttributes(claims);
   }
 
   setNewRequestedAttribute(attrName: string) {
diff --git a/src/app/identity-list/identity-list.component.html 
b/src/app/identity-list/identity-list.component.html
index 9c9eb91..c6b6908 100644
--- a/src/app/identity-list/identity-list.component.html
+++ b/src/app/identity-list/identity-list.component.html
@@ -10,7 +10,7 @@
 <!--Authorization Request-->
 <div class="alert alert-info alert-dismissible fade show mb-1" role="alert" 
*ngIf="inOpenIdFlow()">
   <div  style="text-align: center;">
-    <i class="fa fa-2x fa-openid"></i>
+    <i class="fa fa-2x fa-share-alt"></i>
     <b class="fa-2x"> 
{{getMessage("authorization_request_html@personalInfo")}} </b>
     <br />
     <span *ngIf="isClientVerified() === undefined">
@@ -124,7 +124,7 @@
         [routerLink]="['/edit-identity', identity.name]">{{ 
getMessage("identity_list_html@noAttributes2") }}</a>
     </div>
     <div [hidden]="!isAnyRequestedClaimMissing(identity)" class="alert 
alert-warning alert-dismissible fade show" role="alert">
-      <span class="fa fa-openid"></span> {{ 
getMessage("identity_list_html@missingInformation") }}
+      <span class="fa fa-share-alt"></span> {{ 
getMessage("identity_list_html@missingInformation") }}
       <ul>
         <li *ngIf="isProfileRequested() && isProfileMissing(identity)"><b>{{ 
getProfileDescription() }}</b></li>
         <li *ngIf="isEmailRequested() && isEmailMissing(identity)"><b>{{ 
getEmailDescription() }}</b></li>
@@ -154,7 +154,7 @@
               *ngFor="let attribute of getIdentityAttributes(identity)">
               <div class="col-sm">
                 <span *ngIf="isClaimRequested(identity, attribute)"
-                  class="fa fa-openid 
mr-1"></span><b>{{getAttributeDescription(attribute)}}</b>
+                  class="fa fa-share-alt 
mr-1"></span><b>{{getAttributeDescription(attribute)}}</b>
               </div>
               <div class="col-sm">
                 <div *ngIf="getAttributeValue(identity, attribute).length <= 
20" style="min-width: 15em">
@@ -181,7 +181,7 @@
       <button [disabled]="!isClientVerified()" 
(click)="loginIdentity(identity)"
         class="btn btn-primary mr-1 openid-login">
         <span *ngIf="isClientVerified()">{{ 
getMessage("identity_list_html@shareInfo1") }} <i
-            class="fa fa-openid text-primary"></i> {{ 
getMessage("identity_list_html@shareInfo2") }}</span>
+            class="fa fa-share-alt text-primary"></i> {{ 
getMessage("identity_list_html@shareInfo2") }}</span>
         <span *ngIf="!isClientVerified()"><i class="fa 
fa-exclamation-circle"></i>
           {{ getMessage("identity_list_html@sharingDisabled") }}</span>
       </button>
diff --git a/src/locales/de/messages.json b/src/locales/de/messages.json
index 2cd94b1..f42b7a5 100644
--- a/src/locales/de/messages.json
+++ b/src/locales/de/messages.json
@@ -52,13 +52,14 @@
     "edit_credentials_ts@errorWrongAddress": "Ein Fehler ist aufgetreten - Der 
Grund könnte eine falsche E-Email Adresse sein.",
     "edit_identity_html@basicInfo": "Gebräuchliche Informationen",
     "edit_identity_html@addAttributes": "Neue Attribute hinzufügen",
-    "edit_identity_html@addStandardClaim": "Gebräuchliche, standardisierte 
Attribute:",
+    "edit_identity_html@addStandardClaim": "Fehlende gebräuchliche, 
standardisierte Attribute:",
     "edit_identity_html@addCustomClaim": "Benutzerdefinierte Attribute:",
     "edit_identity_html@addRequestedMissingClaim": "Angefragte, aber fehlende 
Attribute:",
     "edit_identity_html@importInfo": "Deine E-Mail-Addresse deutet darauf hin, 
dass Du Attribute eines externen Kontos bei ``{{ISSUERNAME}}´´ importieren 
kannst.",
     "edit_identity_html@linkAccount": "Attribute importieren",
     "edit_identity_html@credentialRequired": "Dieses Attribut benötigt eine 
Attestierung aber Du hast noch keine.",
     "edit_identity_html@standardScopes": "Die unten stehenden Attribute 
entsprechen den standard \"scopes\" von OpenID Connect:\n``profile'', 
``email'', ``phone'' and ``address''.",
+    "edit_identity_html@infoMissingClaims": "Die Website hat die folgenden 
Attribute angefragt. Du bist nicht verpflichtet diese Attribute 
bereitzustellen. Die Webseite könnte jedoch die Informationen im Rahmen einer 
Dienstleistung benötigen.",
     "edit_identity_html@selfissued": "Selbst ausgestellt",
     "edit_identity_html@importFrom": "Von ``{{ISSUERNAME}}´´ importieren",
     "edit_identity_html@unset": "Nicht gesetzt",
diff --git a/src/locales/en/messages.json b/src/locales/en/messages.json
index b93d032..1a30fcb 100644
--- a/src/locales/en/messages.json
+++ b/src/locales/en/messages.json
@@ -52,13 +52,14 @@
     "edit_credentials_ts@errorWrongAddress": "An Error has occured - This may 
have been caused by a wrong e-mail address.",
     "edit_identity_html@basicInfo": "Basic user information",
     "edit_identity_html@addAttributes": "Add new attributes",
-    "edit_identity_html@addStandardClaim": "Common, standardized attributes:",
+    "edit_identity_html@addStandardClaim": "Missing common, standardized 
attributes:",
     "edit_identity_html@addCustomClaim": "Custom attributes:",
     "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@infoMissingClaims": "The website requests the 
following attributes. You may provide any of the requested attributes but are 
not required to. The website may require the attributes in the scope of its 
service offering.",
     "edit_identity_html@selfissued": "Self-issued",
     "edit_identity_html@importFrom": "Try import from ``{{ISSUERNAME}}´´",
     "edit_identity_html@unset": "Unset",

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