mirror of
https://github.com/outline/outline.git
synced 2026-04-24 02:59:21 -05:00
fix: Catch-all route in development (#11016)
This commit is contained in:
@@ -57,91 +57,81 @@ function AuthenticatedRoutes() {
|
||||
const can = usePolicy(team);
|
||||
|
||||
return (
|
||||
<Switch>
|
||||
<WebsocketProvider>
|
||||
<AuthenticatedLayout>
|
||||
<Suspense
|
||||
fallback={
|
||||
<CenteredContent>
|
||||
<PlaceholderDocument />
|
||||
</CenteredContent>
|
||||
}
|
||||
>
|
||||
<Switch>
|
||||
{can.createDocument && (
|
||||
<Route exact path={draftsPath()} component={Drafts} />
|
||||
)}
|
||||
{can.createDocument && (
|
||||
<Route exact path={archivePath()} component={Archive} />
|
||||
)}
|
||||
{can.createDocument && (
|
||||
<Route exact path={trashPath()} component={Trash} />
|
||||
)}
|
||||
<Route path={`${homePath()}/:tab?`} component={Home} />
|
||||
<Redirect from="/dashboard" to={homePath()} />
|
||||
<Redirect exact from="/starred" to={homePath()} />
|
||||
<Redirect
|
||||
exact
|
||||
from="/templates"
|
||||
to={settingsPath("templates")}
|
||||
/>
|
||||
<Redirect exact from="/collections/*" to="/collection/*" />
|
||||
<Route
|
||||
exact
|
||||
path={`/collection/${collectionSlug}/new`}
|
||||
component={DocumentNew}
|
||||
/>
|
||||
<Route
|
||||
exact
|
||||
path={`/collection/${collectionSlug}/overview/edit`}
|
||||
component={Collection}
|
||||
/>
|
||||
<Route
|
||||
exact
|
||||
path={`/collection/${collectionSlug}/:tab?`}
|
||||
component={Collection}
|
||||
/>
|
||||
<Route exact path="/doc/new" component={DocumentNew} />
|
||||
<Route
|
||||
exact
|
||||
path={`/d/${documentSlug}`}
|
||||
component={RedirectDocument}
|
||||
/>
|
||||
<Route
|
||||
exact
|
||||
path={`/doc/${documentSlug}/history/:revisionId?`}
|
||||
component={Document}
|
||||
/>
|
||||
<WebsocketProvider>
|
||||
<AuthenticatedLayout>
|
||||
<Suspense
|
||||
fallback={
|
||||
<CenteredContent>
|
||||
<PlaceholderDocument />
|
||||
</CenteredContent>
|
||||
}
|
||||
>
|
||||
<Switch>
|
||||
{can.createDocument && (
|
||||
<Route exact path={draftsPath()} component={Drafts} />
|
||||
)}
|
||||
{can.createDocument && (
|
||||
<Route exact path={archivePath()} component={Archive} />
|
||||
)}
|
||||
{can.createDocument && (
|
||||
<Route exact path={trashPath()} component={Trash} />
|
||||
)}
|
||||
<Route path={`${homePath()}/:tab?`} component={Home} />
|
||||
<Redirect from="/dashboard" to={homePath()} />
|
||||
<Redirect exact from="/starred" to={homePath()} />
|
||||
<Redirect exact from="/templates" to={settingsPath("templates")} />
|
||||
<Redirect exact from="/collections/*" to="/collection/*" />
|
||||
<Route
|
||||
exact
|
||||
path={`/collection/${collectionSlug}/new`}
|
||||
component={DocumentNew}
|
||||
/>
|
||||
<Route
|
||||
exact
|
||||
path={`/collection/${collectionSlug}/overview/edit`}
|
||||
component={Collection}
|
||||
/>
|
||||
<Route
|
||||
exact
|
||||
path={`/collection/${collectionSlug}/:tab?`}
|
||||
component={Collection}
|
||||
/>
|
||||
<Route exact path="/doc/new" component={DocumentNew} />
|
||||
<Route
|
||||
exact
|
||||
path={`/d/${documentSlug}`}
|
||||
component={RedirectDocument}
|
||||
/>
|
||||
<Route
|
||||
exact
|
||||
path={`/doc/${documentSlug}/history/:revisionId?`}
|
||||
component={Document}
|
||||
/>
|
||||
|
||||
<Route
|
||||
exact
|
||||
path={`/doc/${documentSlug}/edit`}
|
||||
component={Document}
|
||||
/>
|
||||
<Route path={`/doc/${documentSlug}`} component={Document} />
|
||||
<Route exact path={`${searchPath()}/:query?`} component={Search} />
|
||||
{env.isDevelopment && (
|
||||
<Route exact path={debugPath()} component={Debug} />
|
||||
)}
|
||||
{env.isDevelopment && (
|
||||
<Route
|
||||
exact
|
||||
path={`/doc/${documentSlug}/edit`}
|
||||
component={Document}
|
||||
path={`${debugPath()}/changesets`}
|
||||
component={Changesets}
|
||||
/>
|
||||
<Route path={`/doc/${documentSlug}`} component={Document} />
|
||||
<Route
|
||||
exact
|
||||
path={`${searchPath()}/:query?`}
|
||||
component={Search}
|
||||
/>
|
||||
{env.isDevelopment && (
|
||||
<>
|
||||
<Route exact path={debugPath()} component={Debug} />
|
||||
<Route
|
||||
exact
|
||||
path={`${debugPath()}/changesets`}
|
||||
component={Changesets}
|
||||
/>
|
||||
</>
|
||||
)}
|
||||
<Route path="/404" component={Error404} />
|
||||
<SettingsRoutes />
|
||||
<Route component={Error404} />
|
||||
</Switch>
|
||||
</Suspense>
|
||||
</AuthenticatedLayout>
|
||||
</WebsocketProvider>
|
||||
</Switch>
|
||||
)}
|
||||
<Route exact path="/404" component={Error404} />
|
||||
<SettingsRoutes />
|
||||
<Route component={Error404} />
|
||||
</Switch>
|
||||
</Suspense>
|
||||
</AuthenticatedLayout>
|
||||
</WebsocketProvider>
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
@@ -15,7 +15,7 @@ const Error403 = () => {
|
||||
return (
|
||||
<Scene title={t("No access to this doc")}>
|
||||
<Heading>{t("No access to this doc")}</Heading>
|
||||
<VStack spacing={20} style={{ maxWidth: 500 }}>
|
||||
<VStack spacing={20} style={{ maxWidth: 500 }} align="initial">
|
||||
<Empty size="large">
|
||||
{t(
|
||||
"It doesn’t look like you have permission to access this document."
|
||||
|
||||
@@ -16,7 +16,7 @@ const Error404 = () => {
|
||||
return (
|
||||
<Scene title={t("Not found")}>
|
||||
<Heading>{t("Not found")}</Heading>
|
||||
<VStack spacing={20} style={{ maxWidth: 500 }}>
|
||||
<VStack spacing={20} style={{ maxWidth: 500 }} align="initial">
|
||||
<Empty size="large">
|
||||
<Trans>
|
||||
The page you’re looking for cannot be found. It might have been
|
||||
|
||||
@@ -15,7 +15,7 @@ const ErrorUnknown = () => {
|
||||
<CenteredContent>
|
||||
<PageTitle title={t("Something went wrong")} />
|
||||
<Heading>{t("Something went wrong")}</Heading>
|
||||
<VStack spacing={20} style={{ maxWidth: 500 }}>
|
||||
<VStack spacing={20} style={{ maxWidth: 500 }} align="initial">
|
||||
<Empty size="large">
|
||||
<Trans>
|
||||
Sorry, an unknown error occurred loading the page. Please try again
|
||||
|
||||
Reference in New Issue
Block a user