From 95f8343ad3bef9e76941ce6827e5dcb0cdf33eab Mon Sep 17 00:00:00 2001 From: Manan Vaghasiya Date: Mon, 9 Dec 2024 08:50:40 +0000 Subject: [PATCH] Set default state of filters to expanded in multiple components --- .../src/features/malwares/pages/MalwareScanResults.tsx | 2 +- .../apps/dashboard/src/features/malwares/pages/MalwareScans.tsx | 2 +- .../dashboard/src/features/malwares/pages/UniqueMalwares.tsx | 2 +- .../components/scan-result/cloud/CloudPostureResults.tsx | 2 +- .../components/scan-result/cloud/CloudPostureResultsGrouped.tsx | 2 +- .../apps/dashboard/src/features/postures/pages/Accounts.tsx | 2 +- .../src/features/postures/pages/PostureScanResults.tsx | 2 +- .../src/features/registries/pages/RegistryImageTags.tsx | 2 +- .../dashboard/src/features/secrets/pages/SecretScanResults.tsx | 2 +- .../apps/dashboard/src/features/secrets/pages/SecretScans.tsx | 2 +- .../apps/dashboard/src/features/secrets/pages/UniqueSecrets.tsx | 2 +- .../dashboard/src/features/settings/pages/controls/Controls.tsx | 2 +- .../src/features/settings/pages/feeds/MalwareFeeds.tsx | 2 +- .../dashboard/src/features/settings/pages/feeds/SecretFeeds.tsx | 2 +- .../dashboard/src/features/threat-graph/pages/ThreatGraph.tsx | 2 +- .../topology/data-components/tables/CloudResourcesTable.tsx | 2 +- .../topology/data-components/tables/ContainersTable.tsx | 2 +- .../src/features/topology/data-components/tables/HostsTable.tsx | 2 +- .../topology/data-components/tables/KubernetesTable.tsx | 2 +- .../src/features/topology/data-components/tables/PodsTable.tsx | 2 +- .../dashboard/src/features/vulnerabilities/pages/RuntimeBom.tsx | 2 +- .../features/vulnerabilities/pages/UniqueVulnerabilities.tsx | 2 +- .../features/vulnerabilities/pages/VulnerabilityScanResults.tsx | 2 +- .../src/features/vulnerabilities/pages/VulnerabilityScans.tsx | 2 +- 24 files changed, 24 insertions(+), 24 deletions(-) diff --git a/deepfence_frontend/apps/dashboard/src/features/malwares/pages/MalwareScanResults.tsx b/deepfence_frontend/apps/dashboard/src/features/malwares/pages/MalwareScanResults.tsx index c60d7bca7b..7925ea5957 100644 --- a/deepfence_frontend/apps/dashboard/src/features/malwares/pages/MalwareScanResults.tsx +++ b/deepfence_frontend/apps/dashboard/src/features/malwares/pages/MalwareScanResults.tsx @@ -1742,7 +1742,7 @@ const ScanResults = () => { const [rowSelectionState, setRowSelectionState] = useState({}); const [showDeleteDialog, setShowDeleteDialog] = useState(false); const [idsToDelete, setIdsToDelete] = useState([]); - const [filtersExpanded, setFiltersExpanded] = useState(false); + const [filtersExpanded, setFiltersExpanded] = useState(true); const fetcher = useFetcher(); const onTableAction = useCallback( diff --git a/deepfence_frontend/apps/dashboard/src/features/malwares/pages/MalwareScans.tsx b/deepfence_frontend/apps/dashboard/src/features/malwares/pages/MalwareScans.tsx index f8a423198b..669cc04d3a 100644 --- a/deepfence_frontend/apps/dashboard/src/features/malwares/pages/MalwareScans.tsx +++ b/deepfence_frontend/apps/dashboard/src/features/malwares/pages/MalwareScans.tsx @@ -1138,7 +1138,7 @@ const MalwareScans = () => { const isFetching = useIsFetching({ queryKey: queries.malware.scanList._def, }); - const [filtersExpanded, setFiltersExpanded] = useState(false); + const [filtersExpanded, setFiltersExpanded] = useState(true); const [rowSelectionState, setRowSelectionState] = useState({}); const [openStartScan, setOpenStartScan] = useState(false); diff --git a/deepfence_frontend/apps/dashboard/src/features/malwares/pages/UniqueMalwares.tsx b/deepfence_frontend/apps/dashboard/src/features/malwares/pages/UniqueMalwares.tsx index 96750e48f0..7a98489eb7 100644 --- a/deepfence_frontend/apps/dashboard/src/features/malwares/pages/UniqueMalwares.tsx +++ b/deepfence_frontend/apps/dashboard/src/features/malwares/pages/UniqueMalwares.tsx @@ -442,7 +442,7 @@ const UniqueMalwares = () => { const isFetching = useIsFetching({ queryKey: queries.malware.uniqueMalwares._def, }); - const [filtersExpanded, setFiltersExpanded] = useState(false); + const [filtersExpanded, setFiltersExpanded] = useState(true); const [searchParams] = useSearchParams(); return ( diff --git a/deepfence_frontend/apps/dashboard/src/features/postures/components/scan-result/cloud/CloudPostureResults.tsx b/deepfence_frontend/apps/dashboard/src/features/postures/components/scan-result/cloud/CloudPostureResults.tsx index 3025bf5196..2ecdec3bbc 100644 --- a/deepfence_frontend/apps/dashboard/src/features/postures/components/scan-result/cloud/CloudPostureResults.tsx +++ b/deepfence_frontend/apps/dashboard/src/features/postures/components/scan-result/cloud/CloudPostureResults.tsx @@ -55,7 +55,7 @@ export const CloudPostureResults = () => { const [rowSelectionState, setRowSelectionState] = useState({}); const [showDeleteDialog, setShowDeleteDialog] = useState(false); const [idsToDelete, setIdsToDelete] = useState([]); - const [filtersExpanded, setFiltersExpanded] = useState(false); + const [filtersExpanded, setFiltersExpanded] = useState(true); const fetcher = useFetcher(); const onTableAction = useCallback( diff --git a/deepfence_frontend/apps/dashboard/src/features/postures/components/scan-result/cloud/CloudPostureResultsGrouped.tsx b/deepfence_frontend/apps/dashboard/src/features/postures/components/scan-result/cloud/CloudPostureResultsGrouped.tsx index 684e849895..4c4dbcd4ca 100644 --- a/deepfence_frontend/apps/dashboard/src/features/postures/components/scan-result/cloud/CloudPostureResultsGrouped.tsx +++ b/deepfence_frontend/apps/dashboard/src/features/postures/components/scan-result/cloud/CloudPostureResultsGrouped.tsx @@ -62,7 +62,7 @@ import { isScanComplete } from '@/utils/scan'; export const CloudPostureResultsGrouped = () => { const [searchParams] = useSearchParams(); - const [filtersExpanded, setFiltersExpanded] = useState(false); + const [filtersExpanded, setFiltersExpanded] = useState(true); return (
diff --git a/deepfence_frontend/apps/dashboard/src/features/postures/pages/Accounts.tsx b/deepfence_frontend/apps/dashboard/src/features/postures/pages/Accounts.tsx index e3873be379..052f52794f 100644 --- a/deepfence_frontend/apps/dashboard/src/features/postures/pages/Accounts.tsx +++ b/deepfence_frontend/apps/dashboard/src/features/postures/pages/Accounts.tsx @@ -1615,7 +1615,7 @@ const Accounts = () => { const [searchParams] = useSearchParams(); const [rowSelectionState, setRowSelectionState] = useState({}); - const [filtersExpanded, setFiltersExpanded] = useState(false); + const [filtersExpanded, setFiltersExpanded] = useState(true); const fetcher = useFetcher(); const routeParams = useParams() as { nodeType: string; diff --git a/deepfence_frontend/apps/dashboard/src/features/postures/pages/PostureScanResults.tsx b/deepfence_frontend/apps/dashboard/src/features/postures/pages/PostureScanResults.tsx index a9a2df4d2b..f679bef9b4 100644 --- a/deepfence_frontend/apps/dashboard/src/features/postures/pages/PostureScanResults.tsx +++ b/deepfence_frontend/apps/dashboard/src/features/postures/pages/PostureScanResults.tsx @@ -1306,7 +1306,7 @@ const PostureResults = () => { const [rowSelectionState, setRowSelectionState] = useState({}); const [showDeleteDialog, setShowDeleteDialog] = useState(false); const [idsToDelete, setIdsToDelete] = useState([]); - const [filtersExpanded, setFiltersExpanded] = useState(false); + const [filtersExpanded, setFiltersExpanded] = useState(true); const fetcher = useFetcher(); const onTableAction = useCallback( diff --git a/deepfence_frontend/apps/dashboard/src/features/registries/pages/RegistryImageTags.tsx b/deepfence_frontend/apps/dashboard/src/features/registries/pages/RegistryImageTags.tsx index f3a85eab4c..3ac8778fc3 100644 --- a/deepfence_frontend/apps/dashboard/src/features/registries/pages/RegistryImageTags.tsx +++ b/deepfence_frontend/apps/dashboard/src/features/registries/pages/RegistryImageTags.tsx @@ -458,7 +458,7 @@ const RegistryImagesTagsResults = () => { const [searchParams] = useSearchParams(); - const [filtersExpanded, setFiltersExpanded] = useState(false); + const [filtersExpanded, setFiltersExpanded] = useState(true); const onTableAction = useCallback( (nodeIds: string[], scanType: RegistryScanType, _: string) => { diff --git a/deepfence_frontend/apps/dashboard/src/features/secrets/pages/SecretScanResults.tsx b/deepfence_frontend/apps/dashboard/src/features/secrets/pages/SecretScanResults.tsx index 0b0e84f71f..77c81f2b3c 100644 --- a/deepfence_frontend/apps/dashboard/src/features/secrets/pages/SecretScanResults.tsx +++ b/deepfence_frontend/apps/dashboard/src/features/secrets/pages/SecretScanResults.tsx @@ -1719,7 +1719,7 @@ const ScanResults = () => { const [rowSelectionState, setRowSelectionState] = useState({}); const [showDeleteDialog, setShowDeleteDialog] = useState(false); const [idsToDelete, setIdsToDelete] = useState([]); - const [filtersExpanded, setFiltersExpanded] = useState(false); + const [filtersExpanded, setFiltersExpanded] = useState(true); const fetcher = useFetcher(); const onTableAction = useCallback( diff --git a/deepfence_frontend/apps/dashboard/src/features/secrets/pages/SecretScans.tsx b/deepfence_frontend/apps/dashboard/src/features/secrets/pages/SecretScans.tsx index 5c84330f4c..5757c8efa6 100644 --- a/deepfence_frontend/apps/dashboard/src/features/secrets/pages/SecretScans.tsx +++ b/deepfence_frontend/apps/dashboard/src/features/secrets/pages/SecretScans.tsx @@ -1131,7 +1131,7 @@ const BulkActions = ({ const SecretScans = () => { const [searchParams] = useSearchParams(); - const [filtersExpanded, setFiltersExpanded] = useState(false); + const [filtersExpanded, setFiltersExpanded] = useState(true); const isFetching = useIsFetching({ queryKey: queries.secret.scanList._def, }); diff --git a/deepfence_frontend/apps/dashboard/src/features/secrets/pages/UniqueSecrets.tsx b/deepfence_frontend/apps/dashboard/src/features/secrets/pages/UniqueSecrets.tsx index 84f5c0a622..e840e71c19 100644 --- a/deepfence_frontend/apps/dashboard/src/features/secrets/pages/UniqueSecrets.tsx +++ b/deepfence_frontend/apps/dashboard/src/features/secrets/pages/UniqueSecrets.tsx @@ -427,7 +427,7 @@ const UniqueSecrets = () => { const isFetching = useIsFetching({ queryKey: queries.secret.uniqueSecrets._def, }); - const [filtersExpanded, setFiltersExpanded] = useState(false); + const [filtersExpanded, setFiltersExpanded] = useState(true); const [searchParams] = useSearchParams(); return ( diff --git a/deepfence_frontend/apps/dashboard/src/features/settings/pages/controls/Controls.tsx b/deepfence_frontend/apps/dashboard/src/features/settings/pages/controls/Controls.tsx index ec46155fae..a060f39c9e 100644 --- a/deepfence_frontend/apps/dashboard/src/features/settings/pages/controls/Controls.tsx +++ b/deepfence_frontend/apps/dashboard/src/features/settings/pages/controls/Controls.tsx @@ -112,7 +112,7 @@ interface FilterData { const Controls = () => { const params = useParams<{ nodeType: ParamsNodeType }>(); const [searchParams, setSearchParams] = useSearchParams(); - const [filtersExpanded, setFiltersExpanded] = useState(false); + const [filtersExpanded, setFiltersExpanded] = useState(true); const [rowSelectionState, setRowSelectionState] = useState({}); const fetcher = useFetcher(); const [filterData, setFilterData] = useState({}); diff --git a/deepfence_frontend/apps/dashboard/src/features/settings/pages/feeds/MalwareFeeds.tsx b/deepfence_frontend/apps/dashboard/src/features/settings/pages/feeds/MalwareFeeds.tsx index 97765faf6c..cec0c7fa60 100644 --- a/deepfence_frontend/apps/dashboard/src/features/settings/pages/feeds/MalwareFeeds.tsx +++ b/deepfence_frontend/apps/dashboard/src/features/settings/pages/feeds/MalwareFeeds.tsx @@ -568,7 +568,7 @@ const FeedsTable = ({ const MalwareFeeds = () => { const [rowSelectionState, setRowSelectionState] = useState({}); const fetcher = useFetcher(); - const [filtersExpanded, setFiltersExpanded] = useState(false); + const [filtersExpanded, setFiltersExpanded] = useState(true); const [searchParams] = useSearchParams(); const selectedRows = useMemo(() => { diff --git a/deepfence_frontend/apps/dashboard/src/features/settings/pages/feeds/SecretFeeds.tsx b/deepfence_frontend/apps/dashboard/src/features/settings/pages/feeds/SecretFeeds.tsx index 45962f5789..c84c1055c5 100644 --- a/deepfence_frontend/apps/dashboard/src/features/settings/pages/feeds/SecretFeeds.tsx +++ b/deepfence_frontend/apps/dashboard/src/features/settings/pages/feeds/SecretFeeds.tsx @@ -563,7 +563,7 @@ const SecretFeeds = () => { const [rowSelectionState, setRowSelectionState] = useState({}); const fetcher = useFetcher(); const [searchParams] = useSearchParams(); - const [filtersExpanded, setFiltersExpanded] = useState(false); + const [filtersExpanded, setFiltersExpanded] = useState(true); const selectedRows = useMemo(() => { return Object.keys(rowSelectionState); diff --git a/deepfence_frontend/apps/dashboard/src/features/threat-graph/pages/ThreatGraph.tsx b/deepfence_frontend/apps/dashboard/src/features/threat-graph/pages/ThreatGraph.tsx index 44aa09281a..d0926f4d20 100644 --- a/deepfence_frontend/apps/dashboard/src/features/threat-graph/pages/ThreatGraph.tsx +++ b/deepfence_frontend/apps/dashboard/src/features/threat-graph/pages/ThreatGraph.tsx @@ -23,7 +23,7 @@ const ThreatGraph = () => { cloudId: string; }>(); const { mode } = useTheme(); - const [isFilterOpen, setIsFilterOpen] = useState(false); + const [isFilterOpen, setIsFilterOpen] = useState(true); return (
diff --git a/deepfence_frontend/apps/dashboard/src/features/topology/data-components/tables/CloudResourcesTable.tsx b/deepfence_frontend/apps/dashboard/src/features/topology/data-components/tables/CloudResourcesTable.tsx index aa34199245..2e6e5260aa 100644 --- a/deepfence_frontend/apps/dashboard/src/features/topology/data-components/tables/CloudResourcesTable.tsx +++ b/deepfence_frontend/apps/dashboard/src/features/topology/data-components/tables/CloudResourcesTable.tsx @@ -55,7 +55,7 @@ function useSearchCloudResourcesWithPagination() { export const CloudResourcesTable = () => { const [searchParams] = useSearchParams(); - const [filtersExpanded, setFiltersExpanded] = useState(false); + const [filtersExpanded, setFiltersExpanded] = useState(true); return (
diff --git a/deepfence_frontend/apps/dashboard/src/features/topology/data-components/tables/ContainersTable.tsx b/deepfence_frontend/apps/dashboard/src/features/topology/data-components/tables/ContainersTable.tsx index d8eda7fc08..6acee1eaf2 100644 --- a/deepfence_frontend/apps/dashboard/src/features/topology/data-components/tables/ContainersTable.tsx +++ b/deepfence_frontend/apps/dashboard/src/features/topology/data-components/tables/ContainersTable.tsx @@ -58,7 +58,7 @@ const DEFAULT_PAGE_SIZE = 25; export const ContainersTable = () => { const [rowSelectionState, setRowSelectionState] = useState({}); const [searchParams] = useSearchParams(); - const [filtersExpanded, setFiltersExpanded] = useState(false); + const [filtersExpanded, setFiltersExpanded] = useState(true); const selectedIds = useMemo(() => { return Object.keys(rowSelectionState); }, [rowSelectionState]); diff --git a/deepfence_frontend/apps/dashboard/src/features/topology/data-components/tables/HostsTable.tsx b/deepfence_frontend/apps/dashboard/src/features/topology/data-components/tables/HostsTable.tsx index ba315efcf8..cf826e95b7 100644 --- a/deepfence_frontend/apps/dashboard/src/features/topology/data-components/tables/HostsTable.tsx +++ b/deepfence_frontend/apps/dashboard/src/features/topology/data-components/tables/HostsTable.tsx @@ -70,7 +70,7 @@ const useGetAgentVersions = () => { export const HostsTable = () => { const [selectedNodes, setSelectedNodes] = useState([]); const [searchParams] = useSearchParams(); - const [filtersExpanded, setFiltersExpanded] = useState(false); + const [filtersExpanded, setFiltersExpanded] = useState(true); return (
diff --git a/deepfence_frontend/apps/dashboard/src/features/topology/data-components/tables/KubernetesTable.tsx b/deepfence_frontend/apps/dashboard/src/features/topology/data-components/tables/KubernetesTable.tsx index 53c9bfc7e7..9a0899be5f 100644 --- a/deepfence_frontend/apps/dashboard/src/features/topology/data-components/tables/KubernetesTable.tsx +++ b/deepfence_frontend/apps/dashboard/src/features/topology/data-components/tables/KubernetesTable.tsx @@ -174,7 +174,7 @@ function Filters() { export const KubernetesTable = () => { const [selectedNodes, setSelectedNodes] = useState([]); const [searchParams] = useSearchParams(); - const [filtersExpanded, setFiltersExpanded] = useState(false); + const [filtersExpanded, setFiltersExpanded] = useState(true); return (
diff --git a/deepfence_frontend/apps/dashboard/src/features/topology/data-components/tables/PodsTable.tsx b/deepfence_frontend/apps/dashboard/src/features/topology/data-components/tables/PodsTable.tsx index a8a9ce7000..817de69a82 100644 --- a/deepfence_frontend/apps/dashboard/src/features/topology/data-components/tables/PodsTable.tsx +++ b/deepfence_frontend/apps/dashboard/src/features/topology/data-components/tables/PodsTable.tsx @@ -55,7 +55,7 @@ const DEFAULT_PAGE_SIZE = 25; export const PodsTable = () => { const [searchParams] = useSearchParams(); - const [filtersExpanded, setFiltersExpanded] = useState(false); + const [filtersExpanded, setFiltersExpanded] = useState(true); const [rowSelectionState, setRowSelectionState] = useState({}); const selectedIds = useMemo(() => { diff --git a/deepfence_frontend/apps/dashboard/src/features/vulnerabilities/pages/RuntimeBom.tsx b/deepfence_frontend/apps/dashboard/src/features/vulnerabilities/pages/RuntimeBom.tsx index da7f695b20..40d2a32cc9 100644 --- a/deepfence_frontend/apps/dashboard/src/features/vulnerabilities/pages/RuntimeBom.tsx +++ b/deepfence_frontend/apps/dashboard/src/features/vulnerabilities/pages/RuntimeBom.tsx @@ -64,7 +64,7 @@ const RuntimeBom = () => { const isFetching = useIsFetching({ queryKey: queries.vulnerability.scanList._def, }); - const [filtersExpanded, setFiltersExpanded] = useState(false); + const [filtersExpanded, setFiltersExpanded] = useState(true); const [searchParams] = useSearchParams(); return ( diff --git a/deepfence_frontend/apps/dashboard/src/features/vulnerabilities/pages/UniqueVulnerabilities.tsx b/deepfence_frontend/apps/dashboard/src/features/vulnerabilities/pages/UniqueVulnerabilities.tsx index d8826acece..f18cd9f0ba 100644 --- a/deepfence_frontend/apps/dashboard/src/features/vulnerabilities/pages/UniqueVulnerabilities.tsx +++ b/deepfence_frontend/apps/dashboard/src/features/vulnerabilities/pages/UniqueVulnerabilities.tsx @@ -552,7 +552,7 @@ const UniqueVulnerabilities = () => { const isFetching = useIsFetching({ queryKey: queries.vulnerability.uniqueVulnerabilities._def, }); - const [filtersExpanded, setFiltersExpanded] = useState(false); + const [filtersExpanded, setFiltersExpanded] = useState(true); const [searchParams] = useSearchParams(); return ( diff --git a/deepfence_frontend/apps/dashboard/src/features/vulnerabilities/pages/VulnerabilityScanResults.tsx b/deepfence_frontend/apps/dashboard/src/features/vulnerabilities/pages/VulnerabilityScanResults.tsx index 89c9a2f65c..5e7f611781 100644 --- a/deepfence_frontend/apps/dashboard/src/features/vulnerabilities/pages/VulnerabilityScanResults.tsx +++ b/deepfence_frontend/apps/dashboard/src/features/vulnerabilities/pages/VulnerabilityScanResults.tsx @@ -1673,7 +1673,7 @@ const CVEResults = () => { const [rowSelectionState, setRowSelectionState] = useState({}); const [showDeleteDialog, setShowDeleteDialog] = useState(false); const [idsToDelete, setIdsToDelete] = useState([]); - const [filtersExpanded, setFiltersExpanded] = useState(false); + const [filtersExpanded, setFiltersExpanded] = useState(true); const fetcher = useFetcher(); const onTableAction = useCallback( diff --git a/deepfence_frontend/apps/dashboard/src/features/vulnerabilities/pages/VulnerabilityScans.tsx b/deepfence_frontend/apps/dashboard/src/features/vulnerabilities/pages/VulnerabilityScans.tsx index b24336b501..8360c20b78 100644 --- a/deepfence_frontend/apps/dashboard/src/features/vulnerabilities/pages/VulnerabilityScans.tsx +++ b/deepfence_frontend/apps/dashboard/src/features/vulnerabilities/pages/VulnerabilityScans.tsx @@ -1194,7 +1194,7 @@ const VulnerabilityScans = () => { const isFetching = useIsFetching({ queryKey: queries.vulnerability.scanList._def, }); - const [filtersExpanded, setFiltersExpanded] = useState(false); + const [filtersExpanded, setFiltersExpanded] = useState(true); const [searchParams] = useSearchParams(); const [rowSelectionState, setRowSelectionState] = useState({});