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: 0 additions & 2 deletions app/client/src/ce/constants/messages.ts
Original file line number Diff line number Diff line change
Expand Up @@ -682,8 +682,6 @@ export const ERROR_IMPORTING_APPLICATION_TO_WORKSPACE = () =>
export const IMPORT_APPLICATION_MODAL_TITLE = () => "Import application";
export const IMPORT_APPLICATION_MODAL_LABEL = () =>
"Where would you like to import your application from?";
export const IMPORT_FROM_GIT_DISABLED_IN_ANVIL = () =>
"Importing from Git repositories is not yet supported 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";
Expand Down
28 changes: 3 additions & 25 deletions app/client/src/pages/common/ImportModal.tsx
Original file line number Diff line number Diff line change
@@ -1,15 +1,14 @@
import type { ReactNode } from "react";
import React, { useCallback, useEffect } from "react";
import styled, { useTheme, css } from "styled-components";
import { useDispatch, useSelector } from "react-redux";
import { useDispatch } from "react-redux";
import { setWorkspaceIdForImport } from "ee/actions/applicationActions";
import {
createMessage,
IMPORT_APP_FROM_FILE_MESSAGE,
IMPORT_APP_FROM_FILE_TITLE,
IMPORT_APP_FROM_GIT_MESSAGE,
IMPORT_APP_FROM_GIT_TITLE,
IMPORT_FROM_GIT_DISABLED_IN_ANVIL,
UPLOADING_JSON,
} from "ee/constants/messages";
import { FilePickerV2, FileType } from "@appsmith/ads-old";
Expand All @@ -19,17 +18,9 @@ import { ReduxActionTypes } from "ee/constants/ReduxActionConstants";
import Statusbar from "pages/Editor/gitSync/components/Statusbar";
import AnalyticsUtil from "ee/utils/AnalyticsUtil";
import type { Theme } from "constants/DefaultTheme";
import {
Callout,
Icon,
Modal,
ModalContent,
ModalHeader,
Text,
} from "@appsmith/ads";
import { Icon, Modal, ModalContent, ModalHeader, Text } from "@appsmith/ads";
import useMessages from "ee/hooks/importModal/useMessages";
import useMethods from "ee/hooks/importModal/useMethods";
import { getIsAnvilLayoutEnabled } from "layoutSystems/anvil/integrations/selectors";
import { useGitModEnabled } from "pages/Editor/gitSync/hooks/modHooks";
import { gitToggleImportModal } from "git/store";

Expand Down Expand Up @@ -215,8 +206,6 @@ function ImportModal(props: ImportModalProps) {
resetAppFileToBeUploaded,
uploadingText,
} = useMethods({ editorId, workspaceId });

const isAnvilEnabled = useSelector(getIsAnvilLayoutEnabled);
const dispatch = useDispatch();
const onGitImport = useCallback(() => {
onClose && onClose();
Expand Down Expand Up @@ -281,15 +270,6 @@ function ImportModal(props: ImportModalProps) {
? createMessage(UPLOADING_JSON)
: mainDescription}
</Text>
{
// If Anvil is enabled, we disable the import via Git option.
// This callout informs the user of this.
isAnvilEnabled && (
<Callout kind="warning" onClose={() => {}}>
{createMessage(IMPORT_FROM_GIT_DISABLED_IN_ANVIL)}
</Callout>
)
}
</TextWrapper>

{!isImporting && (
Expand All @@ -309,9 +289,7 @@ function ImportModal(props: ImportModalProps) {
uploadIcon="file-line"
/>
</FileImportCard>
{!toEditor && !isAnvilEnabled && (
<GitImportCard handler={onGitImport} />
)}
{!toEditor && <GitImportCard handler={onGitImport} />}
</Row>
)}
{isImporting && (
Expand Down
Loading