Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: survey list home page #1118

Merged
merged 4 commits into from
Aug 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 1 addition & 11 deletions app/src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ import {BrowserRouter as Router, Route, Routes} from 'react-router-dom';
import './App.css';
import * as ROUTES from './constants/routes';
import {PrivateRoute} from './constants/privateRouter';
import Index from './gui/pages';
import {SignIn} from './gui/pages/signin';
import AboutBuild from './gui/pages/about-build';
import Workspace from './gui/pages/workspace';
Expand Down Expand Up @@ -85,7 +84,7 @@ export default function App() {
}
/>
<Route
path={ROUTES.WORKSPACE}
path={ROUTES.INDEX}
element={
<PrivateRoute allowed={Boolean(token)}>
<Workspace />
Expand Down Expand Up @@ -182,15 +181,6 @@ export default function App() {
</PrivateRoute>
}
/>
<Route
path={'/'}
element={
<PrivateRoute allowed>
<Index token={token} />
</PrivateRoute>
}
/>

<Route path={ROUTES.ABOUT_BUILD} Component={AboutBuild} />
<Route Component={NotFound404} />
</Routes>
Expand Down
1 change: 0 additions & 1 deletion app/src/constants/routes.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ export const INDEX = '/';
export const SIGN_IN = '/signin/';

export const NOT_FOUND = '/not-found';
export const WORKSPACE = '/workspace';

export const INDIVIDUAL_NOTEBOOK_ROUTE = `/${NOTEBOOK_NAME}s/`;
export const NOTEBOOK_LIST_ROUTE = `/${NOTEBOOK_NAME}s`;
Expand Down
2 changes: 1 addition & 1 deletion app/src/gui/components/authentication/appbarAuth.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ export default function AppBarAuth(props: AppBarAuthProps) {
open={Boolean(anchorEl)}
onClose={handleClose}
>
<MenuItem onClick={() => handleRoutingAndClose(ROUTES.WORKSPACE)}>
<MenuItem onClick={() => handleRoutingAndClose(ROUTES.INDEX)}>
<ListItemIcon>
<DashboardIcon fontSize="small" />
</ListItemIcon>
Expand Down
2 changes: 1 addition & 1 deletion app/src/gui/components/authentication/cluster_card.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,7 @@ export default function ClusterCard(props: ClusterCardProps) {
<Button
color="primary"
variant="text"
onClick={() => history(ROUTES.WORKSPACE)}
onClick={() => history(ROUTES.INDEX)}
startIcon={<DashboardIcon />}
sx={{ml: 2}}
>
Expand Down
2 changes: 2 additions & 0 deletions app/src/gui/components/authentication/login_form.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,8 @@ export function LoginButton(props: LoginButtonProps) {
console.debug('token is', token);
props.setToken(token);
reprocess_listing(props.listing_id);

window.location.href = '/';
})
.catch(() => {
props.setToken(undefined);
Expand Down
1 change: 0 additions & 1 deletion app/src/gui/components/footer/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,6 @@ export default function Footer(props: FooterProps) {
const location = useLocation().pathname;
const showFullFooter = [
ROUTES.INDEX,
ROUTES.WORKSPACE,
// ROUTES.SIGN_IN,
].includes(location);
return (
Expand Down
2 changes: 1 addition & 1 deletion app/src/gui/components/notebook/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ export default function NotebookComponent(props: NotebookComponentProps) {
<Button
variant="text"
size={'small'}
onClick={() => history(ROUTES.WORKSPACE)}
onClick={() => history(ROUTES.INDEX)}
startIcon={<DashboardIcon />}
>
Workspace
Expand Down
8 changes: 1 addition & 7 deletions app/src/gui/layout/appBar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
import Drawer from '@mui/material/Drawer';
import Divider from '@mui/material/Divider';
import List from '@mui/material/List';
import HomeIcon from '@mui/icons-material/Home';

Check warning on line 40 in app/src/gui/layout/appBar.tsx

View workflow job for this annotation

GitHub Actions / Build and Test

'HomeIcon' is defined but never used
import ChevronLeftIcon from '@mui/icons-material/ChevronLeft';
import DescriptionIcon from '@mui/icons-material/Description';
import ListItemIcon from '@mui/material/ListItemIcon';
Expand Down Expand Up @@ -186,14 +186,8 @@
const topMenuItems: Array<MenuItemProps> = [
{
title: 'Home',
icon: <HomeIcon />,
to: ROUTES.INDEX,
disabled: false,
},
{
title: 'WorkSpace',
icon: <DashboardIcon />,
to: ROUTES.WORKSPACE,
to: ROUTES.INDEX,
disabled: !isAuthenticated,
},
projectList === null
Expand All @@ -204,10 +198,10 @@
disabled: true,
}
: isAuthenticated
? getNestedProjects(projectList)

Check warning on line 201 in app/src/gui/layout/appBar.tsx

View workflow job for this annotation

GitHub Actions / Build and Test

Insert `··`
: {

Check warning on line 202 in app/src/gui/layout/appBar.tsx

View workflow job for this annotation

GitHub Actions / Build and Test

Insert `··`
title: `${NOTEBOOK_NAME_CAPITALIZED}s`,

Check warning on line 203 in app/src/gui/layout/appBar.tsx

View workflow job for this annotation

GitHub Actions / Build and Test

Insert `··`
icon: <AccountTree />,

Check warning on line 204 in app/src/gui/layout/appBar.tsx

View workflow job for this annotation

GitHub Actions / Build and Test

Replace `··········` with `············`
to: '/',
disabled: true,
},
Expand Down
2 changes: 1 addition & 1 deletion app/src/gui/pages/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ export default function Index(props: IndexProps) {
disableElevation
sx={{mr: 1}}
component={NavLink}
to={ROUTES.WORKSPACE}
to={ROUTES.INDEX}
startIcon={<DashboardIcon />}
>
Workspace
Expand Down
2 changes: 1 addition & 1 deletion app/src/logging.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ export const ErrorPage = () => {
// Do a full page reload of the workspace to ensure we get out of
// any bogus state...may not be the right way to respond
const navigateWS = () => {
window.location.href = ROUTES.WORKSPACE;
window.location.href = ROUTES.INDEX;
};

return (
Expand Down
Loading