16718: Merge branch 'master' into 16718-past-collection-versions-search
authorLucas Di Pentima <lucas@di-pentima.com.ar>
Mon, 12 Oct 2020 22:14:34 +0000 (19:14 -0300)
committerLucas Di Pentima <lucas@di-pentima.com.ar>
Mon, 12 Oct 2020 22:14:34 +0000 (19:14 -0300)
Arvados-DCO-1.1-Signed-off-by: Lucas Di Pentima <lucas@di-pentima.com.ar>

12 files changed:
Makefile
cypress/integration/collection-panel.spec.js
src/models/session.ts
src/services/auth-service/auth-service.ts
src/store/auth/auth-action-session.ts
src/store/auth/auth-action.test.ts
src/views-components/context-menu/action-sets/collection-files-action-set.ts
src/views-components/context-menu/actions/download-action.test.tsx [new file with mode: 0644]
src/views-components/context-menu/actions/download-action.tsx
src/views-components/main-content-bar/main-content-bar.tsx
src/views/search-results-panel/search-results-panel-view.tsx
src/views/site-manager-panel/site-manager-panel-root.tsx

index 4a8854c3fbfd479e08e94b4073cbb4bc986c6522..64fe9e563f4a26b7534aabc7fd424a0032b29ba2 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -72,7 +72,7 @@ integration-tests-in-docker: workbench2-build-image
 
 test: unit-tests integration-tests
 
-build: test
+build: yarn-install
        VERSION=$(VERSION) yarn build
 
 $(DEB_FILE): build
index 6fc2d5656517ce3b7a6d76eda8659f81732be31c..c14101d8c15ed94f3f895942797efb7ae5782f14 100644 (file)
@@ -103,8 +103,8 @@ describe('Collection panel tests', function() {
                     cy.get('[data-cy=collection-files-panel-options-btn]')
                         .click()
                     cy.get('[data-cy=context-menu]')
-                        .should('contain', 'Download selected')
-                        .and(`${isWritable ? '' : 'not.'}contain`, 'Remove selected')
+                        // .should('contain', 'Download selected')
+                        .should(`${isWritable ? '' : 'not.'}contain`, 'Remove selected')
                         .type('{esc}'); // Collapse the options menu
                     // File item 'more options' button
                     cy.get('[data-cy=file-item-options-btn')
@@ -117,4 +117,4 @@ describe('Collection panel tests', function() {
             })
         })
     })
-})
\ No newline at end of file
+})
index d388f59926e0f1235f3c3aef0101252b24d03fe0..630b63d93f513d06fd503d075ca6f6f3c238bdbe 100644 (file)
@@ -19,5 +19,6 @@ export interface Session {
     loggedIn: boolean;
     status: SessionStatus;
     active: boolean;
+    userIsActive: boolean;
     apiRevision: number;
 }
index 5e382fba85bb129d1cff1f3d587990e468f1b63b..7510171106eb2761a4b0a118661ee55dc8c812b2 100644 (file)
@@ -69,6 +69,10 @@ export class AuthService {
         return this.getStorage().getItem(HOME_CLUSTER) || undefined;
     }
 
+    public getApiClient() {
+        return this.apiClient;
+    }
+
     public removeUser() {
         this.getStorage().removeItem(USER_EMAIL_KEY);
         this.getStorage().removeItem(USER_FIRST_NAME_KEY);
@@ -92,7 +96,7 @@ export class AuthService {
         window.location.assign(`${this.baseUrl || ""}/logout?return_to=${currentUrl}`);
     }
 
-    public getUserDetails = (): Promise<User> => {
+    public getUserDetails = (showErrors?: boolean): Promise<User> => {
         const reqId = uuid();
         this.actions.progressFn(reqId, true);
         return this.apiClient
@@ -114,7 +118,7 @@ export class AuthService {
             })
             .catch(e => {
                 this.actions.progressFn(reqId, false);
-                this.actions.errorFn(reqId, e);
+                this.actions.errorFn(reqId, e, showErrors);
                 throw e;
             });
     }
@@ -141,8 +145,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,
index 4568d77eafb572ff1e62eff77fc5fcea4ee7a9d9..ed2e18b2db39079705805501ed2cc4cc9bb18be6 100644 (file)
@@ -6,7 +6,7 @@ import { Dispatch } from "redux";
 import { setBreadcrumbs } from "~/store/breadcrumbs/breadcrumbs-actions";
 import { RootState } from "~/store/store";
 import { ServiceRepository, createServices, setAuthorizationHeader } from "~/services/services";
-import Axios from "axios";
+import Axios, { AxiosInstance } from "axios";
 import { User, getUserDisplayName } from "~/models/user";
 import { authActions } from "~/store/auth/auth-action";
 import {
@@ -20,10 +20,10 @@ import { AuthService } from "~/services/auth-service/auth-service";
 import { snackbarActions, SnackbarKind } from "~/store/snackbar/snackbar-actions";
 import * as jsSHA from "jssha";
 
-const getClusterConfig = async (origin: string): Promise<Config | null> => {
+const getClusterConfig = async (origin: string, apiClient: AxiosInstance): Promise<Config | null> => {
     let configFromDD: Config | undefined;
     try {
-        const dd = (await Axios.get<any>(`${origin}/${DISCOVERY_DOC_PATH}`)).data;
+        const dd = (await apiClient.get<any>(`${origin}/${DISCOVERY_DOC_PATH}`)).data;
         configFromDD = {
             baseUrl: normalizeURLPath(dd.baseUrl),
             keepWebServiceUrl: dd.keepWebServiceUrl,
@@ -41,9 +41,9 @@ const getClusterConfig = async (origin: string): Promise<Config | null> => {
         };
     } catch { }
 
-    // Try the new public config endpoint
+    // Try public config endpoint
     try {
-        const config = (await Axios.get<ClusterConfigJSON>(`${origin}/${CLUSTER_CONFIG_PATH}`)).data;
+        const config = (await apiClient.get<ClusterConfigJSON>(`${origin}/${CLUSTER_CONFIG_PATH}`)).data;
         return { ...buildConfig(config), apiRevision: configFromDD ? configFromDD.apiRevision : 0 };
     } catch { }
 
@@ -55,7 +55,9 @@ const getClusterConfig = async (origin: string): Promise<Config | null> => {
     return null;
 };
 
-const getRemoteHostConfig = async (remoteHost: string): Promise<Config | null> => {
+const getRemoteHostConfig = async (remoteHost: string, useApiClient?: AxiosInstance): Promise<Config | null> => {
+    const apiClient = useApiClient || Axios.create({ headers: {} });
+
     let url = remoteHost;
     if (url.indexOf('://') < 0) {
         url = 'https://' + url;
@@ -63,14 +65,14 @@ const getRemoteHostConfig = async (remoteHost: string): Promise<Config | null> =
     const origin = new URL(url).origin;
 
     // Maybe it is an API server URL, try fetching config and discovery doc
-    let r = await getClusterConfig(origin);
+    let r = await getClusterConfig(origin, apiClient);
     if (r !== null) {
         return r;
     }
 
     // Maybe it is a Workbench2 URL, try getting config.json
     try {
-        r = await getClusterConfig((await Axios.get<any>(`${origin}/config.json`)).data.API_HOST);
+        r = await getClusterConfig((await apiClient.get<any>(`${origin}/config.json`)).data.API_HOST, apiClient);
         if (r !== null) {
             return r;
         }
@@ -78,7 +80,7 @@ const getRemoteHostConfig = async (remoteHost: string): Promise<Config | null> =
 
     // Maybe it is a Workbench1 URL, try getting status.json
     try {
-        r = await getClusterConfig((await Axios.get<any>(`${origin}/status.json`)).data.apiBaseURL);
+        r = await getClusterConfig((await apiClient.get<any>(`${origin}/status.json`)).data.apiBaseURL, apiClient);
         if (r !== null) {
             return r;
         }
@@ -114,14 +116,14 @@ export const validateCluster = async (config: Config, useToken: string):
     const svc = createServices(config, { progressFn: () => { }, errorFn: () => { } });
     setAuthorizationHeader(svc, saltedToken);
 
-    const user = await svc.authService.getUserDetails();
+    const user = await svc.authService.getUserDetails(false);
     return {
         user,
         token: saltedToken,
     };
 };
 
-export const validateSession = (session: Session, activeSession: Session) =>
+export const validateSession = (session: Session, activeSession: Session, useApiClient?: AxiosInstance) =>
     async (dispatch: Dispatch): Promise<Session> => {
         dispatch(authActions.UPDATE_SESSION({ ...session, status: SessionStatus.BEING_VALIDATED }));
         session.loggedIn = false;
@@ -130,6 +132,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;
@@ -137,7 +140,7 @@ export const validateSession = (session: Session, activeSession: Session) =>
         };
 
         let fail: Error | null = null;
-        const config = await getRemoteHostConfig(session.remoteHost);
+        const config = await getRemoteHostConfig(session.remoteHost, useApiClient);
         if (config !== null) {
             dispatch(authActions.REMOTE_CLUSTER_CONFIG({ config }));
             try {
@@ -168,7 +171,7 @@ export const validateSession = (session: Session, activeSession: Session) =>
         return session;
     };
 
-export const validateSessions = () =>
+export const validateSessions = (useApiClient?: AxiosInstance) =>
     async (dispatch: Dispatch<any>, getState: () => RootState, services: ServiceRepository) => {
         const sessions = getState().auth.sessions;
         const activeSession = getActiveSession(sessions);
@@ -186,12 +189,13 @@ export const validateSessions = () =>
                           override it using Dispatch<any>.  This
                           pattern is used in a bunch of different
                           places in Workbench2. */
-                        await dispatch(validateSession(session, activeSession));
+                        await dispatch(validateSession(session, activeSession, useApiClient));
                     } catch (e) {
-                        dispatch(snackbarActions.OPEN_SNACKBAR({
-                            message: e.message,
-                            kind: SnackbarKind.ERROR
-                        }));
+                        // Don't do anything here.  User may get
+                        // spammed with multiple messages that are not
+                        // helpful.  They can see the individual
+                        // errors by going to site manager and trying
+                        // to toggle the session.
                     }
                 }
             }
@@ -242,6 +246,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,
@@ -309,7 +314,7 @@ export const initSessions = (authService: AuthService, config: Config, user: Use
     (dispatch: Dispatch<any>) => {
         const sessions = authService.buildSessions(config, user);
         dispatch(authActions.SET_SESSIONS(sessions));
-        dispatch(validateSessions());
+        dispatch(validateSessions(authService.getApiClient()));
     };
 
 export const loadSiteManagerPanel = () =>
index 8a17fe9f42da87b0360845580d2ce4e8fcdabb6f..83a699a7d2121d7118c2a37ac08cec1f3dc9733c 100644 (file)
@@ -9,7 +9,7 @@ import 'jest-localstorage-mock';
 import { ServiceRepository, createServices } from "~/services/services";
 import { configureStore, RootStore } from "../store";
 import { createBrowserHistory } from "history";
-import { mockConfig } from '~/common/config';
+import { mockConfig, DISCOVERY_DOC_PATH, } from '~/common/config';
 import { ApiActions } from "~/services/api/api-actions";
 import { ACCOUNT_LINK_STATUS_KEY } from '~/services/link-account-service/link-account-service';
 import Axios from "axios";
@@ -57,6 +57,20 @@ describe('auth-actions', () => {
                 prefs: {}
             });
 
+        axiosMock
+            .onGet("https://xc59z.arvadosapi.com/discovery/v1/apis/arvados/v1/rest")
+            .reply(200, {
+                baseUrl: "https://xc59z.arvadosapi.com/arvados/v1",
+                keepWebServiceUrl: "",
+                remoteHosts: {},
+                rootUrl: "https://xc59z.arvadosapi.com",
+                uuidPrefix: "xc59z",
+                websocketUrl: "",
+                workbenchUrl: "",
+                workbench2Url: "",
+                revision: 12345678
+            });
+
         importMocks.push(ImportMock.mockFunction(servicesModule, 'createServices', services));
 
         // Only test the case when a link account operation is not being cancelled
@@ -103,6 +117,12 @@ describe('auth-actions', () => {
                                 "rootUrl": "https://zzzzz.arvadosapi.com",
                                 "uuidPrefix": "zzzzz",
                             },
+                            "xc59z": mockConfig({
+                                apiRevision: 12345678,
+                                baseUrl: "https://xc59z.arvadosapi.com/arvados/v1",
+                                rootUrl: "https://xc59z.arvadosapi.com",
+                                uuidPrefix: "xc59z"
+                            })
                         },
                         remoteHosts: {
                             zzzzz: "zzzzz.arvadosapi.com",
@@ -120,6 +140,7 @@ describe('auth-actions', () => {
                             "name": "John Doe",
                             "apiRevision": 12345678,
                             "uuid": "zzzzz-tpzed-abcefg",
+                            "userIsActive": true
                         }, {
                             "active": false,
                             "baseUrl": "",
@@ -156,22 +177,22 @@ describe('auth-actions', () => {
 
     // TODO: Add remaining action tests
     /*
-    it('should fire external url to login', () => {
-        const initialState = undefined;
-        window.location.assign = jest.fn();
-        reducer(initialState, authActions.LOGIN());
-        expect(window.location.assign).toBeCalledWith(
-            `/login?return_to=${window.location.protocol}//${window.location.host}/token`
-        );
-    });
-
-    it('should fire external url to logout', () => {
-        const initialState = undefined;
-        window.location.assign = jest.fn();
-        reducer(initialState, authActions.LOGOUT());
-        expect(window.location.assign).toBeCalledWith(
-            `/logout?return_to=${location.protocol}//${location.host}`
-        );
-    });
-    */
+       it('should fire external url to login', () => {
+       const initialState = undefined;
+       window.location.assign = jest.fn();
+       reducer(initialState, authActions.LOGIN());
+       expect(window.location.assign).toBeCalledWith(
+       `/login?return_to=${window.location.protocol}//${window.location.host}/token`
+       );
+       });
+
+       it('should fire external url to logout', () => {
+       const initialState = undefined;
+       window.location.assign = jest.fn();
+       reducer(initialState, authActions.LOGOUT());
+       expect(window.location.assign).toBeCalledWith(
+       `/logout?return_to=${location.protocol}//${location.host}`
+       );
+       });
+     */
 });
index fc0139c86f7f42f227872225fe3ad138e18829cf..7e885615d07c453c8cb39190d9b1e664cc1f787a 100644 (file)
@@ -5,7 +5,7 @@
 import { ContextMenuActionSet } from "~/views-components/context-menu/context-menu-action-set";
 import { collectionPanelFilesAction, openMultipleFilesRemoveDialog } from "~/store/collection-panel/collection-panel-files/collection-panel-files-actions";
 import { openCollectionPartialCopyDialog, openCollectionPartialCopyToSelectedCollectionDialog } from '~/store/collections/collection-partial-copy-actions';
-import { DownloadCollectionFileAction } from "~/views-components/context-menu/actions/download-collection-file-action";
+// import { DownloadCollectionFileAction } from "~/views-components/context-menu/actions/download-collection-file-action";
 
 export const readOnlyCollectionFilesActionSet: ContextMenuActionSet = [[
     {
@@ -20,10 +20,10 @@ export const readOnlyCollectionFilesActionSet: ContextMenuActionSet = [[
             dispatch(collectionPanelFilesAction.UNSELECT_ALL_COLLECTION_FILES());
         }
     },
-    {
-        component: DownloadCollectionFileAction,
-        execute: () => { return; }
-    },
+    // { // Disabled for now as we need to create backend version of this feature which will be less buggy
+    //     component: DownloadCollectionFileAction,
+    //     execute: () => { return; }
+    // },
     {
         name: "Create a new collection with selected",
         execute: dispatch => {
diff --git a/src/views-components/context-menu/actions/download-action.test.tsx b/src/views-components/context-menu/actions/download-action.test.tsx
new file mode 100644 (file)
index 0000000..88791d4
--- /dev/null
@@ -0,0 +1,73 @@
+// Copyright (C) The Arvados Authors. All rights reserved.
+//
+// SPDX-License-Identifier: AGPL-3.0
+
+import * as React from 'react';
+import axios from 'axios';
+import { configure, shallow } from "enzyme";
+import * as Adapter from 'enzyme-adapter-react-16';
+import { ListItem } from '@material-ui/core';
+import * as JSZip from 'jszip';
+import { DownloadAction } from './download-action';
+
+configure({ adapter: new Adapter() });
+
+jest.mock('axios');
+
+jest.mock('file-saver', () => ({
+    saveAs: jest.fn(),
+}));
+
+const mock = {
+    file: jest.fn(),
+    generateAsync: jest.fn().mockImplementation(() => Promise.resolve('test')),
+};
+
+jest.mock('jszip', () => jest.fn().mockImplementation(() => mock));
+
+describe('<DownloadAction />', () => {
+    let props;
+    let zip;
+
+    beforeEach(() => {
+        props = {};
+        zip = new JSZip();
+        (axios as any).get.mockImplementationOnce(() => Promise.resolve({ data: '1234' }));
+    });
+
+    it('should return null if missing href or kind of file in props', () => {
+        // when
+        const wrapper = shallow(<DownloadAction {...props} />);
+
+        // then
+        expect(wrapper.html()).toBeNull();
+    });
+
+    it('should return a element', () => {
+        // setup
+        props.href = '#';
+
+        // when
+        const wrapper = shallow(<DownloadAction {...props} />);
+
+        // then
+        expect(wrapper.html()).not.toBeNull();
+    });
+
+    it('should handle download', () => {
+        // setup
+        props = {
+            href: ['file1'],
+            kind: 'files',
+            download: [],
+            currentCollectionUuid: '123412-123123'
+        };
+        const wrapper = shallow(<DownloadAction {...props} />);
+
+        // when
+        wrapper.find(ListItem).simulate('click');
+
+        // then
+        expect(axios.get).toHaveBeenCalledWith(props.href[0]);
+    });
+});
\ No newline at end of file
index 7fcf7c2cbd215fa186f7c75a8fca61f461420726..7468954fdd97d293837dd8edfebbc0d5a62a241a 100644 (file)
@@ -2,10 +2,10 @@
 //
 // SPDX-License-Identifier: AGPL-3.0
 
-import * as React from "react";
-import { ListItemIcon, ListItemText, ListItem } from "@material-ui/core";
-import { DownloadIcon } from "../../../components/icon/icon";
-import * as JSZip from "jszip";
+import * as React from 'react';
+import { ListItemIcon, ListItemText, ListItem } from '@material-ui/core';
+import { DownloadIcon } from '../../../components/icon/icon';
+import * as JSZip from 'jszip';
 import * as FileSaver from 'file-saver';
 import axios from 'axios';
 
@@ -13,28 +13,35 @@ export const DownloadAction = (props: { href?: any, download?: any, onClick?: ()
     const downloadProps = props.download ? { download: props.download } : {};
 
     const createZip = (fileUrls: string[], download: string[]) => {
-        const zip = new JSZip();
         let id = 1;
-        fileUrls.map((href: string) => {
-            axios.get(href).then(response => response).then(({ data }: any) => {
-                const splittedByDot = href.split('.');
-                if (splittedByDot[splittedByDot.length - 1] !== 'json') {
-                    if (fileUrls.length === id) {
-                        zip.file(download[id - 1], data);
-                        zip.generateAsync({ type: 'blob' }).then((content) => {
-                            FileSaver.saveAs(content, `download-${props.currentCollectionUuid}.zip`);
-                        });
+        const zip = new JSZip();
+        const filteredFileUrls = fileUrls
+            .filter((href: string) => {
+                const letter = href.split('').pop();
+                return letter !== '/';
+            });
+
+        filteredFileUrls
+            .map((href: string) => {
+                axios.get(href).then(response => response).then(({ data }: any) => {
+                    const splittedByDot = href.split('.');
+                    if (splittedByDot[splittedByDot.length - 1] !== 'json') {
+                        if (filteredFileUrls.length === id) {
+                            zip.file(download[id - 1], data);
+                            zip.generateAsync({ type: 'blob' }).then((content) => {
+                                FileSaver.saveAs(content, `download-${props.currentCollectionUuid}.zip`);
+                            });
+                        } else {
+                            zip.file(download[id - 1], data);
+                            zip.generateAsync({ type: 'blob' });
+                        }
                     } else {
-                        zip.file(download[id - 1], data);
+                        zip.file(download[id - 1], JSON.stringify(data));
                         zip.generateAsync({ type: 'blob' });
                     }
-                } else {
-                    zip.file(download[id - 1], JSON.stringify(data));
-                    zip.generateAsync({ type: 'blob' });
-                }
-                id++;
+                    id++;
+                });
             });
-        });
     };
 
     return props.href || props.kind === 'files'
index c8565d62b1844c70e3c0eec7459b02e497dc9a28..cad73a3a8e4b8cee12b6eba1155b80a5fa619990 100644 (file)
@@ -43,26 +43,26 @@ export const MainContentBar =
     connect((state: RootState) => ({
         buttonVisible: isButtonVisible(state)
     }), {
-        onDetailsPanelToggle: toggleDetailsPanel,
-    })(
-        withStyles(styles)(
-            (props: MainContentBarProps & WithStyles<CssRules> & any) =>
-                <Toolbar>
-                    <Grid container>
-                        <Grid item xs alignItems="center">
-                            <Breadcrumbs />
+            onDetailsPanelToggle: toggleDetailsPanel,
+        })(
+            withStyles(styles)(
+                (props: MainContentBarProps & WithStyles<CssRules> & any) =>
+                    <Toolbar>
+                        <Grid container>
+                            <Grid container item xs alignItems="center">
+                                <Breadcrumbs />
+                            </Grid>
+                            <Grid item>
+                                <RefreshButton />
+                            </Grid>
+                            <Grid item>
+                                {props.buttonVisible && <Tooltip title="Additional Info">
+                                    <IconButton color="inherit" className={props.classes.infoTooltip} onClick={props.onDetailsPanelToggle}>
+                                        <DetailsIcon />
+                                    </IconButton>
+                                </Tooltip>}
+                            </Grid>
                         </Grid>
-                        <Grid item>
-                            <RefreshButton />
-                        </Grid>
-                        <Grid item>
-                            {props.buttonVisible && <Tooltip title="Additional Info">
-                                <IconButton color="inherit" className={props.classes.infoTooltip} onClick={props.onDetailsPanelToggle}>
-                                    <DetailsIcon />
-                                </IconButton>
-                            </Tooltip>}
-                        </Grid>
-                    </Grid>
-                </Toolbar>
-        )
-    );
+                    </Toolbar>
+            )
+        );
index 109fb3057964c44ae396b8d898d9ae52d970891f..fbaba210e29b94cec6d32def6256c6eba116d342 100644 (file)
@@ -107,7 +107,7 @@ 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);
+        const loggedIn = props.sessions.filter((ss) => ss.loggedIn && ss.userIsActive);
         return <DataExplorer
             id={SEARCH_RESULTS_PANEL_ID}
             onRowClick={props.onItemClick}
index 223e373c58187e34bd3b3f5ea8dfce7ae1c9ec88..e6cc5b23e2a96d17a70575922303a1ef1c1f0330 100644 (file)
@@ -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>