Skip to content

Commit

Permalink
Set default state of filters to expanded in multiple components
Browse files Browse the repository at this point in the history
  • Loading branch information
manV committed Dec 9, 2024
1 parent fe1eed4 commit 95f8343
Show file tree
Hide file tree
Showing 24 changed files with 24 additions and 24 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1742,7 +1742,7 @@ const ScanResults = () => {
const [rowSelectionState, setRowSelectionState] = useState<RowSelectionState>({});
const [showDeleteDialog, setShowDeleteDialog] = useState(false);
const [idsToDelete, setIdsToDelete] = useState<string[]>([]);
const [filtersExpanded, setFiltersExpanded] = useState(false);
const [filtersExpanded, setFiltersExpanded] = useState(true);
const fetcher = useFetcher<ActionData>();

const onTableAction = useCallback(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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<RowSelectionState>({});

const [openStartScan, setOpenStartScan] = useState<boolean>(false);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ export const CloudPostureResults = () => {
const [rowSelectionState, setRowSelectionState] = useState<RowSelectionState>({});
const [showDeleteDialog, setShowDeleteDialog] = useState(false);
const [idsToDelete, setIdsToDelete] = useState<string[]>([]);
const [filtersExpanded, setFiltersExpanded] = useState(false);
const [filtersExpanded, setFiltersExpanded] = useState(true);
const fetcher = useFetcher<ActionData>();

const onTableAction = useCallback(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 (
<div className="self-start">
<div className="h-12 flex items-center">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1615,7 +1615,7 @@ const Accounts = () => {
const [searchParams] = useSearchParams();
const [rowSelectionState, setRowSelectionState] = useState<RowSelectionState>({});

const [filtersExpanded, setFiltersExpanded] = useState(false);
const [filtersExpanded, setFiltersExpanded] = useState(true);
const fetcher = useFetcher();
const routeParams = useParams() as {
nodeType: string;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1306,7 +1306,7 @@ const PostureResults = () => {
const [rowSelectionState, setRowSelectionState] = useState<RowSelectionState>({});
const [showDeleteDialog, setShowDeleteDialog] = useState(false);
const [idsToDelete, setIdsToDelete] = useState<string[]>([]);
const [filtersExpanded, setFiltersExpanded] = useState(false);
const [filtersExpanded, setFiltersExpanded] = useState(true);
const fetcher = useFetcher<ActionData>();

const onTableAction = useCallback(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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) => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1719,7 +1719,7 @@ const ScanResults = () => {
const [rowSelectionState, setRowSelectionState] = useState<RowSelectionState>({});
const [showDeleteDialog, setShowDeleteDialog] = useState(false);
const [idsToDelete, setIdsToDelete] = useState<string[]>([]);
const [filtersExpanded, setFiltersExpanded] = useState(false);
const [filtersExpanded, setFiltersExpanded] = useState(true);
const fetcher = useFetcher<ActionData>();

const onTableAction = useCallback(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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,
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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<RowSelectionState>({});
const fetcher = useFetcher<null>();
const [filterData, setFilterData] = useState<FilterData>({});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -568,7 +568,7 @@ const FeedsTable = ({
const MalwareFeeds = () => {
const [rowSelectionState, setRowSelectionState] = useState<RowSelectionState>({});
const fetcher = useFetcher<ActionData>();
const [filtersExpanded, setFiltersExpanded] = useState(false);
const [filtersExpanded, setFiltersExpanded] = useState(true);
const [searchParams] = useSearchParams();

const selectedRows = useMemo<string[]>(() => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -563,7 +563,7 @@ const SecretFeeds = () => {
const [rowSelectionState, setRowSelectionState] = useState<RowSelectionState>({});
const fetcher = useFetcher<ActionData>();
const [searchParams] = useSearchParams();
const [filtersExpanded, setFiltersExpanded] = useState(false);
const [filtersExpanded, setFiltersExpanded] = useState(true);

const selectedRows = useMemo<string[]>(() => {
return Object.keys(rowSelectionState);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ const ThreatGraph = () => {
cloudId: string;
}>();
const { mode } = useTheme();
const [isFilterOpen, setIsFilterOpen] = useState(false);
const [isFilterOpen, setIsFilterOpen] = useState(true);

return (
<div className="h-full flex flex-col">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ function useSearchCloudResourcesWithPagination() {

export const CloudResourcesTable = () => {
const [searchParams] = useSearchParams();
const [filtersExpanded, setFiltersExpanded] = useState(false);
const [filtersExpanded, setFiltersExpanded] = useState(true);

return (
<div className="px-4 pb-4">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ const DEFAULT_PAGE_SIZE = 25;
export const ContainersTable = () => {
const [rowSelectionState, setRowSelectionState] = useState<RowSelectionState>({});
const [searchParams] = useSearchParams();
const [filtersExpanded, setFiltersExpanded] = useState(false);
const [filtersExpanded, setFiltersExpanded] = useState(true);
const selectedIds = useMemo(() => {
return Object.keys(rowSelectionState);
}, [rowSelectionState]);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ const useGetAgentVersions = () => {
export const HostsTable = () => {
const [selectedNodes, setSelectedNodes] = useState<ModelHost[]>([]);
const [searchParams] = useSearchParams();
const [filtersExpanded, setFiltersExpanded] = useState(false);
const [filtersExpanded, setFiltersExpanded] = useState(true);

return (
<div className="px-4 pb-4">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ function Filters() {
export const KubernetesTable = () => {
const [selectedNodes, setSelectedNodes] = useState<ModelKubernetesCluster[]>([]);
const [searchParams] = useSearchParams();
const [filtersExpanded, setFiltersExpanded] = useState(false);
const [filtersExpanded, setFiltersExpanded] = useState(true);

return (
<div className="px-4 pb-4">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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<RowSelectionState>({});

const selectedIds = useMemo(() => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1673,7 +1673,7 @@ const CVEResults = () => {
const [rowSelectionState, setRowSelectionState] = useState<RowSelectionState>({});
const [showDeleteDialog, setShowDeleteDialog] = useState(false);
const [idsToDelete, setIdsToDelete] = useState<string[]>([]);
const [filtersExpanded, setFiltersExpanded] = useState(false);
const [filtersExpanded, setFiltersExpanded] = useState(true);
const fetcher = useFetcher<ActionData>();

const onTableAction = useCallback(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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<RowSelectionState>({});
Expand Down

0 comments on commit 95f8343

Please sign in to comment.