From 1d0cb96a91040f9bdc6719828e2a2d287f86c622 Mon Sep 17 00:00:00 2001
From: ValueOn AG
Date: Sat, 4 Apr 2026 23:24:59 +0200
Subject: [PATCH] added formgenerator filter query parameter to pass with url
---
.../FormGenerator/FormGeneratorTable/FormGeneratorTable.tsx | 4 +++-
src/pages/Login.tsx | 4 ++--
2 files changed, 5 insertions(+), 3 deletions(-)
diff --git a/src/components/FormGenerator/FormGeneratorTable/FormGeneratorTable.tsx b/src/components/FormGenerator/FormGeneratorTable/FormGeneratorTable.tsx
index 351a59b..f53f0a2 100644
--- a/src/components/FormGenerator/FormGeneratorTable/FormGeneratorTable.tsx
+++ b/src/components/FormGenerator/FormGeneratorTable/FormGeneratorTable.tsx
@@ -226,6 +226,7 @@ export interface FormGeneratorTableProps {
groupRowData?: (groupKey: string, groupRows: T[]) => Record;
groupDefaultExpanded?: boolean;
groupActions?: (groupKey: string, groupRows: T[]) => React.ReactNode;
+ initialSearchTerm?: string;
rowDraggable?: boolean;
onRowDragStart?: (e: React.DragEvent, row: T) => void;
}
@@ -327,6 +328,7 @@ export function FormGeneratorTable>({
groupRowData,
groupDefaultExpanded = true,
groupActions,
+ initialSearchTerm = '',
rowDraggable = false,
onRowDragStart,
}: FormGeneratorTableProps) {
@@ -368,7 +370,7 @@ export function FormGeneratorTable>({
}, [providedColumns, data]);
// State management
- const [searchTerm, setSearchTerm] = useState('');
+ const [searchTerm, setSearchTerm] = useState(initialSearchTerm);
const [searchFocused, setSearchFocused] = useState(false);
const [filterFocused, setFilterFocused] = useState>({});
// Multi-column sorting: array of sort configs in order of priority
diff --git a/src/pages/Login.tsx b/src/pages/Login.tsx
index 4ac295f..91dad94 100644
--- a/src/pages/Login.tsx
+++ b/src/pages/Login.tsx
@@ -28,8 +28,8 @@ function Login() {
const pendingInvitationToken = localStorage.getItem(PENDING_INVITATION_KEY);
const hasPendingInvitation = !!pendingInvitationToken;
- // Get the page the user was trying to visit
- const from = location.state?.from?.pathname || "/";
+ const fromLocation = location.state?.from;
+ const from = (fromLocation?.pathname || "/") + (fromLocation?.search || "");
// Set page title and generate CSRF token
useEffect(() => {