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

[dashboard] Add a few minor missing pages #3760

Merged
merged 3 commits into from
Apr 6, 2021
Merged
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
23 changes: 22 additions & 1 deletion components/dashboard/src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import { shouldSeeWhatsNew, WhatsNew } from './WhatsNew';
import settingsMenu from './settings/settings-menu';
import { User } from '@gitpod/gitpod-protocol';
import { adminMenu } from './admin/admin-menu';
import gitpodIcon from './icons/gitpod.svg';

const Workspaces = React.lazy(() => import(/* webpackPrefetch: true */ './workspaces/Workspaces'));
const Account = React.lazy(() => import(/* webpackPrefetch: true */ './settings/Account'));
Expand Down Expand Up @@ -60,7 +61,15 @@ function App() {
}
if (!user) {
return (<Login />)
};
}
if (window.location.pathname.startsWith('/blocked')) {
return <div className="mt-48 text-center">
<img src={gitpodIcon} className="h-16 mx-auto"/>
<h1 className="mt-12 text-gray-500 text-3xl">Your account has been blocked.</h1>
<p className="mt-4 mb-8 text-lg w-96 mx-auto">Please contact support if you think this is an error. See also <a className="hover:text-blue-600" href="https://www.gitpod.io/terms/">terms of service</a>.</p>
<a className="mx-auto" href="mailto:support@gitpod.io?Subject=Blocked"><button className="secondary">Contact Support</button></a>
</div>;
}
const shouldWhatsNewShown = shouldSeeWhatsNew(user)
if (shouldWhatsNewShown !== isWhatsNewShown) {
setWhatsNewShown(shouldWhatsNewShown);
Expand Down Expand Up @@ -106,6 +115,18 @@ function App() {
<Route path={["/admin"]} exact>
<Redirect to="/admin/users"/>
</Route>
<Route path="/sorry" exact>
<div className="mt-48 text-center">
<h1 className="text-gray-500 text-3xl">Oh, no! Something went wrong!</h1>
<p className="mt-4 text-lg text-gitpod-red">{decodeURIComponent(getURLHash())}</p>
</div>
</Route>
<Route path="*" /* status={404} */>
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would be nice to send an actual HTTP 404 status code here, but this requires some server-side hook.

<div className="mt-48 text-center">
<h1 className="text-gray-500 text-3xl">404</h1>
<p className="mt-4 text-lg">Page not found.</p>
</div>
</Route>
</Switch>
</div>
</Route>;
Expand Down