Skip to content

Commit 6e7206d

Browse files
authored
fix: Remove the date filter from dashboard listings (#1898)
* Tree and hardware listing pages no longer render the “last N days” input. * intervalInDays / ?i still apply from the URL; listing default for tree listing is 30 days. Signed-off-by: Alan Peixinho <alan.peixinho@profusion.mobi>
1 parent 9ac1dc6 commit 6e7206d

7 files changed

Lines changed: 10 additions & 20 deletions

File tree

dashboard/src/components/TreeListingPage/TreeTable.tsx

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,6 @@ import type { ListingTableColumnMeta } from '@/types/table';
5555

5656
import { statusCountToRequiredStatusCount } from '@/utils/status';
5757

58-
import { MemoizedInputTime } from '@/components/InputTime';
5958
import { shouldShowRelativeDate } from '@/lib/date';
6059
import { valueOrEmpty } from '@/lib/string';
6160
import { PinnedTrees } from '@/utils/constants/tables';
@@ -533,7 +532,6 @@ export function TreeTable({
533532
/>
534533
</span>
535534
<div className="flex justify-end gap-y-2 max-[700px]:flex-wrap">
536-
<MemoizedInputTime navigateFrom={urlFromMap.navigate} />
537535
<ItemsPerPageSelector
538536
table={table}
539537
onPaginationChange={navigateWithPageSize}

dashboard/src/components/TreeListingPage/TreeTableV2.tsx

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,6 @@ import {
4646

4747
import type { ListingTableColumnMeta } from '@/types/table';
4848

49-
import { MemoizedInputTime } from '@/components/InputTime';
50-
5149
import QuerySwitcher from '@/components/QuerySwitcher/QuerySwitcher';
5250
import { MemoizedSectionError } from '@/components/DetailsPages/SectionError';
5351

@@ -368,7 +366,6 @@ export function TreeTableV2({
368366
/>
369367
</span>
370368
<div className="flex justify-end gap-y-2 max-[700px]:flex-wrap">
371-
<MemoizedInputTime navigateFrom={urlFromMap.navigate} />
372369
<ItemsPerPageSelector
373370
table={table}
374371
onPaginationChange={navigateWithPageSize}

dashboard/src/pages/Hardware/HardwareTable.tsx

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,6 @@ import type { ListingTableColumnMeta } from '@/types/table';
4949

5050
import { RedirectFrom, type TFilter } from '@/types/general';
5151

52-
import { MemoizedInputTime } from '@/components/InputTime';
53-
import { REDUCED_TIME_SEARCH } from '@/utils/constants/general';
5452
import { EMPTY_VALUE } from '@/lib/string';
5553
import { Badge } from '@/components/ui/badge';
5654

@@ -490,10 +488,6 @@ export function HardwareTable({
490488
/>
491489
</span>
492490
<div className="flex justify-end gap-y-2 max-[700px]:flex-wrap">
493-
<MemoizedInputTime
494-
navigateFrom={navigateFrom}
495-
defaultInterval={REDUCED_TIME_SEARCH}
496-
/>
497491
<ItemsPerPageSelector
498492
table={table}
499493
onPaginationChange={navigateWithPageSize}

dashboard/src/routes/_main/tree/route.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,18 +8,18 @@ import {
88
type SearchSchema,
99
} from '@/types/general';
1010
import {
11+
DEFAULT_LISTING_INTERVAL_IN_DAYS,
1112
DEFAULT_LISTING_ITEMS,
12-
DEFAULT_TIME_SEARCH,
1313
} from '@/utils/constants/general';
1414

1515
const defaultValues = {
16-
intervalInDays: DEFAULT_TIME_SEARCH,
16+
intervalInDays: DEFAULT_LISTING_INTERVAL_IN_DAYS,
1717
treeSearch: '',
1818
listingSize: DEFAULT_LISTING_ITEMS,
1919
};
2020

2121
export const RootSearchSchema = z.object({
22-
intervalInDays: makeZIntervalInDays(DEFAULT_TIME_SEARCH),
22+
intervalInDays: makeZIntervalInDays(DEFAULT_LISTING_INTERVAL_IN_DAYS),
2323
treeSearch: z.string().catch(''),
2424
listingSize: zListingSize,
2525
} satisfies SearchSchema);

dashboard/src/routes/_main/tree/v1/route.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,18 +8,18 @@ import {
88
type SearchSchema,
99
} from '@/types/general';
1010
import {
11+
DEFAULT_LISTING_INTERVAL_IN_DAYS,
1112
DEFAULT_LISTING_ITEMS,
12-
DEFAULT_TIME_SEARCH,
1313
} from '@/utils/constants/general';
1414

1515
const defaultValues = {
16-
intervalInDays: DEFAULT_TIME_SEARCH,
16+
intervalInDays: DEFAULT_LISTING_INTERVAL_IN_DAYS,
1717
treeSearch: '',
1818
listingSize: DEFAULT_LISTING_ITEMS,
1919
};
2020

2121
export const RootSearchSchema = z.object({
22-
intervalInDays: makeZIntervalInDays(DEFAULT_TIME_SEARCH),
22+
intervalInDays: makeZIntervalInDays(DEFAULT_LISTING_INTERVAL_IN_DAYS),
2323
treeSearch: z.string().catch(''),
2424
listingSize: zListingSize,
2525
} satisfies SearchSchema);

dashboard/src/routes/_main/tree/v2/route.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,18 +8,18 @@ import {
88
type SearchSchema,
99
} from '@/types/general';
1010
import {
11+
DEFAULT_LISTING_INTERVAL_IN_DAYS,
1112
DEFAULT_LISTING_ITEMS,
12-
DEFAULT_TIME_SEARCH,
1313
} from '@/utils/constants/general';
1414

1515
const defaultValues = {
16-
intervalInDays: DEFAULT_TIME_SEARCH,
16+
intervalInDays: DEFAULT_LISTING_INTERVAL_IN_DAYS,
1717
treeSearch: '',
1818
listingSize: DEFAULT_LISTING_ITEMS,
1919
};
2020

2121
export const RootSearchSchema = z.object({
22-
intervalInDays: makeZIntervalInDays(DEFAULT_TIME_SEARCH),
22+
intervalInDays: makeZIntervalInDays(DEFAULT_LISTING_INTERVAL_IN_DAYS),
2323
treeSearch: z.string().catch(''),
2424
listingSize: zListingSize,
2525
} satisfies SearchSchema);

dashboard/src/utils/constants/general.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,3 +9,4 @@ export const ItemsPerPageValues = [5, 10, 20, 30, 40, 50];
99
export const DEFAULT_TIME_SEARCH = 7;
1010
export const REDUCED_TIME_SEARCH = 5;
1111
export const DEFAULT_LISTING_ITEMS = 10;
12+
export const DEFAULT_LISTING_INTERVAL_IN_DAYS = 30;

0 commit comments

Comments
 (0)