diff --git a/src/components/Insights/JiraTicket/index.tsx b/src/components/Insights/JiraTicket/index.tsx index 448cfaf47..a9b244f6d 100644 --- a/src/components/Insights/JiraTicket/index.tsx +++ b/src/components/Insights/JiraTicket/index.tsx @@ -1,12 +1,15 @@ import copy from "copy-to-clipboard"; -import { useEffect, useRef, useState } from "react"; +import { useContext, useEffect, useRef, useState } from "react"; import { useTheme } from "styled-components"; import { DefaultTheme } from "styled-components/dist/types"; import { dispatcher } from "../../../dispatcher"; +import { getFeatureFlagValue } from "../../../featureFlags"; import { isString } from "../../../typeGuards/isString"; +import { FeatureFlag } from "../../../types"; import { downloadFile } from "../../../utils/downloadFile"; import { isValidHttpUrl } from "../../../utils/isValidUrl"; import { sendTrackingEvent } from "../../../utils/sendTrackingEvent"; +import { ConfigContext } from "../../common/App/ConfigContext"; import { Button } from "../../common/Button"; import { CircleLoader } from "../../common/CircleLoader"; import { CircleLoaderColors } from "../../common/CircleLoader/types"; @@ -55,6 +58,12 @@ export const JiraTicket = (props: JiraTicketProps) => { const [errorMessage, setErrorMessage] = useState(); const descriptionContentRef = useRef(null); const theme = useTheme(); + const config = useContext(ConfigContext); + + const isLinkUnlinkInputVisible = getFeatureFlagValue( + config, + FeatureFlag.IS_TICKET_LINK_UNLINK_INPUT_ENABLED + ); const handleCloseButtonClick = () => { props.onClose(); @@ -242,32 +251,34 @@ export const JiraTicket = (props: JiraTicketProps) => { errorMessage={downloadErrorMessage} /> )} - - Unlink - - ) : ( - - ) - } - /> + {isLinkUnlinkInputVisible && ( + + Unlink + + ) : ( + + ) + } + /> + )} ); }; diff --git a/src/featureFlags.ts b/src/featureFlags.ts index 370777605..e1ed0fbfa 100644 --- a/src/featureFlags.ts +++ b/src/featureFlags.ts @@ -6,7 +6,8 @@ const featureFlagMinBackendVersions: Record = { [FeatureFlag.IS_DASHBOARD_CLIENT_SPANS_OVERALL_IMPACT_ENABLED]: "v0.2.172-alpha.8", [FeatureFlag.IS_ASSETS_SERVICE_FILTER_VISIBLE]: "v0.2.174", - [FeatureFlag.IS_ASSETS_OVERALL_IMPACT_HIDDEN]: "v0.2.181-alpha.1" + [FeatureFlag.IS_ASSETS_OVERALL_IMPACT_HIDDEN]: "v0.2.181-alpha.1", + [FeatureFlag.IS_TICKET_LINK_UNLINK_INPUT_ENABLED]: "v0.2.200" }; export const getFeatureFlagValue = ( diff --git a/src/types.ts b/src/types.ts index 114230a21..5807c044e 100644 --- a/src/types.ts +++ b/src/types.ts @@ -3,7 +3,8 @@ import { Duration } from "./globals"; export enum FeatureFlag { IS_DASHBOARD_CLIENT_SPANS_OVERALL_IMPACT_ENABLED, IS_ASSETS_SERVICE_FILTER_VISIBLE, - IS_ASSETS_OVERALL_IMPACT_HIDDEN + IS_ASSETS_OVERALL_IMPACT_HIDDEN, + IS_TICKET_LINK_UNLINK_INPUT_ENABLED } export enum InsightType {