[ARVADOS-WORKBENCH2] updated: 2.1.0-360-gec121e0e
Git user
git at public.arvados.org
Wed May 5 13:43:09 UTC 2021
Summary of changes:
package.json | 1 +
src/store/auth/auth-action.ts | 5 +++--
src/views-components/token-dialog/token-dialog.tsx | 3 ++-
yarn.lock | 2 +-
4 files changed, 7 insertions(+), 4 deletions(-)
via ec121e0e865fe99c5df5453ed5fa819594b1cdd6 (commit)
from 7d40a4a432ce8dfea8e49f3d330220aea6957790 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
commit ec121e0e865fe99c5df5453ed5fa819594b1cdd6
Author: Lucas Di Pentima <lucas at di-pentima.com.ar>
Date: Wed May 5 10:41:41 2021 -0300
17568: Adds relative time information to token expiration time display.
Arvados-DCO-1.1-Signed-off-by: Lucas Di Pentima <lucas at di-pentima.com.ar>
diff --git a/package.json b/package.json
index 73522447..18e0be8f 100644
--- a/package.json
+++ b/package.json
@@ -38,6 +38,7 @@
"lodash.mergewith": "4.6.2",
"lodash.template": "4.5.0",
"mem": "4.0.0",
+ "moment": "2.29.1",
"parse-duration": "0.4.4",
"prop-types": "15.7.2",
"query-string": "6.9.0",
diff --git a/src/store/auth/auth-action.ts b/src/store/auth/auth-action.ts
index cca39bb0..4fdb29a1 100644
--- a/src/store/auth/auth-action.ts
+++ b/src/store/auth/auth-action.ts
@@ -69,8 +69,9 @@ const init = (config: Config) => async (dispatch: Dispatch, getState: () => Root
dispatch(progressIndicatorActions.START_WORKING(WORKBENCH_LOADING_SCREEN));
try {
await dispatch<any>(saveApiToken(token));
- } catch (e) {}
- dispatch(progressIndicatorActions.STOP_WORKING(WORKBENCH_LOADING_SCREEN));
+ } finally {
+ dispatch(progressIndicatorActions.STOP_WORKING(WORKBENCH_LOADING_SCREEN));
+ }
}
};
diff --git a/src/views-components/token-dialog/token-dialog.tsx b/src/views-components/token-dialog/token-dialog.tsx
index 1aa3dd07..fc01631d 100644
--- a/src/views-components/token-dialog/token-dialog.tsx
+++ b/src/views-components/token-dialog/token-dialog.tsx
@@ -28,6 +28,7 @@ import { DefaultCodeSnippet } from '~/components/default-code-snippet/default-co
import { snackbarActions, SnackbarKind } from '~/store/snackbar/snackbar-actions';
import { getNewExtraToken } from '~/store/auth/auth-action';
import { DetailsAttributeComponent } from '~/components/details-attribute/details-attribute';
+import * as moment from 'moment';
type CssRules = 'link' | 'paper' | 'button' | 'actionButton' | 'codeBlock';
@@ -95,7 +96,7 @@ unset ARVADOS_API_HOST_INSECURE`
render() {
const { classes, open, closeDialog, ...data } = this.props;
const tokenExpiration = data.tokenExpiration
- ? data.tokenExpiration.toLocaleString()
+ ? `${data.tokenExpiration.toLocaleString()} (${moment(data.tokenExpiration).fromNow()})`
: `This token does not have an expiration date`;
return <Dialog
diff --git a/yarn.lock b/yarn.lock
index 465d82aa..01bb7538 100644
--- a/yarn.lock
+++ b/yarn.lock
@@ -7425,7 +7425,7 @@ mkdirp@^0.5.4:
dependencies:
minimist "^1.2.5"
-moment@^2.27.0:
+moment at 2.29.1, moment@^2.27.0:
version "2.29.1"
resolved "https://registry.yarnpkg.com/moment/-/moment-2.29.1.tgz#b2be769fa31940be9eeea6469c075e35006fa3d3"
integrity sha512-kHmoybcPV8Sqy59DwNDY3Jefr64lK/by/da0ViFcuA4DH0vQg5Q6Ze5VimxkfQNSC+Mls/Kx53s7TjP1RhFEDQ==
-----------------------------------------------------------------------
hooks/post-receive
--
More information about the arvados-commits
mailing list