From f2a1524c325090cf578e61806a3e884961f241c3 Mon Sep 17 00:00:00 2001 From: IRBorisov <8611739+IRBorisov@users.noreply.github.com> Date: Mon, 29 Jan 2024 14:44:51 +0300 Subject: [PATCH] Add initial filter update --- rsconcept/frontend/src/components/ConstituentaPicker.tsx | 4 +++- rsconcept/frontend/src/dialogs/DlgEditReference/EntityTab.tsx | 1 + 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/rsconcept/frontend/src/components/ConstituentaPicker.tsx b/rsconcept/frontend/src/components/ConstituentaPicker.tsx index d98ceb5d..521fda43 100644 --- a/rsconcept/frontend/src/components/ConstituentaPicker.tsx +++ b/rsconcept/frontend/src/components/ConstituentaPicker.tsx @@ -17,6 +17,7 @@ interface ConstituentaPickerProps { data?: IConstituenta[]; rows?: number; + initialFilter?: string; onBeginFilter?: (cst: IConstituenta) => boolean; describeFunc?: (cst: IConstituenta) => string; matchFunc?: (cst: IConstituenta, filter: string) => boolean; @@ -30,6 +31,7 @@ const columnHelper = createColumnHelper(); function ConstituentaPicker({ data, value, + initialFilter = '', rows = 4, prefixID = prefixes.cst_list, describeFunc = describeConstituenta, @@ -39,7 +41,7 @@ function ConstituentaPicker({ }: ConstituentaPickerProps) { const { colors } = useConceptTheme(); const [filteredData, setFilteredData] = useState([]); - const [filterText, setFilterText] = useState(''); + const [filterText, setFilterText] = useState(initialFilter); useEffect(() => { if (!data) { diff --git a/rsconcept/frontend/src/dialogs/DlgEditReference/EntityTab.tsx b/rsconcept/frontend/src/dialogs/DlgEditReference/EntityTab.tsx index 53bb815c..a74c6df4 100644 --- a/rsconcept/frontend/src/dialogs/DlgEditReference/EntityTab.tsx +++ b/rsconcept/frontend/src/dialogs/DlgEditReference/EntityTab.tsx @@ -61,6 +61,7 @@ function EntityTab({ initial, items, setIsValid, setReference }: EntityTabProps) return (