[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[reclaim-ui] 245/459: improved scope display
From: |
gnunet |
Subject: |
[reclaim-ui] 245/459: improved scope display |
Date: |
Fri, 11 Jun 2021 23:25:37 +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 5a4dc9b56d0409383ebdb6598aeb860b2e3b42ab
Author: anna wimbauer <anna.wibauer@gmx.de>
AuthorDate: Mon Jul 20 09:07:31 2020 +0200
improved scope display
---
.../edit-attestations.component.html | 2 +-
.../edit-attestations.component.ts | 37 ++++++++++++++++++++--
2 files changed, 36 insertions(+), 3 deletions(-)
diff --git a/src/app/edit-attestations/edit-attestations.component.html
b/src/app/edit-attestations/edit-attestations.component.html
index 172fe8e..f7bf98f 100644
--- a/src/app/edit-attestations/edit-attestations.component.html
+++ b/src/app/edit-attestations/edit-attestations.component.html
@@ -29,7 +29,7 @@
<div *ngIf="newIdProviderDiscovered() && !loggedIn()" class="mb-3 px-2">
<div class="mx-n2">Available claims to request:</div>
<div *ngFor="let scope of scopes" class="form-check mx-2">
- <input type="checkbox" class="form-check-input" id="scopes"
[(ngModel)]="scope.chosen">
+ <input type="checkbox" class="form-check-input" id="scopes"
[disabled]="necessaryScope(scope.scope)" [(ngModel)]="scope.chosen">
<label class="form-check-label"
for="scope.chosen">{{scope.scope}}</label>
</div>
<button class="btn btn-primary mb-1 mt-2 fhg-link"
(click)="loginFhgAccount()">
diff --git a/src/app/edit-attestations/edit-attestations.component.ts
b/src/app/edit-attestations/edit-attestations.component.ts
index 4ddcec3..caf5009 100644
--- a/src/app/edit-attestations/edit-attestations.component.ts
+++ b/src/app/edit-attestations/edit-attestations.component.ts
@@ -42,7 +42,7 @@ export class EditAttestationsComponent implements OnInit {
this.webfingerEmail = '';
this.emailNotFoundAlertClosed = true;
this.errorMassage = '';
- this.scopes = [];
+ this.loadScopesFromLocalStorage()
this.loadIdProviderFromLocalStorage();
this.attestations = [];
if (this.newIdProvider.url !== ''){
@@ -99,6 +99,7 @@ export class EditAttestationsComponent implements OnInit {
console.log("Saved Attestation");
console.log(res);
this.resetNewIdProvider();
+ this.resetScopes();
this.updateAttestations();
this.newAttestation.name = '';
this.newAttestation.value = '';
@@ -249,6 +250,7 @@ export class EditAttestationsComponent implements OnInit {
cancelAdding(){
this.logOutFromOauthService();
this.resetNewIdProvider();
+ this.resetScopes();
this.newAttestation.value = '';
this.newAttestation.name = '';
}
@@ -296,10 +298,28 @@ export class EditAttestationsComponent implements OnInit {
}
this.scopes.push(scopeInterface)
});
- console.log(this.scopes);
+ localStorage.setItem("scopes", JSON.stringify(this.scopes));
});
}
+ loadScopesFromLocalStorage(){
+ this.scopes = [];
+ var loadedScopes = localStorage.getItem("scopes");
+ if (loadedScopes==null){
+ return
+ }
+ loadedScopes.split(',{').forEach(scopeObject => {
+ var scopeName = scopeObject.split(',')[0];
+ var scopeChosen = scopeObject.split(',')[1].slice(0, -1);
+ const scopeInterface: Scope = {
+ scope: scopeName.split(':')[1].slice(1,-1),
+ chosen: (/true/i).test(scopeChosen.split(':')[1]),
+ }
+ this.scopes.push(scopeInterface)
+ }
+ );
+ }
+
newIdProviderDiscovered(){
if (this.newIdProvider.url == ''){
return false;
@@ -325,8 +345,21 @@ export class EditAttestationsComponent implements OnInit {
cancelLinking(){
this.resetNewIdProvider();
+ this.resetScopes();
this.webfingerEmail = '';
}
+ necessaryScope(scope){
+ if(scope=="openid"||scope=="profile"){
+ return true;
+ }
+ return false;
+ }
+
+ resetScopes(){
+ localStorage.removeItem("scopes");
+ this.scopes = [];
+ }
+
}
--
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.
- [reclaim-ui] 213/459: Attestation is added after account is linked, (continued)
- [reclaim-ui] 213/459: Attestation is added after account is linked, gnunet, 2021/06/11
- [reclaim-ui] 215/459: merge, gnunet, 2021/06/11
- [reclaim-ui] 211/459: update dependencies, gnunet, 2021/06/11
- [reclaim-ui] 223/459: button label changed, gnunet, 2021/06/11
- [reclaim-ui] 229/459: fix, gnunet, 2021/06/11
- [reclaim-ui] 238/459: improved error massage, gnunet, 2021/06/11
- [reclaim-ui] 225/459: added logout url to webfinger, gnunet, 2021/06/11
- [reclaim-ui] 212/459: Add typescript dependency to make modules happy., gnunet, 2021/06/11
- [reclaim-ui] 239/459: -fix expiration date display, gnunet, 2021/06/11
- [reclaim-ui] 231/459: maing, gnunet, 2021/06/11
- [reclaim-ui] 245/459: improved scope display,
gnunet <=
- [reclaim-ui] 236/459: redirect after logout from idProvider, gnunet, 2021/06/11
- [reclaim-ui] 255/459: remove env, gnunet, 2021/06/11
- [reclaim-ui] 228/459: redirect to edit-attestation after linking account, gnunet, 2021/06/11
- [reclaim-ui] 237/459: moved IdProvider-Linking to edit-attestations, gnunet, 2021/06/11
- [reclaim-ui] 242/459: more style, gnunet, 2021/06/11
- [reclaim-ui] 217/459: fixed attestation-save (already existing attestations were always added again), gnunet, 2021/06/11
- [reclaim-ui] 222/459: omejdn:api scope deleted, gnunet, 2021/06/11
- [reclaim-ui] 227/459: redirect now to edit-attestations/clientname should be edit-identity/clientname #20, gnunet, 2021/06/11
- [reclaim-ui] 203/459: yarn.lock, gnunet, 2021/06/11
- [reclaim-ui] 234/459: adding attestation works, gnunet, 2021/06/11