gnunet-svn
[Top][All Lists]
Advanced

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

[reclaim-ui] 399/459: update


From: gnunet
Subject: [reclaim-ui] 399/459: update
Date: Fri, 11 Jun 2021 23:28:11 +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 b026ffafc11124540df1b11b2db620660a861f37
Author: Martin Schanzenbach <schanzen@gnunet.org>
AuthorDate: Fri Jan 1 16:20:47 2021 +0900

    update
---
 package.json                                       |   2 +-
 src/app/edit-identity/edit-identity.component.html | 400 +++++++++++----------
 src/app/edit-identity/edit-identity.component.ts   |  16 +-
 src/locales/de/messages.json                       |   8 +-
 src/locales/en/messages.json                       |   8 +-
 src/styles.scss                                    |   2 +-
 yarn.lock                                          |  10 +-
 7 files changed, 238 insertions(+), 208 deletions(-)

diff --git a/package.json b/package.json
index d9812b0..2dd4804 100644
--- a/package.json
+++ b/package.json
@@ -28,7 +28,7 @@
     "angular-oauth2-oidc": "^10.0.0",
     "bootstrap": "^4.4.1",
     "core-js": "^3.5",
-    "font-awesome": "^4.7.0",
+    "@fortawesome/fontawesome-free": "^5.15.0",
     "i18next": "^19.8.2",
     "jquery": ">=3.4.0",
     "popper.js": "^1.16.0",
diff --git a/src/app/edit-identity/edit-identity.component.html 
b/src/app/edit-identity/edit-identity.component.html
index 4e0f281..b20916d 100644
--- a/src/app/edit-identity/edit-identity.component.html
+++ b/src/app/edit-identity/edit-identity.component.html
@@ -7,33 +7,65 @@
   </div>
 
   <div class="card-body" *ngIf="importInProgress && 
attributesToOverwriteOnImport.length > 0">
-      <div class="alert alert-warning">{{ 
getMessage("edit_identity_html@importOverwriteInfo") }}</div>
-      <div *ngFor="let overwriteInfo of attributesToOverwriteOnImport" 
style="margin: 1em" (click)="overwriteInfo[1] = !overwriteInfo[1]">
-        <i [className]="overwriteInfo[1] ? 'fa fa-toggle-on mr-2 text-primary' 
: 'fa fa-toggle-off mr-2'"></i>
-        <b>{{ getDescription(overwriteInfo[0]) }}</b>
-        <span [className]="!overwriteInfo[1] ? 'ml-4 text-primary' : 
'text-secondary ml-4'">{{ 
getAttrValue(getAttributeByName(overwriteInfo[0].name)) }}</span> <i 
class="ml-1" 
*ngIf="isClaimCred(getAttributeByName(overwriteInfo[0].name))">({{getMessage("attested")}})</i>
  <i class="fa fa-arrow-right mr-2 ml-2"></i> <span 
[className]="overwriteInfo[1] ? 'text-primary' : 'text-secondary'">{{ 
getAttrValue(overwriteInfo[0]) }}</span> <i class="ml-1" 
*ngIf="isClaimCred(overwriteInfo[0])">({{ [...]
+    <div class="alert alert-warning">{{ 
getMessage("edit_identity_html@importOverwriteInfo") }}</div>
+    <div class="table">
+      <div class="row">
+        <div class="col-sm">
+          <b>{{ getMessage("Name") }}</b>
+        </div>
+        <div class="col-sm">
+          <b>{{ getMessage("edit_identity_html@currentAttribute")}}</b>
+        </div>
+        <div class="col-sm">
+          <b>{{ getMessage("edit_identity_html@newAttribute")}}</b>
+        </div>
       </div>
-      <button class="ml-1 btn btn-primary"
-           (click)="toggleAllOverwriteInfo()">
-        <b *ngIf="!allSetToOverride()">{{ getMessage("selectAll") }}</b>
-        <b *ngIf="allSetToOverride()">{{ getMessage("deselectAll") }}</b>
-      </button><br/>
-      <button class="ml-1 btn btn-primary" (click)="proceedAttributeImport()">
-        <span class="fa fa-download"></span> {{getMessage("import") }}
-      </button>
-      <button class="ml-1 btn btn-primary" (click)="abortAttributeImport()">
-        <span class="fa fa-download"></span> {{getMessage("Back") }}
-      </button>
+      <div class="row" *ngFor="let overwriteInfo of 
attributesToOverwriteOnImport">
+        <div class="col-sm">
+          {{ getDescription(overwriteInfo[0]) }}
+        </div>
+        <div class="col-sm" (click)="overwriteInfo[1] = false">
+          <i [className]="!overwriteInfo[1] ? 'far fa-check-circle mr-2 
text-primary' : 'far fa-circle mr-2'"></i>
+          <span [className]="!overwriteInfo[1] ? 'text-primary' : 
'text-secondary'">{{ getAttrValue(getAttributeByName(overwriteInfo[0].name)) 
}}</span> <i class="ml-1" 
*ngIf="isClaimCred(getAttributeByName(overwriteInfo[0].name))">({{getMessage("attested")}})</i>
+        </div>
+        <div class="col-sm" (click)="overwriteInfo[1] = true">
+          <i [className]="overwriteInfo[1] ? 'far fa-check-circle mr-2 
text-primary' : 'far fa-circle mr-2'"></i>
+          <span [className]="overwriteInfo[1] ? 'text-primary' : 
'text-secondary'">{{ getAttrValue(overwriteInfo[0]) }}</span> <i class="ml-1" 
*ngIf="isClaimCred(overwriteInfo[0])">({{getMessage("attested")}})</i>
+        </div>
+      </div>
+    </div>
+    <div class="row">
+      <div class="col-sm">
+      </div>
+      <div class="col-sm">
+        <button class="ml-1 btn btn-primary"
+            (click)="setAllOverwriteInfo(false)">
+              <b>{{ getMessage("keepAll") }}</b>
+        </button>
+      </div>
+      <div class="col-sm">
+        <button class="ml-1 btn btn-primary"
+            (click)="setAllOverwriteInfo(true)">
+          <b>{{ getMessage("overwriteAll") }}</b>
+        </button>
+      </div>
+    </div>
+    <button class="ml-1 btn btn-primary" (click)="proceedAttributeImport()">
+      <span class="fa fa-download"></span> {{getMessage("import") }}
+    </button>
+    <button class="ml-1 btn btn-primary" (click)="abortAttributeImport()">
+      <span class="fa fa-download"></span> {{getMessage("Back") }}
+    </button>
   </div>
   <div class="text-center card-body" *ngIf="importInProgress && 
attributesToOverwriteOnImport.length == 0">
     <div class="text-center fa fa-4x">
-      <i *ngIf="attributesToOverwriteOnImport.length == 0" class="fa fa-cog 
fa-spin"></i>
+      <i *ngIf="attributesToOverwriteOnImport.length == 0" class="fa 
fa-spinner fa-spin"></i>
     </div>
   </div>
   <div *ngIf="validImportEmail && !importInProgress" class="col-sm alert 
alert-primary alert-dismissible fade show my-2" role="alert" >
     {{getMessage("edit_identity_html@importInfo", {ISSUERNAME: 
getImportIssuerName()})}}<br/>
-              
<i>{{getMessage("Note")}}</i>{{getMessage("edit_credentials_html@linkAccountInfo2")}}
-              <br/>
+    
<i>{{getMessage("Note")}}</i>{{getMessage("edit_credentials_html@linkAccountInfo2")}}
+    <br/>
     <button class="ml-1 btn btn-primary" (click)="import()">
       <span class="fa fa-download"></span> 
{{getMessage("edit_identity_html@importFrom", {ISSUERNAME: 
getImportIssuerName()})}}
     </button>
@@ -48,204 +80,204 @@
         {{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">
+        <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.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" *ngIf="getMissingClaims() == 0">
-        <!-- Add standard attribute -->
-        <div class="row mb-3"
-             [class.alert-danger]="isInConflict(newStandardAttribute)">
-          <div class="col-sm">
-            <select class="custom-select"
-              [(ngModel)]="newStandardAttribute.name"
-              (change)="newStandardAttribute.name=$event.target.value">
-              <option value="" >{{ 
getMessage("edit_identity_html@selectAttribute") }}</option>
-              <option *ngFor="let claim of getMissingStandardClaims()" 
value={{claim.name}}>
+                      [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(newStandardAttribute)" 
placeholder="{{ getMessage('Value') }}" 
[(ngModel)]="newStandardAttribute.value">
-              <select class="custom-select"
-                *ngIf="newStandardAttribute.credential !== '' && 
isClaimCred(newStandardAttribute)" 
(change)="newStandardAttribute.value=$event.target.value">
-                <option value="" >{{ 
getMessage("edit_identity_html@selectClaim") }}</option>
-                <option *ngFor="let claim of 
credentialValuesForClaim(newStandardAttribute)" value={{claim.name}}>
-                {{claim.value}} <i>({{claim.name}})</i>
-                </option>
-              </select>
-            </div>
-            <div style="float:right;" *ngIf="credentials.length > 0">
-              <select class="custom-select"
-                [(ngModel)]="newStandardAttribute.credential"
-                (change)="newStandardAttribute.credential=$event.target.value; 
newStandardAttribute.flag = ($event.target.value == '') ? '0' : '1'" >
-                <option [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(newStandardAttribute)" 
class="btn btn-primary"  (click)="saveAttribute(newStandardAttribute)">
-              <span class="fa fa-plus"></span>
-            </button>
-          </div>
-        </div>
-      </div>
-      <p class="mb-2"> {{getMessage("edit_identity_html@addCustomClaim")}}</p>
-      <div class="table pb-1">
-        <!-- Add custom attribute -->
-
-          <div class="row mb-3"
-               [class.alert-danger]="isInConflict(newAttribute)">
-            <div class="col-sm">
-              <input [class.text-danger]="!attributeNameValid(newAttribute)" 
placeholder="{{ getMessage('edit_identity_html@name') }}" 
[(ngModel)]="newAttribute.name">
-            </div>
             <div class="col-sm" style="display:flex;">
               <div style="flex:1;">
-                <input *ngIf="!isClaimCred(newAttribute)" placeholder="{{ 
getMessage('Value') }}" [(ngModel)]="newAttribute.value">
+                <input *ngIf="!isClaimCred(newRequestedAttribute) && 
!isClaimCredentialRequested(newRequestedAttribute)"
+                   placeholder="{{ getMessage('Value') }}" 
[(ngModel)]="newRequestedAttribute.value">
                 <select class="custom-select"
-                  *ngIf="newAttribute.credential !== '' && 
isClaimCred(newAttribute)" (change)="newAttribute.value=$event.target.value">
-                  <option value="" >{{ 
getMessage("edit_identity_html@selectClaim") }}</option>
-                  <option *ngFor="let claim of 
credentialValuesForClaim(newAttribute)" value={{claim.name}}>
+                        
*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)]="newAttribute.credential"
-                  (change)="newAttribute.credential=$event.target.value; 
newAttribute.flag = ($event.target.value == '') ? '0' : '1'" >
-                  <option [value]="getZeroId()">{{ 
getMessage("edit_identity_html@selfissued") }}</option>
-                  <option *ngFor="let cred of credentials" value={{cred.id}}>
-                  {{getIssuerName(cred)}}
-                  </option>
+                        [(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(newAttribute)" class="btn 
btn-primary"  (click)="saveAttribute(newAttribute)">
+              <button [disabled]="!canAddAttribute(newRequestedAttribute)" 
class="btn btn-primary"  (click)="saveAttribute(newRequestedAttribute)">
                 <span class="fa fa-plus"></span>
               </button>
             </div>
           </div>
+        </div>
 
-      </div>
-
-      <hr >
-      <!-- All existing attributes -->
-      <div *ngIf="attributes.length == 0"
-        class="alert alert-primary">
-        {{ getMessage('identity_list_html@noAttributes1') }}
-      </div>
-      <h3 *ngIf="attributes.length > 0"
-        class="card-subtitle mb-4"> 
{{getMessage("edit_identity_html@storedAttributes")}}</h3>
-      <div *ngIf="attributes.length > 0"
-        class="table pb-1">
-          <div class="row mb-3" [class.openid]="inOpenIdFlow()"
-              [class.inEdit]="claim == claimInEdit"
-              [class.text-primary]="isClaimRequested(claim)"
-              [class.alert-danger]="newAttribute.name === claim.name"
-              *ngFor="let claim of attributes">
-            <div class="col-sm">
-                <i *ngIf="isClaimRequested(claim)" class="fa 
fa-openid"></i><b> {{ getDescription(claim) }}</b>
-            </div>
-            <div class="col-sm" style="display:flex;">
-              <div style="flex:1;" *ngIf="claim == claimInEdit">
-                <input *ngIf="!isClaimCred(claim)" placeholder="{{ 
getMessage('Value') }}" [(ngModel)]="claim.value">
+        <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" *ngIf="getMissingClaims() == 0">
+            <!-- Add standard attribute -->
+            <div class="row mb-3"
+                 [class.alert-danger]="isInConflict(newStandardAttribute)">
+              <div class="col-sm">
                 <select class="custom-select"
-                  [(ngModel)]="claim.value"
-                  *ngIf="claim.credential !== '' && isClaimCred(claim)" 
(change)="credentialClaimSelected(claim, $event.target.value)">
-                  <option value="" >{{ 
getMessage("edit_identity_html@selectClaim") }}</option>
-                  <option *ngFor="let cred of credentialValuesForClaim(claim)" 
value={{cred.name}}>
-                  {{cred.value}} <i>({{cred.name}})</i>
+                        [(ngModel)]="newStandardAttribute.name"
+                        
(change)="newStandardAttribute.name=$event.target.value">
+                  <option value="" >{{ 
getMessage("edit_identity_html@selectAttribute") }}</option>
+                  <option *ngFor="let claim of getMissingStandardClaims()" 
value={{claim.name}}>
+                  {{getDescription(claim)}}
                   </option>
                 </select>
               </div>
-              <div style="flex:1;" *ngIf="claim != claimInEdit">
-                <span *ngIf="!isClaimCred(claim) && (claim != claimInEdit)">{{ 
claim.value }} <i class="text-secondary" style="float:right;"><i class="fa 
fa-certificate"></i> {{ getMessage("edit_identity_html@selfissued") 
}}</i></span>
-                <span *ngIf="isClaimCred(claim) && (claim != claimInEdit)"  
>{{ getCredValue(claim) }} <i class="text-primary" style="float:right;"><i 
class="fa fa-certificate"></i> {{ getIssuerNameForAttribute(claim) }}</i></span>
+              <div class="col-sm" style="display:flex;">
+                <div style="flex:1;">
+                  <input *ngIf="!isClaimCred(newStandardAttribute)" 
placeholder="{{ getMessage('Value') }}" 
[(ngModel)]="newStandardAttribute.value">
+                  <select class="custom-select"
+                          *ngIf="newStandardAttribute.credential !== '' && 
isClaimCred(newStandardAttribute)" 
(change)="newStandardAttribute.value=$event.target.value">
+                    <option value="" >{{ 
getMessage("edit_identity_html@selectClaim") }}</option>
+                    <option *ngFor="let claim of 
credentialValuesForClaim(newStandardAttribute)" value={{claim.name}}>
+                    {{claim.value}} <i>({{claim.name}})</i>
+                    </option>
+                  </select>
+                </div>
+                <div style="float:right;" *ngIf="credentials.length > 0">
+                  <select class="custom-select"
+                          [(ngModel)]="newStandardAttribute.credential"
+                          
(change)="newStandardAttribute.credential=$event.target.value; 
newStandardAttribute.flag = ($event.target.value == '') ? '0' : '1'" >
+                          <option [value]="getZeroId()">{{ 
getMessage("edit_identity_html@selfissued") }}</option>
+                          <option *ngFor="let cred of credentials" 
value={{cred.id}}>
+                          {{getIssuerName(cred)}}
+                          </option>
+                  </select>
+                </div>
               </div>
-              <div *ngIf="claim == claimInEdit" style="float:right;">
-                <select class="custom-select"
-                  [(ngModel)]="claim.credential"
-                  (change)="credentialSelected(claim, $event.target.value);">
-                  <option [value]="getZeroId()">{{ 
getMessage("edit_identity_html@selfissued") }}</option>
-                  <option *ngFor="let cred of credentials" [value]="cred.id">
-                  {{getIssuerName(cred)}}
-                  </option>
-                </select>
+              <div class="col-sm">
+                <button [disabled]="!canAddAttribute(newStandardAttribute)" 
class="btn btn-primary"  (click)="saveAttribute(newStandardAttribute)">
+                  <span class="fa fa-plus"></span>
+                </button>
               </div>
             </div>
-            <div class="col-sm">
-              <button *ngIf="claim == claimInEdit" 
[disabled]="!canUpdateAttribute(claim)" class="btn btn-primary"  
(click)="saveAttribute(claim)">
-                <span class="fa fa-save"></span>
-              </button>
-              <button class="btn btn-primary" (click)="editAttribute(claim)" 
*ngIf="claim != claimInEdit">
-                <span class="fa fa-edit"></span>
-              </button>
-              <button class="ml-2 btn btn-primary"  
(click)="deleteAttribute(claim)">
-                <span class="fa fa-trash"></span>
-              </button>
+          </div>
+          <p class="mb-2"> 
{{getMessage("edit_identity_html@addCustomClaim")}}</p>
+          <div class="table pb-1">
+            <!-- Add custom attribute -->
+
+            <div class="row mb-3"
+                 [class.alert-danger]="isInConflict(newAttribute)">
+              <div class="col-sm">
+                <input [class.text-danger]="!attributeNameValid(newAttribute)" 
placeholder="{{ getMessage('edit_identity_html@name') }}" 
[(ngModel)]="newAttribute.name">
+              </div>
+              <div class="col-sm" style="display:flex;">
+                <div style="flex:1;">
+                  <input *ngIf="!isClaimCred(newAttribute)" placeholder="{{ 
getMessage('Value') }}" [(ngModel)]="newAttribute.value">
+                  <select class="custom-select"
+                          *ngIf="newAttribute.credential !== '' && 
isClaimCred(newAttribute)" (change)="newAttribute.value=$event.target.value">
+                    <option value="" >{{ 
getMessage("edit_identity_html@selectClaim") }}</option>
+                    <option *ngFor="let claim of 
credentialValuesForClaim(newAttribute)" value={{claim.name}}>
+                    {{claim.value}} <i>({{claim.name}})</i>
+                    </option>
+                  </select>
+                </div>
+                <div style="float:right;" *ngIf="credentials.length > 0">
+                  <select class="custom-select"
+                          [(ngModel)]="newAttribute.credential"
+                          
(change)="newAttribute.credential=$event.target.value; newAttribute.flag = 
($event.target.value == '') ? '0' : '1'" >
+                          <option [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(newAttribute)" class="btn 
btn-primary"  (click)="saveAttribute(newAttribute)">
+                  <span class="fa fa-plus"></span>
+                </button>
+              </div>
+            </div>
+
+          </div>
+
+          <hr >
+          <!-- All existing attributes -->
+          <div *ngIf="attributes.length == 0"
+                        class="alert alert-primary">
+            {{ getMessage('identity_list_html@noAttributes1') }}
+          </div>
+          <h3 *ngIf="attributes.length > 0"
+                        class="card-subtitle mb-4"> 
{{getMessage("edit_identity_html@storedAttributes")}}</h3>
+          <div *ngIf="attributes.length > 0"
+                        class="table pb-1">
+            <div class="row mb-3" [class.openid]="inOpenIdFlow()"
+                 [class.inEdit]="claim == claimInEdit"
+                 [class.text-primary]="isClaimRequested(claim)"
+                 [class.alert-danger]="newAttribute.name === claim.name"
+                 *ngFor="let claim of attributes">
+              <div class="col-sm">
+                <i *ngIf="isClaimRequested(claim)" class="fa 
fa-openid"></i><b> {{ getDescription(claim) }}</b>
+              </div>
+              <div class="col-sm" style="display:flex;">
+                <div style="flex:1;" *ngIf="claim == claimInEdit">
+                  <input *ngIf="!isClaimCred(claim)" placeholder="{{ 
getMessage('Value') }}" [(ngModel)]="claim.value">
+                  <select class="custom-select"
+                          [(ngModel)]="claim.value"
+                          *ngIf="claim.credential !== '' && 
isClaimCred(claim)" (change)="credentialClaimSelected(claim, 
$event.target.value)">
+                    <option value="" >{{ 
getMessage("edit_identity_html@selectClaim") }}</option>
+                    <option *ngFor="let cred of 
credentialValuesForClaim(claim)" value={{cred.name}}>
+                    {{cred.value}} <i>({{cred.name}})</i>
+                    </option>
+                  </select>
+                </div>
+                <div style="flex:1;" *ngIf="claim != claimInEdit">
+                  <span *ngIf="!isClaimCred(claim) && (claim != 
claimInEdit)">{{ claim.value }} <i class="text-secondary" 
style="float:right;"><i class="fa fa-certificate"></i> {{ 
getMessage("edit_identity_html@selfissued") }}</i></span>
+                  <span *ngIf="isClaimCred(claim) && (claim != claimInEdit)"  
>{{ getCredValue(claim) }} <i class="text-primary" style="float:right;"><i 
class="fa fa-certificate"></i> {{ getIssuerNameForAttribute(claim) }}</i></span>
+                </div>
+                <div *ngIf="claim == claimInEdit" style="float:right;">
+                  <select class="custom-select"
+                          [(ngModel)]="claim.credential"
+                          (change)="credentialSelected(claim, 
$event.target.value);">
+                    <option [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 *ngIf="claim == claimInEdit" 
[disabled]="!canUpdateAttribute(claim)" class="btn btn-primary"  
(click)="saveAttribute(claim)">
+                  <span class="fa fa-save"></span>
+                </button>
+                <button class="btn btn-primary" (click)="editAttribute(claim)" 
*ngIf="claim != claimInEdit">
+                  <span class="fa fa-edit"></span>
+                </button>
+                <button class="ml-2 btn btn-primary"  
(click)="deleteAttribute(claim)">
+                  <span class="fa fa-trash"></span>
+                </button>
 
+              </div>
             </div>
           </div>
-      </div>
     </div>
     <!-- Attribute creation warning -->
     <div *ngIf="!attributeNameValid(newAttribute) || 
!attributeValueValid(newAttribute)" class="alert alert-primary 
alert-dismissible fade show" role="alert">
diff --git a/src/app/edit-identity/edit-identity.component.ts 
b/src/app/edit-identity/edit-identity.component.ts
index 32d7013..f221e19 100644
--- a/src/app/edit-identity/edit-identity.component.ts
+++ b/src/app/edit-identity/edit-identity.component.ts
@@ -584,6 +584,7 @@ export class EditIdentityComponent implements OnInit {
 
   tryImportCredential() {
     if (this.importIdProvider.url === '') {
+      this.importInProgress = false;
       return;
     }
     const loginOptions: LoginOptions = {
@@ -666,22 +667,12 @@ export class EditIdentityComponent implements OnInit {
 
   }
 
-  toggleAllOverwriteInfo() {
-    let target = !this.allSetToOverride();
+  setAllOverwriteInfo(target: boolean) {
     for (let overwriteInfo of this.attributesToOverwriteOnImport) {
       overwriteInfo[1] = target;
     }
   }
 
-  allSetToOverride() {
-    for (let overwriteInfo of this.attributesToOverwriteOnImport) {
-      if (!overwriteInfo[1]) {
-        return false;
-      }
-    }
-    return true;
-  }
-
   getAttrValue(attr: Attribute) {
     if (attr.credential === this.getZeroId()) {
       return attr.value;
@@ -752,6 +743,7 @@ export class EditIdentityComponent implements OnInit {
 
   private validateEmailForImport() {
     var emailAddr = null;
+    this.importInProgress = false;
     for (let attr of this.attributes) {
       if (attr.name !== 'email') {
         continue;
@@ -769,6 +761,7 @@ export class EditIdentityComponent implements OnInit {
       this.validImportEmail = false;
       return;
     }
+    this.importInProgress = true;
     this.discoverIdProvider(emailAddr);
   }
 
@@ -792,6 +785,7 @@ export class EditIdentityComponent implements OnInit {
                                              this.tryImportCredential();
     },
     error => {
+      this.importInProgress = false;
       this.validImportEmail = false;
       console.log (error);
     });
diff --git a/src/locales/de/messages.json b/src/locales/de/messages.json
index 57b13e2..71d089e 100644
--- a/src/locales/de/messages.json
+++ b/src/locales/de/messages.json
@@ -10,8 +10,8 @@
     "Save": "Speichern",
     "Note": "Hinweis: ",
     "Value": "Wert",
-    "selectAll": "Alles auswählen",
-    "deselectAll": "Alles abwählen",
+    "keepAll": "Alle behalten",
+    "overwriteAll": "Alle überschreiben",
     "import": "Importieren",
     "attested": "attestiert",
     "authorization_request_html@personalInfo": "Persönliche Datenabfrage",
@@ -54,6 +54,8 @@
     "edit_credentials_ts@noAccount": "Kein Konto mit diese E-Email Addresse 
gefunden",
     "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@currentAttribute": "Momentane attributes",
+    "edit_identity_html@newAttribute": "Neue Attribute",
     "edit_identity_html@importOverwriteInfo": "Du hast einige der zu 
importierenden Attribute bereits gesetzt. Wähle unten diejenigen Attribute aus, 
welche mit den neuen, importierten Werten überschrieben werden sollen.",
     "edit_identity_html@addAttributes": "Neue Attribute hinzufügen",
     "edit_identity_html@addStandardClaim": "Fehlende gebräuchliche, 
standardisierte Attribute:",
@@ -94,7 +96,7 @@
     "identity_list_html@verifyDelete": "Willst du diese Identität wirklich 
löschen?",
     "identity_list_html@noAttributes1": "Diese Identität hat keine Attribute.",
     "identity_list_html@noAttributes2": "Füge welche hinzu?",
-    "identity_list_html@missingInformation": "Dieser Identität fehlen einige 
angefragte Attribute:",
+    "identity_list_html@missingInformation": "Dieser Identität fehlen einige 
Attribute:",
     "identity_list_html@essential": "benötigt",
     "identity_list_html@editId": "Identität ändern",
     "identity_list_html@moreAttributes": "… und {{ATTRIBUTENUMBER}} weitere 
Attribute",
diff --git a/src/locales/en/messages.json b/src/locales/en/messages.json
index d214bb5..21ca678 100644
--- a/src/locales/en/messages.json
+++ b/src/locales/en/messages.json
@@ -10,8 +10,8 @@
     "Save": "Save",
     "Note": "Note: ",
     "Value": "Value",
-    "selectAll": "Select all",
-    "deselectAll": "Deselect all",
+    "keepAll": "Keep all",
+    "overwriteAll": "Overwrite all",
     "import": "Import",
     "attested": "attested",
     "authorization_request_html@personalInfo": "Personal information request",
@@ -54,6 +54,8 @@
     "edit_credentials_ts@noAccount": "No account found with this email",
     "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@currentAttribute": "Current attributes",
+    "edit_identity_html@newAttribute": "Attributes to import",
     "edit_identity_html@importOverwriteInfo": "You already have set some of 
the attributes to be imported. Select below those attributes which you want to 
overwrite with the new, imported values.",
     "edit_identity_html@addAttributes": "Add new attributes",
     "edit_identity_html@addStandardClaim": "Missing common, standardized 
attributes:",
@@ -94,7 +96,7 @@
     "identity_list_html@verifyDelete": "Do you really want to delete this 
identity?",
     "identity_list_html@noAttributes1": "This identity has no attributes.",
     "identity_list_html@noAttributes2": "Maybe try adding some?",
-    "identity_list_html@missingInformation": "This identity is missing some 
essential information:",
+    "identity_list_html@missingInformation": "This identity is missing some 
information:",
     "identity_list_html@essential": "essential",
     "identity_list_html@editId": "Edit identity",
     "identity_list_html@moreAttributes": "… and {{ATTRIBUTENUMBER}} more 
attributes",
diff --git a/src/styles.scss b/src/styles.scss
index 898a963..da45fee 100644
--- a/src/styles.scss
+++ b/src/styles.scss
@@ -1,6 +1,6 @@
 @import "node_modules/bootstrap/scss/bootstrap";
 /*$fa-font-path: "../node_modules/font-awesome/fonts";*/
-@import "node_modules/font-awesome/scss/font-awesome.scss";
+@import "../node_modules/@fortawesome/fontawesome-free/css/all.css";
 @import "app/modal.scss";
 
 html {
diff --git a/yarn.lock b/yarn.lock
index bdc7ab0..8c44c0d 100644
--- a/yarn.lock
+++ b/yarn.lock
@@ -1078,6 +1078,11 @@
     lodash "^4.17.19"
     to-fast-properties "^2.0.0"
 
+"@fortawesome/fontawesome-free@^5.15.0":
+  version "5.15.1"
+  resolved 
"https://registry.yarnpkg.com/@fortawesome/fontawesome-free/-/fontawesome-free-5.15.1.tgz#ccfef6ddbe59f8fe8f694783e1d3eb88902dc5eb";
+  integrity 
sha512-OEdH7SyC1suTdhBGW91/zBfR6qaIhThbcN8PUXtXilY4GYnSBbVqOntdHbC1vXwsDnX0Qix2m2+DSU1J51ybOQ==
+
 "@istanbuljs/schema@^0.1.2":
   version "0.1.2"
   resolved 
"https://registry.yarnpkg.com/@istanbuljs/schema/-/schema-0.1.2.tgz#26520bf09abe4a5644cd5414e37125a8954241dd";
@@ -3822,11 +3827,6 @@ follow-redirects@^1.0.0:
   resolved 
"https://registry.yarnpkg.com/follow-redirects/-/follow-redirects-1.13.1.tgz#5f69b813376cee4fd0474a3aba835df04ab763b7";
   integrity 
sha512-SSG5xmZh1mkPGyKzjZP8zLjltIfpW32Y5QpdNJyjcfGxK3qo3NDDkZOZSFiGn1A6SclQxY9GzEwAHQ3dmYRWpg==
 
-font-awesome@^4.7.0:
-  version "4.7.0"
-  resolved 
"https://registry.yarnpkg.com/font-awesome/-/font-awesome-4.7.0.tgz#8fa8cf0411a1a31afd07b06d2902bb9fc815a133";
-  integrity sha1-j6jPBBGhoxr9B7BtKQK7n8gVoTM=
-
 for-in@^1.0.2:
   version "1.0.2"
   resolved 
"https://registry.yarnpkg.com/for-in/-/for-in-1.0.2.tgz#81068d295a8142ec0ac726c6e2200c30fb6d5e80";

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