Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions app/client/src/ce/constants/messages.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 = () =>
Expand Down Expand Up @@ -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";
Expand Down
8 changes: 8 additions & 0 deletions app/client/src/git/ce/constants/messages.tsx
Original file line number Diff line number Diff line change
@@ -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",
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ describe("ConnectButton Component", () => {
</ThemeProvider>,
);

const button = screen.getByRole("button", { name: "Connect Git (Beta)" });
const button = screen.getByRole("button", { name: "Connect Git" });

fireEvent.click(button);

Expand All @@ -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();
Expand All @@ -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
Expand All @@ -118,7 +118,7 @@ describe("ConnectButton Component", () => {
</ThemeProvider>,
);

const button = screen.getByRole("button", { name: "Connect Git (Beta)" });
const button = screen.getByRole("button", { name: "Connect Git" });

fireEvent.click(button);

Expand Down
17 changes: 5 additions & 12 deletions app/client/src/git/components/QuickActions/ConnectButton.tsx
Original file line number Diff line number Diff line change
@@ -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;
Expand Down Expand Up @@ -41,13 +34,13 @@ function ConnectButton({ isConnectPermitted, onClick }: ConnectButtonProps) {
const isTooltipEnabled = !isConnectPermitted;
const tooltipContent = useMemo(() => {
if (!isConnectPermitted) {
return <CenterDiv>{createMessage(CONTACT_ADMIN_FOR_GIT)}</CenterDiv>;
return <CenterDiv>{QUICK_ACTIONS.CONNECT_BTN_CONTACT_ADMIN}</CenterDiv>;
}

return (
<>
<div>{createMessage(NOT_LIVE_FOR_YOU_YET)}</div>
<div>{createMessage(COMING_SOON)}</div>
<div>{QUICK_ACTIONS.CONNECT_BTN_NOT_LIVE_YET}</div>
<div>{QUICK_ACTIONS.CONNECT_BTN_COMING_SOON}</div>
</>
);
}, [isConnectPermitted]);
Expand All @@ -68,7 +61,7 @@ function ConnectButton({ isConnectPermitted, onClick }: ConnectButtonProps) {
onClick={onClick}
size="sm"
>
{createMessage(CONNECT_GIT_BETA)}
{QUICK_ACTIONS.CONNECT_BTN_CTA}
</Button>
</Container>
</Tooltip>
Expand Down
3 changes: 2 additions & 1 deletion app/client/src/pages/common/ImportModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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 (
<CardWrapper onClick={onClick}>
Expand Down
Loading