File tree Expand file tree Collapse file tree 2 files changed +14
-17
lines changed
Expand file tree Collapse file tree 2 files changed +14
-17
lines changed Original file line number Diff line number Diff line change 55} from "../../../../../containers/Admin/hooks" ;
66import { useGetEnvironmentsQuery } from "../../../../../redux/services/digma" ;
77import { setSelectedEnvironmentId } from "../../../../../redux/slices/issuesReportSlice" ;
8- import { setEnvironmentId } from "../../../../../redux/slices/scopeSlice" ;
98import { sendUserActionTrackingEvent } from "../../../../../utils/actions/sendUserActionTrackingEvent" ;
109import { EnvironmentIcon } from "../../../../common/EnvironmentIcon" ;
1110import { ChevronIcon } from "../../../../common/icons/16px/ChevronIcon" ;
@@ -53,10 +52,14 @@ export const EnvironmentSelect = () => {
5352 sortedEnvironments . length > 0 &&
5453 ! selectedEnvironmentId
5554 ) {
56- dispatch ( setEnvironmentId ( sortedEnvironments [ 0 ] . id ) ) ;
55+ dispatch ( setSelectedEnvironmentId ( sortedEnvironments [ 0 ] . id ) ) ;
5756 }
5857 } , [ dispatch , sortedEnvironments , selectedEnvironmentId ] ) ;
5958
59+ if ( ! selectedEnvironmentId ) {
60+ return null ;
61+ }
62+
6063 return (
6164 < NewPopover
6265 content = {
@@ -79,7 +82,9 @@ export const EnvironmentSelect = () => {
7982 { selectedEnvironment && (
8083 < EnvironmentIcon environment = { selectedEnvironment } size = { 16 } />
8184 ) }
82- < s . EnvironmentName > { selectedEnvironment ?. name } </ s . EnvironmentName >
85+ < s . EnvironmentName >
86+ { selectedEnvironment ?. name ?? selectedEnvironmentId }
87+ </ s . EnvironmentName >
8388 < s . ChevronIconContainer >
8489 < ChevronIcon
8590 direction = { isMenuOpen ? Direction . Up : Direction . Down }
Original file line number Diff line number Diff line change 1- import { useAdminSelector } from "../../../../../containers/Admin/hooks" ;
21import { EnvironmentSelect } from "../EnvironmentSelect" ;
32import { FilterMenu } from "../FilterMenu" ;
43
5- export const FilterToolbar = ( ) => {
6- const environmentId = useAdminSelector (
7- ( state ) => state . codeIssuesReport . selectedEnvironmentId
8- ) ;
9- return (
10- environmentId && (
11- < >
12- < EnvironmentSelect />
13- < FilterMenu />
14- </ >
15- )
16- ) ;
17- } ;
4+ export const FilterToolbar = ( ) => (
5+ < >
6+ < EnvironmentSelect />
7+ < FilterMenu />
8+ </ >
9+ ) ;
You can’t perform that action at this time.
0 commit comments