2019-11-25 05:07:27 +00:00
|
|
|
import { MenuIcons } from "icons/MenuIcons";
|
2019-10-18 08:16:26 +00:00
|
|
|
export const BASE_URL = "/";
|
|
|
|
|
export const LOGIN_URL = "/login";
|
2019-11-07 04:59:40 +00:00
|
|
|
export const APPLICATIONS_URL = `/applications`;
|
2019-11-22 14:02:55 +00:00
|
|
|
export const BUILDER_URL = "/applications/:applicationId/pages/:pageId/edit";
|
2019-11-07 04:59:40 +00:00
|
|
|
|
2019-11-22 14:02:55 +00:00
|
|
|
export type BuilderRouteParams = {
|
|
|
|
|
applicationId: string;
|
|
|
|
|
pageId: string;
|
|
|
|
|
};
|
2019-11-07 04:59:40 +00:00
|
|
|
|
2019-11-22 14:02:55 +00:00
|
|
|
export type AppViewerRouteParams = {
|
|
|
|
|
applicationId?: string;
|
|
|
|
|
pageId?: string;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
export type APIEditorRouteParams = {
|
|
|
|
|
applicationId: string;
|
|
|
|
|
pageId: string;
|
|
|
|
|
apiId?: string;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
export const BUILDER_BASE_URL = (applicationId = ":applicationId"): string =>
|
|
|
|
|
`/applications/${applicationId}`;
|
|
|
|
|
|
|
|
|
|
export const BUILDER_PAGE_URL = (
|
|
|
|
|
applicationId?: string,
|
2019-11-07 04:59:40 +00:00
|
|
|
pageId?: string,
|
2019-11-22 14:02:55 +00:00
|
|
|
): string => {
|
|
|
|
|
if (!pageId) return APPLICATIONS_URL;
|
|
|
|
|
return `${BUILDER_BASE_URL(applicationId)}/pages/${pageId}/edit`;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
export const API_EDITOR_URL = (
|
|
|
|
|
applicationId = ":applicationId",
|
|
|
|
|
pageId = ":pageId",
|
|
|
|
|
): string => `${BUILDER_PAGE_URL(applicationId, pageId)}/api`;
|
|
|
|
|
|
|
|
|
|
export const API_EDITOR_ID_URL = (
|
|
|
|
|
applicationId = ":applicationId",
|
|
|
|
|
pageId = ":pageId",
|
|
|
|
|
apiId = ":apiId",
|
|
|
|
|
): string => `${API_EDITOR_URL(applicationId, pageId)}/${apiId}`;
|
|
|
|
|
|
|
|
|
|
export const APP_VIEW_URL = `/applications/:applicationId`;
|
|
|
|
|
|
|
|
|
|
export const getApplicationViewerURL = (
|
|
|
|
|
applicationId = ":applicationId",
|
|
|
|
|
): string => `/applications/${applicationId}`;
|
|
|
|
|
|
|
|
|
|
export const getApplicationViewerPageURL = (
|
|
|
|
|
applicationId = ":applicationId",
|
|
|
|
|
pageId = ":pageId",
|
|
|
|
|
): string => `/applications/${applicationId}/pages/${pageId}`;
|
2019-10-29 12:02:58 +00:00
|
|
|
|
|
|
|
|
export const EDITOR_ROUTES = [
|
|
|
|
|
{
|
|
|
|
|
icon: MenuIcons.WIDGETS_ICON,
|
2019-11-22 14:02:55 +00:00
|
|
|
path: BUILDER_PAGE_URL,
|
2019-10-29 12:02:58 +00:00
|
|
|
title: "Widgets",
|
2019-11-07 09:32:38 +00:00
|
|
|
exact: true,
|
2019-10-29 12:02:58 +00:00
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
icon: MenuIcons.APIS_ICON,
|
|
|
|
|
path: API_EDITOR_URL,
|
|
|
|
|
title: "APIs",
|
|
|
|
|
exact: false,
|
|
|
|
|
},
|
|
|
|
|
];
|