[ARVADOS-WORKBENCH2] created: 1.4.1-292-g9fa1d108

Git user git at public.arvados.org
Fri Feb 28 10:52:01 UTC 2020


        at  9fa1d108babf22fc20bfc625f13e2cbc66396137 (commit)


commit 9fa1d108babf22fc20bfc625f13e2cbc66396137
Author: PiotrAleksander <piotrhugonow at gmail.com>
Date:   Fri Feb 28 11:51:48 2020 +0100

    not found panel added, redirect if url provided was not found

diff --git a/src/routes/routes.ts b/src/routes/routes.ts
index 191fe11b..e21bdd16 100644
--- a/src/routes/routes.ts
+++ b/src/routes/routes.ts
@@ -48,6 +48,7 @@ export const Routes = {
     PUBLIC_FAVORITES: '/public-favorites',
     COLLECTIONS_CONTENT_ADDRESS: '/collections/:id',
     ALL_PROCESSES: '/all_processes',
+    NOT_FOUND: '/not_found',
 };
 
 export const getResourceUrl = (uuid: string) => {
@@ -74,12 +75,12 @@ export const getNavUrl = (uuid: string, config: FederationConfig) => {
     } else if (config.remoteHostsConfig[cls]) {
         let u: URL;
         if (config.remoteHostsConfig[cls].workbench2Url) {
-	    /* NOTE: wb2 presently doesn't support passing api_token
-	       to arbitrary page to set credentials, only through
-	       api-token route.  So for navigation to work, user needs
-	       to already be logged in.  In the future we want to just
-	       request the records and display in the current
-	       workbench instance making this redirect unnecessary. */
+            /* NOTE: wb2 presently doesn't support passing api_token
+               to arbitrary page to set credentials, only through
+               api-token route.  So for navigation to work, user needs
+               to already be logged in.  In the future we want to just
+               request the records and display in the current
+               workbench instance making this redirect unnecessary. */
             u = new URL(config.remoteHostsConfig[cls].workbench2Url);
         } else {
             u = new URL(config.remoteHostsConfig[cls].workbenchUrl);
diff --git a/src/views/not-found-panel/not-found-panel-root.tsx b/src/views/not-found-panel/not-found-panel-root.tsx
new file mode 100644
index 00000000..79273a1a
--- /dev/null
+++ b/src/views/not-found-panel/not-found-panel-root.tsx
@@ -0,0 +1,38 @@
+// Copyright (C) The Arvados Authors. All rights reserved.
+//
+// SPDX-License-Identifier: AGPL-3.0
+
+import * as React from 'react';
+import {
+    StyleRulesCallback,
+    WithStyles,
+    withStyles,
+    Card,
+    CardContent,
+    Typography,
+} from '@material-ui/core';
+import { ArvadosTheme } from '~/common/custom-theme';
+
+type CssRules = 'root' | 'title';
+
+const styles: StyleRulesCallback<CssRules> = (theme: ArvadosTheme) => ({
+    root: {
+        width: '100%',
+        overflow: 'auto'
+    },
+    title: {
+        color: theme.palette.grey["600"]
+    },
+});
+
+export default withStyles(styles)(
+    ({ classes }: WithStyles<CssRules>) => {
+        return <Card className={classes.root}>
+            <CardContent>
+                <Typography variant="title" className={classes.title}>
+                    URL provided was not found.
+                </Typography>
+            </CardContent >
+        </Card >;
+    }
+);
diff --git a/src/views/not-found-panel/not-found-panel.tsx b/src/views/not-found-panel/not-found-panel.tsx
new file mode 100644
index 00000000..138a5245
--- /dev/null
+++ b/src/views/not-found-panel/not-found-panel.tsx
@@ -0,0 +1,6 @@
+// Copyright (C) The Arvados Authors. All rights reserved.
+//
+// SPDX-License-Identifier: AGPL-3.0
+import NotFoundPanel from './not-found-panel-root';
+
+export { NotFoundPanel };
\ No newline at end of file
diff --git a/src/views/workbench/workbench.tsx b/src/views/workbench/workbench.tsx
index 31c2a026..b68ccaa1 100644
--- a/src/views/workbench/workbench.tsx
+++ b/src/views/workbench/workbench.tsx
@@ -4,7 +4,7 @@
 
 import * as React from 'react';
 import { StyleRulesCallback, WithStyles, withStyles } from '@material-ui/core/styles';
-import { Route, Switch } from "react-router";
+import { Route, Switch, Redirect } from "react-router";
 import { ProjectPanel } from "~/views/project-panel/project-panel";
 import { DetailsPanel } from '~/views-components/details-panel/details-panel';
 import { ArvadosTheme } from '~/common/custom-theme';
@@ -47,6 +47,7 @@ import { SearchResultsPanel } from '~/views/search-results-panel/search-results-
 import { SshKeyPanel } from '~/views/ssh-key-panel/ssh-key-panel';
 import { SiteManagerPanel } from "~/views/site-manager-panel/site-manager-panel";
 import { MyAccountPanel } from '~/views/my-account-panel/my-account-panel';
+import { NotFoundPanel } from '~/views/not-found-panel/not-found-panel';
 import { SharingDialog } from '~/views-components/sharing-dialog/sharing-dialog';
 import { AdvancedTabDialog } from '~/views-components/advanced-tab-dialog/advanced-tab-dialog';
 import { ProcessInputDialog } from '~/views-components/process-input-dialog/process-input-dialog';
@@ -151,12 +152,12 @@ export const WorkbenchPanel =
                     primaryIndex={0} primaryMinSize={10}
                     secondaryInitialSize={getSplitterInitialSize()} secondaryMinSize={40}
                     onSecondaryPaneSizeChange={saveSplitterSize}>
-                    { props.isUserActive && props.isNotLinking && <Grid container item xs component='aside' direction='column' className={props.classes.asidePanel}>
+                    {props.isUserActive && props.isNotLinking && <Grid container item xs component='aside' direction='column' className={props.classes.asidePanel}>
                         <SidePanel />
-                    </Grid> }
+                    </Grid>}
                     <Grid container item xs component="main" direction="column" className={props.classes.contentWrapper}>
                         <Grid item xs>
-                            { props.isNotLinking && <MainContentBar /> }
+                            {props.isNotLinking && <MainContentBar />}
                         </Grid>
                         <Grid item xs className={props.classes.content}>
                             <Switch>
@@ -188,6 +189,8 @@ export const WorkbenchPanel =
                                 <Route path={Routes.PUBLIC_FAVORITES} component={PublicFavoritePanel} />
                                 <Route path={Routes.LINK_ACCOUNT} component={LinkAccountPanel} />
                                 <Route path={Routes.COLLECTIONS_CONTENT_ADDRESS} component={CollectionsContentAddressPanel} />
+                                <Route path={Routes.NOT_FOUND} component={NotFoundPanel} />
+                                <Redirect to={Routes.NOT_FOUND} />
                             </Switch>
                         </Grid>
                     </Grid>

-----------------------------------------------------------------------


hooks/post-receive
-- 




More information about the arvados-commits mailing list