From 1898e6c301c50e35db7c967c2cd930d227a13dbf Mon Sep 17 00:00:00 2001 From: claire bontempo <68122737+hellobontempo@users.noreply.github.com> Date: Thu, 21 Oct 2021 07:05:45 -0700 Subject: [PATCH] UI/Remove spinner after token renew (#12887) * fixes loading spinner * adds changelog --- changelog/12887.txt | 3 +++ ui/app/components/auth-info.js | 5 +++-- ui/app/services/auth.js | 7 ++++--- ui/app/templates/components/auth-info.hbs | 2 +- 4 files changed, 11 insertions(+), 6 deletions(-) create mode 100644 changelog/12887.txt diff --git a/changelog/12887.txt b/changelog/12887.txt new file mode 100644 index 000000000..92ce4c86a --- /dev/null +++ b/changelog/12887.txt @@ -0,0 +1,3 @@ +```release-note:bug +ui: Remove spinner after token renew +``` diff --git a/ui/app/components/auth-info.js b/ui/app/components/auth-info.js index 9f77ebc28..602770edf 100644 --- a/ui/app/components/auth-info.js +++ b/ui/app/components/auth-info.js @@ -40,8 +40,9 @@ export default class AuthInfoComponent extends Component { renewToken() { this.fakeRenew = true; run.later(() => { - this.fakeRenew = false; - this.auth.renew(); + this.auth.renew().then(() => { + this.fakeRenew = this.auth.isRenewing; + }); }, 200); } diff --git a/ui/app/services/auth.js b/ui/app/services/auth.js index d8ceb1455..005f0dbd5 100644 --- a/ui/app/services/auth.js +++ b/ui/app/services/auth.js @@ -23,6 +23,7 @@ export default Service.extend({ namespaceService: service('namespace'), IDLE_TIMEOUT: 3 * 60e3, expirationCalcTS: null, + isRenewing: false, init() { this._super(...arguments); this.checkForRootToken(); @@ -249,14 +250,14 @@ export default Service.extend({ if (currentlyRenewing) { return; } - this.set('isRenewing', true); + this.isRenewing = true; return this.renewCurrentToken().then( resp => { - this.set('isRenewing', false); + this.isRenewing = false; return this.persistAuthData(tokenName, resp.data || resp.auth); }, e => { - this.set('isRenewing', false); + this.isRenewing = false; throw e; } ); diff --git a/ui/app/templates/components/auth-info.hbs b/ui/app/templates/components/auth-info.hbs index a158e7b9d..5b24756eb 100644 --- a/ui/app/templates/components/auth-info.hbs +++ b/ui/app/templates/components/auth-info.hbs @@ -26,7 +26,7 @@ {{#if (is-before (now interval=1000) this.auth.tokenExpirationDate)}} {{#if this.auth.authData.renewable}}
  • -