@solidxai/core-ui 0.1.14 → 0.1.15-beta.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/auth/AuthLayout.js +1 -1
- package/dist/components/auth/AuthLayout.js.map +1 -1
- package/dist/components/auth/AuthLayout.tsx +2 -2
- package/dist/components/common/DropzonePlaceholder.d.ts +2 -1
- package/dist/components/common/DropzonePlaceholder.d.ts.map +1 -1
- package/dist/components/common/DropzonePlaceholder.js +10 -7
- package/dist/components/common/DropzonePlaceholder.js.map +1 -1
- package/dist/components/common/DropzonePlaceholder.tsx +14 -9
- package/dist/components/common/SettingsComponent.module.css +4 -1
- package/dist/components/common/SolidFormStepper.d.ts.map +1 -1
- package/dist/components/common/SolidFormStepper.js +7 -6
- package/dist/components/common/SolidFormStepper.js.map +1 -1
- package/dist/components/common/SolidFormStepper.tsx +7 -1
- package/dist/components/common/SolidThemeProvider.d.ts.map +1 -1
- package/dist/components/common/SolidThemeProvider.js +127 -11
- package/dist/components/common/SolidThemeProvider.js.map +1 -1
- package/dist/components/common/SolidThemeProvider.tsx +104 -22
- package/dist/components/core/card/CardGrid.d.ts +1 -1
- package/dist/components/core/card/CardGrid.d.ts.map +1 -1
- package/dist/components/core/card/CardGrid.js +2 -2
- package/dist/components/core/card/CardGrid.js.map +1 -1
- package/dist/components/core/card/CardGrid.tsx +4 -0
- package/dist/components/core/card/CardItem.d.ts +2 -0
- package/dist/components/core/card/CardItem.d.ts.map +1 -1
- package/dist/components/core/card/CardItem.js +5 -4
- package/dist/components/core/card/CardItem.js.map +1 -1
- package/dist/components/core/card/CardItem.tsx +16 -1
- package/dist/components/core/card/SolidCardView.d.ts +28 -1
- package/dist/components/core/card/SolidCardView.d.ts.map +1 -1
- package/dist/components/core/card/SolidCardView.js +99 -44
- package/dist/components/core/card/SolidCardView.js.map +1 -1
- package/dist/components/core/card/SolidCardView.tsx +119 -7
- package/dist/components/core/card/SolidCardViewConfigure.d.ts +1 -1
- package/dist/components/core/card/SolidCardViewConfigure.d.ts.map +1 -1
- package/dist/components/core/card/SolidCardViewConfigure.js +15 -6
- package/dist/components/core/card/SolidCardViewConfigure.js.map +1 -1
- package/dist/components/core/card/SolidCardViewConfigure.tsx +34 -0
- package/dist/components/core/common/PDFViewer.d.ts +9 -5
- package/dist/components/core/common/PDFViewer.d.ts.map +1 -1
- package/dist/components/core/common/PDFViewer.js +10 -102
- package/dist/components/core/common/PDFViewer.js.map +1 -1
- package/dist/components/core/common/PDFViewer.tsx +29 -88
- package/dist/components/core/common/SolidCreateButton.d.ts.map +1 -1
- package/dist/components/core/common/SolidCreateButton.js +2 -2
- package/dist/components/core/common/SolidCreateButton.js.map +1 -1
- package/dist/components/core/common/SolidCreateButton.tsx +22 -2
- package/dist/components/core/common/SolidGlobalSearchElement.d.ts.map +1 -1
- package/dist/components/core/common/SolidGlobalSearchElement.js +216 -198
- package/dist/components/core/common/SolidGlobalSearchElement.js.map +1 -1
- package/dist/components/core/common/SolidGlobalSearchElement.tsx +287 -216
- package/dist/components/core/form/SolidFormActionHeader.d.ts.map +1 -1
- package/dist/components/core/form/SolidFormActionHeader.js +21 -21
- package/dist/components/core/form/SolidFormActionHeader.js.map +1 -1
- package/dist/components/core/form/SolidFormActionHeader.tsx +62 -53
- package/dist/components/core/form/SolidFormView.d.ts.map +1 -1
- package/dist/components/core/form/SolidFormView.js +101 -74
- package/dist/components/core/form/SolidFormView.js.map +1 -1
- package/dist/components/core/form/SolidFormView.tsx +46 -19
- package/dist/components/core/form/fields/SolidMediaMultipleField.d.ts.map +1 -1
- package/dist/components/core/form/fields/SolidMediaMultipleField.js +3 -2
- package/dist/components/core/form/fields/SolidMediaMultipleField.js.map +1 -1
- package/dist/components/core/form/fields/SolidMediaMultipleField.tsx +3 -1
- package/dist/components/core/form/fields/SolidMediaSingleField.d.ts.map +1 -1
- package/dist/components/core/form/fields/SolidMediaSingleField.js +3 -2
- package/dist/components/core/form/fields/SolidMediaSingleField.js.map +1 -1
- package/dist/components/core/form/fields/SolidMediaSingleField.tsx +3 -1
- package/dist/components/core/form/fields/relations/SolidRelationManyToManyField.d.ts +1 -0
- package/dist/components/core/form/fields/relations/SolidRelationManyToManyField.d.ts.map +1 -1
- package/dist/components/core/form/fields/relations/SolidRelationManyToManyField.js +20 -2
- package/dist/components/core/form/fields/relations/SolidRelationManyToManyField.js.map +1 -1
- package/dist/components/core/form/fields/relations/SolidRelationManyToManyField.tsx +29 -2
- package/dist/components/core/form/fields/solidFields.module.css +7 -0
- package/dist/components/core/kanban/KanbanBoard.d.ts +1 -1
- package/dist/components/core/kanban/KanbanBoard.d.ts.map +1 -1
- package/dist/components/core/kanban/KanbanBoard.js +2 -2
- package/dist/components/core/kanban/KanbanBoard.js.map +1 -1
- package/dist/components/core/kanban/KanbanBoard.tsx +3 -1
- package/dist/components/core/kanban/KanbanCard.d.ts +2 -0
- package/dist/components/core/kanban/KanbanCard.d.ts.map +1 -1
- package/dist/components/core/kanban/KanbanCard.js +5 -3
- package/dist/components/core/kanban/KanbanCard.js.map +1 -1
- package/dist/components/core/kanban/KanbanCard.tsx +15 -2
- package/dist/components/core/kanban/KanbanColumn.d.ts +3 -1
- package/dist/components/core/kanban/KanbanColumn.d.ts.map +1 -1
- package/dist/components/core/kanban/KanbanColumn.js +2 -2
- package/dist/components/core/kanban/KanbanColumn.js.map +1 -1
- package/dist/components/core/kanban/KanbanColumn.tsx +4 -2
- package/dist/components/core/kanban/SolidKanbanView.d.ts +25 -1
- package/dist/components/core/kanban/SolidKanbanView.d.ts.map +1 -1
- package/dist/components/core/kanban/SolidKanbanView.js +95 -50
- package/dist/components/core/kanban/SolidKanbanView.js.map +1 -1
- package/dist/components/core/kanban/SolidKanbanView.tsx +87 -9
- package/dist/components/core/list/PLAN.md +1 -1
- package/dist/components/core/list/SolidListView.d.ts +11 -0
- package/dist/components/core/list/SolidListView.d.ts.map +1 -1
- package/dist/components/core/list/SolidListView.js +51 -90
- package/dist/components/core/list/SolidListView.js.map +1 -1
- package/dist/components/core/list/SolidListView.tsx +77 -112
- package/dist/components/core/list/SolidListViewColumn.d.ts +2 -1
- package/dist/components/core/list/SolidListViewColumn.d.ts.map +1 -1
- package/dist/components/core/list/SolidListViewColumn.js +2 -2
- package/dist/components/core/list/SolidListViewColumn.js.map +1 -1
- package/dist/components/core/list/SolidListViewColumn.tsx +4 -3
- package/dist/components/core/list/SolidListViewConfigure.js +1 -1
- package/dist/components/core/list/SolidListViewConfigure.js.map +1 -1
- package/dist/components/core/list/SolidListViewConfigure.tsx +1 -1
- package/dist/components/core/list/columns/SolidRelationColumn.d.ts +1 -1
- package/dist/components/core/list/columns/SolidRelationColumn.d.ts.map +1 -1
- package/dist/components/core/list/columns/SolidRelationColumn.js +2 -2
- package/dist/components/core/list/columns/SolidRelationColumn.js.map +1 -1
- package/dist/components/core/list/columns/SolidRelationColumn.tsx +2 -2
- package/dist/components/core/list/columns/relations/SolidRelationManyToOneColumn.d.ts +2 -2
- package/dist/components/core/list/columns/relations/SolidRelationManyToOneColumn.d.ts.map +1 -1
- package/dist/components/core/list/columns/relations/SolidRelationManyToOneColumn.js +5 -4
- package/dist/components/core/list/columns/relations/SolidRelationManyToOneColumn.js.map +1 -1
- package/dist/components/core/list/columns/relations/SolidRelationManyToOneColumn.tsx +5 -4
- package/dist/components/core/model/CreateModel.d.ts.map +1 -1
- package/dist/components/core/model/CreateModel.js +2 -1
- package/dist/components/core/model/CreateModel.js.map +1 -1
- package/dist/components/core/model/CreateModel.tsx +2 -0
- package/dist/components/core/model/FieldMetaData.d.ts +1 -1
- package/dist/components/core/model/FieldMetaData.d.ts.map +1 -1
- package/dist/components/core/model/FieldMetaData.js +8 -8
- package/dist/components/core/model/FieldMetaData.js.map +1 -1
- package/dist/components/core/model/FieldMetaData.tsx +2 -2
- package/dist/components/core/model/FieldMetaDataForm.css +119 -0
- package/dist/components/core/model/FieldMetaDataForm.d.ts.map +1 -1
- package/dist/components/core/model/FieldMetaDataForm.js +147 -97
- package/dist/components/core/model/FieldMetaDataForm.js.map +1 -1
- package/dist/components/core/model/FieldMetaDataForm.tsx +124 -32
- package/dist/components/core/module/ModuleMetadataExplorer.css +64 -0
- package/dist/components/core/module/ModulePackageDialog.css +117 -12
- package/dist/components/core/tree/SolidTreeView.d.ts.map +1 -1
- package/dist/components/core/tree/SolidTreeView.js +6 -3
- package/dist/components/core/tree/SolidTreeView.js.map +1 -1
- package/dist/components/core/tree/SolidTreeView.tsx +27 -13
- package/dist/components/layout/AdminHeaderActions.d.ts.map +1 -1
- package/dist/components/layout/AdminHeaderActions.js +16 -11
- package/dist/components/layout/AdminHeaderActions.js.map +1 -1
- package/dist/components/layout/AdminHeaderActions.tsx +16 -9
- package/dist/components/layout/AdminTopHeader.d.ts.map +1 -1
- package/dist/components/layout/AdminTopHeader.js +1 -18
- package/dist/components/layout/AdminTopHeader.js.map +1 -1
- package/dist/components/layout/AdminTopHeader.tsx +3 -21
- package/dist/helpers/getAcceptedFileTypes.d.ts +12 -2
- package/dist/helpers/getAcceptedFileTypes.d.ts.map +1 -1
- package/dist/helpers/getAcceptedFileTypes.js +72 -16
- package/dist/helpers/getAcceptedFileTypes.js.map +1 -1
- package/dist/helpers/getAcceptedFileTypes.tsx +101 -18
- package/dist/helpers/registry.js +2 -1
- package/dist/helpers/registry.js.map +1 -1
- package/dist/helpers/registry.ts +3 -1
- package/dist/index.d.ts +6 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3 -0
- package/dist/index.js.map +1 -1
- package/dist/index.ts +6 -2
- package/dist/resources/globals.css +274 -109
- package/dist/resources/solid-custom.css +11 -0
- package/dist/resources/solid-responsive.css +1 -5
- package/dist/resources/solid-tailwind-generated.css +1 -1
- package/dist/routes/pages/admin/core/CardPage.d.ts.map +1 -1
- package/dist/routes/pages/admin/core/CardPage.js +15 -2
- package/dist/routes/pages/admin/core/CardPage.js.map +1 -1
- package/dist/routes/pages/admin/core/CardPage.tsx +17 -2
- package/dist/routes/pages/admin/core/DashboardPage.d.ts.map +1 -1
- package/dist/routes/pages/admin/core/DashboardPage.js +31 -3
- package/dist/routes/pages/admin/core/DashboardPage.js.map +1 -1
- package/dist/routes/pages/admin/core/DashboardPage.tsx +39 -11
- package/dist/routes/pages/admin/core/KanbanPage.d.ts.map +1 -1
- package/dist/routes/pages/admin/core/KanbanPage.js +15 -2
- package/dist/routes/pages/admin/core/KanbanPage.js.map +1 -1
- package/dist/routes/pages/admin/core/KanbanPage.tsx +17 -2
- package/dist/routes/pages/admin/core/ListPage.d.ts.map +1 -1
- package/dist/routes/pages/admin/core/ListPage.js +5 -13
- package/dist/routes/pages/admin/core/ListPage.js.map +1 -1
- package/dist/routes/pages/admin/core/ListPage.tsx +5 -15
- package/dist/types/index.d.ts +2 -4
- package/dist/types/solid-core.d.ts +12 -13
- package/package.json +1 -1
|
@@ -4,7 +4,9 @@ import { useGetSolidViewLayoutQuery } from "../../../redux/api/solidViewApi";
|
|
|
4
4
|
import { useLazyCheckIfPermissionExistsQuery } from "../../../redux/api/userApi";
|
|
5
5
|
import { DropResult } from "@hello-pangea/dnd";
|
|
6
6
|
import qs from "qs";
|
|
7
|
-
import { useEffect, useRef, useState } from "react";
|
|
7
|
+
import { forwardRef, useEffect, useImperativeHandle, useRef, useState } from "react";
|
|
8
|
+
import { useSession } from "../../../hooks/useSession";
|
|
9
|
+
import { resolveActiveUserId, resolveSavedFilterVariables } from "../../../helpers/resolveActiveUserId";
|
|
8
10
|
import { SolidCreateButton } from "../common/SolidCreateButton";
|
|
9
11
|
import { SolidGlobalSearchElement } from "../common/SolidGlobalSearchElement";
|
|
10
12
|
import KanbanBoard from "./KanbanBoard";
|
|
@@ -50,6 +52,31 @@ type SolidKanbanViewParams = {
|
|
|
50
52
|
moduleName: string;
|
|
51
53
|
modelName: string;
|
|
52
54
|
embeded: boolean;
|
|
55
|
+
customFilter?: any;
|
|
56
|
+
};
|
|
57
|
+
|
|
58
|
+
type SolidKanbanFilterInput = {
|
|
59
|
+
custom_filter_predicate?: any;
|
|
60
|
+
search_predicate?: any;
|
|
61
|
+
saved_filter_predicate?: any;
|
|
62
|
+
predefined_search_predicate?: any;
|
|
63
|
+
};
|
|
64
|
+
|
|
65
|
+
export type SolidKanbanViewHandle = {
|
|
66
|
+
refresh: () => void;
|
|
67
|
+
clearFilters: () => void;
|
|
68
|
+
applyFilter: (filter: SolidKanbanFilterInput) => void;
|
|
69
|
+
getSavedFilters: () => any[];
|
|
70
|
+
applySavedFilter: (name: string, variables?: Record<string, any>) => boolean;
|
|
71
|
+
setShowArchived: (value: boolean) => void;
|
|
72
|
+
getState: () => {
|
|
73
|
+
groupByFieldName: string;
|
|
74
|
+
showArchived: boolean;
|
|
75
|
+
filters: any;
|
|
76
|
+
filterPredicates: any;
|
|
77
|
+
kanbanData: any[];
|
|
78
|
+
loading: boolean;
|
|
79
|
+
};
|
|
53
80
|
};
|
|
54
81
|
|
|
55
82
|
type KanbanSwimlaneDefinition = {
|
|
@@ -119,12 +146,14 @@ const mergeKanbanGroupsWithDefinitions = (
|
|
|
119
146
|
};
|
|
120
147
|
|
|
121
148
|
|
|
122
|
-
export const SolidKanbanView = (params
|
|
149
|
+
export const SolidKanbanView = forwardRef<SolidKanbanViewHandle, SolidKanbanViewParams>((params, ref) => {
|
|
150
|
+
const session = useSession();
|
|
151
|
+
const user = session?.data?.user;
|
|
123
152
|
|
|
124
153
|
const visibleNavbar = useSelector((state: any) => state.navbarState?.visibleNavbar);
|
|
125
154
|
const dispatch = useDispatch()
|
|
126
155
|
|
|
127
|
-
const solidGlobalSearchElementRef = useRef();
|
|
156
|
+
const solidGlobalSearchElementRef = useRef<any>(null);
|
|
128
157
|
const router = useRouter();
|
|
129
158
|
const searchParams = useSearchParams();
|
|
130
159
|
// TODO: The initial filter state will be created based on the fields which are present on this kanban view.
|
|
@@ -542,7 +571,11 @@ export const SolidKanbanView = (params: SolidKanbanViewParams) => {
|
|
|
542
571
|
}
|
|
543
572
|
if (queryObject.saved_filter_predicate) {
|
|
544
573
|
// @ts-ignore
|
|
545
|
-
filters.$and.push(
|
|
574
|
+
filters.$and.push(resolveSavedFilterVariables(
|
|
575
|
+
queryObject.saved_filter_predicate,
|
|
576
|
+
user?.id,
|
|
577
|
+
queryObject.saved_filter_variables || {}
|
|
578
|
+
).value);
|
|
546
579
|
}
|
|
547
580
|
if (queryObject.predefined_search_predicate) {
|
|
548
581
|
// @ts-ignore
|
|
@@ -976,7 +1009,8 @@ export const SolidKanbanView = (params: SolidKanbanViewParams) => {
|
|
|
976
1009
|
}
|
|
977
1010
|
if (filterPredicates.saved_filter_predicate) {
|
|
978
1011
|
// @ts-ignore
|
|
979
|
-
queryfilter.$and.push(filterPredicates.
|
|
1012
|
+
queryfilter.$and.push(filterPredicates.resolved_saved_filter_predicate ||
|
|
1013
|
+
resolveActiveUserId(filterPredicates.saved_filter_predicate, user?.id));
|
|
980
1014
|
}
|
|
981
1015
|
if (filterPredicates.predefined_search_predicate) {
|
|
982
1016
|
// @ts-ignore
|
|
@@ -1031,6 +1065,14 @@ export const SolidKanbanView = (params: SolidKanbanViewParams) => {
|
|
|
1031
1065
|
// @ts-ignore
|
|
1032
1066
|
urlData.saved_filter_predicate = customFilter.saved_filter_predicate || {};
|
|
1033
1067
|
// @ts-ignore
|
|
1068
|
+
urlData.saved_filter_variables = customFilter.saved_filter_variables || {};
|
|
1069
|
+
// @ts-ignore
|
|
1070
|
+
urlData.saved_filter_id = customFilter.saved_filter_id || null;
|
|
1071
|
+
// @ts-ignore
|
|
1072
|
+
urlData.saved_filter_system_key = customFilter.saved_filter_system_key || null;
|
|
1073
|
+
// @ts-ignore
|
|
1074
|
+
urlData.saved_filter_name = customFilter.saved_filter_name || null;
|
|
1075
|
+
// @ts-ignore
|
|
1034
1076
|
urlData.predefined_search_predicate = customFilter.predefined_search_predicate || {};
|
|
1035
1077
|
// @ts-ignore
|
|
1036
1078
|
urlData.predefined_search_chip = customFilter.predefined_search_chip || null;
|
|
@@ -1088,6 +1130,39 @@ export const SolidKanbanView = (params: SolidKanbanViewParams) => {
|
|
|
1088
1130
|
loadKanbanBoard(filters);
|
|
1089
1131
|
};
|
|
1090
1132
|
|
|
1133
|
+
const cloneKanbanData = () => {
|
|
1134
|
+
if (typeof structuredClone === "function") return structuredClone(kanbanViewData);
|
|
1135
|
+
return JSON.parse(JSON.stringify(kanbanViewData));
|
|
1136
|
+
};
|
|
1137
|
+
|
|
1138
|
+
useImperativeHandle(ref, () => ({
|
|
1139
|
+
refresh: () => {
|
|
1140
|
+
void loadKanbanBoard(filters);
|
|
1141
|
+
},
|
|
1142
|
+
clearFilters: () => {
|
|
1143
|
+
setFilters(params.customFilter || { $and: [] });
|
|
1144
|
+
setFilterPredicates(null);
|
|
1145
|
+
solidGlobalSearchElementRef.current?.clearFilter?.();
|
|
1146
|
+
},
|
|
1147
|
+
applyFilter: (filter) => {
|
|
1148
|
+
void handleApplyCustomFilter(filter);
|
|
1149
|
+
},
|
|
1150
|
+
getSavedFilters: () => solidGlobalSearchElementRef.current?.getSavedFilters?.() ?? [],
|
|
1151
|
+
applySavedFilter: (name, variables) =>
|
|
1152
|
+
solidGlobalSearchElementRef.current?.applySavedFilterByName?.(name, variables) ?? false,
|
|
1153
|
+
setShowArchived: (value) => {
|
|
1154
|
+
setShowArchived(value);
|
|
1155
|
+
},
|
|
1156
|
+
getState: () => ({
|
|
1157
|
+
groupByFieldName,
|
|
1158
|
+
showArchived,
|
|
1159
|
+
filters,
|
|
1160
|
+
filterPredicates,
|
|
1161
|
+
kanbanData: cloneKanbanData(),
|
|
1162
|
+
loading,
|
|
1163
|
+
}),
|
|
1164
|
+
}), [groupByFieldName, showArchived, filters, filterPredicates, kanbanViewData, loading]);
|
|
1165
|
+
|
|
1091
1166
|
const toggleBothSidebars = () => {
|
|
1092
1167
|
if (visibleNavbar) {
|
|
1093
1168
|
dispatch(toggleNavbar()); // close both
|
|
@@ -1113,7 +1188,10 @@ export const SolidKanbanView = (params: SolidKanbanViewParams) => {
|
|
|
1113
1188
|
*/}
|
|
1114
1189
|
|
|
1115
1190
|
{/* <p className="m-0 view-title solid-text-wrapper">{kanbanViewTitle}</p> */}
|
|
1116
|
-
|
|
1191
|
+
{/* Base `hidden` must be avoided here: the consuming app's Tailwind CSS loads after this
|
|
1192
|
+
library's generated CSS, so the app's base `.hidden` would override our media-scoped
|
|
1193
|
+
`lg:flex`. Only media-scoped visibility classes are safe on this element. */}
|
|
1194
|
+
<div className={`${showGlobalSearchElement ? "flex" : "max-lg:hidden lg:flex"} w-full mt-3 lg:mt-0 lg:min-w-0`}>
|
|
1117
1195
|
{/* Keep global search mounted for now because kanban bootstrap/filter hydration still flows through this element. */}
|
|
1118
1196
|
<SolidGlobalSearchElement viewType="kanban" showSaveFilterPopup={showSaveFilterPopup} setShowSaveFilterPopup={setShowSaveFilterPopup} ref={solidGlobalSearchElementRef} viewData={solidKanbanViewMetaData} handleApplyCustomFilter={handleApplyCustomFilter} filterPredicates={filterPredicates} ></SolidGlobalSearchElement>
|
|
1119
1197
|
</div>
|
|
@@ -1121,7 +1199,7 @@ export const SolidKanbanView = (params: SolidKanbanViewParams) => {
|
|
|
1121
1199
|
|
|
1122
1200
|
<div className="flex items-center solid-header-buttons-wrapper solid-list-toolbar-actions lg:ml-auto">
|
|
1123
1201
|
<SolidHeaderRequestStatus label={headerRequestStatusLabel} />
|
|
1124
|
-
|
|
1202
|
+
<div className="solid-list-search-toggle">
|
|
1125
1203
|
<SolidButton
|
|
1126
1204
|
type="button"
|
|
1127
1205
|
variant="outline"
|
|
@@ -1192,7 +1270,7 @@ export const SolidKanbanView = (params: SolidKanbanViewParams) => {
|
|
|
1192
1270
|
|
|
1193
1271
|
<style>{`.p-datatable .p-datatable-loading-overlay {background-color: rgba(0, 0, 0, 0.0);}`}</style>
|
|
1194
1272
|
{solidKanbanViewMetaData && kanbanViewData &&
|
|
1195
|
-
<KanbanBoard groupByFieldName={groupByFieldName} kanbanViewData={kanbanViewData} maxSwimLanesCount={maxSwimLanesCount} solidKanbanViewMetaData={solidKanbanViewMetaData?.data} setKanbanViewData={setKanbanViewData} handleLoadMore={handleLoadMore} onDragEnd={onDragEnd} handleSwimLanePagination={handleSwimLanePagination} onDelete={actionsAllowed.includes(`${permissionExpression(params.modelName, 'delete')}`) && solidKanbanViewMetaData?.data?.solidView?.layout?.attrs.delete !== false ? openDeleteDialogForRecord : undefined} onRecover={handleRecoverRecord} setLightboxUrls={setLightboxUrls} setOpenLightbox={setOpenLightbox} editButtonUrl={editBaseUrl} recordClickAction={recordClickAction} showArchived={showArchived}></KanbanBoard>
|
|
1273
|
+
<KanbanBoard groupByFieldName={groupByFieldName} kanbanViewData={kanbanViewData} maxSwimLanesCount={maxSwimLanesCount} solidKanbanViewMetaData={solidKanbanViewMetaData?.data} setKanbanViewData={setKanbanViewData} handleLoadMore={handleLoadMore} onDragEnd={onDragEnd} handleSwimLanePagination={handleSwimLanePagination} onDelete={actionsAllowed.includes(`${permissionExpression(params.modelName, 'delete')}`) && solidKanbanViewMetaData?.data?.solidView?.layout?.attrs.delete !== false ? openDeleteDialogForRecord : undefined} onRecover={handleRecoverRecord} setLightboxUrls={setLightboxUrls} setOpenLightbox={setOpenLightbox} editButtonUrl={editBaseUrl} recordClickAction={recordClickAction} showArchived={showArchived} params={params} handleCustomButtonClick={handleCustomButtonClick}></KanbanBoard>
|
|
1196
1274
|
}
|
|
1197
1275
|
</div>
|
|
1198
1276
|
</div>
|
|
@@ -1242,4 +1320,4 @@ export const SolidKanbanView = (params: SolidKanbanViewParams) => {
|
|
|
1242
1320
|
</SolidDialog>
|
|
1243
1321
|
</div>
|
|
1244
1322
|
);
|
|
1245
|
-
};
|
|
1323
|
+
});
|
|
@@ -57,7 +57,7 @@
|
|
|
57
57
|
Keep existing predicate/rule state shape and `transformFilterRules(...)` contract unchanged.
|
|
58
58
|
- [ ] Replace remaining Prime icon class usage in filter flow with non-Prime icons.
|
|
59
59
|
- [ ] Audit `SolidFilterFields` and list filter input widgets for hidden Prime event-shape coupling.
|
|
60
|
-
- [ ] Preserve saved
|
|
60
|
+
- [ ] Preserve local-storage saved-filter application and rehydration behavior without URL state.
|
|
61
61
|
- [ ] Confirm relation filter hydration still works.
|
|
62
62
|
- [ ] Preserve `clearFilter()` and imperative `SolidListViewHandle.applyFilter(...)` behavior unchanged.
|
|
63
63
|
|
|
@@ -38,6 +38,17 @@ export type SolidListViewHandle = {
|
|
|
38
38
|
saved_filter_predicate?: any;
|
|
39
39
|
predefined_search_predicate?: any;
|
|
40
40
|
}) => void;
|
|
41
|
+
/**
|
|
42
|
+
* Returns the saved filters currently available in the list view, including
|
|
43
|
+
* any seeded/system filters supplied by the view.
|
|
44
|
+
*/
|
|
45
|
+
getSavedFilters: () => any[];
|
|
46
|
+
/**
|
|
47
|
+
* Applies the currently available saved filter with the given name using the
|
|
48
|
+
* same selection path as clicking that filter in the search UI.
|
|
49
|
+
* Returns false when no saved filter with that name is available.
|
|
50
|
+
*/
|
|
51
|
+
applySavedFilter: (name: string, variables?: Record<string, any>) => boolean;
|
|
41
52
|
/**
|
|
42
53
|
* Updates pagination state directly.
|
|
43
54
|
* Use this when a caller needs to jump to a specific page window
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SolidListView.d.ts","sourceRoot":"","sources":["../../../../src/components/core/list/SolidListView.tsx"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"SolidListView.d.ts","sourceRoot":"","sources":["../../../../src/components/core/list/SolidListView.tsx"],"names":[],"mappings":";AAqEA,KAAK,mBAAmB,GAAG;IACzB,UAAU,EAAE,MAAM,CAAC;IACnB,SAAS,EAAE,MAAM,CAAC;IAClB,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,6BAA6B,CAAC,EAAE,GAAG,CAAC;IACpC,8BAA8B,CAAC,EAAE,GAAG,CAAC;IACrC,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,wBAAwB,CAAC,EAAE,MAAM,CAAC;IAClC,YAAY,CAAC,EAAE,GAAG,CAAC;IACnB,YAAY,CAAC,EAAE,GAAG,CAAC;IACnB,iBAAiB,CAAC,EAAE,GAAG,CAAC;CACzB,CAAC;AAEF,MAAM,MAAM,mBAAmB,GAAG;IAChC;;;;;OAKG;IACH,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB;;;;OAIG;IACH,YAAY,EAAE,MAAM,IAAI,CAAC;IACzB;;;;;;OAMG;IACH,WAAW,EAAE,CAAC,MAAM,EAAE;QACpB,uBAAuB,CAAC,EAAE,GAAG,CAAC;QAC9B,gBAAgB,CAAC,EAAE,GAAG,CAAC;QACvB,sBAAsB,CAAC,EAAE,GAAG,CAAC;QAC7B,2BAA2B,CAAC,EAAE,GAAG,CAAC;KACnC,KAAK,IAAI,CAAC;IACX;;;OAGG;IACH,eAAe,EAAE,MAAM,GAAG,EAAE,CAAC;IAC7B;;;;OAIG;IACH,gBAAgB,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,SAAS,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,KAAK,OAAO,CAAC;IAC7E;;;;OAIG;IACH,aAAa,EAAE,CAAC,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,KAAK,IAAI,CAAC;IAC7D;;;OAGG;IACH,OAAO,EAAE,CAAC,aAAa,EAAE,MAAM,EAAE,aAAa,EAAE,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,KAAK,IAAI,CAAC;IACpE;;;OAGG;IACH,eAAe,EAAE,CAAC,KAAK,EAAE,OAAO,KAAK,IAAI,CAAC;IAC1C;;;OAGG;IACH,QAAQ,EAAE,MAAM;QACd,KAAK,EAAE,MAAM,CAAC;QACd,IAAI,EAAE,MAAM,CAAC;QACb,SAAS,EAAE,MAAM,CAAC;QAClB,SAAS,EAAE,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC;QACtB,YAAY,EAAE,OAAO,CAAC;QACtB,OAAO,EAAE,GAAG,CAAC;QACb,gBAAgB,EAAE,GAAG,CAAC;QACtB,QAAQ,EAAE,GAAG,EAAE,CAAC;QAChB,YAAY,EAAE,MAAM,CAAC;QACrB,OAAO,EAAE,OAAO,CAAC;KAClB,CAAC;CACH,CAAC;AAEF,eAAO,MAAM,aAAa,qHAqwDxB,CAAC"}
|
|
@@ -54,7 +54,7 @@ var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
|
|
|
54
54
|
}
|
|
55
55
|
return to.concat(ar || Array.prototype.slice.call(from));
|
|
56
56
|
};
|
|
57
|
-
import { jsx as _jsx,
|
|
57
|
+
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
58
58
|
import { forwardRef, useState, useEffect, useRef, useMemo, useImperativeHandle } from "react";
|
|
59
59
|
import { SolidDataTable as DataTable, Column } from "./SolidDataTable";
|
|
60
60
|
import qs from "qs";
|
|
@@ -87,6 +87,7 @@ import styles from "./SolidListViewWrapper.module.css";
|
|
|
87
87
|
import { isArchivedListRow } from "./columns/PublishStatusColumnDefaults";
|
|
88
88
|
import { getExtensionFunction } from "../../../helpers/registry";
|
|
89
89
|
import { useSession } from "../../../hooks/useSession";
|
|
90
|
+
import { resolveActiveUserId } from "../../../helpers/resolveActiveUserId";
|
|
90
91
|
import { ERROR_MESSAGES } from "../../../constants/error-messages";
|
|
91
92
|
import { getSettingsMap, resolveRecordClickAction } from "../../../helpers/settingsPayload";
|
|
92
93
|
import { useGetSolidSettingsQuery } from "../../../redux/api/solidSettingsApi";
|
|
@@ -147,11 +148,6 @@ export var SolidListView = forwardRef(function (params, ref) {
|
|
|
147
148
|
var _48 = useState(false), showSaveFilterPopup = _48[0], setShowSaveFilterPopup = _48[1];
|
|
148
149
|
var _49 = useState(false), showGlobalSearchElement = _49[0], setShowGlobalSearchElement = _49[1];
|
|
149
150
|
var suppressNextFilterPaginationResetRef = useRef(false);
|
|
150
|
-
// Filters offered by an onBeforeListDataLoad handler (event.definedFilters).
|
|
151
|
-
// Each stays independently removable via the search bar's pill UI rather
|
|
152
|
-
// than being baked directly into the outgoing query filter.
|
|
153
|
-
var _50 = useState([]), definedFilters = _50[0], setDefinedFilters = _50[1];
|
|
154
|
-
var definedFilterOverridesRef = useRef({});
|
|
155
151
|
var triggerCheckIfPermissionExists = useLazyCheckIfPermissionExistsQuery()[0];
|
|
156
152
|
var handleCustomButtonClick = useHandleListCustomButtonClick();
|
|
157
153
|
var visibleHeaderButtons = useMemo(function () {
|
|
@@ -159,7 +155,7 @@ export var SolidListView = forwardRef(function (params, ref) {
|
|
|
159
155
|
return ((_b = (_a = solidListViewLayout === null || solidListViewLayout === void 0 ? void 0 : solidListViewLayout.attrs) === null || _a === void 0 ? void 0 : _a.headerButtons) !== null && _b !== void 0 ? _b : []).filter(function (button) { return isButtonVisibleInCurrentEnv(button === null || button === void 0 ? void 0 : button.attrs); });
|
|
160
156
|
}, [(_g = solidListViewLayout === null || solidListViewLayout === void 0 ? void 0 : solidListViewLayout.attrs) === null || _g === void 0 ? void 0 : _g.headerButtons]);
|
|
161
157
|
var editBaseUrl = useMemo(function () { return normalizeSolidListTreeKanbanActionPath(pathname, editButtonUrl || "form"); }, [editButtonUrl, pathname]);
|
|
162
|
-
var
|
|
158
|
+
var recordClickFormMode = useMemo(function () {
|
|
163
159
|
var _a, _b, _c;
|
|
164
160
|
var isSystemModule = ((_c = (_b = (_a = solidListViewMetaData === null || solidListViewMetaData === void 0 ? void 0 : solidListViewMetaData.data) === null || _a === void 0 ? void 0 : _a.solidView) === null || _b === void 0 ? void 0 : _b.module) === null || _c === void 0 ? void 0 : _c.isSystem) === true;
|
|
165
161
|
if (isSystemModule) {
|
|
@@ -269,7 +265,7 @@ export var SolidListView = forwardRef(function (params, ref) {
|
|
|
269
265
|
}, {
|
|
270
266
|
encodeValuesOnly: true,
|
|
271
267
|
});
|
|
272
|
-
var
|
|
268
|
+
var _50 = useGetSolidViewLayoutQuery(listViewMetaDataQs), solidListViewInitialMetaData = _50.data, solidListViewMetaDataError = _50.error, solidListViewMetaDataIsLoading = _50.isLoading, solidListViewMetaDataIsError = _50.isError, refetch = _50.refetch;
|
|
273
269
|
var initialFilterMethod = function () {
|
|
274
270
|
var _a, _b, _c, _d;
|
|
275
271
|
var solidView = (_a = solidListViewMetaData === null || solidListViewMetaData === void 0 ? void 0 : solidListViewMetaData.data) === null || _a === void 0 ? void 0 : _a.solidView;
|
|
@@ -392,15 +388,15 @@ export var SolidListView = forwardRef(function (params, ref) {
|
|
|
392
388
|
// { label: 'List ', value: 'list', image: ListImage },
|
|
393
389
|
// { label: 'Kanban', value: 'kanban', image: KanbanImage },
|
|
394
390
|
// ]
|
|
395
|
-
var
|
|
396
|
-
var
|
|
391
|
+
var _51 = useState(sizeOptions[1].value), size = _51[0], setSize = _51[1];
|
|
392
|
+
var _52 = useState([]), viewModes = _52[0], setViewModes = _52[1];
|
|
397
393
|
// Custom Row Action
|
|
398
|
-
var
|
|
399
|
-
var
|
|
394
|
+
var _53 = useState(false), listViewRowActionPopupState = _53[0], setListViewRowActionPopupState = _53[1];
|
|
395
|
+
var _54 = useState(), listViewRowActionData = _54[0], setListRowActionData = _54[1];
|
|
400
396
|
// Get the list view data.
|
|
401
|
-
var
|
|
402
|
-
var
|
|
403
|
-
var
|
|
397
|
+
var _55 = useLazyGetSolidEntitiesQuery(), triggerGetSolidEntities = _55[0], _56 = _55[1], solidEntityListViewData = _56.data, isLoading = _56.isLoading, isListViewFetching = _56.isFetching, error = _56.error;
|
|
398
|
+
var _57 = useLazyRecoverSolidEntityByIdQuery(), triggerRecoverSolidEntitiesById = _57[0], _58 = _57[1], recoverByIdData = _58.data, recoverByIdIsLoading = _58.isLoading, recoverByIdError = _58.error, recoverByIdIsError = _58.isError, recoverByIdIsSuccess = _58.isSuccess;
|
|
399
|
+
var _59 = useRecoverSolidEntityMutation(), triggerRecoverSolidEntities = _59[0], _60 = _59[1], recoverByData = _60.data, recoverByIsLoading = _60.isLoading, recoverError = _60.error, recoverIsError = _60.isError, recoverByIsSuccess = _60.isSuccess;
|
|
404
400
|
// After data is fetched populate the list view state so as to be able to render the data.
|
|
405
401
|
useEffect(function () {
|
|
406
402
|
if (solidEntityListViewData) {
|
|
@@ -432,9 +428,9 @@ export var SolidListView = forwardRef(function (params, ref) {
|
|
|
432
428
|
setLoading(false);
|
|
433
429
|
}
|
|
434
430
|
}, [solidEntityListViewData]);
|
|
435
|
-
var
|
|
431
|
+
var _61 = useDeleteSolidEntityMutation(), deleteSolidSingleEntiry = _61[0], isDeleteSolidSingleEntitySuccess = _61[1].isSuccess;
|
|
436
432
|
// Delete mutation
|
|
437
|
-
var
|
|
433
|
+
var _62 = useDeleteMultipleSolidEntitiesMutation(), deleteManySolidEntities = _62[0], _63 = _62[1], isSolidEntitiesDeleted = _63.isLoading, isDeleteSolidEntitiesSucess = _63.isSuccess, isSolidEntitiesDeleteError = _63.isError, SolidEntitiesDeleteError = _63.error, DeletedSolidEntities = _63.data;
|
|
438
434
|
// Fetch data after toPopulate has been populated...
|
|
439
435
|
useEffect(function () {
|
|
440
436
|
var _a;
|
|
@@ -519,6 +515,7 @@ export var SolidListView = forwardRef(function (params, ref) {
|
|
|
519
515
|
listData: listViewData,
|
|
520
516
|
totalRecords: totalRecords,
|
|
521
517
|
type: "onListLoad",
|
|
518
|
+
isInitialLoad: !hasFiredInitialOnListLoadRef.current,
|
|
522
519
|
viewMetadata: (_g = solidListViewMetaData === null || solidListViewMetaData === void 0 ? void 0 : solidListViewMetaData.data) === null || _g === void 0 ? void 0 : _g.solidView,
|
|
523
520
|
listViewLayout: listLayout,
|
|
524
521
|
queryParams: {
|
|
@@ -531,6 +528,7 @@ export var SolidListView = forwardRef(function (params, ref) {
|
|
|
531
528
|
session: session.data,
|
|
532
529
|
params: params
|
|
533
530
|
};
|
|
531
|
+
hasFiredInitialOnListLoadRef.current = true;
|
|
534
532
|
if (!dynamicHeader) return [3 /*break*/, 3];
|
|
535
533
|
dynamicExtensionFunction = getExtensionFunction(dynamicHeader);
|
|
536
534
|
if (!dynamicExtensionFunction) return [3 /*break*/, 2];
|
|
@@ -564,6 +562,8 @@ export var SolidListView = forwardRef(function (params, ref) {
|
|
|
564
562
|
var latestFilterPredicatesRef = useRef(filterPredicates);
|
|
565
563
|
var latestSortFieldRef = useRef(sortField);
|
|
566
564
|
var latestSortOrderRef = useRef(sortOrder);
|
|
565
|
+
var hasFiredInitialOnBeforeListDataLoadRef = useRef(false);
|
|
566
|
+
var hasFiredInitialOnListLoadRef = useRef(false);
|
|
567
567
|
useEffect(function () {
|
|
568
568
|
latestSortFieldRef.current = sortField;
|
|
569
569
|
}, [sortField]);
|
|
@@ -622,18 +622,17 @@ export var SolidListView = forwardRef(function (params, ref) {
|
|
|
622
622
|
setSelectedRecoverRecords(deletedRecords);
|
|
623
623
|
};
|
|
624
624
|
var setQueryString = function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
625
|
-
var solidFieldsMetadata, explicitLocale, queryData, resolvedLocale, currentSortField, currentSortOrder, meta, resolvedField, dynamicHeader, dynamicExtensionFunction, event, updatedListData,
|
|
626
|
-
var _a;
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
switch (_m.label) {
|
|
625
|
+
var solidFieldsMetadata, explicitLocale, queryData, resolvedLocale, currentSortField, currentSortOrder, meta, resolvedField, dynamicHeader, dynamicExtensionFunction, isInitialLoad, event, updatedListData, err_1, queryString, fileterTobeStored;
|
|
626
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
627
|
+
return __generator(this, function (_k) {
|
|
628
|
+
switch (_k.label) {
|
|
630
629
|
case 0:
|
|
631
|
-
solidFieldsMetadata = (
|
|
630
|
+
solidFieldsMetadata = (_a = solidListViewMetaData === null || solidListViewMetaData === void 0 ? void 0 : solidListViewMetaData.data) === null || _a === void 0 ? void 0 : _a.solidFieldsMetadata;
|
|
632
631
|
explicitLocale = resolveLocaleFromFilter(latestFiltersRef.current);
|
|
633
632
|
queryData = {
|
|
634
633
|
offset: first,
|
|
635
634
|
limit: rows,
|
|
636
|
-
filters: (
|
|
635
|
+
filters: (_b = latestFiltersRef.current) !== null && _b !== void 0 ? _b : latestFiltersRef.current,
|
|
637
636
|
populate: toPopulate,
|
|
638
637
|
populateMedia: toPopulateMedia,
|
|
639
638
|
};
|
|
@@ -651,7 +650,7 @@ export var SolidListView = forwardRef(function (params, ref) {
|
|
|
651
650
|
else {
|
|
652
651
|
resolvedField = currentSortField;
|
|
653
652
|
if ((meta === null || meta === void 0 ? void 0 : meta.type) === "relation" && (meta === null || meta === void 0 ? void 0 : meta.relationType) === "many-to-one") {
|
|
654
|
-
resolvedField = "".concat(currentSortField, ".").concat((
|
|
653
|
+
resolvedField = "".concat(currentSortField, ".").concat((_d = (_c = meta === null || meta === void 0 ? void 0 : meta.relationModel) === null || _c === void 0 ? void 0 : _c.userKeyField) === null || _d === void 0 ? void 0 : _d.name);
|
|
655
654
|
}
|
|
656
655
|
queryData.sort = ["".concat(resolvedField, ":").concat(currentSortOrder === 1 ? "asc" : "desc")];
|
|
657
656
|
}
|
|
@@ -662,12 +661,15 @@ export var SolidListView = forwardRef(function (params, ref) {
|
|
|
662
661
|
if (showArchived) {
|
|
663
662
|
queryData.showSoftDeleted = "inclusive";
|
|
664
663
|
}
|
|
665
|
-
dynamicHeader = (
|
|
664
|
+
dynamicHeader = (_g = (_f = (_e = solidListViewMetaData === null || solidListViewMetaData === void 0 ? void 0 : solidListViewMetaData.data) === null || _e === void 0 ? void 0 : _e.solidView) === null || _f === void 0 ? void 0 : _f.layout) === null || _g === void 0 ? void 0 : _g.onBeforeListDataLoad;
|
|
666
665
|
dynamicExtensionFunction = null;
|
|
666
|
+
isInitialLoad = !hasFiredInitialOnBeforeListDataLoadRef.current;
|
|
667
|
+
hasFiredInitialOnBeforeListDataLoadRef.current = true;
|
|
667
668
|
event = {
|
|
668
669
|
type: "onBeforeListDataLoad",
|
|
669
|
-
|
|
670
|
-
|
|
670
|
+
isInitialLoad: isInitialLoad,
|
|
671
|
+
fieldsMetadata: (_h = solidListViewMetaData === null || solidListViewMetaData === void 0 ? void 0 : solidListViewMetaData.data) === null || _h === void 0 ? void 0 : _h.solidFieldsMetadata,
|
|
672
|
+
viewMetadata: (_j = solidListViewMetaData === null || solidListViewMetaData === void 0 ? void 0 : solidListViewMetaData.data) === null || _j === void 0 ? void 0 : _j.solidView,
|
|
671
673
|
listViewLayout: solidListViewMetaData === null || solidListViewMetaData === void 0 ? void 0 : solidListViewMetaData.data.solidView.layout,
|
|
672
674
|
filter: structuredClone(queryData),
|
|
673
675
|
queryParams: {
|
|
@@ -680,53 +682,24 @@ export var SolidListView = forwardRef(function (params, ref) {
|
|
|
680
682
|
session: session.data,
|
|
681
683
|
params: params
|
|
682
684
|
};
|
|
683
|
-
if (!dynamicHeader) return [3 /*break*/,
|
|
685
|
+
if (!dynamicHeader) return [3 /*break*/, 4];
|
|
684
686
|
dynamicExtensionFunction = getExtensionFunction(dynamicHeader);
|
|
685
687
|
if (!dynamicExtensionFunction) return [3 /*break*/, 4];
|
|
686
|
-
|
|
688
|
+
_k.label = 1;
|
|
687
689
|
case 1:
|
|
688
|
-
|
|
690
|
+
_k.trys.push([1, 3, , 4]);
|
|
689
691
|
return [4 /*yield*/, dynamicExtensionFunction(event)];
|
|
690
692
|
case 2:
|
|
691
|
-
updatedListData =
|
|
693
|
+
updatedListData = _k.sent();
|
|
692
694
|
if (updatedListData && (updatedListData === null || updatedListData === void 0 ? void 0 : updatedListData.filterApplied) && (updatedListData === null || updatedListData === void 0 ? void 0 : updatedListData.newFilter)) {
|
|
693
695
|
queryData = updatedListData === null || updatedListData === void 0 ? void 0 : updatedListData.newFilter;
|
|
694
696
|
}
|
|
695
|
-
nextDefinedFilters = (_l = updatedListData === null || updatedListData === void 0 ? void 0 : updatedListData.definedFilters) !== null && _l !== void 0 ? _l : [];
|
|
696
|
-
reconciledDefinedFilters_1 = nextDefinedFilters.map(function (def) {
|
|
697
|
-
var hasOverride = Object.prototype.hasOwnProperty.call(definedFilterOverridesRef.current, def.key);
|
|
698
|
-
var applied = hasOverride ? definedFilterOverridesRef.current[def.key] : def.applied;
|
|
699
|
-
definedFilterOverridesRef.current[def.key] = applied;
|
|
700
|
-
return __assign(__assign({}, def), { applied: applied });
|
|
701
|
-
});
|
|
702
|
-
Object.keys(definedFilterOverridesRef.current).forEach(function (key) {
|
|
703
|
-
if (!reconciledDefinedFilters_1.some(function (def) { return def.key === key; })) {
|
|
704
|
-
delete definedFilterOverridesRef.current[key];
|
|
705
|
-
}
|
|
706
|
-
});
|
|
707
|
-
setDefinedFilters(reconciledDefinedFilters_1);
|
|
708
|
-
activeDefinedFilterPredicates = reconciledDefinedFilters_1
|
|
709
|
-
.filter(function (def) { return def.applied; })
|
|
710
|
-
.map(function (def) { return def.predicate; });
|
|
711
|
-
if (activeDefinedFilterPredicates.length > 0) {
|
|
712
|
-
mergedFilters = queryData.filters ? structuredClone(queryData.filters) : {};
|
|
713
|
-
mergedFilters.$and = Array.isArray(mergedFilters.$and) ? mergedFilters.$and : [];
|
|
714
|
-
(_a = mergedFilters.$and).push.apply(_a, activeDefinedFilterPredicates);
|
|
715
|
-
queryData.filters = mergedFilters;
|
|
716
|
-
}
|
|
717
697
|
return [3 /*break*/, 4];
|
|
718
698
|
case 3:
|
|
719
|
-
err_1 =
|
|
699
|
+
err_1 = _k.sent();
|
|
720
700
|
console.error("Error executing onBeforeListDataLoad extension:", err_1);
|
|
721
701
|
return [3 /*break*/, 4];
|
|
722
|
-
case 4:
|
|
723
|
-
case 5:
|
|
724
|
-
if (Object.keys(definedFilterOverridesRef.current).length > 0) {
|
|
725
|
-
definedFilterOverridesRef.current = {};
|
|
726
|
-
setDefinedFilters([]);
|
|
727
|
-
}
|
|
728
|
-
_m.label = 6;
|
|
729
|
-
case 6:
|
|
702
|
+
case 4:
|
|
730
703
|
queryString = qs.stringify(queryData, { encodeValuesOnly: true });
|
|
731
704
|
if (latestFilterPredicatesRef.current) {
|
|
732
705
|
fileterTobeStored = structuredClone(queryData);
|
|
@@ -735,6 +708,7 @@ export var SolidListView = forwardRef(function (params, ref) {
|
|
|
735
708
|
fileterTobeStored.custom_filter_predicate = latestFilterPredicatesRef.current.custom_filter_predicate || null;
|
|
736
709
|
fileterTobeStored.search_predicate = latestFilterPredicatesRef.current.search_predicate || null;
|
|
737
710
|
fileterTobeStored.saved_filter_predicate = latestFilterPredicatesRef.current.saved_filter_predicate || null;
|
|
711
|
+
fileterTobeStored.saved_filter_variables = latestFilterPredicatesRef.current.saved_filter_variables || {};
|
|
738
712
|
fileterTobeStored.saved_filter_id = latestFilterPredicatesRef.current.saved_filter_id || null;
|
|
739
713
|
fileterTobeStored.saved_filter_system_key = latestFilterPredicatesRef.current.saved_filter_system_key || null;
|
|
740
714
|
fileterTobeStored.saved_filter_name = latestFilterPredicatesRef.current.saved_filter_name || null;
|
|
@@ -759,7 +733,8 @@ export var SolidListView = forwardRef(function (params, ref) {
|
|
|
759
733
|
queryfilter.$and.push(filterPredicates.search_predicate);
|
|
760
734
|
}
|
|
761
735
|
if (filterPredicates.saved_filter_predicate) {
|
|
762
|
-
queryfilter.$and.push(filterPredicates.
|
|
736
|
+
queryfilter.$and.push(filterPredicates.resolved_saved_filter_predicate ||
|
|
737
|
+
resolveActiveUserId(filterPredicates.saved_filter_predicate, user === null || user === void 0 ? void 0 : user.id));
|
|
763
738
|
}
|
|
764
739
|
if (filterPredicates.predefined_search_predicate) {
|
|
765
740
|
queryfilter.$and.push(filterPredicates.predefined_search_predicate);
|
|
@@ -837,24 +812,6 @@ export var SolidListView = forwardRef(function (params, ref) {
|
|
|
837
812
|
}
|
|
838
813
|
// Force synchronous state updates
|
|
839
814
|
};
|
|
840
|
-
// Removes a single handler-offered filter pill. The override persists for
|
|
841
|
-
// the rest of this mount (setQueryString reconciliation keeps it applied:false
|
|
842
|
-
// on subsequent fetches) but is not persisted beyond it.
|
|
843
|
-
var removeDefinedFilter = function (key) {
|
|
844
|
-
definedFilterOverridesRef.current[key] = false;
|
|
845
|
-
setDefinedFilters(function (prev) { return prev.map(function (def) { return (def.key === key ? __assign(__assign({}, def), { applied: false }) : def); }); });
|
|
846
|
-
setFirst(0);
|
|
847
|
-
void setQueryString();
|
|
848
|
-
};
|
|
849
|
-
// Applies a handler-offered filter the user picked from the "defined
|
|
850
|
-
// filters" list (one the handler returned with applied:false by default).
|
|
851
|
-
// Mirrors removeDefinedFilter in the other direction.
|
|
852
|
-
var applyDefinedFilter = function (key) {
|
|
853
|
-
definedFilterOverridesRef.current[key] = true;
|
|
854
|
-
setDefinedFilters(function (prev) { return prev.map(function (def) { return (def.key === key ? __assign(__assign({}, def), { applied: true }) : def); }); });
|
|
855
|
-
setFirst(0);
|
|
856
|
-
void setQueryString();
|
|
857
|
-
};
|
|
858
815
|
// clear Filter
|
|
859
816
|
var clearFilter = function () {
|
|
860
817
|
if (solidListViewMetaData) {
|
|
@@ -888,6 +845,8 @@ export var SolidListView = forwardRef(function (params, ref) {
|
|
|
888
845
|
applyFilter: function (filter) {
|
|
889
846
|
handleApplyCustomFilter(filter);
|
|
890
847
|
},
|
|
848
|
+
getSavedFilters: function () { var _a, _b, _c; return (_c = (_b = (_a = solidGlobalSearchElementRef.current) === null || _a === void 0 ? void 0 : _a.getSavedFilters) === null || _b === void 0 ? void 0 : _b.call(_a)) !== null && _c !== void 0 ? _c : []; },
|
|
849
|
+
applySavedFilter: function (name, variables) { var _a, _b, _c; return (_c = (_b = (_a = solidGlobalSearchElementRef.current) === null || _a === void 0 ? void 0 : _a.applySavedFilterByName) === null || _b === void 0 ? void 0 : _b.call(_a, name, variables)) !== null && _c !== void 0 ? _c : false; },
|
|
891
850
|
setPagination: function (nextFirst, nextRows) {
|
|
892
851
|
setFirst(nextFirst);
|
|
893
852
|
setRows(nextRows);
|
|
@@ -924,8 +883,8 @@ export var SolidListView = forwardRef(function (params, ref) {
|
|
|
924
883
|
loading,
|
|
925
884
|
listViewData,
|
|
926
885
|
]);
|
|
927
|
-
var
|
|
928
|
-
var
|
|
886
|
+
var _64 = useState(), selectedSolidViewData = _64[0], setSelectedSolidViewData = _64[1];
|
|
887
|
+
var _65 = useState(false), deleteEntity = _65[0], setDeleteEntity = _65[1];
|
|
929
888
|
// Recover functions
|
|
930
889
|
var recoverById = function (id) {
|
|
931
890
|
triggerRecoverSolidEntitiesById(id);
|
|
@@ -999,8 +958,8 @@ export var SolidListView = forwardRef(function (params, ref) {
|
|
|
999
958
|
setSelectedRecoverRecords([]);
|
|
1000
959
|
};
|
|
1001
960
|
var entityDisplayName = ((_k = (_j = (_h = solidListViewMetaData === null || solidListViewMetaData === void 0 ? void 0 : solidListViewMetaData.data) === null || _h === void 0 ? void 0 : _h.solidView) === null || _j === void 0 ? void 0 : _j.model) === null || _k === void 0 ? void 0 : _k.displayName) || (params === null || params === void 0 ? void 0 : params.modelName);
|
|
1002
|
-
var
|
|
1003
|
-
var
|
|
961
|
+
var _66 = useState(false), openLightbox = _66[0], setOpenLightbox = _66[1];
|
|
962
|
+
var _67 = useState([]), lightboxUrls = _67[0], setLightboxUrls = _67[1];
|
|
1004
963
|
// Render columns dynamically based on metadata
|
|
1005
964
|
var renderColumnsDynamically = function (solidListViewMetaData, solidListViewLayout) {
|
|
1006
965
|
var _a;
|
|
@@ -1038,7 +997,8 @@ export var SolidListView = forwardRef(function (params, ref) {
|
|
|
1038
997
|
column: column,
|
|
1039
998
|
setLightboxUrls: setLightboxUrls,
|
|
1040
999
|
setOpenLightbox: setOpenLightbox,
|
|
1041
|
-
embeded: params.embeded
|
|
1000
|
+
embeded: params.embeded,
|
|
1001
|
+
recordClickAction: recordClickFormMode
|
|
1042
1002
|
});
|
|
1043
1003
|
}
|
|
1044
1004
|
else {
|
|
@@ -1052,7 +1012,8 @@ export var SolidListView = forwardRef(function (params, ref) {
|
|
|
1052
1012
|
column: column,
|
|
1053
1013
|
setLightboxUrls: setLightboxUrls,
|
|
1054
1014
|
setOpenLightbox: setOpenLightbox,
|
|
1055
|
-
embeded: params.embeded
|
|
1015
|
+
embeded: params.embeded,
|
|
1016
|
+
recordClickAction: recordClickFormMode
|
|
1056
1017
|
});
|
|
1057
1018
|
}
|
|
1058
1019
|
});
|
|
@@ -1240,7 +1201,7 @@ export var SolidListView = forwardRef(function (params, ref) {
|
|
|
1240
1201
|
// }
|
|
1241
1202
|
// };
|
|
1242
1203
|
return (_jsxs("div", { className: "page-parent-wrapper ".concat(isEmbeddedList ? "solid-list-page-wrapper-embedded" : "solid-list-page-wrapper", " flex ").concat(isEmbeddedList ? "min-h-0 overflow-visible" : "h-full min-h-0 overflow-hidden"), children: [_jsx("div", { className: "solid-list-content flex flex-col ".concat(isEmbeddedList ? "min-h-0" : "flex-grow-1", " ").concat(styles.ListContentWrapper), children: _jsxs("div", { className: "solid-list-surface flex flex-col min-h-0 ".concat(isEmbeddedList ? "" : "flex-1"), children: [solidListViewInitialMetaData &&
|
|
1243
|
-
_jsx("div", { className: "page-header solid-list-toolbar flex-col lg:flex-row", children: _jsxs("div", { className: "flex w-full flex-col-reverse lg:flex-row lg:items-center items-end", children: [_jsx("div", { className: "solid-list-toolbar-left flex w-full items-center gap-3 lg:min-w-0 lg:flex-1", children: params.embeded === false && (_jsx("div", { className: "".concat(showGlobalSearchElement ? "flex" : "hidden lg:flex", " mt-3 lg:mt-0
|
|
1204
|
+
_jsx("div", { className: "page-header solid-list-toolbar flex-col lg:flex-row", children: _jsxs("div", { className: "flex w-full flex-col-reverse lg:flex-row lg:items-center items-end", children: [_jsx("div", { className: "solid-list-toolbar-left flex w-full items-center gap-3 lg:min-w-0 lg:flex-1", children: params.embeded === false && (_jsx(_Fragment, { children: _jsx("div", { className: "".concat(showGlobalSearchElement ? "flex" : "max-lg:hidden lg:flex", " w-full mt-3 lg:mt-0 lg:min-w-0"), children: _jsx(SolidGlobalSearchElement, { viewType: "list", showSaveFilterPopup: showSaveFilterPopup, setShowSaveFilterPopup: setShowSaveFilterPopup, ref: solidGlobalSearchElementRef, viewData: solidListViewMetaData, handleApplyCustomFilter: handleApplyCustomFilter, filterPredicates: filterPredicates }, params.modelName) }) })) }), _jsxs("div", { className: "flex items-center solid-header-buttons-wrapper solid-list-toolbar-actions lg:ml-auto", children: [_jsx(SolidHeaderRequestStatus, { label: headerRequestStatusLabel }), params.embeded === false && (_jsx("div", { className: "solid-list-search-toggle", children: _jsx(SolidButton, { type: "button", size: "small", variant: "outline", className: "solid-icon-button", onClick: function () { return setShowGlobalSearchElement(!showGlobalSearchElement); }, leftIcon: _jsx(Search, { size: 14 }) }) })), _jsx("div", { className: "solid-header-buttons-wrapper hidden items-center lg:flex", children: (_0 = visibleHeaderButtons === null || visibleHeaderButtons === void 0 ? void 0 : visibleHeaderButtons.filter(function (rb) { return rb.attrs.actionInContextMenu != true; })) === null || _0 === void 0 ? void 0 : _0.map(function (button, index) { return (_jsx(SolidListViewHeaderButton, { button: button, params: params, solidListViewMetaData: solidListViewMetaData, handleCustomButtonClick: handleCustomButtonClick, selectedRecords: selectedRecords, filters: filters }, index)); }) }), actionsAllowed.includes("".concat(permissionExpression(params.modelName, 'create'))) &&
|
|
1244
1205
|
((_1 = solidListViewLayout === null || solidListViewLayout === void 0 ? void 0 : solidListViewLayout.attrs) === null || _1 === void 0 ? void 0 : _1.create) !== false &&
|
|
1245
1206
|
params.embeded !== true &&
|
|
1246
1207
|
((_4 = (_3 = (_2 = solidListViewMetaData === null || solidListViewMetaData === void 0 ? void 0 : solidListViewMetaData.data) === null || _2 === void 0 ? void 0 : _2.solidView) === null || _3 === void 0 ? void 0 : _3.layout) === null || _4 === void 0 ? void 0 : _4.attrs.showDefaultAddButton) !== false && (_jsx(SolidCreateButton, { createButtonUrl: createButtonUrl, createActionQueryParams: createActionQueryParams, solidListViewLayout: solidListViewLayout, responsiveIconOnly: true })), actionsAllowed.includes("".concat(permissionExpression(params.modelName, 'create'))) &&
|
|
@@ -1276,7 +1237,7 @@ export var SolidListView = forwardRef(function (params, ref) {
|
|
|
1276
1237
|
}
|
|
1277
1238
|
else {
|
|
1278
1239
|
storeCurrentModelViewContext();
|
|
1279
|
-
router.push("".concat(editBaseUrl, "/").concat(rowData === null || rowData === void 0 ? void 0 : rowData.id, "?viewMode=").concat(
|
|
1240
|
+
router.push("".concat(editBaseUrl, "/").concat(rowData === null || rowData === void 0 ? void 0 : rowData.id, "?viewMode=").concat(recordClickFormMode, "&").concat(buildEditNavigationQueryString(rowData)));
|
|
1280
1241
|
}
|
|
1281
1242
|
}, children: [params.embeded === true ? null : (_jsx(Column, { selectionMode: "multiple", headerStyle: { width: "3em" } })), solidListViewMetaData && solidListViewLayout && renderColumnsDynamically(solidListViewMetaData, solidListViewLayout), ((_18 = solidListViewLayout === null || solidListViewLayout === void 0 ? void 0 : solidListViewLayout.attrs) === null || _18 === void 0 ? void 0 : _18.rowButtons) &&
|
|
1282
1243
|
((_19 = solidListViewLayout === null || solidListViewLayout === void 0 ? void 0 : solidListViewLayout.attrs) === null || _19 === void 0 ? void 0 : _19.rowButtons.filter(function (rb) {
|