## Description - Adds chevron menu to package editor ## Automation /ok-to-test tags="@tag.Git" ### 🔍 Cypress test results <!-- This is an auto-generated comment: Cypress test results --> > [!TIP] > 🟢 🟢 🟢 All cypress tests have passed! 🎉 🎉 🎉 > Workflow run: <https://github.com/appsmithorg/appsmith/actions/runs/14023181461> > Commit: f427da94d24bbcbf8a69c92159e98651676f09b2 > <a href="https://internal.appsmith.com/app/cypress-dashboard/rundetails-65890b3c81d7400d08fa9ee5?branch=master&workflowId=14023181461&attempt=1" target="_blank">Cypress dashboard</a>. > Tags: `@tag.Git` > Spec: > <hr>Sun, 23 Mar 2025 22:27:03 UTC <!-- end of auto-generated comment: Cypress test results --> ## Communication Should the DevRel and Marketing teams inform users about this change? - [ ] Yes - [ ] No <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit - **New Features** - Introduced a new Price Tag icon to expand the design system’s visual assets. - Enhanced deployment menu behavior by conditionally showing or hiding options based on Git connection status and permissions. - Updated the header deployment interface to provide streamlined access, where clicking a deployment option now opens the link in a new tab. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
42 lines
1.1 KiB
TypeScript
42 lines
1.1 KiB
TypeScript
import React, { useCallback } from "react";
|
|
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;
|
|
}
|
|
|
|
function DeployMenuItemsView({
|
|
toggleConnectModal = noop,
|
|
}: DeployMenuItemsViewProps) {
|
|
const isConnected = useConnected();
|
|
const { isConnectPermitted } = useGitContext();
|
|
|
|
const handleClickOnConnect = useCallback(() => {
|
|
AnalyticsUtil.logEvent("GS_CONNECT_GIT_CLICK", {
|
|
source: "Deploy button",
|
|
});
|
|
toggleConnectModal(true);
|
|
}, [toggleConnectModal]);
|
|
|
|
if (isConnected || !isConnectPermitted) {
|
|
return null;
|
|
}
|
|
|
|
return (
|
|
<MenuItem
|
|
data-testid="t--git-deploy-menu-connect"
|
|
onClick={handleClickOnConnect}
|
|
startIcon="git-branch"
|
|
>
|
|
{createMessage(CONNECT_TO_GIT_OPTION)}
|
|
</MenuItem>
|
|
);
|
|
}
|
|
|
|
export default DeployMenuItemsView;
|