2019-10-18 08:16:26 +00:00
|
|
|
export const BASE_URL = "/";
|
2019-12-23 12:16:33 +00:00
|
|
|
export const ORG_URL = "/org";
|
2020-07-08 10:14:03 +00:00
|
|
|
export const PAGE_NOT_FOUND_URL = "/404";
|
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-12-16 08:49:10 +00:00
|
|
|
export const USER_AUTH_URL = "/user";
|
2020-01-31 10:46:43 +00:00
|
|
|
export const USERS_URL = "/users";
|
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;
|
|
|
|
|
};
|
|
|
|
|
|
2020-04-14 12:34:14 +00:00
|
|
|
export type ProviderViewerRouteParams = {
|
|
|
|
|
applicationId: string;
|
|
|
|
|
pageId: string;
|
|
|
|
|
providerId: string;
|
|
|
|
|
};
|
|
|
|
|
|
2020-05-05 07:50:30 +00:00
|
|
|
export type QueryEditorRouteParams = {
|
|
|
|
|
applicationId: string;
|
|
|
|
|
pageId: string;
|
|
|
|
|
queryId: string;
|
|
|
|
|
};
|
|
|
|
|
|
2019-11-22 14:02:55 +00:00
|
|
|
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,
|
2020-04-01 08:09:57 +00:00
|
|
|
params?: Record<string, string>,
|
2019-11-22 14:02:55 +00:00
|
|
|
): string => {
|
|
|
|
|
if (!pageId) return APPLICATIONS_URL;
|
2020-04-01 08:09:57 +00:00
|
|
|
const queryParams = convertToQueryParams(params);
|
|
|
|
|
return (
|
|
|
|
|
`${BUILDER_BASE_URL(applicationId)}/pages/${pageId}/edit` + queryParams
|
|
|
|
|
);
|
2019-11-22 14:02:55 +00:00
|
|
|
};
|
|
|
|
|
|
Feature/entity browse (#220)
# New Feature: Entity Explorer
- Entities are actions (apis and queries), datasources, pages, and widgets
- With this new feature, all entities in the application will be available
to view in the new entity explorer sidebar
- All existing application features from the api sidebar, query sidebar, datasource sidebar and pages sidebar
now are avialable on the entity explorer sidebar
- Users are now able to quickly switch to any entity in the application from the entity explorer sidebar.
- Users can also search all entities in the application from the new sidebar. Use cmd + f or ctrl + f to focus on the search input
- Users can rename entities from the new sidebar
- Users can also perform contextual actions on these entities like set a page as home page, copy/move actions, delete entity, etc from the context menu available alongside the entities in the sidebar
- Users can view the properties of the entities in the sidebar, as well as copy bindings to use in the application.
2020-08-10 08:52:45 +00:00
|
|
|
export const WIDGETS_URL = (
|
|
|
|
|
applicationId = ":applicationId",
|
|
|
|
|
pageId = ":pageId",
|
|
|
|
|
params?: Record<string, string>,
|
|
|
|
|
): string => {
|
|
|
|
|
if (!pageId) return APPLICATIONS_URL;
|
|
|
|
|
const queryParams = convertToQueryParams(params);
|
|
|
|
|
return (
|
|
|
|
|
`${BUILDER_BASE_URL(applicationId)}/pages/${pageId}/edit/widgets` +
|
|
|
|
|
queryParams
|
|
|
|
|
);
|
|
|
|
|
};
|
|
|
|
|
|
2019-11-22 14:02:55 +00:00
|
|
|
export const API_EDITOR_URL = (
|
|
|
|
|
applicationId = ":applicationId",
|
|
|
|
|
pageId = ":pageId",
|
|
|
|
|
): string => `${BUILDER_PAGE_URL(applicationId, pageId)}/api`;
|
|
|
|
|
|
2020-01-27 08:24:58 +00:00
|
|
|
export const PAGE_LIST_EDITOR_URL = (
|
|
|
|
|
applicationId = ":applicationId",
|
|
|
|
|
pageId = ":pageId",
|
|
|
|
|
): string => `${BUILDER_PAGE_URL(applicationId, pageId)}/pages`;
|
|
|
|
|
|
2020-04-28 06:52:53 +00:00
|
|
|
export const DATA_SOURCES_EDITOR_URL = (
|
|
|
|
|
applicationId = ":applicationId",
|
|
|
|
|
pageId = ":pageId",
|
|
|
|
|
): string => `${BUILDER_PAGE_URL(applicationId, pageId)}/datasources`;
|
|
|
|
|
|
|
|
|
|
export const DATA_SOURCES_EDITOR_ID_URL = (
|
|
|
|
|
applicationId = ":applicationId",
|
|
|
|
|
pageId = ":pageId",
|
|
|
|
|
datasourceId = ":datasourceId",
|
|
|
|
|
): string =>
|
|
|
|
|
`${DATA_SOURCES_EDITOR_URL(applicationId, pageId)}/${datasourceId}`;
|
|
|
|
|
|
2020-05-05 07:50:30 +00:00
|
|
|
export const QUERIES_EDITOR_URL = (
|
|
|
|
|
applicationId = ":applicationId",
|
|
|
|
|
pageId = ":pageId",
|
|
|
|
|
): string => `${BUILDER_PAGE_URL(applicationId, pageId)}/queries`;
|
|
|
|
|
|
|
|
|
|
export const QUERIES_EDITOR_ID_URL = (
|
|
|
|
|
applicationId = ":applicationId",
|
|
|
|
|
pageId = ":pageId",
|
|
|
|
|
queryId = ":queryId",
|
2020-07-06 05:38:39 +00:00
|
|
|
params = {},
|
|
|
|
|
): string => {
|
|
|
|
|
const queryparams = convertToQueryParams(params);
|
|
|
|
|
return `${QUERIES_EDITOR_URL(
|
|
|
|
|
applicationId,
|
|
|
|
|
pageId,
|
|
|
|
|
)}/${queryId}${queryparams}`;
|
|
|
|
|
};
|
2020-05-05 07:50:30 +00:00
|
|
|
|
2019-11-22 14:02:55 +00:00
|
|
|
export const API_EDITOR_ID_URL = (
|
|
|
|
|
applicationId = ":applicationId",
|
|
|
|
|
pageId = ":pageId",
|
|
|
|
|
apiId = ":apiId",
|
2020-07-06 05:38:39 +00:00
|
|
|
params = {},
|
|
|
|
|
): string => {
|
|
|
|
|
const queryParams = convertToQueryParams(params);
|
|
|
|
|
return `${API_EDITOR_URL(applicationId, pageId)}/${apiId}${queryParams}`;
|
|
|
|
|
};
|
2019-11-22 14:02:55 +00:00
|
|
|
|
2020-04-14 12:34:14 +00:00
|
|
|
export const API_EDITOR_URL_WITH_SELECTED_PAGE_ID = (
|
|
|
|
|
applicationId = ":applicationId",
|
|
|
|
|
pageId = ":pageId",
|
|
|
|
|
selectedPageId = ":importTo",
|
|
|
|
|
): string => {
|
|
|
|
|
return `${BUILDER_PAGE_URL(
|
|
|
|
|
applicationId,
|
|
|
|
|
pageId,
|
|
|
|
|
)}/api?importTo=${selectedPageId}`;
|
|
|
|
|
};
|
|
|
|
|
|
2019-11-22 14:02:55 +00:00
|
|
|
export const APP_VIEW_URL = `/applications/:applicationId`;
|
|
|
|
|
|
|
|
|
|
export const getApplicationViewerURL = (
|
|
|
|
|
applicationId = ":applicationId",
|
|
|
|
|
): string => `/applications/${applicationId}`;
|
|
|
|
|
|
|
|
|
|
export const getApplicationViewerPageURL = (
|
|
|
|
|
applicationId = ":applicationId",
|
|
|
|
|
pageId = ":pageId",
|
2020-04-01 08:09:57 +00:00
|
|
|
params: Record<string, string> = {},
|
|
|
|
|
): string => {
|
|
|
|
|
const url = `/applications/${applicationId}/pages/${pageId}`;
|
|
|
|
|
const queryParams = convertToQueryParams(params);
|
|
|
|
|
return url + queryParams;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
function convertToQueryParams(params: Record<string, string> = {}): string {
|
|
|
|
|
const paramKeys = Object.keys(params);
|
2020-08-07 14:24:26 +00:00
|
|
|
const queryParams: string[] = [];
|
2020-04-01 08:09:57 +00:00
|
|
|
if (paramKeys) {
|
2020-08-07 14:24:26 +00:00
|
|
|
paramKeys.forEach((paramKey: string) => {
|
2020-04-01 08:09:57 +00:00
|
|
|
const value = params[paramKey];
|
|
|
|
|
if (paramKey && value) {
|
2020-08-07 14:24:26 +00:00
|
|
|
queryParams.push(`${paramKey}=${value}`);
|
2020-04-01 08:09:57 +00:00
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
}
|
2020-08-07 14:24:26 +00:00
|
|
|
return queryParams.length ? "?" + queryParams.join("&") : "";
|
2020-04-01 08:09:57 +00:00
|
|
|
}
|
2019-10-29 12:02:58 +00:00
|
|
|
|
2020-04-14 12:34:14 +00:00
|
|
|
export const getCurlImportPageURL = (
|
|
|
|
|
applicationId = ":applicationId",
|
|
|
|
|
pageId = ":pageId",
|
|
|
|
|
): string => `${API_EDITOR_URL(applicationId, pageId)}/curl/curl-import`;
|
|
|
|
|
|
|
|
|
|
export const getProviderTemplatesURL = (
|
|
|
|
|
applicationId = ":applicationId",
|
|
|
|
|
pageId = ":pageId",
|
|
|
|
|
providerId = ":providerId",
|
2020-04-28 10:47:59 +00:00
|
|
|
): string => `${API_EDITOR_URL(applicationId, pageId)}/provider/${providerId}`;
|
2020-04-14 12:34:14 +00:00
|
|
|
|
2020-05-05 07:50:30 +00:00
|
|
|
export const QUERY_EDITOR_URL_WITH_SELECTED_PAGE_ID = (
|
|
|
|
|
applicationId = ":applicationId",
|
|
|
|
|
pageId = ":pageId",
|
|
|
|
|
selectedPageId = ":importTo",
|
|
|
|
|
): string => {
|
|
|
|
|
return `${BUILDER_PAGE_URL(
|
|
|
|
|
applicationId,
|
|
|
|
|
pageId,
|
|
|
|
|
)}/queries?importTo=${selectedPageId}`;
|
|
|
|
|
};
|
|
|
|
|
|
2019-12-16 08:49:10 +00:00
|
|
|
export const FORGOT_PASSWORD_URL = `${USER_AUTH_URL}/forgotPassword`;
|
|
|
|
|
export const RESET_PASSWORD_URL = `${USER_AUTH_URL}/resetPassword`;
|
2020-01-15 04:49:36 +00:00
|
|
|
export const BASE_SIGNUP_URL = `/signup`;
|
2019-12-16 08:49:10 +00:00
|
|
|
export const SIGN_UP_URL = `${USER_AUTH_URL}/signup`;
|
2020-01-15 04:49:36 +00:00
|
|
|
export const BASE_LOGIN_URL = `/login`;
|
2019-12-16 08:49:10 +00:00
|
|
|
export const AUTH_LOGIN_URL = `${USER_AUTH_URL}/login`;
|
2019-12-23 12:16:33 +00:00
|
|
|
|
|
|
|
|
export const ORG_INVITE_USERS_PAGE_URL = `${ORG_URL}/invite`;
|
|
|
|
|
export const ORG_SETTINGS_PAGE_URL = `${ORG_URL}/settings`;
|