[ARVADOS-WORKBENCH2] created: 1.4.1-451-g0ca70397
Git user
git at public.arvados.org
Fri Oct 2 15:19:34 UTC 2020
at 0ca7039728489e25ae1e196278454e7bafbca948 (commit)
commit 0ca7039728489e25ae1e196278454e7bafbca948
Author: Peter Amstutz <peter.amstutz at curii.com>
Date: Fri Oct 2 11:19:08 2020 -0400
16941: Multi-site search recognizes inactive remote users
Arvados-DCO-1.1-Signed-off-by: Peter Amstutz <peter.amstutz at curii.com>
diff --git a/src/models/session.ts b/src/models/session.ts
index d388f599..630b63d9 100644
--- a/src/models/session.ts
+++ b/src/models/session.ts
@@ -19,5 +19,6 @@ export interface Session {
loggedIn: boolean;
status: SessionStatus;
active: boolean;
+ userIsActive: boolean;
apiRevision: number;
}
diff --git a/src/services/auth-service/auth-service.ts b/src/services/auth-service/auth-service.ts
index 5e382fba..29442401 100644
--- a/src/services/auth-service/auth-service.ts
+++ b/src/services/auth-service/auth-service.ts
@@ -141,8 +141,9 @@ export class AuthService {
clusterId: cfg.uuidPrefix,
remoteHost: cfg.rootUrl,
baseUrl: cfg.baseUrl,
- name: user ? getUserDisplayName(user): '',
+ name: user ? getUserDisplayName(user) : '',
email: user ? user.email : '',
+ userIsActive: user ? user.isActive : false,
token: this.getApiToken(),
loggedIn: true,
active: true,
diff --git a/src/store/auth/auth-action-session.ts b/src/store/auth/auth-action-session.ts
index 4568d77e..5fc8cffb 100644
--- a/src/store/auth/auth-action-session.ts
+++ b/src/store/auth/auth-action-session.ts
@@ -130,6 +130,7 @@ export const validateSession = (session: Session, activeSession: Session) =>
session.baseUrl = baseUrl;
session.token = token;
session.email = user.email;
+ session.userIsActive = user.isActive;
session.uuid = user.uuid;
session.name = getUserDisplayName(user);
session.loggedIn = true;
@@ -242,6 +243,7 @@ export const addSession = (remoteHost: string, token?: string, sendToLogin?: boo
status: SessionStatus.VALIDATED,
active: false,
email: user.email,
+ userIsActive: user.isActive,
name: getUserDisplayName(user),
uuid: user.uuid,
baseUrl: config.baseUrl,
diff --git a/src/views/search-results-panel/search-results-panel-view.tsx b/src/views/search-results-panel/search-results-panel-view.tsx
index 8bc5419b..6a02f8e1 100644
--- a/src/views/search-results-panel/search-results-panel-view.tsx
+++ b/src/views/search-results-panel/search-results-panel-view.tsx
@@ -114,7 +114,8 @@ export const searchResultsPanelColumns: DataColumns<string> = [
export const SearchResultsPanelView = withStyles(styles, { withTheme: true })(
(props: SearchResultsPanelProps & WithStyles<CssRules, true>) => {
const homeCluster = props.user.uuid.substr(0, 5);
- const loggedIn = props.sessions.filter((ss) => ss.loggedIn);
+ console.log(props.sessions);
+ const loggedIn = props.sessions.filter((ss) => ss.loggedIn && ss.userIsActive);
return <DataExplorer
id={SEARCH_RESULTS_PANEL_ID}
onRowClick={props.onItemClick}
diff --git a/src/views/site-manager-panel/site-manager-panel-root.tsx b/src/views/site-manager-panel/site-manager-panel-root.tsx
index 223e373c..e6cc5b23 100644
--- a/src/views/site-manager-panel/site-manager-panel-root.tsx
+++ b/src/views/site-manager-panel/site-manager-panel-root.tsx
@@ -158,7 +158,10 @@ export const SiteManagerPanelRoot = compose(
disabled={validating || session.status === SessionStatus.INVALIDATED || session.active}
className={session.loggedIn ? classes.buttonLoggedIn : classes.buttonLoggedOut}
onClick={() => toggleSession(session)}>
- {validating ? "Validating" : (session.loggedIn ? "Logged in" : "Logged out")}
+ {validating ? "Validating"
+ : (session.loggedIn ?
+ (session.userIsActive ? "Logged in" : "Inactive")
+ : "Logged out")}
</Button>
</TableCell>
<TableCell>
-----------------------------------------------------------------------
hooks/post-receive
--
More information about the arvados-commits
mailing list