From b107273db3f58511f3025c2ab61f33a484335758 Mon Sep 17 00:00:00 2001 From: TekH Date: Fri, 4 Jul 2025 10:07:55 +0200 Subject: [PATCH] Update filter type and refactor DocSearchView component - Made the `label` property in the `Filter` type optional for greater flexibility. - Added `TextField` import in `doc-search-view.tsx` for user input. - Removed `DocSearch` and `DocSort` components, replacing them with a `TextField` that uses `filter.label` or `filter.type` as its label. --- .../dd-hub-react/src/api/filter-service.ts | 2 +- .../document/view/doc-search-view.tsx | 25 +++++++++++-------- 2 files changed, 16 insertions(+), 11 deletions(-) diff --git a/src/client/dd-hub-react/src/api/filter-service.ts b/src/client/dd-hub-react/src/api/filter-service.ts index aeb85d6..a544205 100644 --- a/src/client/dd-hub-react/src/api/filter-service.ts +++ b/src/client/dd-hub-react/src/api/filter-service.ts @@ -4,7 +4,7 @@ export type Type = 'BOOLEAN' | 'DATE' | 'VARCHAR' | 'INTEGER' | 'DECIMAL'; export type Filter = { id: number; - label: string; + label?: string; name: string; type: Type; }; diff --git a/src/client/dd-hub-react/src/sections/document/view/doc-search-view.tsx b/src/client/dd-hub-react/src/sections/document/view/doc-search-view.tsx index 25297e6..9071021 100644 --- a/src/client/dd-hub-react/src/sections/document/view/doc-search-view.tsx +++ b/src/client/dd-hub-react/src/sections/document/view/doc-search-view.tsx @@ -3,6 +3,7 @@ import { useState, useCallback, useEffect } from 'react'; import Box from '@mui/material/Box'; import Grid from '@mui/material/Grid'; import Button from '@mui/material/Button'; +import TextField from '@mui/material/TextField'; import Typography from '@mui/material/Typography'; import Pagination from '@mui/material/Pagination'; @@ -38,6 +39,19 @@ export function DocSearchView({ posts }: Props) { }); }, []); + //#region example components + // + // + //#endregion + return ( @@ -91,16 +105,7 @@ export function DocSearchView({ posts }: Props) { justifyContent: 'space-between', }} > - - + ) )}