diff --git a/app/client/src/ce/constants/messages.ts b/app/client/src/ce/constants/messages.ts index b066fb375104..606505b1cf2c 100644 --- a/app/client/src/ce/constants/messages.ts +++ b/app/client/src/ce/constants/messages.ts @@ -688,8 +688,8 @@ export const IMPORT_FROM_GIT_DISABLED_IN_ANVIL = () => export const IMPORT_APP_FROM_FILE_TITLE = () => "Import from file"; export const UPLOADING_JSON = () => "Uploading JSON file"; export const UPLOADING_APPLICATION = () => "Uploading application"; -export const IMPORT_APP_FROM_GIT_TITLE = () => - "Import from Git repository (Beta)"; +export const IMPORT_APP_FROM_GIT_TITLE = (isBeta: boolean = true) => + `Import from Git repository ${isBeta ? "(Beta)" : ""}`; export const IMPORT_APP_FROM_FILE_MESSAGE = () => "Drag and drop your file or upload from your computer"; export const IMPORT_APP_FROM_GIT_MESSAGE = () => @@ -923,7 +923,6 @@ export const IS_MERGING = () => "Merging changes..."; export const MERGE_CHANGES = () => "Merge changes"; export const SELECT_BRANCH_TO_MERGE = () => "Select branch to merge"; -export const CONNECT_GIT = () => "Connect Git"; export const CONNECT_GIT_BETA = () => "Connect Git (Beta)"; export const RETRY = () => "Retry"; export const CREATE_NEW_BRANCH = () => "Create new branch"; diff --git a/app/client/src/git/ce/constants/messages.tsx b/app/client/src/git/ce/constants/messages.tsx index 432d0dcd4cea..49d68fd6a894 100644 --- a/app/client/src/git/ce/constants/messages.tsx +++ b/app/client/src/git/ce/constants/messages.tsx @@ -1,3 +1,11 @@ +export const QUICK_ACTIONS = { + CONNECT_BTN_NOT_LIVE_YET: "It's not live for you yet", + CONNECT_BTN_COMING_SOON: "Coming Soon!", + CONNECT_BTN_CTA: "Connect Git", + CONNECT_BTN_CONTACT_ADMIN: + "Please contact your workspace admin to connect your artifact to a git repo", +}; + export const OPS_MODAL = { TAB_RELEASE: "Release", }; diff --git a/app/client/src/git/components/QuickActions/ConnectButton.test.tsx b/app/client/src/git/components/QuickActions/ConnectButton.test.tsx index ee01a5af95da..316ad1d0a0f5 100644 --- a/app/client/src/git/components/QuickActions/ConnectButton.test.tsx +++ b/app/client/src/git/components/QuickActions/ConnectButton.test.tsx @@ -64,7 +64,7 @@ describe("ConnectButton Component", () => { , ); - const button = screen.getByRole("button", { name: "Connect Git (Beta)" }); + const button = screen.getByRole("button", { name: "Connect Git" }); fireEvent.click(button); @@ -91,7 +91,7 @@ describe("ConnectButton Component", () => { ); // Check that the button is rendered and disabled - const button = screen.getByRole("button", { name: "Connect Git (Beta)" }); + const button = screen.getByRole("button", { name: "Connect Git" }); expect(button).toBeInTheDocument(); expect(button).toBeDisabled(); @@ -101,7 +101,7 @@ describe("ConnectButton Component", () => { expect(tooltipContent).toBeInTheDocument(); expect(tooltipContent).toHaveTextContent( - "Please contact your workspace admin to connect your app to a git repo", + "Please contact your workspace admin to connect your artifact to a git repo", ); // Icon should be rendered @@ -118,7 +118,7 @@ describe("ConnectButton Component", () => { , ); - const button = screen.getByRole("button", { name: "Connect Git (Beta)" }); + const button = screen.getByRole("button", { name: "Connect Git" }); fireEvent.click(button); diff --git a/app/client/src/git/components/QuickActions/ConnectButton.tsx b/app/client/src/git/components/QuickActions/ConnectButton.tsx index b4f4f69647ae..49fa8aee7dc9 100644 --- a/app/client/src/git/components/QuickActions/ConnectButton.tsx +++ b/app/client/src/git/components/QuickActions/ConnectButton.tsx @@ -1,14 +1,7 @@ import React, { useMemo } from "react"; import styled from "styled-components"; -import { - COMING_SOON, - CONNECT_GIT_BETA, - CONTACT_ADMIN_FOR_GIT, - createMessage, - NOT_LIVE_FOR_YOU_YET, -} from "ee/constants/messages"; - import { Button, Icon, Tooltip } from "@appsmith/ads"; +import { QUICK_ACTIONS } from "git/ee/constants/messages"; const CenterDiv = styled.div` text-align: center; @@ -41,13 +34,13 @@ function ConnectButton({ isConnectPermitted, onClick }: ConnectButtonProps) { const isTooltipEnabled = !isConnectPermitted; const tooltipContent = useMemo(() => { if (!isConnectPermitted) { - return {createMessage(CONTACT_ADMIN_FOR_GIT)}; + return {QUICK_ACTIONS.CONNECT_BTN_CONTACT_ADMIN}; } return ( <> -
{createMessage(NOT_LIVE_FOR_YOU_YET)}
-
{createMessage(COMING_SOON)}
+
{QUICK_ACTIONS.CONNECT_BTN_NOT_LIVE_YET}
+
{QUICK_ACTIONS.CONNECT_BTN_COMING_SOON}
); }, [isConnectPermitted]); @@ -68,7 +61,7 @@ function ConnectButton({ isConnectPermitted, onClick }: ConnectButtonProps) { onClick={onClick} size="sm" > - {createMessage(CONNECT_GIT_BETA)} + {QUICK_ACTIONS.CONNECT_BTN_CTA} diff --git a/app/client/src/pages/common/ImportModal.tsx b/app/client/src/pages/common/ImportModal.tsx index 5eb89e3d2daf..d22ddffd0e13 100644 --- a/app/client/src/pages/common/ImportModal.tsx +++ b/app/client/src/pages/common/ImportModal.tsx @@ -174,8 +174,9 @@ function GitImportCard(props: { children?: ReactNode; handler?: () => void }) { AnalyticsUtil.logEvent("GS_IMPORT_VIA_GIT_CARD_CLICK"); props.handler && props.handler(); }, []); + const isGitModEnabled = useGitModEnabled(); const message = createMessage(IMPORT_APP_FROM_GIT_MESSAGE); - const title = createMessage(IMPORT_APP_FROM_GIT_TITLE); + const title = createMessage(IMPORT_APP_FROM_GIT_TITLE, !isGitModEnabled); return (