From d0050e48f65c375272f51fe1bb4e37a3acb68832 Mon Sep 17 00:00:00 2001 From: olehp Date: Tue, 30 Apr 2024 16:59:29 +0300 Subject: [PATCH 1/2] make backward compatible --- .../AssetsViewScopeConfiguration.stories.tsx | 2 +- .../InsightsCatalog.stories.tsx | 2 +- .../InsightsPage/InsightsPage.stories.tsx | 4 +-- .../InsightsStats/InsightsStats.stories.tsx | 6 +++++ .../InsightsCatalog/InsightsStats/index.tsx | 25 ++++++++++++++----- .../InsightsCatalog/InsightsStats/types.ts | 4 +-- .../Insights/InsightsCatalog/index.tsx | 6 ++--- .../Navigation/ScopeBar/ScopeBar.stories.tsx | 2 +- src/components/common/App/types.ts | 8 +++--- 9 files changed, 38 insertions(+), 21 deletions(-) diff --git a/src/components/Assets/AssetsViewScopeConfiguration/AssetsViewScopeConfiguration.stories.tsx b/src/components/Assets/AssetsViewScopeConfiguration/AssetsViewScopeConfiguration.stories.tsx index 3007c9887..e750929bc 100644 --- a/src/components/Assets/AssetsViewScopeConfiguration/AssetsViewScopeConfiguration.stories.tsx +++ b/src/components/Assets/AssetsViewScopeConfiguration/AssetsViewScopeConfiguration.stories.tsx @@ -30,7 +30,7 @@ export const Default: Story = { codeDetailsList: [] }, hasErrors: false, - totalQueryResultCount: 0, + issuesInsightsCount: 0, analyticsInsightsCount: 0, unreadInsightsCount: 0 }, diff --git a/src/components/Insights/InsightsCatalog/InsightsCatalog.stories.tsx b/src/components/Insights/InsightsCatalog/InsightsCatalog.stories.tsx index 9cf89d81c..d0d2777bb 100644 --- a/src/components/Insights/InsightsCatalog/InsightsCatalog.stories.tsx +++ b/src/components/Insights/InsightsCatalog/InsightsCatalog.stories.tsx @@ -68,7 +68,7 @@ export const WithStats = { insightStats: { allIssuesCount: 100, criticalInsightsCount: 5, - totalQueryResultCount: 14, + issuesInsightsCount: 14, unreadInsightsCount: 20, analyticsInsightsCount: 10, scope: null diff --git a/src/components/Insights/InsightsCatalog/InsightsPage/InsightsPage.stories.tsx b/src/components/Insights/InsightsCatalog/InsightsPage/InsightsPage.stories.tsx index d8f2f275e..3b5faffdb 100644 --- a/src/components/Insights/InsightsCatalog/InsightsPage/InsightsPage.stories.tsx +++ b/src/components/Insights/InsightsCatalog/InsightsPage/InsightsPage.stories.tsx @@ -26,7 +26,7 @@ const scope: Scope = { codeDetailsList: [] }, hasErrors: false, - totalQueryResultCount: 0, + issuesInsightsCount: 0, analyticsInsightsCount: 0, unreadInsightsCount: 0 }; @@ -52,7 +52,7 @@ export const WithInsights: Story = { ...initialState, scope: { ...scope, - totalQueryResultCount: 1 + issuesInsightsCount: 1 } }} > diff --git a/src/components/Insights/InsightsCatalog/InsightsStats/InsightsStats.stories.tsx b/src/components/Insights/InsightsCatalog/InsightsStats/InsightsStats.stories.tsx index 144dbffc2..c8b15b1bf 100644 --- a/src/components/Insights/InsightsCatalog/InsightsStats/InsightsStats.stories.tsx +++ b/src/components/Insights/InsightsCatalog/InsightsStats/InsightsStats.stories.tsx @@ -22,3 +22,9 @@ export const Default: Story = { unreadCount: 12 } }; + +export const Old: Story = { + args: { + unreadCount: 12 + } +}; diff --git a/src/components/Insights/InsightsCatalog/InsightsStats/index.tsx b/src/components/Insights/InsightsCatalog/InsightsStats/index.tsx index d0ccac6c5..cdd7770ce 100644 --- a/src/components/Insights/InsightsCatalog/InsightsStats/index.tsx +++ b/src/components/Insights/InsightsCatalog/InsightsStats/index.tsx @@ -1,4 +1,5 @@ import { useState } from "react"; +import { Tooltip } from "../../../common/v3/Tooltip"; import { InsightFilterType } from "../types"; import * as s from "./styles"; import { InsightStatsProps } from "./types"; @@ -29,17 +30,19 @@ export const InsightStats = ({ return ( handleSelectionChange("criticality")} > - {criticalCount} + {criticalCount ? ( + {criticalCount} + ) : ( + + )} Critical issues handleSelectionChange("unread")} > @@ -47,9 +50,19 @@ export const InsightStats = ({ Unread issues - {allIssuesCount} + {allIssuesCount ? ( + {allIssuesCount} + ) : ( + + )} All issues ); }; + +const NotAssignedValue = () => ( + + N/A + +); diff --git a/src/components/Insights/InsightsCatalog/InsightsStats/types.ts b/src/components/Insights/InsightsCatalog/InsightsStats/types.ts index 557324f65..e92da8a8d 100644 --- a/src/components/Insights/InsightsCatalog/InsightsStats/types.ts +++ b/src/components/Insights/InsightsCatalog/InsightsStats/types.ts @@ -2,9 +2,9 @@ import { InsightFilterType } from "../types"; export interface InsightStatsProps { onChange: (selected: InsightFilterType[]) => void; - allIssuesCount: number; + allIssuesCount?: number; unreadCount: number; - criticalCount: number; + criticalCount?: number; } export interface StatsProps { diff --git a/src/components/Insights/InsightsCatalog/index.tsx b/src/components/Insights/InsightsCatalog/index.tsx index 09799f227..78ea1b023 100644 --- a/src/components/Insights/InsightsCatalog/index.tsx +++ b/src/components/Insights/InsightsCatalog/index.tsx @@ -249,10 +249,8 @@ export const InsightsCatalog = (props: InsightsCatalogProps) => { {!searchInputValue && (insights.length > 0 || selectedFilters.length > 0) && ( diff --git a/src/components/Navigation/ScopeBar/ScopeBar.stories.tsx b/src/components/Navigation/ScopeBar/ScopeBar.stories.tsx index e486b0a5e..f79c96fca 100644 --- a/src/components/Navigation/ScopeBar/ScopeBar.stories.tsx +++ b/src/components/Navigation/ScopeBar/ScopeBar.stories.tsx @@ -39,7 +39,7 @@ const mockedScope: Scope = { relatedCodeDetailsList: [] }, hasErrors: false, - totalQueryResultCount: 0, + issuesInsightsCount: 0, analyticsInsightsCount: 0, unreadInsightsCount: 0 }; diff --git a/src/components/common/App/types.ts b/src/components/common/App/types.ts index f42c23d36..b8d7462c5 100644 --- a/src/components/common/App/types.ts +++ b/src/components/common/App/types.ts @@ -60,7 +60,7 @@ export interface Scope { codeDetailsList: CodeDetails[]; }; hasErrors: boolean; - totalQueryResultCount: number; + issuesInsightsCount: number; analyticsInsightsCount: number; unreadInsightsCount: number; } @@ -119,11 +119,11 @@ export interface InsightStats { spanCodeObjectId: string; }; } | null; - totalQueryResultCount: number; + issuesInsightsCount: number; analyticsInsightsCount: number; unreadInsightsCount: number; - criticalInsightsCount: number; - allIssuesCount: number; + criticalInsightsCount?: number; + allIssuesCount?: number; } export interface UserInfo { From 7aa2904550a5b05557b2d52e4935e4c21d816377 Mon Sep 17 00:00:00 2001 From: olehp Date: Tue, 30 Apr 2024 17:11:24 +0300 Subject: [PATCH 2/2] added events --- .../Insights/InsightsCatalog/InsightsStats/index.tsx | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/components/Insights/InsightsCatalog/InsightsStats/index.tsx b/src/components/Insights/InsightsCatalog/InsightsStats/index.tsx index cdd7770ce..9993718dd 100644 --- a/src/components/Insights/InsightsCatalog/InsightsStats/index.tsx +++ b/src/components/Insights/InsightsCatalog/InsightsStats/index.tsx @@ -1,4 +1,5 @@ import { useState } from "react"; +import { sendUserActionTrackingEvent } from "../../../../utils/actions/sendUserActionTrackingEvent"; import { Tooltip } from "../../../common/v3/Tooltip"; import { InsightFilterType } from "../types"; import * as s from "./styles"; @@ -23,6 +24,8 @@ export const InsightStats = ({ } else { selection.push(selectedFilter); } + + sendUserActionTrackingEvent(`issues filter changed`, { selection }); setSelectedFilters(selection); onChange(selection); };