feat: Add Option to export app in Navigation Menu (#6913)
Now the user will be able to export applications inside the editor also. Added Option in Navigation Header.
This commit is contained in:
parent
1109ecb37f
commit
1d63add091
|
|
@ -29,3 +29,6 @@ export const GithubOAuthURL = `${OAuthURL}/github`;
|
|||
|
||||
export const LOGIN_SUBMIT_PATH = "login";
|
||||
export const SIGNUP_SUBMIT_PATH = "users";
|
||||
|
||||
export const getExportAppAPIRoute = (applicationId: string) =>
|
||||
`/api/v1/applications/export/${applicationId}`;
|
||||
|
|
|
|||
|
|
@ -49,6 +49,7 @@ import { isEllipsisActive } from "utils/helpers";
|
|||
import ForkApplicationModal from "./ForkApplicationModal";
|
||||
import { Toaster } from "components/ads/Toast";
|
||||
import { Variant } from "components/ads/common";
|
||||
import { getExportAppAPIRoute } from "constants/ApiConstants";
|
||||
|
||||
type NameWrapperProps = {
|
||||
hasReadPermission: boolean;
|
||||
|
|
@ -355,7 +356,8 @@ export function ApplicationCard(props: ApplicationCardProps) {
|
|||
const existingLink = document.getElementById(id);
|
||||
existingLink && existingLink.remove();
|
||||
const link = document.createElement("a");
|
||||
link.href = `/api/v1/applications/export/${props.application.id}`;
|
||||
|
||||
link.href = getExportAppAPIRoute(props.application.id);
|
||||
link.id = id;
|
||||
document.body.appendChild(link);
|
||||
// will fetch the file manually during cypress test run.
|
||||
|
|
|
|||
|
|
@ -15,6 +15,7 @@ import { APPLICATIONS_URL, PAGE_LIST_EDITOR_URL } from "constants/routes";
|
|||
import { MenuItemData, MenuTypes } from "./NavigationMenuItem";
|
||||
import { useCallback } from "react";
|
||||
import { ExplorerURLParams } from "../Explorer/helpers";
|
||||
import { getExportAppAPIRoute } from "constants/ApiConstants";
|
||||
|
||||
type NavigationMenuDataProps = ThemeProp & {
|
||||
applicationId: string | undefined;
|
||||
|
|
@ -152,6 +153,13 @@ export const GetNavigationMenuData = ({
|
|||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
text: "Export Application",
|
||||
onClick: () =>
|
||||
applicationId && openExternalLink(getExportAppAPIRoute(applicationId)),
|
||||
type: MenuTypes.MENU,
|
||||
isVisible: isApplicationIdPresent,
|
||||
},
|
||||
{
|
||||
text: "Delete Application",
|
||||
confirmText: "Are you sure?",
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user