diff --git a/app/client/packages/design-system/ads/src/Icon/Icon.provider.tsx b/app/client/packages/design-system/ads/src/Icon/Icon.provider.tsx index 1f6abfef5d57..92b42c61ba88 100644 --- a/app/client/packages/design-system/ads/src/Icon/Icon.provider.tsx +++ b/app/client/packages/design-system/ads/src/Icon/Icon.provider.tsx @@ -581,6 +581,9 @@ const AppsLineIcon = importRemixIcon( const ProtectedIcon = importRemixIcon( async () => import("remixicon-react/ShieldKeyholeLineIcon"), ); +const PriceTagIcon = importRemixIcon( + async () => import("remixicon-react/PriceTag3LineIcon"), +); const CornerDownLeftLineIcon = importSvg( async () => import("../__assets__/icons/ads/corner-down-left-line.svg"), @@ -1492,6 +1495,7 @@ const ICON_LOOKUP = { "widgets-v3": WidgetsV3Icon, "workflows-mono": WorkflowsMonochromeIcon, "protected-icon": ProtectedIcon, + pricetag: PriceTagIcon, billing: BillingIcon, binding: Binding, book: BookIcon, diff --git a/app/client/src/git/components/DeployMenuItems/DeployMenuItemsView.tsx b/app/client/src/git/components/DeployMenuItems/DeployMenuItemsView.tsx index 1d088eb2e438..91ab9a29333a 100644 --- a/app/client/src/git/components/DeployMenuItems/DeployMenuItemsView.tsx +++ b/app/client/src/git/components/DeployMenuItems/DeployMenuItemsView.tsx @@ -3,6 +3,8 @@ import { MenuItem } from "@appsmith/ads"; import { CONNECT_TO_GIT_OPTION, createMessage } from "ee/constants/messages"; import AnalyticsUtil from "ee/utils/AnalyticsUtil"; import noop from "lodash/noop"; +import useConnected from "git/hooks/useConnected"; +import { useGitContext } from "../GitContextProvider"; interface DeployMenuItemsViewProps { toggleConnectModal: (open: boolean) => void; @@ -11,6 +13,9 @@ interface DeployMenuItemsViewProps { function DeployMenuItemsView({ toggleConnectModal = noop, }: DeployMenuItemsViewProps) { + const isConnected = useConnected(); + const { isConnectPermitted } = useGitContext(); + const handleClickOnConnect = useCallback(() => { AnalyticsUtil.logEvent("GS_CONNECT_GIT_CLICK", { source: "Deploy button", @@ -18,6 +23,10 @@ function DeployMenuItemsView({ toggleConnectModal(true); }, [toggleConnectModal]); + if (isConnected || !isConnectPermitted) { + return null; + } + return ( { - const isGitConnected = useGitConnected(); - const isConnectToGitPermitted = useHasConnectToGitPermission(); +export const ChevronMenu = ({ deployLink }: ChevronMenuProps) => { // We check if the current application is an Anvil application. // If it is an Anvil application, we remove the Git features from the deploy button // as they donot yet work correctly with Anvil. const isAnvilEnabled = useSelector(getIsAnvilEnabledInCurrentApplication); + const handleClickOnLatestDeployed = useCallback(() => { + if (window) { + window.open(deployLink, "_blank")?.focus(); + } + }, [deployLink]); + return ( @@ -74,16 +72,10 @@ export const DeployLinkButton = (props: Props) => { /> - {!isGitConnected && isConnectToGitPermitted && !isAnvilEnabled && ( - - )} + {!isAnvilEnabled && } { - if (window) { - window.open(props.link, "_blank")?.focus(); - } - }} + onClick={handleClickOnLatestDeployed} startIcon="share-box-line" > {CURRENT_DEPLOY_PREVIEW_OPTION()} @@ -94,4 +86,4 @@ export const DeployLinkButton = (props: Props) => { ); }; -export default DeployLinkButton; +export default ChevronMenu; diff --git a/app/client/src/pages/AppIDE/layouts/components/Header/index.tsx b/app/client/src/pages/AppIDE/layouts/components/Header/index.tsx index 68875cb989a0..e4612150158a 100644 --- a/app/client/src/pages/AppIDE/layouts/components/Header/index.tsx +++ b/app/client/src/pages/AppIDE/layouts/components/Header/index.tsx @@ -48,7 +48,6 @@ import AppInviteUsersForm from "pages/workspace/AppInviteUsersForm"; import { getEmbedSnippetForm } from "ee/utils/BusinessFeatures/privateEmbedHelpers"; import CommunityTemplatesPublishInfo from "pages/Editor/CommunityTemplates/Modals/CommunityTemplatesPublishInfo"; import PublishCommunityTemplateModal from "pages/Editor/CommunityTemplates/Modals/PublishCommunityTemplate"; -import DeployLinkButtonDialog from "components/designSystems/appsmith/header/DeployLinkButton"; import { useFeatureFlag } from "utils/hooks/useFeatureFlag"; import { FEATURE_FLAG } from "ee/entities/FeatureFlag"; import { getAppsmithConfigs } from "ee/configs"; @@ -65,6 +64,7 @@ import useLibraryHeaderTitle from "ee/pages/AppIDE/layouts/components/Header/use import { AppsmithLink } from "pages/Editor/AppsmithLink"; import DeployButton from "./DeployButton"; import { GitApplicationContextProvider } from "git-artifact-helpers/application/components"; +import ChevronMenu from "./ChevronMenu"; const StyledDivider = styled(Divider)` height: 50%; @@ -259,7 +259,7 @@ const Header = () => { />
- +