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
2 changes: 1 addition & 1 deletion app/client/src/ce/constants/messages.ts
Original file line number Diff line number Diff line change
Expand Up @@ -690,7 +690,7 @@ export const IMPORT_APP_FROM_GIT_TITLE = (isBeta: boolean = true) =>
export const IMPORT_APP_FROM_FILE_MESSAGE = () =>
"Drag and drop your file or upload from your computer";
export const IMPORT_APP_FROM_GIT_MESSAGE = () =>
"Import an application from its Git repository using its SSH URL";
"Import from a Git repository using its SSH URL";
export const IMPORT_FROM_GIT_REPOSITORY = () => "Import from Git repository";
export const RECONNECT_MISSING_DATASOURCE_CREDENTIALS = () =>
"Reconnect missing datasource credentials";
Expand Down
20 changes: 19 additions & 1 deletion app/client/src/git/ce/constants/messages.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,27 @@
export const IMPORT_GIT = {
MODAL_TITLE: "Import via Git",
IMPORT_CTA: "Import",
WAIT_TEXT: "Please wait while we import via Git..",
};

export const CONNECT_GIT = {
MODAL_TITLE: "Configure Git",
CHOOSE_PROVIDER_CTA: "Configure Git",
GENERATE_SSH_KEY_CTA: "Generate SSH key",
CONNECT_CTA: "Connect Git",
CHOOSE_PROVIDER_STEP_TITLE: "Choose a Git provider",
GENERATE_SSH_KEY_STEP_TITLE: "Generate SSH key",
ADD_DEPLOY_KEY_STEP_TITLE: "Add deploy key",
WAIT_TEXT: "Please wait while we connect to Git...",
PREV_STEP: "Previous step",
};

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",
"Please contact your workspace admin to connect your artifact to a Git repo",
};

export const OPS_MODAL = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,26 +9,14 @@ import Steps from "./Steps";
import Statusbar from "../../Statusbar";
import { Button, ModalBody, ModalFooter, ModalHeader } from "@appsmith/ads";
import { GIT_CONNECT_STEPS } from "./constants";
import {
ADD_DEPLOY_KEY_STEP,
CHOOSE_A_GIT_PROVIDER_STEP,
CONFIGURE_GIT,
CONNECT_GIT_TEXT,
GENERATE_SSH_KEY_STEP,
GIT_CONNECT_WAITING,
GIT_IMPORT_WAITING,
IMPORT_APP,
IMPORT_APP_CTA,
PREVIOUS_STEP,
createMessage,
} from "ee/constants/messages";
import { isValidGitRemoteUrl } from "../../utils";
import type { ConnectRequestParams } from "git/requests/connectRequest.types";
import noop from "lodash/noop";
import type { GitApiError } from "git/store/types";
import type { ConnectFormDataState } from "./types";
import type { GitImportRequestParams } from "git/requests/gitImportRequest.types";
import { GitErrorCodes } from "git/constants/enums";
import { CONNECT_GIT, IMPORT_GIT } from "git/ee/constants/messages";

const OFFSET = 200;
const OUTER_PADDING = 32;
Expand All @@ -53,15 +41,15 @@ const StyledModalFooter = styled(ModalFooter)<StyledModalFooterProps>`
const steps = [
{
key: GIT_CONNECT_STEPS.CHOOSE_PROVIDER,
text: createMessage(CHOOSE_A_GIT_PROVIDER_STEP),
text: CONNECT_GIT.CHOOSE_PROVIDER_STEP_TITLE,
},
{
key: GIT_CONNECT_STEPS.GENERATE_SSH_KEY,
text: createMessage(GENERATE_SSH_KEY_STEP),
text: CONNECT_GIT.GENERATE_SSH_KEY_STEP_TITLE,
},
{
key: GIT_CONNECT_STEPS.ADD_DEPLOY_KEY,
text: createMessage(ADD_DEPLOY_KEY_STEP),
text: CONNECT_GIT.ADD_DEPLOY_KEY_STEP_TITLE,
},
];

Expand Down Expand Up @@ -97,11 +85,11 @@ function ConnectInitialize({
sshPublicKey = null,
}: ConnectInitializeProps) {
const nextStepText = {
[GIT_CONNECT_STEPS.CHOOSE_PROVIDER]: createMessage(CONFIGURE_GIT),
[GIT_CONNECT_STEPS.GENERATE_SSH_KEY]: createMessage(GENERATE_SSH_KEY_STEP),
[GIT_CONNECT_STEPS.ADD_DEPLOY_KEY]: createMessage(
isImport ? IMPORT_APP_CTA : CONNECT_GIT_TEXT,
),
[GIT_CONNECT_STEPS.CHOOSE_PROVIDER]: CONNECT_GIT.CHOOSE_PROVIDER_CTA,
[GIT_CONNECT_STEPS.GENERATE_SSH_KEY]: CONNECT_GIT.GENERATE_SSH_KEY_CTA,
[GIT_CONNECT_STEPS.ADD_DEPLOY_KEY]: isImport
? IMPORT_GIT.IMPORT_CTA
: CONNECT_GIT.CONNECT_CTA,
};

const [formData, setFormData] = useState<ConnectFormDataState>({
Expand Down Expand Up @@ -210,7 +198,7 @@ function ConnectInitialize({
return (
<>
<ModalHeader>
{isImport ? createMessage(IMPORT_APP) : createMessage(CONFIGURE_GIT)}
{isImport ? IMPORT_GIT.MODAL_TITLE : CONNECT_GIT.MODAL_TITLE}
</ModalHeader>
<StyledModalBody>
{possibleSteps.includes(activeStep) && (
Expand Down Expand Up @@ -249,9 +237,7 @@ function ConnectInitialize({
{isSubmitLoading && (
<Statusbar
completed={!isSubmitLoading}
message={createMessage(
isImport ? GIT_IMPORT_WAITING : GIT_CONNECT_WAITING,
)}
message={isImport ? IMPORT_GIT.WAIT_TEXT : CONNECT_GIT.WAIT_TEXT}
/>
)}
{!isSubmitLoading && (
Expand All @@ -278,7 +264,7 @@ function ConnectInitialize({
size="md"
startIcon="arrow-left-s-line"
>
{createMessage(PREVIOUS_STEP)}
{CONNECT_GIT.PREV_STEP}
</Button>
)}
</StyledModalFooter>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ describe("ConnectButton Component", () => {

expect(tooltipContent).toBeInTheDocument();
expect(tooltipContent).toHaveTextContent(
"Please contact your workspace admin to connect your artifact to a git repo",
"Please contact your workspace admin to connect your artifact to a Git repo",
);

// Icon should be rendered
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ export const calcStatusChangeCount = (status: FetchStatusResponseData) => {
modifiedJSLibs = 0,
modifiedJSObjects = 0,
modifiedModuleInstances = 0,
modifiedModules = 0,
modifiedPages = 0,
modifiedQueries = 0,
modifiedSourceModules = 0,
Expand All @@ -25,6 +26,7 @@ export const calcStatusChangeCount = (status: FetchStatusResponseData) => {
modifiedQueries +
themeCount +
modifiedSourceModules +
modifiedModules +
modifiedModuleInstances +
settingsCount
);
Expand Down
Loading