diff --git a/src/actions.ts b/src/actions.ts index 07fca64a7..ace97cb57 100644 --- a/src/actions.ts +++ b/src/actions.ts @@ -34,5 +34,8 @@ export const actions = addPrefix(ACTION_PREFIX, { OPEN_DASHBOARD: "OPEN_DASHBOARD", OPEN_INSTALLATION_WIZARD: "OPEN_INSTALLATION_WIZARD", SET_SCOPE: "SET_SCOPE", - CHANGE_SCOPE: "CHANGE_SCOPE" + CHANGE_SCOPE: "CHANGE_SCOPE", + SET_STATE: "SET_STATE", + GET_STATE: "GET_STATE", + UPDATE_STATE: "UPDATE_STATE" }); diff --git a/src/components/Insights/InsightJiraTicket/index.tsx b/src/components/Insights/InsightJiraTicket/index.tsx index 131a2c4bc..b5611b306 100644 --- a/src/components/Insights/InsightJiraTicket/index.tsx +++ b/src/components/Insights/InsightJiraTicket/index.tsx @@ -6,7 +6,11 @@ import { isValidHttpUrl } from "../../../utils/isValidUrl"; import { ConfigContext } from "../../common/App/ConfigContext"; import { JiraTicket } from "../../common/JiraTicket"; import { actions } from "../actions"; -import { InsightJiraTicketProps, LinkTicketResponse } from "./types"; +import { + InsightJiraTicketProps, + InsightsGetDataListQuery, + LinkTicketResponse +} from "./types"; export const InsightJiraTicket = (props: InsightJiraTicketProps) => { const [errorMessage, setErrorMessage] = useState(); @@ -59,9 +63,11 @@ export const InsightJiraTicket = (props: InsightJiraTicketProps) => { setErrorMessage(linkTicketResponse.message); } - window.sendMessageToDigma({ - action: actions.GET_DATA - }); + config.state?.insights?.query && + window.sendMessageToDigma({ + action: actions.GET_DATA_LIST, + payload: { query: config.state.insights.query } + }); props.onReloadSpanInsight && props.onReloadSpanInsight(); }; @@ -77,7 +83,7 @@ export const InsightJiraTicket = (props: InsightJiraTicketProps) => { handleInsightTicketLink ); }; - }, []); + }, [config.state?.insights?.query]); useEffect(() => { if (props.relatedInsight) { diff --git a/src/components/Insights/InsightJiraTicket/types.ts b/src/components/Insights/InsightJiraTicket/types.ts index c323d65bb..d8502c9b8 100644 --- a/src/components/Insights/InsightJiraTicket/types.ts +++ b/src/components/Insights/InsightJiraTicket/types.ts @@ -1,4 +1,5 @@ import { ReactNode } from "react"; +import { InsightsQuery } from "../../common/App/types"; import { GenericCodeObjectInsight } from "../types"; export interface InsightJiraTicketProps { @@ -22,3 +23,7 @@ export interface LinkTicketResponse { codeObjectId: string; insightType: string; } + +export interface InsightsGetDataListQuery { + query: InsightsQuery; +} diff --git a/src/components/Insights/common/InsightCard/index.tsx b/src/components/Insights/common/InsightCard/index.tsx index 31c12baee..319d6bb46 100644 --- a/src/components/Insights/common/InsightCard/index.tsx +++ b/src/components/Insights/common/InsightCard/index.tsx @@ -102,10 +102,10 @@ export const InsightCard = (props: InsightCardProps) => { tooltip: "Open Trace", button: (btnProps) => (