Skip to content

Commit

Permalink
ui: move schema viewer under the admin path
Browse files Browse the repository at this point in the history
Signed-off-by: Miguel Garcia Garcia <[email protected]>
  • Loading branch information
miguelgrc committed Jul 17, 2023
1 parent a173d84 commit 2114a62
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion ui/cap-react/src/actions/schemaWizard.js
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,7 @@ export function createContentType(content_type) {

export function selectContentType(id) {
return function (dispatch) {
dispatch(push(`${CMS}/${id}`));
dispatch(push(`${CMS_EDITOR}/${id}`));
};
}

Expand Down
7 changes: 4 additions & 3 deletions ui/cap-react/src/antd/App/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,13 @@ import Footer from "../partials/Footer";
import DocumentTitle from "../partials/DocumentTitle";
import { Layout, Row, Spin } from "antd";

import { HOME, WELCOME, ABOUT, POLICY, CMS, SCHEMAS } from "../routes";
import { HOME, WELCOME, ABOUT, POLICY, CMS, SCHEMA } from "../routes";

import ErrorPage from "../utils/ErrorPage";
import * as Sentry from "@sentry/react";
import useTrackPageViews from "../hooks/useTrackPageViews";
import { lazy } from "react";
import Loading from "../routes/Loading/Loading";
import Loading from "../routes/Loading";

const AdminPage = lazy(() => import("../admin"));

Expand Down Expand Up @@ -63,7 +64,7 @@ const App = ({ initCurrentUser, loadingInit, history, roles }) => {
<Route path={ABOUT} component={AboutPage} />
<Route path={POLICY} component={PolicyPage} />
{isAdmin && <Route path={CMS} component={AdminPage} />}
<Route path={SCHEMAS} component={SchemasPage} />
<Route path={SCHEMA} component={SchemasPage} />
<Route path={HOME} component={requireAuth(IndexPage)} />
</Switch>
</Suspense>
Expand Down
9 changes: 4 additions & 5 deletions ui/cap-react/src/antd/routes/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,12 @@ export const ABOUT = "/about";
export const POLICY = "/policy";
export const SEARCH_TIPS = "/search-tips";
export const STATUS = "/status";
export const SCHEMAS = "/schemas/:schema_name/:schema_version?";
export const SCHEMA = "/admin/schema/:schema_name/:schema_version?";

export const CMS = "/admin";
export const CMS_NEW = `${CMS}/new`;
export const CMS_SCHEMA_PATH = `${CMS}/:schema_name?/:schema_version?`;
export const CMS_NOTIFICATION = `${CMS_SCHEMA_PATH}/notifications/:category?`;
export const CMS_NOTIFICATION_EDIT = `${CMS_NOTIFICATION}/:id?`;
export const CMS_EDITOR = `${CMS}/editor`;
export const CMS_NEW = `${CMS_EDITOR}/new`;
export const CMS_SCHEMA_PATH = `${CMS_EDITOR}/:schema_name?/:schema_version?`;
export const COLLECTION_BASE = "/collection";
export const COLLECTION = `${COLLECTION_BASE}/:collection_name/:version?`;

Expand Down

0 comments on commit 2114a62

Please sign in to comment.