[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[reclaim-ui] 267/459: refactoring, style
From: |
gnunet |
Subject: |
[reclaim-ui] 267/459: refactoring, style |
Date: |
Fri, 11 Jun 2021 23:25:59 +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 43732a0a37248e813ae7f2a6c761afb6da241b2e
Author: Martin Schanzenbach <mschanzenbach@posteo.de>
AuthorDate: Thu Aug 6 09:47:43 2020 +0200
refactoring, style
---
src/app/identity-list/identity-list.component.ts | 34 ++++++++++++++----------
1 file changed, 20 insertions(+), 14 deletions(-)
diff --git a/src/app/identity-list/identity-list.component.ts
b/src/app/identity-list/identity-list.component.ts
index c491e73..9887b6a 100644
--- a/src/app/identity-list/identity-list.component.ts
+++ b/src/app/identity-list/identity-list.component.ts
@@ -82,6 +82,13 @@ export class IdentityListComponent implements OnInit {
console.log('processed nginit');
}
+ private getAttributesForIdentity(identity: Identity): Attribute[] {
+ if (undefined === this.attributes[identity.pubkey]) {
+ return [];
+ }
+ return this.attributes[identity.pubkey];
+ }
+
cancelRequest() {
this.oidcService.cancelAuthorization();
}
@@ -98,26 +105,25 @@ export class IdentityListComponent implements OnInit {
*/
updateMissingClaims(identity) {
const refscopes = this.oidcService.getRequestedClaims();
- let i;
- for (i = 0; i < this.attributes[identity.pubkey].length; i++) {
+ for (let attr of this.getAttributesForIdentity(identity)) {
for (var j = 0; j < refscopes.length; j++) {
- if (this.attributes[identity.pubkey][i].name === refscopes[j][0] ) {
+ if (attr.name === refscopes[j][0] ) {
refscopes.splice(j,1);
}
}
}
this.missingClaims[identity.pubkey] = [];
this.optionalClaims[identity.pubkey] = [];
- for (i = 0; i < refscopes.length; i++) {
+ for (let refscope of refscopes) {
const attested = new Attribute('', '', '', '', 'STRING', '');
- if (refscopes[i][1] === true)
+ if (refscope[1] === true)
{
- attested.name = refscopes[i][0];
+ attested.name = refscope[0];
this.missingClaims[identity.pubkey].push(attested);
}
- if (refscopes[i][1] === false)
+ if (refscope[1] === false)
{
- attested.name = refscopes[i][0];
+ attested.name = refscope[0];
this.optionalClaims[identity.pubkey].push(attested);
}
}
@@ -274,21 +280,21 @@ export class IdentityListComponent implements OnInit {
if (!this.inOpenIdFlow()) {
return false;
}
- return this.oidcService.isProfileMissing(this.attributes[identity.pubkey]);
+ return
this.oidcService.isProfileMissing(this.getAttributesForIdentity(identity));
}
isEmailMissing(identity) {
if (!this.inOpenIdFlow()) {
return false;
}
- return this.oidcService.isEmailMissing(this.attributes[identity.pubkey]);
+ return
this.oidcService.isEmailMissing(this.getAttributesForIdentity(identity));
}
isPhoneMissing(identity) {
if (!this.inOpenIdFlow()) {
return false;
}
- return this.oidcService.isPhoneMissing(this.attributes[identity.pubkey]);
+ return
this.oidcService.isPhoneMissing(this.getAttributesForIdentity(identity));
}
isRequestedScopeMissing(identity) {
@@ -302,7 +308,7 @@ export class IdentityListComponent implements OnInit {
if (!this.inOpenIdFlow()) {
return false;
}
- return this.oidcService.isAddressMissing(this.attributes[identity.pubkey]);
+ return
this.oidcService.isAddressMissing(this.getAttributesForIdentity(identity));
}
getProfileDescription() {
@@ -322,10 +328,10 @@ export class IdentityListComponent implements OnInit {
}
hasAttributes(identity) {
- if (undefined === this.attributes[identity.pubkey]) {
+ if (undefined === this.getAttributesForIdentity(identity)) {
return false;
}
- return 0 !== this.attributes[identity.pubkey].length;
+ return 0 !== this.getAttributesForIdentity(identity).length;
}
private updateIdentities() {
--
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.
- [reclaim-ui] 263/459: add spinner when saving, (continued)
- [reclaim-ui] 263/459: add spinner when saving, gnunet, 2021/06/11
- [reclaim-ui] 291/459: fix, gnunet, 2021/06/11
- [reclaim-ui] 282/459: style change, gnunet, 2021/06/11
- [reclaim-ui] 265/459: fix, gnunet, 2021/06/11
- [reclaim-ui] 287/459: add danger, gnunet, 2021/06/11
- [reclaim-ui] 241/459: formatting, gnunet, 2021/06/11
- [reclaim-ui] 264/459: fix phone number claim name; pass claims parameter, gnunet, 2021/06/11
- [reclaim-ui] 258/459: -minor, gnunet, 2021/06/11
- [reclaim-ui] 247/459: fix, gnunet, 2021/06/11
- [reclaim-ui] 249/459: fix conflict, gnunet, 2021/06/11
- [reclaim-ui] 267/459: refactoring, style,
gnunet <=
- [reclaim-ui] 276/459: more test, gnunet, 2021/06/11
- [reclaim-ui] 253/459: improve error/retry UX, gnunet, 2021/06/11
- [reclaim-ui] 232/459: update dependencies, gnunet, 2021/06/11
- [reclaim-ui] 278/459: fix display requested, gnunet, 2021/06/11
- [reclaim-ui] 281/459: fix, gnunet, 2021/06/11
- [reclaim-ui] 266/459: include(s), gnunet, 2021/06/11
- [reclaim-ui] 270/459: improve authz display, gnunet, 2021/06/11
- [reclaim-ui] 256/459: fix: ftbfs, gnunet, 2021/06/11
- [reclaim-ui] 261/459: towards cleanup of codebase and fixes, gnunet, 2021/06/11
- [reclaim-ui] 271/459: fix, gnunet, 2021/06/11