Skip to content

Commit 34f6562

Browse files
Add issues days filter (#1345)
* Add issues days filter * Add class name to compact insight card --------- Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
1 parent 887d023 commit 34f6562

File tree

32 files changed

+497
-383
lines changed

32 files changed

+497
-383
lines changed

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "digma-ui",
3-
"version": "11.8.0-alpha.0",
3+
"version": "11.8.0-alpha.1",
44
"description": "Digma UI",
55
"scripts": {
66
"lint:eslint": "eslint --cache .",

src/components/Admin/Reports/CodeIssues/index.tsx

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -155,6 +155,7 @@ export const CodeIssues = () => {
155155

156156
const handleTileIssuesStatsClick = (
157157
viewLevel: IssuesReportViewLevel,
158+
timeMode: IssuesReportTimeMode,
158159
target: TargetScope
159160
) => {
160161
const spanId =
@@ -354,6 +355,11 @@ export const CodeIssues = () => {
354355
FeatureFlag.IsIssuesCriticalityLevelsFilterEnabled
355356
);
356357

358+
const isIssuesLastDaysFilterEnabled = getFeatureFlagValue(
359+
about,
360+
FeatureFlag.IsIssuesLastDaysFilterEnabled
361+
);
362+
357363
const mainSidebarQuery: MainSidebarQuery = useMemo(
358364
() => ({
359365
query: {
@@ -366,7 +372,11 @@ export const CodeIssues = () => {
366372
: [],
367373
...(isCriticalityLevelsFilterEnabled
368374
? { criticalityFilter: criticalityLevels }
369-
: {})
375+
: {}),
376+
lastDays:
377+
isIssuesLastDaysFilterEnabled && timeMode === "changes"
378+
? periodInDays
379+
: undefined
370380
}
371381
}),
372382
[
@@ -375,7 +385,10 @@ export const CodeIssues = () => {
375385
selectedService,
376386
spanCodeObjectId,
377387
isCriticalityLevelsFilterEnabled,
378-
criticalityLevels
388+
criticalityLevels,
389+
periodInDays,
390+
timeMode,
391+
isIssuesLastDaysFilterEnabled
379392
]
380393
);
381394

src/components/Dashboard/MetricsReport/index.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,7 @@ export const MetricsReport = () => {
113113

114114
const handleIssuesStatsClick = (
115115
_: IssuesReportViewLevel,
116+
timeMode: IssuesReportTimeMode,
116117
target: TargetScope
117118
) => {
118119
if (!selectedService) {
@@ -124,7 +125,8 @@ export const MetricsReport = () => {
124125
event: ScopeChangeEvent.MetricsServiceSelected,
125126
payload: {
126127
service: target.value,
127-
criticalityLevels
128+
criticalityLevels,
129+
...(timeMode ? { lastDays: periodInDays } : {})
128130
}
129131
}
130132
});

src/components/Errors/GlobalErrorsList/DaysFilter/index.tsx

Lines changed: 0 additions & 166 deletions
This file was deleted.

src/components/Errors/GlobalErrorsList/index.tsx

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ import { FeatureFlag, ScopeChangeEvent } from "../../../types";
1919
import { changeScope } from "../../../utils/actions/changeScope";
2020
import { sendUserActionTrackingEvent } from "../../../utils/actions/sendUserActionTrackingEvent";
2121
import { formatUnit } from "../../../utils/formatUnit";
22+
import { DaysFilter } from "../../common/DaysFilter";
2223
import { OppositeArrowsIcon } from "../../common/icons/12px/OppositeArrowsIcon";
2324
import { ChevronIcon } from "../../common/icons/16px/ChevronIcon";
2425
import { Direction } from "../../common/icons/types";
@@ -33,7 +34,6 @@ import { actions } from "../actions";
3334
import { EmptyState } from "../EmptyState";
3435
import { NewErrorCard } from "../NewErrorCard";
3536
import { trackingEvents } from "../tracking";
36-
import { DaysFilter } from "./DaysFilter";
3737
import { GlobalErrorsFilters } from "./GlobalErrorsFilters";
3838
import * as s from "./styles";
3939
import type {
@@ -126,7 +126,7 @@ export const GlobalErrorsList = () => {
126126
searchCriteria: search,
127127
sortBy: sorting,
128128
page,
129-
lastDays,
129+
lastDays: isNumber(lastDays) ? lastDays : undefined,
130130
pageSize: PAGE_SIZE,
131131
dismissed: mode === ViewMode.OnlyDismissed,
132132
...(areGlobalErrorsFiltersEnabled
@@ -281,7 +281,7 @@ export const GlobalErrorsList = () => {
281281
setGlobalErrorsSearch(search);
282282
};
283283

284-
const handleDayFilterChange = (days?: number) => {
284+
const handleDayFilterChange = (days: number) => {
285285
setGlobalErrorsLastDays(days);
286286
};
287287

@@ -388,7 +388,11 @@ export const GlobalErrorsList = () => {
388388
{areGlobalErrorsFiltersEnabled && <GlobalErrorsFilters />}
389389
<SearchInput value={search} onChange={handleSearchInputChange} />
390390
{isGlobalErrorsLastDaysFilterEnabled && (
391-
<DaysFilter onChanged={handleDayFilterChange} />
391+
<DaysFilter
392+
onChange={handleDayFilterChange}
393+
trackingPrefix={"global errors"}
394+
value={lastDays}
395+
/>
392396
)}
393397
<NewPopover
394398
isOpen={isSortingMenuOpen}

src/components/Errors/tracking.ts

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -15,17 +15,7 @@ export const trackingEvents = addPrefix(
1515
WORKSPACE_ONLY_TOGGLE_SWITCHED: "workspace only toggle switched",
1616
GLOBAL_ERRORS_VIEW_SEARCH_CHANGED: "global errors view search changed",
1717
GLOBAL_ERRORS_VIEW_SORTING_CHANGE: "global errors view sorting change",
18-
GLOBAL_ERRORS_VIEW_DATES_FILTERS_CHANGE:
19-
"global errors view date filters change",
2018
GLOBAL_ERRORS_VIEW_PAGE_CHANGE: "global errors view page change",
21-
GLOBAL_ERRORS_DAYS_FILTER_INPUT_VALUE_CHANGE:
22-
"global errors days filter input value change",
23-
GLOBAL_ERRORS_DAYS_FILTER_INCREMENT_CLICKED:
24-
"global errors days filter increment change",
25-
GLOBAL_ERRORS_DAYS_FILTER_DECREMENT_CLICKED:
26-
"global errors days filter decrement change",
27-
GLOBAL_ERRORS_DAYS_FILTER_APPLY_BTN_CLICKED:
28-
"global errors days filter apply button clicked",
2919
GLOBAL_ERRORS_VIEW_RESET_FILTERS_BUTTON_CLICKED:
3020
"global errors view reset filters button clicked",
3121
GLOBAL_ERRORS_VIEW_FILTERS_BUTTON_CLICKED:

src/components/Insights/InsightsCatalog/FilterPanel/IssuesFilter/types.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,4 +18,5 @@ export interface IssuesFilterQuery {
1818
services?: string[];
1919
criticalityFilter?: IssueCriticality[];
2020
criticalityFilterInGlobalScope?: IssueCriticality[];
21+
lastDays?: number | null;
2122
}

src/components/Insights/InsightsCatalog/InsightsPage/InsightCardRenderer/insightCards/common/IssueCompactCard/index.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -177,6 +177,7 @@ export const IssueCompactCard = ({
177177

178178
return (
179179
<s.Container
180+
className={"insight-card"}
180181
$isCritical={isCritical}
181182
$isRead={insight.isRead}
182183
onClick={handleContainerClick}

0 commit comments

Comments
 (0)