[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[reclaim-ui] 380/459: quality of life improvements
From: |
gnunet |
Subject: |
[reclaim-ui] 380/459: quality of life improvements |
Date: |
Fri, 11 Jun 2021 23:27:52 +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 2ff5aa71f4e0d8560dcc0549501ddcdc502da720
Author: Martin Schanzenbach <schanzen@gnunet.org>
AuthorDate: Sat Dec 26 21:20:49 2020 +0900
quality of life improvements
---
src/app/edit-identity/edit-identity.component.html | 128 ++++++++++++---------
src/app/edit-identity/edit-identity.component.ts | 15 ++-
.../import-attributes.component.html | 7 +-
.../import-attributes.component.ts | 16 ++-
4 files changed, 109 insertions(+), 57 deletions(-)
diff --git a/src/app/edit-identity/edit-identity.component.html
b/src/app/edit-identity/edit-identity.component.html
index f62b710..aa7414c 100644
--- a/src/app/edit-identity/edit-identity.component.html
+++ b/src/app/edit-identity/edit-identity.component.html
@@ -29,7 +29,7 @@
<div class="table pb-1">
<!-- Standard "profile" claims first -->
<div class="row mb-3" [class.openid]="inOpenIdFlow()"
- [class.text-primary]="isClaimRequested(claim)"
+ [class.text-primary]="isClaimRequested(claim) || claim ==
claimInEdit"
[class.alert-danger]="newAttribute.name === claim.name"
*ngFor="let claim of existingProfileClaims">
<div class="col-sm"><div style="min-width: 15em">
@@ -37,76 +37,86 @@
</div>
</div>
<div class="col-sm">
- <input *ngIf="!isClaimCred(claim)" placeholder="{{
getMessage('Value') }}" [(ngModel)]="claim.value">
- <span *ngIf="isClaimCred(claim)"
>{{getMessage("edit_identity_html@claimAsAttribute", {CREDVALUE:
getCredValue(claim), ISSUER: getIssuer(claim), CLAIMVALUE: claim.value,
interpolation: { escapeValue: false } }) }}</span>
+ <input *ngIf="!isClaimCred(claim) && (claim == claimInEdit)"
placeholder="{{ getMessage('Value') }}" [(ngModel)]="claim.value">
+ <span *ngIf="!isClaimCred(claim) && (claim != claimInEdit)">{{
claim.value }} <i class="text-secondary" style="float:right;"><i class="fa
fa-certificate"></i> Self-issued</i></span>
+ <span *ngIf="isClaimCred(claim)" >{{ getCredValue(claim) }} <i
class="text-primary" style="float:right;"><i class="fa fa-certificate"></i> {{
getIssuer(claim) }}</i></span>
</div>
<div class="col-sm">
- <button class="btn btn-primary" (click)="deleteAttribute(claim)"
*ngIf="!isClaimCred(claim)">
+ <button class="btn btn-primary"
(click)="deleteAttribute(claim)">
<span class="fa fa-trash"></span>
</button>
- <button class="btn btn-primary"
(click)="deleteAttribute(claim)" *ngIf="isClaimCred(claim)">
- <span class="fa fa-trash"></span>
+ <button class="ml-1 btn btn-primary"
(click)="editAttribute(claim)" *ngIf="!isClaimCred(claim) && (claim !=
claimInEdit)">
+ <span class="fa fa-edit"></span>
</button>
</div>
</div>
<!-- Standard "profile" claims missing on the identity -->
<div class="row mb-3" [class.openid]="inOpenIdFlow()"
- [class.text-primary]="isClaimRequested(claim)"
+ [class.text-primary]="isClaimRequested(claim) || claim ==
claimInEdit"
[class.alert-danger]="newAttribute.name === claim.name"
*ngFor="let claim of missingProfileClaims">
<div class="col-sm"><div style="min-width: 15em">
<i *ngIf="isClaimRequested(claim)" class="fa
fa-openid"></i><b> {{ getDescription(claim) }}</b></div></div>
<div class="col-sm">
<!-- FIXME Allow adding of credential OR plain value -->
- <input placeholder="{{ getMessage('Value') }}"
[(ngModel)]="claim.value">
+ <input *ngIf="claim == claimInEdit" placeholder="{{
getMessage('Value') }}" [(ngModel)]="claim.value">
+ <span *ngIf="claim != claimInEdit"><i
class="text-secondary">Unset</i></span>
<!--<input *ngIf="!isClaimCred(claim)" placeholder="{{
getMessage('Value') }}" [(ngModel)]="claim.value">
<span *ngIf="isClaimCred(claim)" >{{ getCredValue(claim) }}
issued by <i>{{ getIssuer(claim) }}</i> as attribute for ``{{ claim.value
}}''</span>-->
</div>
<div class="col-sm">
- <button [disabled]="!canAddAttribute(claim)" class="btn
btn-primary" (click)="addAttribute()">
+ <button *ngIf="claim == claimInEdit"
[disabled]="!canAddAttribute(claim)" class="btn btn-primary"
(click)="addAttribute()">
<span class="fa fa-save"></span>
</button>
+ <button *ngIf="claim != claimInEdit" class="btn btn-primary"
(click)="editAttribute(claim)">
+ <span class="fa fa-plus"></span>
+ </button>
</div>
</div>
</div>
<div class="table pb-1">
<!-- Standard "email" claims first -->
<div class="row mb-3" [class.openid]="inOpenIdFlow()"
- [class.text-primary]="isClaimRequested(claim)"
+ [class.text-primary]="isClaimRequested(claim) || claim ==
claimInEdit"
[class.alert-danger]="newAttribute.name === claim.name"
*ngFor="let claim of existingEmailClaims">
<div class="col-sm"><div style="min-width: 15em">
<i *ngIf="isClaimRequested(claim)" class="fa
fa-openid"></i><b> {{ getDescription(claim) }}</b></div></div>
<div class="col-sm">
- <input *ngIf="!isClaimCred(claim)" placeholder="{{
getMessage('Value') }}" [(ngModel)]="claim.value">
- <span *ngIf="isClaimCred(claim)"
>{{getMessage("edit_identity_html@claimAsAttribute", {CREDVALUE:
getCredValue(claim), ISSUER: getIssuer(claim), CLAIMVALUE: claim.value,
interpolation: { escapeValue: false } }) }}</span>
+ <input *ngIf="!isClaimCred(claim) && (claim == claimInEdit)"
placeholder="{{ getMessage('Value') }}" [(ngModel)]="claim.value">
+ <span *ngIf="!isClaimCred(claim) && (claim != claimInEdit)">{{
claim.value }} <i class="text-secondary" style="float:right;"><i class="fa
fa-certificate"></i> Self-issued</i></span>
+ <span *ngIf="isClaimCred(claim)" >{{ getCredValue(claim) }} <i
class="text-primary" style="float:right;"><i class="fa fa-certificate"></i> {{
getIssuer(claim) }}</i></span>
</div>
<div class="col-sm">
- <button class="btn btn-primary" (click)="deleteAttribute(claim)"
*ngIf="!isClaimCred(claim)">
+ <button class="btn btn-primary"
(click)="deleteAttribute(claim)">
<span class="fa fa-trash"></span>
</button>
- <button class="btn btn-primary"
(click)="deleteAttribute(claim)" *ngIf="isClaimCred(claim)">
- <span class="fa fa-trash"></span>
+ <button class="ml-1 btn btn-primary"
(click)="editAttribute(claim)" *ngIf="!isClaimCred(claim) && (claim !=
claimInEdit)">
+ <span class="fa fa-edit"></span>
</button>
</div>
</div>
<!-- Standard "email" claims missing on the identity -->
<div class="row mb-3" [class.openid]="inOpenIdFlow()"
- [class.text-primary]="isClaimRequested(claim)"
+ [class.text-primary]="isClaimRequested(claim) || claim ==
claimInEdit"
[class.alert-danger]="newAttribute.name === claim.name"
*ngFor="let claim of missingEmailClaims">
<div class="col-sm"><div style="min-width: 15em">
<i *ngIf="isClaimRequested(claim)" class="fa
fa-openid"></i><b> {{ getDescription(claim) }}</b></div></div>
<div class="col-sm">
<!-- FIXME Allow adding of credential OR plain value -->
- <input placeholder="{{ getMessage('Value') }}"
[(ngModel)]="claim.value">
+ <input *ngIf="claim == claimInEdit" placeholder="{{
getMessage('Value') }}" [(ngModel)]="claim.value">
+ <span *ngIf="claim != claimInEdit"><i
class="text-secondary">Unset</i></span>
<!--<input *ngIf="!isClaimCred(claim)" placeholder="{{
getMessage('Value') }}" [(ngModel)]="claim.value">
<span *ngIf="isClaimCred(claim)" >{{ getCredValue(claim) }}
issued by <i>{{ getIssuer(claim) }}</i> as attribute for ``{{ claim.value
}}''</span>-->
</div>
<div class="col-sm">
- <button [disabled]="!canAddAttribute(claim)" class="btn
btn-primary" (click)="addAttribute()">
+ <button *ngIf="claim == claimInEdit"
[disabled]="!canAddAttribute(claim)" class="btn btn-primary"
(click)="addAttribute()">
<span class="fa fa-save"></span>
</button>
+ <button *ngIf="claim != claimInEdit" class="btn btn-primary"
(click)="editAttribute(claim)">
+ <span class="fa fa-plus"></span>
+ </button>
</div>
</div>
</div>
@@ -115,41 +125,47 @@
<div class="table pb-1">
<!-- Standard "address" claims first -->
<div class="row mb-3" [class.openid]="inOpenIdFlow()"
- [class.text-primary]="isClaimRequested(claim)"
+ [class.text-primary]="isClaimRequested(claim) || claim ==
claimInEdit"
[class.alert-danger]="newAttribute.name === claim.name"
*ngFor="let claim of existingAddressClaims">
<div class="col-sm"><div style="min-width: 15em">
<i *ngIf="isClaimRequested(claim)" class="fa
fa-openid"></i><b> {{ getDescription(claim) }}</b></div></div>
<div class="col-sm">
- <input *ngIf="!isClaimCred(claim)" placeholder="{{
getMessage('Value') }}" [(ngModel)]="claim.value">
- <span *ngIf="isClaimCred(claim)"
>{{getMessage("edit_identity_html@claimAsAttribute", { CREDVALUE:
getCredValue(claim), ISSUER: getIssuer(claim), CLAIMVALUE: claim.value,
interpolation: { escapeValue: false } }) }}</span>
+ <input *ngIf="!isClaimCred(claim) && (claim == claimInEdit)"
placeholder="{{ getMessage('Value') }}" [(ngModel)]="claim.value">
+ <span *ngIf="!isClaimCred(claim) && (claim != claimInEdit)">{{
claim.value }} <i class="text-secondary" style="float:right;"><i class="fa
fa-certificate"></i> Self-issued</i></span>
+ <span *ngIf="isClaimCred(claim)" >{{ getCredValue(claim) }} <i
class="text-primary" style="float:right;"><i class="fa fa-certificate"></i> {{
getIssuer(claim) }}</i></span>
</div>
<div class="col-sm">
- <button class="btn btn-primary" (click)="deleteAttribute(claim)"
*ngIf="!isClaimCred(claim)">
+ <button class="btn btn-primary"
(click)="deleteAttribute(claim)">
<span class="fa fa-trash"></span>
</button>
- <button class="btn btn-primary"
(click)="deleteAttribute(claim)" *ngIf="isClaimCred(claim)">
- <span class="fa fa-trash"></span>
+ <button class="ml-1 btn btn-primary"
(click)="editAttribute(claim)" *ngIf="!isClaimCred(claim) && (claim !=
claimInEdit)">
+ <span class="fa fa-edit"></span>
</button>
+
</div>
</div>
<!-- Standard "profile" claims missing on the identity -->
<div class="row mb-3" [class.openid]="inOpenIdFlow()"
- [class.text-primary]="isClaimRequested(claim)"
+ [class.text-primary]="isClaimRequested(claim) || claim ==
claimInEdit"
[class.alert-danger]="newAttribute.name === claim.name"
*ngFor="let claim of missingAddressClaims">
<div class="col-sm"><div style="min-width: 15em">
<i *ngIf="isClaimRequested(claim)" class="fa
fa-openid"></i><b> {{ getDescription(claim) }}</b></div></div>
<div class="col-sm">
<!-- FIXME Allow adding of credential OR plain value -->
- <input placeholder="{{ getMessage('Value') }}"
[(ngModel)]="claim.value">
+ <input *ngIf="claim == claimInEdit" placeholder="{{
getMessage('Value') }}" [(ngModel)]="claim.value">
+ <span *ngIf="claim != claimInEdit"><i
class="text-secondary">Unset</i></span>
<!--<input *ngIf="!isClaimCred(claim)" placeholder="{{
getMessage('Value') }}" [(ngModel)]="claim.value">
<span *ngIf="isClaimCred(claim)" >{{ getCredValue(claim) }}
issued by <i>{{ getIssuer(claim) }}</i> as attribute for ``{{ claim.value
}}''</span>-->
</div>
<div class="col-sm">
- <button [disabled]="!canAddAttribute(claim)" class="btn
btn-primary" (click)="addAttribute()">
+ <button *ngIf="claim == claimInEdit"
[disabled]="!canAddAttribute(claim)" class="btn btn-primary"
(click)="addAttribute()">
<span class="fa fa-save"></span>
</button>
+ <button *ngIf="claim != claimInEdit" class="btn btn-primary"
(click)="editAttribute(claim)">
+ <span class="fa fa-plus"></span>
+ </button>
</div>
</div>
</div>
@@ -157,49 +173,51 @@
<div class="table pb-1">
<!-- Standard "phone" claims first -->
<div class="row mb-3" [class.openid]="inOpenIdFlow()"
- [class.text-primary]="isClaimRequested(claim)"
+ [class.text-primary]="isClaimRequested(claim) || claim ==
claimInEdit"
[class.alert-danger]="newAttribute.name === claim.name"
*ngFor="let claim of existingPhoneClaims">
<div class="col-sm"><div style="min-width: 15em">
<i *ngIf="isClaimRequested(claim)" class="fa
fa-openid"></i><b> {{ getDescription(claim) }}</b></div></div>
<div class="col-sm">
- <input *ngIf="!isClaimCred(claim)" placeholder="{{
getMessage('Value') }}" [(ngModel)]="claim.value">
- <span *ngIf="isClaimCred(claim)"
>{{getMessage("edit_identity_html@claimAsAttribute", { CREDVALUE:
getCredValue(claim), ISSUER: getIssuer(claim), CLAIMVALUE: claim.value,
interpolation: { escapeValue: false } }) }}</span>
+ <input *ngIf="!isClaimCred(claim) && (claim == claimInEdit)"
placeholder="{{ getMessage('Value') }}" [(ngModel)]="claim.value">
+ <span *ngIf="!isClaimCred(claim) && (claim != claimInEdit)">{{
claim.value }} <i class="text-secondary" style="float:right;"><i class="fa
fa-certificate"></i> Self-issued</i></span>
+ <span *ngIf="isClaimCred(claim)" >{{ getCredValue(claim) }} <i
class="text-primary" style="float:right;"><i class="fa fa-certificate"></i> {{
getIssuer(claim) }}</i></span>
</div>
<div class="col-sm">
- <button class="btn btn-primary" (click)="deleteAttribute(claim)"
*ngIf="!isClaimCred(claim)">
+ <button class="btn btn-primary"
(click)="deleteAttribute(claim)">
<span class="fa fa-trash"></span>
</button>
- <button class="btn btn-primary"
(click)="deleteAttribute(claim)" *ngIf="isClaimCred(claim)">
- <span class="fa fa-trash"></span>
+ <button class="ml-1 btn btn-primary"
(click)="editAttribute(claim)" *ngIf="!isClaimCred(claim) && (claim !=
claimInEdit)">
+ <span class="fa fa-edit"></span>
</button>
+
</div>
</div>
<!-- Standard "phone" claims missing on the identity -->
<div class="row mb-3" [class.openid]="inOpenIdFlow()"
- [class.text-primary]="isClaimRequested(claim)"
+ [class.text-primary]="isClaimRequested(claim) || claim ==
claimInEdit"
[class.alert-danger]="newAttribute.name === claim.name"
*ngFor="let claim of missingPhoneClaims">
<div class="col-sm"><div style="min-width: 15em">
<i *ngIf="isClaimRequested(claim)" class="fa
fa-openid"></i><b> {{ getDescription(claim) }}</b></div></div>
<div class="col-sm">
- <div *ngIf="isExperimental()" name="newAttribute">
+ <div *ngIf="claim == claimInEdit && isExperimental()"
name="newAttribute">
<div class="form-check form-check-inline">
- <input class="form-check-input" type="radio" name="claim"
[(ngModel)]="claim.flag" id="plainClaim" value="0" checked>
+ <input class="form-check-input" type="radio" name="claim"
[(ngModel)]="claim.flag" (click)="claim.value=''" id="plainClaim" value="0"
checked>
<label class="form-check-label" for="plainClaim">
{{ getMessage("edit_identity_html@plain") }}
</label>
</div>
<div class="form-check form-check-inline">
- <input class="form-check-input" type="radio" name="claim"
[(ngModel)]="claim.flag" id="credentialClaim" value="1">
+ <input class="form-check-input" type="radio" name="claim"
(click)="claim.value=''" [(ngModel)]="claim.flag" id="credentialClaim"
value="1">
<label class="form-check-label" for="credentialClaim">
{{ getMessage("edit_identity_html@credential") }}
</label>
</div>
</div>
-
- <input *ngIf="claim.flag == '0'" placeholder="{{
getMessage('Value') }}" [(ngModel)]="claim.value">
- <select *ngIf="claim.flag == '1' && hasCredentialSources()"
class="custom-select"
+ <input *ngIf="claim == claimInEdit && claim.flag == '0'"
placeholder="{{ getMessage('Value') }}" [(ngModel)]="claim.value">
+ <span *ngIf="claim != claimInEdit"><i
class="text-secondary">Unset</i></span>
+ <select *ngIf="claim == claimInEdit && claim.flag == '1' &&
hasCredentialSources()" class="custom-select"
(change)="claim.credential=$event.target.value; " >
<option value="">{{
getMessage("edit_identity_html@selectSource") }}</option>
<option *ngFor="let cred of credentials" value={{cred.id}}>
@@ -220,9 +238,12 @@
</div>
<div class="col-sm">
- <button [disabled]="!canAddAttribute(claim)" class="btn
btn-primary" (click)="addAttribute()">
+ <button *ngIf="claim == claimInEdit"
[disabled]="!canAddAttribute(claim)" class="btn btn-primary"
(click)="addAttribute()">
<span class="fa fa-save"></span>
</button>
+ <button *ngIf="claim != claimInEdit" class="btn btn-primary"
(click)="editAttribute(claim)">
+ <span class="fa fa-plus"></span>
+ </button>
</div>
</div>
</div>
@@ -235,8 +256,9 @@
<!-- Missing "non-standard" claims that are requested -->
<div class="table pb-1" *ngIf="isAnyRequestedNonStandardClaimMissing()">
- <div class="row mb-3 text-primary"
+ <div class="row mb-3 text-primary"
[class.openid]="inOpenIdFlow()"
+ [class.text-primary]="missing == claimInEdit"
[class.alert-danger]="newAttribute.name === missing.name"
*ngFor="let missing of missingNonStandardClaims">
<div class="col-sm"><div style="min-width: 15em">
@@ -268,7 +290,7 @@
<div class="table pb-1">
<div class="row mb-3"
[class.openid]="inOpenIdFlow()"
- [class.text-primary]="isClaimRequested(attribute)"
+ [class.text-primary]="isClaimRequested(attribute) || attribute ==
claimInEdit"
[class.alert-danger]="newAttribute.name === attribute.name"
[class.text-secondary]="isClaimCred(attribute)"
*ngFor="let attribute of existingNonStandardClaims">
@@ -276,21 +298,23 @@
<i *ngIf="isClaimRequested(attribute)" class="fa
fa-openid"></i><b> {{ attribute.name }}</b>
</div>
<div class="col-sm">
- <input *ngIf="!isClaimCred(attribute)" placeholder="{{
getMessage('Value') }}" [(ngModel)]="attribute.value">
- <span *ngIf="isClaimCred(attribute)"
>{{getMessage("edit_identity_html@claimAsAttribute", {CREDVALUE:
getCredValue(attribute), ISSUER: getIssuer(attribute), CLAIMVALUE:
attribute.value, interpolation: { escapeValue: false } }) }}</span>
+ <input *ngIf="!isClaimCred(attribute) && (attribute ==
claimInEdit)" placeholder="{{ getMessage('Value') }}"
[(ngModel)]="attribute.value">
+ <span *ngIf="!isClaimCred(attribute) && (attribute !=
claimInEdit)">{{ attribute.value }} <i class="text-secondary"
style="float:right;"><i class="fa fa-certificate"></i> Self-issued</i></span>
+ <span *ngIf="isClaimCred(attribute)" >{{
getCredValue(attribute) }} <i class="text-primary" style="float:right;"><i
class="fa fa-certificate"></i> {{ getIssuer(attribute) }}</i></span>
</div>
<div class="col-sm">
- <button class="btn btn-primary"
(click)="deleteAttribute(attribute)" *ngIf="!isClaimCred(attribute)">
+ <button class="btn btn-primary"
(click)="deleteAttribute(attribute)">
<span class="fa fa-trash"></span>
</button>
- <button class="btn btn-primary"
(click)="deleteAttribute(attribute)" *ngIf="isClaimCred(attribute)">
- <span class="fa fa-trash"></span>
+ <button class="ml-1 btn btn-primary"
(click)="editAttribute(attribute)" *ngIf="!isClaimCred(attribute) && (attribute
!= claimInEdit)">
+ <span class="fa fa-edit"></span>
</button>
</div>
</div>
<!-- New Attribute -->
- <div class="row mb-3"
[class.alert-danger]="isInConflict(newAttribute)">
+ <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@attribute') }}"
[(ngModel)]="newAttribute.name">
</div>
@@ -298,13 +322,13 @@
<div *ngIf="isExperimental()" name="newAttribute">
<div class="form-check form-check-inline active">
- <input class="form-check-input" type="radio"
name="newAttribute" [(ngModel)]="newAttribute.flag" id="plain" value="0"
checked>
+ <input class="form-check-input" type="radio"
(click)="newAttribute.value=''" name="newAttribute"
[(ngModel)]="newAttribute.flag" id="plain" value="0" checked>
<label class="form-check-label" for="plain">
{{ getMessage("edit_identity_html@plain") }}
</label>
</div>
<div class="form-check form-check-inline">
- <input class="form-check-input" type="radio"
name="newAttribute" [(ngModel)]="newAttribute.flag" id="credential" value="1">
+ <input class="form-check-input" type="radio"
(click)="newAttribute.value=''" name="newAttribute"
[(ngModel)]="newAttribute.flag" id="credential" value="1">
<label class="form-check-label" for="credential">
{{ getMessage("edit_identity_html@credential") }}
</label>
@@ -332,7 +356,7 @@
</div>
<div class="col-sm">
<button [disabled]="!canAddAttribute(newAttribute)" class="btn
btn-primary" (click)="addAttribute()">
- <span class="fa fa-plus"></span>
+ <span class="fa fa-save"></span>
</button>
</div>
</div>
diff --git a/src/app/edit-identity/edit-identity.component.ts
b/src/app/edit-identity/edit-identity.component.ts
index 654d622..57cbaf0 100644
--- a/src/app/edit-identity/edit-identity.component.ts
+++ b/src/app/edit-identity/edit-identity.component.ts
@@ -48,6 +48,7 @@ export class EditIdentityComponent implements OnInit {
showExtraInfo: boolean = false;
showGeneralInfo: boolean = false;
actions: string = '';
+ claimInEdit: Attribute = null;
constructor(private reclaimService: ReclaimService,
private identityService: IdentityService,
@@ -487,11 +488,18 @@ export class EditIdentityComponent implements OnInit {
return this.credentials.length > 0
}
+ mapIssuer(iss: string): string {
+ if (iss == "https://omejdn.nslab.ch") {
+ return "Berner Fachhochschule";
+ }
+ return iss;
+ }
+
//FIXME credentials need an issuer field
getIssuer(attribute: Attribute) {
for (let i = 0; i < this.credentials.length; i++) {
if (this.credentials[i].id == attribute.credential) {
- return this.credentials[i].issuer;
+ return this.mapIssuer(this.credentials[i].issuer);
}
}
}
@@ -501,7 +509,7 @@ export class EditIdentityComponent implements OnInit {
if (this.credentials[i].id == attribute.credential) {
for (let j = 0; j < this.credentials[i].attributes.length; j++) {
if (attribute.value == this.credentials[i].attributes[j].name) {
- return this.credentials[i].attributes[j].value;
+ return this.credentials[i].attributes[j].value.replace(/\"/g, "");
}
}
}
@@ -549,4 +557,7 @@ export class EditIdentityComponent implements OnInit {
return this.attributes.length > 0;
}
+ editAttribute(claim: Attribute) {
+ this.claimInEdit = claim;
+ }
}
diff --git a/src/app/import-attributes/import-attributes.component.html
b/src/app/import-attributes/import-attributes.component.html
index d468721..a49e9b4 100644
--- a/src/app/import-attributes/import-attributes.component.html
+++ b/src/app/import-attributes/import-attributes.component.html
@@ -8,8 +8,11 @@
</h2>
</div>
</div>
+ <div class="card-body text-center fa-4x" *ngIf="inProgress">
+ <i class="fa fa-spinner fa-spin"></i>
+ </div>
<!-- Credential management -->
- <div class="card-body">
+ <div class="card-body" *ngIf="!inProgress">
<!--IdProvider-Discovery-->
<div>
<!--Email not found Warning-->
@@ -39,7 +42,7 @@
<!-- Edit card buttons -->
<div>
- <button class="btn btn-primary" [routerLink]="['/edit-identity',
identity.name ]">
+ <button class="btn btn-primary" [disabled]="inProgress"
[routerLink]="['/edit-identity', identity.name ]">
<span class="fa fa-save"></span> {{ getMessage("Back") }}
</button>
</div>
diff --git a/src/app/import-attributes/import-attributes.component.ts
b/src/app/import-attributes/import-attributes.component.ts
index 4e05032..c298b1c 100644
--- a/src/app/import-attributes/import-attributes.component.ts
+++ b/src/app/import-attributes/import-attributes.component.ts
@@ -34,6 +34,7 @@ export class ImportAttributesComponent implements OnInit {
timer: any;
validEmail: boolean;
discoveringIdProvider: boolean;
+ inProgress: boolean;
constructor(private reclaimService: ReclaimService,
private identityService: IdentityService,
@@ -50,6 +51,7 @@ export class ImportAttributesComponent implements OnInit {
this.identity = new Identity('','');
this.newIdProvider = new IdProvider ('', '');
this.webfingerEmail = '';
+ this.inProgress = false;
this.emailNotFoundAlertClosed = true;
this.errorMessage = '';
this.loadScopesFromLocalStorage()
@@ -60,8 +62,13 @@ export class ImportAttributesComponent implements OnInit {
customHashFragment: "?code="+localStorage.getItem("credentialCode") +
"&state=" + localStorage.getItem("credentialState") + "&session_state="+
localStorage.getItem("credentialSession_State"),
}
this.configureOauthService();
+ this.inProgress = true;
if (!localStorage.getItem("credentialCode")){
this.oauthService.loadDiscoveryDocumentAndTryLogin().then(success => {
+ if (!success || (null == this.oauthService.getIdToken())) {
+ this.inProgress = false;
+ return;
+ }
console.log("Login successful: "+this.oauthService.getIdToken());
this.newCredential.name = this.newIdProvider.name + "oidcjwt";
this.newCredential.value = this.oauthService.getIdToken();
@@ -71,6 +78,10 @@ export class ImportAttributesComponent implements OnInit {
}
else{
this.oauthService.loadDiscoveryDocumentAndTryLogin(loginOptions).then(success
=> {
+ if (!success || (null == this.oauthService.getIdToken())) {
+ this.inProgress = false;
+ return;
+ }
console.log("Login successful: "+this.oauthService.getIdToken());
this.newCredential.name = this.newIdProvider.name + "oidcjwt";
this.newCredential.value = this.oauthService.getIdToken();
@@ -103,6 +114,7 @@ export class ImportAttributesComponent implements OnInit {
}
importAttributesFromCredential() {
+ this.inProgress = true;
this.reclaimService.addCredential(this.identity,
this.newCredential).subscribe(res => {
console.log("Stored credential");
this.reclaimService.getCredentials(this.identity).subscribe(creds => {
@@ -115,6 +127,7 @@ export class ImportAttributesComponent implements OnInit {
}
if (null == cred) {
console.log("ERROR: credential was not added!");
+ this.inProgress = false;
return;
}
console.log("Trying to import " + cred.attributes.length + "
attributes");
@@ -139,6 +152,7 @@ export class ImportAttributesComponent implements OnInit {
this.newIdProvider.name = '';
localStorage.removeItem('newIdProviderURL');
localStorage.removeItem("credentialCode");
+ this.inProgress = false;
this.oauthService.logOut();
})
)
@@ -280,7 +294,7 @@ export class ImportAttributesComponent implements OnInit {
this.timer = setTimeout(() => {
this.discoverIdProvider();
- }, 400);
+ }, 800);
}
isValidEmailforDiscovery(){
--
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.
- [reclaim-ui] 397/459: fix address handling, (continued)
- [reclaim-ui] 397/459: fix address handling, gnunet, 2021/06/11
- [reclaim-ui] 406/459: allow authorization from edit component, gnunet, 2021/06/11
- [reclaim-ui] 376/459: updatte attribute info, gnunet, 2021/06/11
- [reclaim-ui] 371/459: attribute import done, gnunet, 2021/06/11
- [reclaim-ui] 404/459: fix, gnunet, 2021/06/11
- [reclaim-ui] 368/459: settings page, experiments tweaks, gnunet, 2021/06/11
- [reclaim-ui] 395/459: fix, gnunet, 2021/06/11
- [reclaim-ui] 382/459: style adjustments, gnunet, 2021/06/11
- [reclaim-ui] 373/459: fix credential string lowercase, gnunet, 2021/06/11
- [reclaim-ui] 393/459: display all missing claims, gnunet, 2021/06/11
- [reclaim-ui] 380/459: quality of life improvements,
gnunet <=
- [reclaim-ui] 383/459: better credential selection, gnunet, 2021/06/11
- [reclaim-ui] 396/459: relax attribute requirements, gnunet, 2021/06/11
- [reclaim-ui] 388/459: significantly simplify identity edit, gnunet, 2021/06/11
- [reclaim-ui] 418/459: more cleanup, gnunet, 2021/06/11
- [reclaim-ui] 431/459: Added translation using Weblate (Portuguese), gnunet, 2021/06/11
- [reclaim-ui] 430/459: mini fix, gnunet, 2021/06/11
- [reclaim-ui] 405/459: fix search icon, gnunet, 2021/06/11
- [reclaim-ui] 381/459: even more quality of life improvements, gnunet, 2021/06/11
- [reclaim-ui] 416/459: fix, gnunet, 2021/06/11
- [reclaim-ui] 392/459: fix, gnunet, 2021/06/11