[ARVADOS-WORKBENCH2] created: 1.4.1-366-gdd400401

Git user git at public.arvados.org
Wed Jun 24 20:38:27 UTC 2020


        at  dd4004015ae711939d2474dd8c6e031b6be2d0ff (commit)


commit dd4004015ae711939d2474dd8c6e031b6be2d0ff
Author: Daniel Kutyła <daniel.kutyla at contractors.roche.com>
Date:   Wed Jun 24 22:36:52 2020 +0200

    14990: adds 404 page with wildcard route
    
    Arvados-DCO-1.1-Signed-off-by: Daniel Kutyła <daniel.kutyla at contractors.roche.com>

diff --git a/src/routes/routes.ts b/src/routes/routes.ts
index 191fe11b..ebab383f 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',
+    NO_MATCH: '*',
 };
 
 export const getResourceUrl = (uuid: string) => {
diff --git a/src/store/navigation/navigation-action.ts b/src/store/navigation/navigation-action.ts
index fda6ec71..cb2eb186 100644
--- a/src/store/navigation/navigation-action.ts
+++ b/src/store/navigation/navigation-action.ts
@@ -52,6 +52,8 @@ export const navigateTo = (uuid: string) =>
         }
     };
 
+export const navigateToNotFound = push(Routes.NO_MATCH);
+
 export const navigateToRoot = push(Routes.ROOT);
 
 export const navigateToFavorites = push(Routes.FAVORITES);
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..7d8ed3fb
--- /dev/null
+++ b/src/views/not-found-panel/not-found-panel-root.tsx
@@ -0,0 +1,41 @@
+// Copyright (C) The Arvados Authors. All rights reserved.
+//
+// SPDX-License-Identifier: AGPL-3.0
+
+import * as React from 'react';
+import { StyleRulesCallback, WithStyles, withStyles, Paper, Grid } from '@material-ui/core';
+import { User } from "~/models/user";
+import { ArvadosTheme } from '~/common/custom-theme';
+
+type CssRules = 'root' | 'title';
+
+const styles: StyleRulesCallback<CssRules> = (theme: ArvadosTheme) => ({
+    root: {
+        overflow: 'hidden',
+        width: '100vw',
+        height: '100vh'
+    },
+    title: {
+        paddingLeft: theme.spacing.unit * 3,
+        paddingTop: theme.spacing.unit * 3,
+        fontSize: '18px'
+    }
+});
+
+export interface NotFoundPanelRootDataProps {
+    user?: User;
+}
+
+type NotFoundPanelRootProps = NotFoundPanelRootDataProps & WithStyles<CssRules>;
+
+export const NotFoundPanelRoot = withStyles(styles)(
+    ({ classes }: NotFoundPanelRootProps) =>
+    <Paper>
+        <Grid container justify="space-between" wrap="nowrap" alignItems="center">
+            <div className={classes.title}>
+                <h2>Not Found</h2>
+                <p>The page you requested was not found.</p>
+            </div>
+        </Grid>
+    </Paper>
+);
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..9631c815
--- /dev/null
+++ b/src/views/not-found-panel/not-found-panel.tsx
@@ -0,0 +1,17 @@
+// Copyright (C) The Arvados Authors. All rights reserved.
+//
+// SPDX-License-Identifier: AGPL-3.0
+
+import { RootState } from '~/store/store';
+import { connect } from 'react-redux';
+import { NotFoundPanelRoot, NotFoundPanelRootDataProps } from '~/views/not-found-panel/not-found-panel-root';
+
+const mapStateToProps = (state: RootState): NotFoundPanelRootDataProps => {
+    return {
+        user: state.auth.user,
+    };
+};
+
+const mapDispatchToProps = null;
+
+export const NotFoundPanel = connect(mapStateToProps, mapDispatchToProps)(NotFoundPanelRoot);
diff --git a/src/views/workbench/workbench.tsx b/src/views/workbench/workbench.tsx
index 31c2a026..4526132a 100644
--- a/src/views/workbench/workbench.tsx
+++ b/src/views/workbench/workbench.tsx
@@ -96,6 +96,7 @@ import { LinkAccountPanel } from '~/views/link-account-panel/link-account-panel'
 import { FedLogin } from './fed-login';
 import { CollectionsContentAddressPanel } from '~/views/collection-content-address-panel/collection-content-address-panel';
 import { AllProcessesPanel } from '../all-processes-panel/all-processes-panel';
+import { NotFoundPanel } from '../not-found-panel/not-found-panel';
 
 type CssRules = 'root' | 'container' | 'splitter' | 'asidePanel' | 'contentWrapper' | 'content';
 
@@ -188,6 +189,7 @@ 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.NO_MATCH} component={NotFoundPanel} />
                             </Switch>
                         </Grid>
                     </Grid>

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


hooks/post-receive
-- 




More information about the arvados-commits mailing list