gnunet-svn
[Top][All Lists]
Advanced

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

[reclaim-ui] 423/459: add spinner


From: gnunet
Subject: [reclaim-ui] 423/459: add spinner
Date: Fri, 11 Jun 2021 23:28:35 +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 ff9210bdd2ef3dac3e2894f37addc1f77999f114
Author: Martin Schanzenbach <mschanzenbach@posteo.de>
AuthorDate: Thu Jan 14 14:41:05 2021 +0100

    add spinner
---
 src/app/edit-identity/edit-identity.component.html | 10 ++++++++--
 src/app/edit-identity/edit-identity.component.ts   | 19 +++++++++++++++++++
 2 files changed, 27 insertions(+), 2 deletions(-)

diff --git a/src/app/edit-identity/edit-identity.component.html 
b/src/app/edit-identity/edit-identity.component.html
index 006bb71..a074833 100644
--- a/src/app/edit-identity/edit-identity.component.html
+++ b/src/app/edit-identity/edit-identity.component.html
@@ -66,7 +66,7 @@
     </button>
   </div>
 
-  <div *ngIf="validImportEmail && !overwriteRequiresDecision && 
!importBannerDismissed"
+  <div *ngIf="validImportEmail && isAttributeTableShown() && 
!importBannerDismissed"
     class="col-sm alert alert-primary alert-dismissible show my-2" 
role="alert" >
     {{getMessage("edit_identity_html@importInfo", {ISSUERNAME: 
getImportIssuerName()})}}<br/>
     
<i>{{getMessage("Note")}}</i>{{getMessage("edit_credentials_html@linkAccountInfo2")}}
@@ -79,8 +79,14 @@
     </button>
   </div>
 
+  <div class="card-body" *ngIf="isImportInProgress() && 
!overwriteRequiresDecision">
+    <div style="text-align: center">
+      <span class="fa fa-4x fa-spin fa-spinner"></span>
+    </div>
+  </div>
+
   <!-- Attribute table -->
-  <div class="card-body" *ngIf="!overwriteRequiresDecision">
+  <div class="card-body" *ngIf="isAttributeTableShown()">
     <div>
       <h3 class="mb-2"> {{getMessage("edit_identity_html@addAttributes")}}</h3>
       <p *ngIf="getMissingClaims().length > 0"> 
{{getMessage("edit_identity_html@addRequestedMissingClaim")}} <span 
(click)="showMissingInfo = !showMissingInfo" class="fa 
fa-question-circle"></span></p>
diff --git a/src/app/edit-identity/edit-identity.component.ts 
b/src/app/edit-identity/edit-identity.component.ts
index 20eeff3..d8ac78a 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 {
   missingNonStandardClaims: Attribute[] = [];
   showMissingInfo: boolean = false;
   showGeneralInfo: boolean = false;
+  attributeUpdateInProgress: boolean = true;
   claimInEdit: Attribute = null;
 
   //Attribute import
@@ -57,6 +58,7 @@ export class EditIdentityComponent implements OnInit {
   overwriteRequiresDecision: boolean = false;
   validImportEmail: boolean = false;
   importBannerDismissed: boolean = false;
+  importInProgress: boolean = false;
   scopes: Scope[];
   newCredential: Credential;
 
@@ -172,6 +174,7 @@ export class EditIdentityComponent implements OnInit {
   }
 
   private updateAttributes() {
+    this.attributeUpdateInProgress = true;
     this.reclaimService.getAttributes(this.identity).subscribe(attributes => {
       this.reclaimService.getCredentials(this.identity).subscribe(credentials 
=> {
         this.credentials = credentials;
@@ -201,11 +204,17 @@ export class EditIdentityComponent implements OnInit {
         this.updateMissingAttributes();
         this.validateEmailForImport();
         this.resetAttributes();
+        this.attributeUpdateInProgress = false;
       },
       err => {
         //this.errorInfos.push("Error retrieving attributes for ``" + 
identity.name + "''");
+        this.attributeUpdateInProgress = false;
         console.log(err);
       });
+    },
+    err => {
+      this.attributeUpdateInProgress = false;
+      console.log(err);
     });
   }
 
@@ -596,6 +605,7 @@ export class EditIdentityComponent implements OnInit {
 
   private handleLoginResponse(success: any) {
     if (!success || (null == this.oauthService.getIdToken())) {
+      this.importInProgress = false;
       return;
     }
     console.log("Login successful: "+this.oauthService.getIdToken());
@@ -669,6 +679,7 @@ export class EditIdentityComponent implements OnInit {
         this.attributesToOverwriteOnImport = [];
         this.overwriteRequiresDecision = false;
         this.importBannerDismissed = true;
+        this.importInProgress = false;
         localStorage.removeItem('importIdProviderURL');
         localStorage.removeItem('emailForCredential');
         localStorage.removeItem('credentialCode');
@@ -801,6 +812,7 @@ export class EditIdentityComponent implements OnInit {
         account = emailAddr.substr(0, emailAddr.indexOf('@')+1) + 
'omejdn.nslab.ch';
       }
     }
+    this.importInProgress = true;
     this.credentialService.getLink(account).subscribe (idProvider => {
       this.importIdProvider = new IdProvider((idProvider.links[0]).href,
                                              
(idProvider.links[0]).href.split('//')[1]);
@@ -941,5 +953,12 @@ export class EditIdentityComponent implements OnInit {
     return '';
   }
 
+  isImportInProgress(): boolean {
+    return this.importInProgress;
+  }
+
+  isAttributeTableShown(): boolean {
+    return !this.overwriteRequiresDecision && !this.isImportInProgress() && 
!this.attributeUpdateInProgress;
+  }
 
   }

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