@solidxai/core-ui 0.1.4-beta.0 → 0.1.4-beta.1
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/core/common/SolidGlobalSearchElement.d.ts.map +1 -1
- package/dist/components/core/common/SolidGlobalSearchElement.js +6 -5
- package/dist/components/core/common/SolidGlobalSearchElement.js.map +1 -1
- package/dist/components/core/common/SolidGlobalSearchElement.tsx +21 -17
- package/dist/components/core/extension/solid-core/roleMetadata/RolePermissionsManyToManyFieldWidget.d.ts.map +1 -1
- package/dist/components/core/extension/solid-core/roleMetadata/RolePermissionsManyToManyFieldWidget.js +15 -30
- package/dist/components/core/extension/solid-core/roleMetadata/RolePermissionsManyToManyFieldWidget.js.map +1 -1
- package/dist/components/core/extension/solid-core/roleMetadata/RolePermissionsManyToManyFieldWidget.tsx +46 -36
- package/dist/components/core/form/fields/relations/SolidRelationManyToManyField.d.ts +40 -0
- package/dist/components/core/form/fields/relations/SolidRelationManyToManyField.d.ts.map +1 -1
- package/dist/components/core/form/fields/relations/SolidRelationManyToManyField.js +315 -160
- package/dist/components/core/form/fields/relations/SolidRelationManyToManyField.js.map +1 -1
- package/dist/components/core/form/fields/relations/SolidRelationManyToManyField.tsx +459 -249
- package/dist/components/core/form/fields/relations/SolidRelationOneToManyField.d.ts.map +1 -1
- package/dist/components/core/form/fields/relations/SolidRelationOneToManyField.js +46 -95
- package/dist/components/core/form/fields/relations/SolidRelationOneToManyField.js.map +1 -1
- package/dist/components/core/form/fields/relations/SolidRelationOneToManyField.tsx +57 -113
- package/dist/components/core/form/fields/relations/widgets/helpers/useRelationEntityHandler.d.ts +15 -5
- package/dist/components/core/form/fields/relations/widgets/helpers/useRelationEntityHandler.d.ts.map +1 -1
- package/dist/components/core/form/fields/relations/widgets/helpers/useRelationEntityHandler.js +203 -67
- package/dist/components/core/form/fields/relations/widgets/helpers/useRelationEntityHandler.js.map +1 -1
- package/dist/components/core/form/fields/relations/widgets/helpers/useRelationEntityHandler.ts +147 -67
- package/dist/components/core/kanban/SolidKanbanView.d.ts.map +1 -1
- package/dist/components/core/kanban/SolidKanbanView.js +8 -7
- package/dist/components/core/kanban/SolidKanbanView.js.map +1 -1
- package/dist/components/core/kanban/SolidKanbanView.tsx +3 -2
- package/dist/components/core/list/SolidListView.d.ts +8 -5
- package/dist/components/core/list/SolidListView.d.ts.map +1 -1
- package/dist/components/core/list/SolidListView.js +70 -59
- package/dist/components/core/list/SolidListView.js.map +1 -1
- package/dist/components/core/list/SolidListView.tsx +51 -57
- package/dist/components/core/list/SolidListViewConfigure.d.ts +7 -0
- package/dist/components/core/list/SolidListViewConfigure.d.ts.map +1 -1
- package/dist/components/core/list/SolidListViewConfigure.js +6 -5
- package/dist/components/core/list/SolidListViewConfigure.js.map +1 -1
- package/dist/components/core/list/SolidListViewConfigure.tsx +21 -12
- package/dist/components/core/list/columns/SolidShortTextColumn.d.ts.map +1 -1
- package/dist/components/core/list/columns/SolidShortTextColumn.js +1 -37
- package/dist/components/core/list/columns/SolidShortTextColumn.js.map +1 -1
- package/dist/components/core/list/columns/SolidShortTextColumn.tsx +0 -41
- package/dist/components/core/list/columns/relations/SolidRelationManyToOneColumn.d.ts.map +1 -1
- package/dist/components/core/list/columns/relations/SolidRelationManyToOneColumn.js +9 -5
- package/dist/components/core/list/columns/relations/SolidRelationManyToOneColumn.js.map +1 -1
- package/dist/components/core/list/columns/relations/SolidRelationManyToOneColumn.tsx +14 -3
- package/dist/components/core/tree/SolidTreeView.d.ts.map +1 -1
- package/dist/components/core/tree/SolidTreeView.js +23 -14
- package/dist/components/core/tree/SolidTreeView.js.map +1 -1
- package/dist/components/core/tree/SolidTreeView.tsx +50 -16
- package/dist/helpers/registry.js +3 -1
- package/dist/helpers/registry.js.map +1 -1
- package/dist/helpers/registry.ts +4 -1
- package/dist/resources/globals.css +14 -0
- package/dist/routes/pages/admin/core/ListPage.js +1 -1
- package/dist/routes/pages/admin/core/ListPage.js.map +1 -1
- package/dist/routes/pages/admin/core/ListPage.tsx +1 -1
- package/dist/routes/pages/admin/core/ModuleHomePage.d.ts.map +1 -1
- package/dist/routes/pages/admin/core/ModuleHomePage.js +4 -15
- package/dist/routes/pages/admin/core/ModuleHomePage.js.map +1 -1
- package/dist/routes/pages/admin/core/ModuleHomePage.tsx +4 -3
- package/dist/types/solid-core.d.ts +1 -1
- package/package.json +1 -1
|
@@ -1,31 +1,24 @@
|
|
|
1
|
-
|
|
2
|
-
import React, { forwardRef, useState, useEffect, useRef, useMemo, useImperativeHandle } from "react";
|
|
1
|
+
import { forwardRef, useState, useEffect, useRef, useMemo, useImperativeHandle } from "react";
|
|
3
2
|
import {
|
|
4
3
|
DataTable,
|
|
5
|
-
DataTableFilterMeta,
|
|
6
4
|
DataTableStateEvent,
|
|
7
5
|
} from "primereact/datatable";
|
|
8
6
|
import { Column } from "primereact/column";
|
|
9
7
|
import { FilterMatchMode } from "primereact/api";
|
|
10
|
-
import Link from "../../common/Link";
|
|
11
8
|
import qs from "qs";
|
|
12
9
|
import { Button } from "primereact/button";
|
|
13
10
|
import { Dialog } from "primereact/dialog";
|
|
14
11
|
import { createSolidEntityApi } from "../../../redux/api/solidEntityApi";
|
|
15
12
|
import { useGetSolidViewLayoutQuery } from "../../../redux/api/solidViewApi";
|
|
16
13
|
import { SolidListViewColumn } from "./SolidListViewColumn";
|
|
17
|
-
// import { SolidListViewOptions } from "../common/SolidListviewOptions";
|
|
18
14
|
import { SolidCreateButton } from "../common/SolidCreateButton";
|
|
19
15
|
import { SolidGlobalSearchElement } from "../common/SolidGlobalSearchElement";
|
|
20
|
-
import { pascalCase } from "change-case";
|
|
21
16
|
import { useLazyCheckIfPermissionExistsQuery } from "../../../redux/api/userApi";
|
|
22
17
|
import { permissionExpression } from "../../../helpers/permissions";
|
|
23
18
|
import { usePathname } from "../../../hooks/usePathname";
|
|
24
19
|
import { useRouter } from "../../../hooks/useRouter";
|
|
25
20
|
import { useSearchParams } from "../../../hooks/useSearchParams";
|
|
26
21
|
import { ListViewRowActionPopup } from "./ListViewRowActionPopup";
|
|
27
|
-
import FilterComponent, { FilterOperator, FilterRule, FilterRuleType } from "../../../components/core/common/FilterComponent";
|
|
28
|
-
import { SolidLayoutViews } from "../common/SolidLayoutViews";
|
|
29
22
|
import { FilterIcon } from '../../../components/modelsComponents/filterIcon';
|
|
30
23
|
import { OverlayPanel } from "primereact/overlaypanel";
|
|
31
24
|
import { Toast } from "primereact/toast";
|
|
@@ -33,8 +26,6 @@ import { Divider } from "primereact/divider";
|
|
|
33
26
|
import CompactImage from '../../../resources/images/layout/images/compact.png';
|
|
34
27
|
import CozyImage from '../../../resources/images/layout/images/cozy.png';
|
|
35
28
|
import ComfortableImage from '../../../resources/images/layout/images/comfortable.png';
|
|
36
|
-
import KanbanImage from '../../../resources/images/layout/images/kanban.png';
|
|
37
|
-
import { capitalize, filter, set } from "lodash";
|
|
38
29
|
import Lightbox from "yet-another-react-lightbox";
|
|
39
30
|
import Counter from "yet-another-react-lightbox/plugins/counter";
|
|
40
31
|
import Download from "yet-another-react-lightbox/plugins/download";
|
|
@@ -58,7 +49,6 @@ import { ERROR_MESSAGES } from "../../../constants/error-messages";
|
|
|
58
49
|
import { SolidAiMainWrapper } from "../solid-ai/SolidAiMainWrapper";
|
|
59
50
|
import { showNavbar, toggleNavbar } from "../../../redux/features/navbarSlice";
|
|
60
51
|
import { useLazyGetMcpUrlQuery, useLazyGetSolidSettingsQuery } from "../../../redux/api/solidSettingsApi";
|
|
61
|
-
import { log } from "console";
|
|
62
52
|
import { normalizeSolidListKanbanActionPath } from "../../../helpers/routePaths";
|
|
63
53
|
// import { ERROR_MESSAGES } from "../../../constants/error-messages";
|
|
64
54
|
|
|
@@ -85,7 +75,7 @@ export const getFilterObjectFromLocalStorage = () => {
|
|
|
85
75
|
};
|
|
86
76
|
|
|
87
77
|
|
|
88
|
-
export const getFilterObjectFromLocalStorageByUrl = (url) => {
|
|
78
|
+
export const getFilterObjectFromLocalStorageByUrl = (url: string) => {
|
|
89
79
|
const currentPageUrl = url; // Get the current page URL
|
|
90
80
|
const encodedQueryString = localStorage.getItem(currentPageUrl); // Retrieve the encoded query string from local storage
|
|
91
81
|
|
|
@@ -116,7 +106,7 @@ export const setFilterObjectToLocalStorage = (queryObject: string) => {
|
|
|
116
106
|
};
|
|
117
107
|
|
|
118
108
|
|
|
119
|
-
export const setFilterObjectToLocalStorageByUrl = (url, queryObject: string) => {
|
|
109
|
+
export const setFilterObjectToLocalStorageByUrl = (url: string, queryObject: string) => {
|
|
120
110
|
if (queryObject) {
|
|
121
111
|
const stringifiedObject = JSON.stringify(queryObject);
|
|
122
112
|
// const stringifiedObject = qs.stringify(queryObject, { encodeValuesOnly: true, arrayFormat: "brackets" });
|
|
@@ -132,10 +122,13 @@ type SolidListViewParams = {
|
|
|
132
122
|
moduleName: string;
|
|
133
123
|
modelName: string;
|
|
134
124
|
inlineCreate?: boolean;
|
|
135
|
-
|
|
125
|
+
handleAddClickForEmbeddedView?: any;
|
|
126
|
+
handleEditClickForEmbeddedView?: any;
|
|
136
127
|
embeded?: boolean;
|
|
128
|
+
embededFieldRelationType?: string;
|
|
137
129
|
customLayout?: any;
|
|
138
130
|
customFilter?: any;
|
|
131
|
+
handleDeleteClick?: any;
|
|
139
132
|
};
|
|
140
133
|
|
|
141
134
|
export type SolidListViewHandle = {
|
|
@@ -205,12 +198,17 @@ export const SolidListView = forwardRef<SolidListViewHandle, SolidListViewParams
|
|
|
205
198
|
const visibleNavbar = useSelector((state: any) => state.navbarState?.visibleNavbar);
|
|
206
199
|
|
|
207
200
|
const pathname = usePathname();
|
|
208
|
-
const solidGlobalSearchElementRef = useRef();
|
|
201
|
+
const solidGlobalSearchElementRef = useRef<any>();
|
|
209
202
|
|
|
210
203
|
const router = useRouter();
|
|
211
204
|
const searchParams = useSearchParams();
|
|
212
205
|
const localeName = searchParams.get("locale");
|
|
213
206
|
|
|
207
|
+
|
|
208
|
+
const [solidListViewMetaData, setSolidListViewMetaData] = useState<any>(null);
|
|
209
|
+
const [solidListViewLayout, setSolidListViewLayout] = useState<any>(null);
|
|
210
|
+
const [isDraftPublishWorkflowEnabled, setIsDraftPublishWorkflowEnabled] = useState(false);
|
|
211
|
+
|
|
214
212
|
// Filter query realted states
|
|
215
213
|
const [filters, setFilters] = useState<any>(null);
|
|
216
214
|
const [totalRecords, setTotalRecords] = useState(0);
|
|
@@ -397,9 +395,6 @@ export const SolidListView = forwardRef<SolidListViewHandle, SolidListViewParams
|
|
|
397
395
|
}
|
|
398
396
|
);
|
|
399
397
|
|
|
400
|
-
const [solidListViewMetaData, setSolidListViewMetaData] = useState(null);
|
|
401
|
-
const [solidListViewLayout, setSolidListViewLayout] = useState(null);
|
|
402
|
-
const [isDraftPublishWorkflowEnabled, setIsDraftPublishWorkflowEnabled] = useState(false);
|
|
403
398
|
const {
|
|
404
399
|
data: solidListViewInitialMetaData,
|
|
405
400
|
error: solidListViewMetaDataError,
|
|
@@ -486,7 +481,7 @@ export const SolidListView = forwardRef<SolidListViewHandle, SolidListViewParams
|
|
|
486
481
|
const populate = toPopulate;
|
|
487
482
|
const populateMedia = toPopulateMedia;
|
|
488
483
|
const rows = currentLayout?.attrs?.defaultPageSize ?? 25;
|
|
489
|
-
const multiSortMeta = [{ field: "id", order: -1 }];
|
|
484
|
+
const multiSortMeta: { field: string; order: 1 | -1 }[] = [{ field: "id", order: -1 }];
|
|
490
485
|
return { multiSortMeta, rows, populate, populateMedia };
|
|
491
486
|
};
|
|
492
487
|
|
|
@@ -529,8 +524,8 @@ export const SolidListView = forwardRef<SolidListViewHandle, SolidListViewParams
|
|
|
529
524
|
});
|
|
530
525
|
}
|
|
531
526
|
|
|
532
|
-
const viewModes = listLayoutAttrs?.allowedViews && listLayoutAttrs?.allowedViews.length > 0 && listLayoutAttrs?.allowedViews.map((view: any) => { return { label: capitalize(view), value: view }; });
|
|
533
|
-
setViewModes(viewModes);
|
|
527
|
+
// const viewModes = listLayoutAttrs?.allowedViews && listLayoutAttrs?.allowedViews.length > 0 && listLayoutAttrs?.allowedViews.map((view: any) => { return { label: capitalize(view), value: view }; });
|
|
528
|
+
setViewModes(solidListViewInitialMetaData?.data?.viewModes);
|
|
534
529
|
if (createActionUrl) {
|
|
535
530
|
setCreateButtonUrl(createActionUrl);
|
|
536
531
|
}
|
|
@@ -591,7 +586,7 @@ export const SolidListView = forwardRef<SolidListViewHandle, SolidListViewParams
|
|
|
591
586
|
useEffect(() => {
|
|
592
587
|
if (solidEntityListViewData) {
|
|
593
588
|
setLoading(true);
|
|
594
|
-
const cleanedRecords = solidEntityListViewData.records.map((record) => {
|
|
589
|
+
const cleanedRecords = solidEntityListViewData.records.map((record: any) => {
|
|
595
590
|
const newRecord = { ...record };
|
|
596
591
|
|
|
597
592
|
Object.entries(newRecord).forEach(([key, value]) => {
|
|
@@ -750,10 +745,10 @@ export const SolidListView = forwardRef<SolidListViewHandle, SolidListViewParams
|
|
|
750
745
|
|
|
751
746
|
|
|
752
747
|
// Create a ref that always has the latest filters
|
|
753
|
-
const latestFiltersRef = useRef(filters);
|
|
754
|
-
const latestFilterPredicatesRef = useRef(filterPredicates);
|
|
748
|
+
const latestFiltersRef = useRef<any>(filters);
|
|
749
|
+
const latestFilterPredicatesRef = useRef<any>(filterPredicates);
|
|
755
750
|
// 1. Add the ref (near the other latestXxxRef declarations)
|
|
756
|
-
const latestMultiSortMetaRef = useRef(multiSortMeta);
|
|
751
|
+
const latestMultiSortMetaRef = useRef<any>(multiSortMeta);
|
|
757
752
|
|
|
758
753
|
// 2. Keep it in sync
|
|
759
754
|
useEffect(() => {
|
|
@@ -852,7 +847,7 @@ export const SolidListView = forwardRef<SolidListViewHandle, SolidListViewParams
|
|
|
852
847
|
const currentSortMeta = latestMultiSortMetaRef.current;
|
|
853
848
|
|
|
854
849
|
if (currentSortMeta && currentSortMeta.length > 0) {
|
|
855
|
-
queryData.sort = currentSortMeta.map(({ field, order }) => {
|
|
850
|
+
queryData.sort = currentSortMeta.map(({ field, order }: any) => {
|
|
856
851
|
const meta = solidFieldsMetadata?.[field];
|
|
857
852
|
let resolvedField = field;
|
|
858
853
|
if (meta?.type === "relation" && meta?.relationType === "many-to-one") {
|
|
@@ -963,7 +958,7 @@ export const SolidListView = forwardRef<SolidListViewHandle, SolidListViewParams
|
|
|
963
958
|
|
|
964
959
|
|
|
965
960
|
setFilters(params.customFilter || { $and: [] })
|
|
966
|
-
solidGlobalSearchElementRef
|
|
961
|
+
solidGlobalSearchElementRef?.current.clearFilter();
|
|
967
962
|
};
|
|
968
963
|
|
|
969
964
|
const cloneListData = () => {
|
|
@@ -1019,7 +1014,7 @@ export const SolidListView = forwardRef<SolidListViewHandle, SolidListViewParams
|
|
|
1019
1014
|
|
|
1020
1015
|
const [selectedSolidViewData, setSelectedSolidViewData] = useState<any>();
|
|
1021
1016
|
const selectedDataRef = useRef<any>();
|
|
1022
|
-
const op = useRef(null);
|
|
1017
|
+
const op = useRef<any>(null);
|
|
1023
1018
|
const [deleteEntity, setDeleteEntity] = useState(false);
|
|
1024
1019
|
|
|
1025
1020
|
// clickable link allowing one to open the detail / form view.
|
|
@@ -1057,7 +1052,7 @@ export const SolidListView = forwardRef<SolidListViewHandle, SolidListViewParams
|
|
|
1057
1052
|
</div>
|
|
1058
1053
|
// <a onClick={() => {
|
|
1059
1054
|
// if (params.embeded == true) {
|
|
1060
|
-
// params.
|
|
1055
|
+
// params.handleAddClickForEmbeddedView(solidViewData.id);
|
|
1061
1056
|
// } else {
|
|
1062
1057
|
// router.push(`${editButtonUrl}/${solidViewData.id}`)
|
|
1063
1058
|
// }
|
|
@@ -1068,7 +1063,7 @@ export const SolidListView = forwardRef<SolidListViewHandle, SolidListViewParams
|
|
|
1068
1063
|
};
|
|
1069
1064
|
|
|
1070
1065
|
// Recover functions
|
|
1071
|
-
const recoverById = (id) => {
|
|
1066
|
+
const recoverById = (id: any) => {
|
|
1072
1067
|
triggerRecoverSolidEntitiesById(id);
|
|
1073
1068
|
};
|
|
1074
1069
|
|
|
@@ -1101,7 +1096,7 @@ export const SolidListView = forwardRef<SolidListViewHandle, SolidListViewParams
|
|
|
1101
1096
|
}
|
|
1102
1097
|
}, [recoverByIdIsSuccess, recoverByIdData, recoverByIdIsError, recoverByIdError, recoverIsError, recoverError]);
|
|
1103
1098
|
|
|
1104
|
-
const showError = async (error) => {
|
|
1099
|
+
const showError = async (error: any) => {
|
|
1105
1100
|
const errorMessages = error?.data?.message;
|
|
1106
1101
|
const messages = Array.isArray(errorMessages)
|
|
1107
1102
|
? errorMessages
|
|
@@ -1130,7 +1125,7 @@ export const SolidListView = forwardRef<SolidListViewHandle, SolidListViewParams
|
|
|
1130
1125
|
}
|
|
1131
1126
|
};
|
|
1132
1127
|
|
|
1133
|
-
const showFieldError = async (error) => {
|
|
1128
|
+
const showFieldError = async (error: any) => {
|
|
1134
1129
|
if (error) {
|
|
1135
1130
|
toast?.current?.show({
|
|
1136
1131
|
severity: "error",
|
|
@@ -1288,7 +1283,7 @@ export const SolidListView = forwardRef<SolidListViewHandle, SolidListViewParams
|
|
|
1288
1283
|
throw new Error(ERROR_MESSAGES.NO_ENTITY_SELECTED);
|
|
1289
1284
|
}
|
|
1290
1285
|
|
|
1291
|
-
const response = await deleteSolidSingleEntiry(selectedSolidViewData.id);
|
|
1286
|
+
const response: any = await deleteSolidSingleEntiry(selectedSolidViewData.id);
|
|
1292
1287
|
|
|
1293
1288
|
if (response?.data?.statusCode === 200) {
|
|
1294
1289
|
setDeleteEntity(false);
|
|
@@ -1296,18 +1291,14 @@ export const SolidListView = forwardRef<SolidListViewHandle, SolidListViewParams
|
|
|
1296
1291
|
severity: "success",
|
|
1297
1292
|
summary: ERROR_MESSAGES.DELETED,
|
|
1298
1293
|
detail: ERROR_MESSAGES.ENTITY_DELETE,
|
|
1299
|
-
|
|
1300
|
-
? { sticky: true } // stays until user closes
|
|
1301
|
-
: { life: 3000 }),
|
|
1294
|
+
life: 3000,
|
|
1302
1295
|
});
|
|
1303
1296
|
} else {
|
|
1304
1297
|
toast.current?.show({
|
|
1305
1298
|
severity: "error",
|
|
1306
1299
|
summary: ERROR_MESSAGES.DELETE_FAIELD,
|
|
1307
1300
|
detail: response?.error?.data?.error,
|
|
1308
|
-
|
|
1309
|
-
? { sticky: true } // stays until user closes
|
|
1310
|
-
: { life: 3000 }),
|
|
1301
|
+
sticky: true, // stays until user closes
|
|
1311
1302
|
});
|
|
1312
1303
|
}
|
|
1313
1304
|
} catch (error: any) {
|
|
@@ -1315,9 +1306,8 @@ export const SolidListView = forwardRef<SolidListViewHandle, SolidListViewParams
|
|
|
1315
1306
|
severity: "error",
|
|
1316
1307
|
summary: ERROR_MESSAGES.DELETE_FAIELD,
|
|
1317
1308
|
detail: ERROR_MESSAGES.SOMETHING_WRONG,
|
|
1318
|
-
|
|
1319
|
-
|
|
1320
|
-
: { life: 3000 }),
|
|
1309
|
+
sticky: true, // stays until user closes
|
|
1310
|
+
|
|
1321
1311
|
});
|
|
1322
1312
|
}
|
|
1323
1313
|
};
|
|
@@ -1362,7 +1352,7 @@ export const SolidListView = forwardRef<SolidListViewHandle, SolidListViewParams
|
|
|
1362
1352
|
|
|
1363
1353
|
const hasCustomContextMenuButtons =
|
|
1364
1354
|
solidListViewLayout?.attrs?.rowButtons?.some(
|
|
1365
|
-
(rb) => rb?.attrs?.actionInContextMenu === true
|
|
1355
|
+
(rb: any) => rb?.attrs?.actionInContextMenu === true
|
|
1366
1356
|
);
|
|
1367
1357
|
|
|
1368
1358
|
const hasAnyContextMenuActions =
|
|
@@ -1433,7 +1423,7 @@ export const SolidListView = forwardRef<SolidListViewHandle, SolidListViewParams
|
|
|
1433
1423
|
|
|
1434
1424
|
<div className="hidden lg:flex align-items-center solid-header-buttons-wrapper">
|
|
1435
1425
|
{solidListViewLayout?.attrs?.headerButtons
|
|
1436
|
-
?.filter((rb) => rb.attrs.actionInContextMenu != true)
|
|
1426
|
+
?.filter((rb: any) => rb.attrs.actionInContextMenu != true)
|
|
1437
1427
|
?.map((button: any, index: number) => (
|
|
1438
1428
|
<SolidListViewHeaderButton
|
|
1439
1429
|
key={index}
|
|
@@ -1471,7 +1461,7 @@ export const SolidListView = forwardRef<SolidListViewHandle, SolidListViewParams
|
|
|
1471
1461
|
label={solidListViewLayout?.attrs?.addButtonTitle ? solidListViewLayout?.attrs?.addButtonTitle : "Add"}
|
|
1472
1462
|
className={`${solidListViewLayout?.attrs?.addButtonClassName}`}
|
|
1473
1463
|
size="small"
|
|
1474
|
-
onClick={() => params.
|
|
1464
|
+
onClick={() => params.handleAddClickForEmbeddedView("new")}
|
|
1475
1465
|
></Button>
|
|
1476
1466
|
)}
|
|
1477
1467
|
{/* Button For Manual Refresh */}
|
|
@@ -1611,7 +1601,7 @@ export const SolidListView = forwardRef<SolidListViewHandle, SolidListViewParams
|
|
|
1611
1601
|
// loadingIcon="pi pi-spinner"
|
|
1612
1602
|
selection={
|
|
1613
1603
|
params.embeded === true
|
|
1614
|
-
?
|
|
1604
|
+
? []
|
|
1615
1605
|
: [...selectedRecords, ...selectedRecoverRecords]
|
|
1616
1606
|
}
|
|
1617
1607
|
onSelectionChange={
|
|
@@ -1640,7 +1630,7 @@ export const SolidListView = forwardRef<SolidListViewHandle, SolidListViewParams
|
|
|
1640
1630
|
if (!(hasFindPermission || hasUpdatePermission)) return;
|
|
1641
1631
|
|
|
1642
1632
|
if (params.embeded === true) {
|
|
1643
|
-
params.
|
|
1633
|
+
params.handleEditClickForEmbeddedView(rowData?.id);
|
|
1644
1634
|
} else {
|
|
1645
1635
|
if (typeof window !== "undefined") {
|
|
1646
1636
|
// store a simple marker for the caller
|
|
@@ -1747,7 +1737,7 @@ export const SolidListView = forwardRef<SolidListViewHandle, SolidListViewParams
|
|
|
1747
1737
|
icon={"pi pi-pencil"}
|
|
1748
1738
|
onClick={() => {
|
|
1749
1739
|
if (params.embeded == true) {
|
|
1750
|
-
params.
|
|
1740
|
+
params.handleEditClickForEmbeddedView(rowData?.id);
|
|
1751
1741
|
} else {
|
|
1752
1742
|
if (typeof window !== "undefined") {
|
|
1753
1743
|
try {
|
|
@@ -1772,15 +1762,15 @@ export const SolidListView = forwardRef<SolidListViewHandle, SolidListViewParams
|
|
|
1772
1762
|
`${permissionExpression(params.modelName, 'delete')}`
|
|
1773
1763
|
) &&
|
|
1774
1764
|
solidListViewLayout?.attrs?.delete !== false &&
|
|
1775
|
-
solidListViewLayout?.attrs?.showRowDeleteInContextMenu
|
|
1776
|
-
|
|
1765
|
+
solidListViewLayout?.attrs?.showRowDeleteInContextMenu !==
|
|
1766
|
+
true && (
|
|
1777
1767
|
<Column
|
|
1778
1768
|
header="Delete"
|
|
1779
1769
|
body={(rowData) => {
|
|
1780
1770
|
const shouldHideEditOrDeleteButton = isDraftPublishWorkflowEnabled && rowData?.publishedAt;
|
|
1781
1771
|
return (
|
|
1782
1772
|
<>
|
|
1783
|
-
{!shouldHideEditOrDeleteButton && (
|
|
1773
|
+
{(!shouldHideEditOrDeleteButton || params.embeded) && (
|
|
1784
1774
|
<Button
|
|
1785
1775
|
text
|
|
1786
1776
|
type="button"
|
|
@@ -1790,8 +1780,12 @@ export const SolidListView = forwardRef<SolidListViewHandle, SolidListViewParams
|
|
|
1790
1780
|
severity="danger"
|
|
1791
1781
|
icon={"pi pi-trash"}
|
|
1792
1782
|
onClick={() => {
|
|
1793
|
-
|
|
1794
|
-
|
|
1783
|
+
if (params?.embededFieldRelationType === "many-to-many") {
|
|
1784
|
+
params?.handleDeleteClick(rowData.id);
|
|
1785
|
+
} else {
|
|
1786
|
+
setSelectedSolidViewData(rowData);
|
|
1787
|
+
setDeleteEntity(true);
|
|
1788
|
+
}
|
|
1795
1789
|
}}
|
|
1796
1790
|
/>
|
|
1797
1791
|
)}
|
|
@@ -1841,7 +1835,7 @@ export const SolidListView = forwardRef<SolidListViewHandle, SolidListViewParams
|
|
|
1841
1835
|
icon={"pi pi-pencil"}
|
|
1842
1836
|
onClick={() => {
|
|
1843
1837
|
if (params.embeded == true) {
|
|
1844
|
-
params.
|
|
1838
|
+
params.handleEditClickForEmbeddedView(
|
|
1845
1839
|
selectedDataRef.current?.id
|
|
1846
1840
|
);
|
|
1847
1841
|
} else {
|
|
@@ -1857,7 +1851,7 @@ export const SolidListView = forwardRef<SolidListViewHandle, SolidListViewParams
|
|
|
1857
1851
|
/>
|
|
1858
1852
|
)}
|
|
1859
1853
|
|
|
1860
|
-
{hasDeleteInContextMenu && (
|
|
1854
|
+
{hasDeleteInContextMenu && params.embeded !== true && (
|
|
1861
1855
|
<Button
|
|
1862
1856
|
text
|
|
1863
1857
|
type="button"
|
|
@@ -1872,7 +1866,7 @@ export const SolidListView = forwardRef<SolidListViewHandle, SolidListViewParams
|
|
|
1872
1866
|
)}
|
|
1873
1867
|
{hasCustomContextMenuButtons && solidListViewLayout?.attrs?.rowButtons
|
|
1874
1868
|
?.filter(
|
|
1875
|
-
(rb) =>
|
|
1869
|
+
(rb: any) =>
|
|
1876
1870
|
rb?.attrs?.actionInContextMenu === true &&
|
|
1877
1871
|
rb?.attrs?.visible !== false
|
|
1878
1872
|
)
|
|
@@ -1978,7 +1972,7 @@ export const SolidListView = forwardRef<SolidListViewHandle, SolidListViewParams
|
|
|
1978
1972
|
<div className="p-4">
|
|
1979
1973
|
<p className="m-0 solid-primary-title" style={{ fontSize: 16 }}>Are you sure you want to delete the selected records?</p>
|
|
1980
1974
|
<div className="flex align-items-center gap-2 mt-3">
|
|
1981
|
-
<Button label="Delete" severity="danger" size="small"
|
|
1975
|
+
<Button label="Delete" severity="danger" size="small" autoFocus onClick={deleteBulk} />
|
|
1982
1976
|
<Button label="Cancel" size="small" onClick={onDeleteClose} outlined className='bg-primary-reverse' />
|
|
1983
1977
|
</div>
|
|
1984
1978
|
</div>
|
|
@@ -1,3 +1,10 @@
|
|
|
1
1
|
import "../../common/solid-export.css";
|
|
2
|
+
export type ViewMode = {
|
|
3
|
+
actionId: string;
|
|
4
|
+
actionName: string;
|
|
5
|
+
menuItemId: string;
|
|
6
|
+
menuItemName: string;
|
|
7
|
+
type: string;
|
|
8
|
+
};
|
|
2
9
|
export declare const SolidListViewConfigure: ({ listViewMetaData, solidListViewLayout, setShowArchived, showArchived, viewData, sizeOptions, setSize, size, viewModes, params, actionsAllowed, selectedRecords, setDialogVisible, setShowSaveFilterPopup, filters, handleFetchUpdatedRecords, setRecoverDialogVisible, }: any) => import("react/jsx-runtime").JSX.Element;
|
|
3
10
|
//# sourceMappingURL=SolidListViewConfigure.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SolidListViewConfigure.d.ts","sourceRoot":"","sources":["../../../../src/components/core/list/SolidListViewConfigure.tsx"],"names":[],"mappings":"AAiBA,OAAO,+BAA+B,CAAC;
|
|
1
|
+
{"version":3,"file":"SolidListViewConfigure.d.ts","sourceRoot":"","sources":["../../../../src/components/core/list/SolidListViewConfigure.tsx"],"names":[],"mappings":"AAiBA,OAAO,+BAA+B,CAAC;AAMvC,MAAM,MAAM,QAAQ,GAAG;IACnB,QAAQ,EAAE,MAAM,CAAC;IACjB,UAAU,EAAE,MAAM,CAAC;IACnB,UAAU,EAAE,MAAM,CAAC;IACnB,YAAY,EAAE,MAAM,CAAC;IACrB,IAAI,EAAE,MAAM,CAAC;CAChB,CAAA;AAED,eAAO,MAAM,sBAAsB,+QAoB3B,GAAG,4CA2SV,CAAA"}
|
|
@@ -20,6 +20,7 @@ import "../../common/solid-export.css";
|
|
|
20
20
|
import { SolidGenericImport } from "../common/SolidGenericImport/SolidGenericImport";
|
|
21
21
|
import { hasAnyRole } from "../../../helpers/rolesHelper";
|
|
22
22
|
import { SolidListViewHeaderButton } from "./SolidListViewHeaderButton";
|
|
23
|
+
import { capitalize } from "lodash";
|
|
23
24
|
export var SolidListViewConfigure = function (_a) {
|
|
24
25
|
var _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z;
|
|
25
26
|
var listViewMetaData = _a.listViewMetaData, solidListViewLayout = _a.solidListViewLayout, setShowArchived = _a.setShowArchived, showArchived = _a.showArchived, viewData = _a.viewData, sizeOptions = _a.sizeOptions, setSize = _a.setSize, size = _a.size, viewModes = _a.viewModes, params = _a.params, actionsAllowed = _a.actionsAllowed, selectedRecords = _a.selectedRecords, setDialogVisible = _a.setDialogVisible, setShowSaveFilterPopup = _a.setShowSaveFilterPopup, filters = _a.filters, handleFetchUpdatedRecords = _a.handleFetchUpdatedRecords, setRecoverDialogVisible = _a.setRecoverDialogVisible;
|
|
@@ -35,11 +36,11 @@ export var SolidListViewConfigure = function (_a) {
|
|
|
35
36
|
var _2 = useState(false), exportView = _2[0], setExportView = _2[1];
|
|
36
37
|
var _3 = useState(false), isOverlayOpen = _3[0], setIsOverlayOpen = _3[1];
|
|
37
38
|
var handleViewChange = function (newView) {
|
|
38
|
-
if (view === newView)
|
|
39
|
+
if (view === newView.type)
|
|
39
40
|
return; // Prevent unnecessary updates
|
|
40
41
|
var pathSegments = pathname.split('/').filter(Boolean);
|
|
41
|
-
pathSegments[pathSegments.length - 1] = newView; // Replace the last part with new view
|
|
42
|
-
var newPath = '/' + pathSegments.join('/');
|
|
42
|
+
pathSegments[pathSegments.length - 1] = newView.type; // Replace the last part with new view
|
|
43
|
+
var newPath = '/' + pathSegments.join('/') + "?menuItemId=".concat(newView.menuItemId, "&menuItemName=").concat(newView.menuItemName, "&actionId=").concat(newView.actionId, "&actionName=").concat(newView.actionName);
|
|
43
44
|
router.push(newPath);
|
|
44
45
|
};
|
|
45
46
|
useEffect(function () {
|
|
@@ -134,9 +135,9 @@ export var SolidListViewConfigure = function (_a) {
|
|
|
134
135
|
}, children: _jsx("i", { className: "pi pi-chevron-right text-sm" }) })), isHeaderActionEnabled('savedFilters') && permissionExpression('savedFilters', 'create') && (_jsx(Button, { text: true, icon: 'pi pi-save', label: "Save Custom Filter", size: "small", severity: "secondary", className: "text-left gap-2 text-base", onClick: function () { return setShowSaveFilterPopup(true); } })), _jsx(Button, { text: true, icon: 'pi pi-trash', label: "Clear cache", size: "small", severity: "secondary", className: "text-left gap-2 text-base ", onClick: function () { return clearLocalstorageCache(); } }), _jsx(OverlayPanel, { ref: customizeLayout, className: "customize-layout-panel", style: { minWidth: 250 }, onShow: function () { return setIsOverlayOpen(true); }, onHide: function () {
|
|
135
136
|
setTimeout(function () { return setIsOverlayOpen(false); }, 50); // ✅ Ensure state updates
|
|
136
137
|
}, children: _jsx("div", { className: "solid-layout-accordion", children: _jsxs(Accordion, { multiple: true, expandIcon: "pi pi-chevron-down", collapseIcon: "pi pi-chevron-up", activeIndex: [2], children: [viewModes && viewModes.length > 0 &&
|
|
137
|
-
_jsx(AccordionTab, { header: "Switch Type", children: _jsx("div", { className: "flex flex-column gap-1 p-1", children: viewModes.map(function (option) { return (_jsxs("div", { className: "flex align-items-center ".concat(option.
|
|
138
|
+
_jsx(AccordionTab, { header: "Switch Type", children: _jsx("div", { className: "flex flex-column gap-1 p-1", children: viewModes.map(function (option) { return (_jsxs("div", { className: "flex align-items-center ".concat(option.type === view ? 'solid-active-view' : 'solid-view'), children: [_jsx(RadioButton, { inputId: option.type, name: "views", value: option.type,
|
|
138
139
|
// onChange={(e) => router}
|
|
139
|
-
onChange: function () { return handleViewChange(option
|
|
140
|
+
onChange: function () { return handleViewChange(option); }, checked: option.type === view }), _jsx("label", { htmlFor: option.type, className: "ml-2 flex align-items-center justify-content-between w-full", children: capitalize(option.type) })] }, option.type)); }) }) }), _jsx(AccordionTab, { header: "Row Spacing", children: _jsx("div", { className: "flex flex-column gap-1 p-1flex flex-column gap-1 p-1", children: sizeOptions.map(function (option) { return (_jsxs("div", { className: "flex align-items-center ".concat(option.value === size ? 'solid-active-view' : 'solid-view'), children: [_jsx(RadioButton, { inputId: option.value, name: "sizes", value: option.value, onChange: function (e) { return setSize(e.value); }, checked: option.value === size }), _jsxs("label", { htmlFor: option.value, className: "ml-2 flex align-items-center justify-content-between w-full", children: [option.label, _jsx(Image, { src: option.image, alt: option.value, fill: true, className: 'relative row-spacing-img' })] })] }, option.value)); }) }) }), _jsx(AccordionTab, { header: "Column Selector", headerClassName: "pb-0", children: _jsx(SolidListColumnSelector, { listViewMetaData: listViewMetaData, customizeLayout: customizeLayout }) })] }) }) })] })] }), openImportDialog &&
|
|
140
141
|
_jsx(SolidGenericImport, { openImportDialog: openImportDialog, setOpenImportDialog: setOpenImportDialog, listViewMetaData: listViewMetaData, handleFetchUpdatedRecords: handleFetchUpdatedRecords })] }));
|
|
141
142
|
};
|
|
142
143
|
//# sourceMappingURL=SolidListViewConfigure.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SolidListViewConfigure.js","sourceRoot":"","sources":["../../../../src/components/core/list/SolidListViewConfigure.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,2BAA2B,CAAC;AACvD,OAAO,EAAE,oBAAoB,EAAE,MAAM,8BAA8B,CAAC;AACpE,OAAO,KAAK,MAAM,oBAAoB,CAAC;AACvC,OAAO,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAC;AACzD,OAAO,EAAE,SAAS,EAAE,MAAM,0BAA0B,CAAC;AACrD,OAAO,EAAE,SAAS,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AAC/D,OAAO,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAC3C,OAAO,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AAC/C,OAAO,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAC;AAC7C,OAAO,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AACvD,OAAO,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AACrD,OAAO,EAAE,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACpD,OAAO,EAAE,uBAAuB,EAAE,MAAM,+CAA+C,CAAC;AACxF,OAAO,EAAE,WAAW,EAAE,MAAM,wCAAwC,CAAC;AACrE,OAAO,EAAE,MAAM,EAAE,MAAM,mBAAm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,GACtF,IACP,GACV,GACK,IACb,IACK,EACd,gBAAgB;gBACb,KAAC,kBAAkB,IACf,gBAAgB,EAAE,gBAAgB,EAClC,mBAAmB,EAAE,mBAAmB,EACxC,gBAAgB,EAAE,gBAAgB,EAClC,yBAAyB,EAAE,yBAAyB,GACtD,IAEJ,CACT,CAAA;AACL,CAAC,CAAA","sourcesContent":["import { useSession } from \"../../../hooks/useSession\";\nimport { permissionExpression } from \"../../../helpers/permissions\";\nimport Image from \"../../common/Image\";\nimport { usePathname } from \"../../../hooks/usePathname\";\nimport { useRouter } from \"../../../hooks/useRouter\";\nimport { Accordion, AccordionTab } from \"primereact/accordion\";\nimport { Button } from \"primereact/button\";\nimport { Checkbox } from \"primereact/checkbox\";\nimport { Divider } from \"primereact/divider\";\nimport { OverlayPanel } from \"primereact/overlaypanel\";\nimport { RadioButton } from \"primereact/radiobutton\";\nimport { useEffect, useRef, useState } from \"react\";\nimport { SolidListColumnSelector } from \"./SolidColumnSelector/SolidListColumnSelector\";\nimport { SolidExport } from \"../../../components/common/SolidExport\";\nimport { Dialog } from \"primereact/dialog\";\nimport { useHandleListCustomButtonClick } from \"../../../components/common/useHandleListCustomButtonClick\";\nimport { SolidListViewHeaderContextMenuButton } from \"./SolidListViewHeaderContextMenuButton\";\nimport \"../../common/solid-export.css\";\nimport { SolidGenericImport } from \"../common/SolidGenericImport/SolidGenericImport\";\nimport { hasAnyRole } from \"../../../helpers/rolesHelper\";\nimport { SolidListViewHeaderButton } from \"./SolidListViewHeaderButton\";\n\nexport const SolidListViewConfigure = (\n { listViewMetaData,\n solidListViewLayout,\n setShowArchived,\n showArchived,\n viewData,\n sizeOptions,\n setSize,\n size,\n viewModes,\n params,\n actionsAllowed,\n selectedRecords,\n setDialogVisible,\n setShowSaveFilterPopup,\n filters,\n handleFetchUpdatedRecords,\n setRecoverDialogVisible,\n\n }:\n any) => {\n // const [visible, setVisible] = useState<boolean>(false);\n const handleCustomButtonClick = useHandleListCustomButtonClick();\n const [openImportDialog, setOpenImportDialog] = useState<boolean>(false);\n const op = useRef(null);\n const exportRef = useRef(null);\n const customizeLayout = useRef<OverlayPanel | null>(null);\n const pathname = usePathname();\n const router = useRouter();\n const [view, setView] = useState<string>(\"\");\n const [exportView, setExportView] = useState<boolean>(false);\n const [isOverlayOpen, setIsOverlayOpen] = useState(false);\n\n\n const handleViewChange = (newView: string) => {\n if (view === newView) return; // Prevent unnecessary updates\n const pathSegments = pathname.split('/').filter(Boolean);\n pathSegments[pathSegments.length - 1] = newView; // Replace the last part with new view\n const newPath = '/' + pathSegments.join('/');\n router.push(newPath);\n };\n\n useEffect(() => {\n if (typeof pathname === 'string') {\n const pathSegments = pathname.split('/').filter(Boolean);\n if (pathSegments.length > 0) {\n setView(pathSegments[pathSegments.length - 1]);\n }\n }\n }, [])\n\n useEffect(() => {\n const handleClickOutside = (event: MouseEvent) => {\n if (\n customizeLayout.current &&\n !customizeLayout.current.getElement()?.contains(event.target as Node)\n ) {\n setIsOverlayOpen(false);\n }\n };\n\n if (isOverlayOpen) {\n document.addEventListener(\"click\", handleClickOutside);\n } else {\n document.removeEventListener(\"click\", handleClickOutside);\n }\n\n return () => document.removeEventListener(\"click\", handleClickOutside);\n }, [isOverlayOpen])\n\n\n //Build a map of actionKey → boolean at the top level\n const headerActions = solidListViewLayout?.attrs ?? {};\n\n const normalizeAction = (value: boolean | string[]) => {\n if (value === true) return { enabled: true, roles: [] };\n if (value === false) return { enabled: false, roles: [] };\n if (Array.isArray(value)) return { enabled: true, roles: value };\n return { enabled: true, roles: [] }; // default\n };\n const normalized = {\n import: normalizeAction(headerActions.import),\n export: normalizeAction(headerActions.export),\n customizeLayout: normalizeAction(headerActions.customizeLayout),\n savedFilters: normalizeAction(headerActions.savedFilters),\n };\n\n // Role checks\n const { data: session, status } = useSession();\n const user = session?.user;\n const useRoleCheck = (roles: string[]) => hasAnyRole(user?.roles, roles);\n\n // Map of action → roleCheck\n const roleCheckMap = {\n import: useRoleCheck(normalized.import.roles),\n export: useRoleCheck(normalized.export.roles),\n customizeLayout: useRoleCheck(normalized.customizeLayout.roles),\n savedFilters: useRoleCheck(normalized.savedFilters.roles),\n };\n\n const isHeaderActionEnabled = (action: keyof typeof normalized) => {\n const { enabled, roles } = normalized[action];\n\n // 1. If explicitly disabled\n if (!enabled) return false;\n\n // 2. If roles list exists → must have at least one\n if (roles.length > 0) {\n return roleCheckMap[action] === true;\n }\n // 3. No restrictions → enabled\n return true;\n };\n\n const clearLocalstorageCache = () => {\n const currentPageUrl = window.location.pathname; // Get the current page URL\n localStorage.removeItem(currentPageUrl); // Remove from local storage with the URL as the key\n window.location.reload();\n };\n\n return (\n <div className=\"position-relative\">\n <Button\n type=\"button\"\n size=\"small\"\n icon=\"pi pi-cog\"\n severity=\"secondary\"\n className=\"solid-icon-button\"\n outlined\n // @ts-ignore\n onClick={(e) => op.current.toggle(e)}\n />\n <Dialog header=\"Export\" visible={exportView} headerClassName=\"solid-export-dialog-header\" className=\"ExportDialog p-0 m-0\" onHide={() => { if (!exportView) return; setExportView(false); }}>\n <SolidExport listViewMetaData={listViewMetaData} filters={filters} />\n </Dialog>\n <OverlayPanel ref={exportRef} className=\"listview-export-panel\">\n\n </OverlayPanel>\n <OverlayPanel ref={op} className=\"listview-cogwheel-panel\">\n {(\n (actionsAllowed.includes(`${permissionExpression(params.modelName, 'deleteMany')}`) &&\n viewData?.data?.solidView?.layout?.attrs?.delete !== false &&\n selectedRecords.length > 0) ||\n isHeaderActionEnabled('import') && actionsAllowed.includes(`${permissionExpression(params.modelName, 'create')}`) && actionsAllowed.includes(`${permissionExpression('importTransaction', 'create')}`) ||\n isHeaderActionEnabled('export') && actionsAllowed.includes(`${permissionExpression(params.modelName, 'findMany')}`) && actionsAllowed.includes(`${permissionExpression('exportTransaction', 'create')}`) ||\n isHeaderActionEnabled('customizeLayout') && actionsAllowed.includes(`${permissionExpression('userViewMetadata', 'create')}`) ||\n isHeaderActionEnabled('savedFilters') && actionsAllowed.includes(`${permissionExpression('savedFilters', 'create')}`) ||\n (solidListViewLayout?.attrs?.headerButtons\n ?.some((rb: any) => rb.attrs.actionInContextMenu === true)) ||\n viewData?.data?.solidView?.model?.enableSoftDelete\n ) && (\n <>\n <div className=\"p-2\">\n <div className=\"flex flex-column\">\n {actionsAllowed.includes(`${permissionExpression(params.modelName, 'deleteMany')}`) && viewData?.data?.solidView?.layout?.attrs?.delete !== false && selectedRecords.length > 0 &&\n <Button\n text\n type=\"button\"\n className=\"text-left gap-2 text-base\"\n label=\"Delete\"\n size=\"small\"\n iconPos=\"left\"\n severity=\"danger\"\n icon={'pi pi-trash'}\n onClick={() => setDialogVisible(true)}\n />}\n {isHeaderActionEnabled(\"import\") && actionsAllowed.includes(`${permissionExpression(params.modelName, 'create')}`) && actionsAllowed.includes(`${permissionExpression('importTransaction', 'create')}`) && (\n <Button text icon='pi pi-download' label=\"Import\" size=\"small\" severity=\"secondary\" className=\"text-left gap-2 text-base\"\n onClick={() => setOpenImportDialog(true)}\n />\n )}\n {isHeaderActionEnabled(\"export\") && actionsAllowed.includes(`${permissionExpression(params.modelName, 'findMany')}`) && actionsAllowed.includes(`${permissionExpression('exportTransaction', 'create')}`) && (\n <Button text icon='pi pi-upload' label=\"Export\" size=\"small\" severity=\"secondary\" className=\"text-left gap-2 text-base\"\n // @ts-ignore\n onClick={() => { setExportView((exportView) => !exportView); }} />\n )}\n {solidListViewLayout?.attrs?.headerButtons\n ?.filter((rb: any) => rb.attrs.actionInContextMenu === true)\n ?.map((button: any, index: number) => (\n <SolidListViewHeaderContextMenuButton\n key={index}\n button={button}\n params={params}\n solidListViewMetaData={listViewMetaData}\n handleCustomButtonClick={handleCustomButtonClick}\n />\n ))}\n {viewData?.data?.solidView?.model?.enableSoftDelete && (\n <div className=\"flex align-items-center px-3 gap-2 mt-2 mb-1\">\n <Checkbox\n inputId=\"showArchived\"\n checked={showArchived}\n onChange={() => setShowArchived(!showArchived)}\n />\n <label htmlFor=\"showArchived\" className=\"ml-2 text-base solid-secondary-text-color\">\n Show Archived Records\n </label>\n </div>\n )}\n {showArchived && (\n <Button text icon='pi pi-refresh' label=\"Recover\" size=\"small\" severity=\"secondary\" className=\"flex lg:hidden text-left gap-2 text-base \"\n onClick={() => setRecoverDialogVisible(true)} />\n )}\n\n <div className=\"flex flex-column lg:hidden\">\n {solidListViewLayout?.attrs?.headerButtons\n ?.filter((rb: any) => rb.attrs.actionInContextMenu != true)\n ?.map((button: any, index: number) => (\n <SolidListViewHeaderButton\n key={index}\n button={button}\n params={params}\n solidListViewMetaData={listViewMetaData}\n handleCustomButtonClick={handleCustomButtonClick}\n selectedRecords={selectedRecords}\n filters={filters}\n />\n ))}\n </div>\n\n </div>\n </div>\n <Divider className=\"m-0\" />\n </>\n )}\n <div className=\"p-2 relative flex flex-column gap-1\">\n {isHeaderActionEnabled('customizeLayout') && permissionExpression('userViewMetadata', 'create') && (<Button\n icon='pi pi-sliders-h'\n label=\"Customize Layout\"\n severity={isOverlayOpen ? undefined : \"secondary\"}\n size=\"small\"\n text={isOverlayOpen ? false : true}\n className=\"text-left gap-2 w-full text-base\"\n // @ts-ignore\n onClick={(e) => {\n customizeLayout.current?.toggle(e);\n setIsOverlayOpen((prev) => !prev); // ✅ Ensure state updates when toggled\n }}\n >\n <i className=\"pi pi-chevron-right text-sm\"></i>\n </Button>\n )}\n {isHeaderActionEnabled('savedFilters') && permissionExpression('savedFilters', 'create') && (\n <Button text icon='pi pi-save' label=\"Save Custom Filter\" size=\"small\" severity=\"secondary\" className=\"text-left gap-2 text-base\" onClick={() => setShowSaveFilterPopup(true)} />\n )}\n <Button text icon='pi pi-trash' label=\"Clear cache\" size=\"small\" severity=\"secondary\" className=\"text-left gap-2 text-base \"\n onClick={() => clearLocalstorageCache()} />\n\n <OverlayPanel ref={customizeLayout} className=\"customize-layout-panel\" style={{ minWidth: 250 }}\n onShow={() => setIsOverlayOpen(true)}\n onHide={() => {\n setTimeout(() => setIsOverlayOpen(false), 50); // ✅ Ensure state updates\n }}\n >\n <div className=\"solid-layout-accordion\">\n <Accordion multiple expandIcon=\"pi pi-chevron-down\" collapseIcon=\"pi pi-chevron-up\" activeIndex={[2]}>\n {viewModes && viewModes.length > 0 &&\n <AccordionTab header=\"Switch Type\">\n <div className=\"flex flex-column gap-1 p-1\">\n {viewModes.map((option: any) => (\n <div key={option.value} className={`flex align-items-center ${option.value === view ? 'solid-active-view' : 'solid-view'}`}>\n <RadioButton\n inputId={option.value}\n name=\"views\"\n value={option.value}\n // onChange={(e) => router}\n onChange={() => handleViewChange(option.value)}\n checked={option.value === view}\n />\n <label htmlFor={option.value} className=\"ml-2 flex align-items-center justify-content-between w-full\">\n {option.label}\n </label>\n </div>\n ))}\n </div>\n </AccordionTab>\n }\n <AccordionTab header=\"Row Spacing\">\n <div className=\"flex flex-column gap-1 p-1flex flex-column gap-1 p-1\">\n {sizeOptions.map((option: any) => (\n <div key={option.value} className={`flex align-items-center ${option.value === size ? 'solid-active-view' : 'solid-view'}`}>\n <RadioButton\n inputId={option.value}\n name=\"sizes\"\n value={option.value}\n onChange={(e) => setSize(e.value)}\n checked={option.value === size}\n />\n <label htmlFor={option.value} className=\"ml-2 flex align-items-center justify-content-between w-full\">\n {option.label}\n <Image\n src={option.image}\n alt={option.value}\n fill\n className='relative row-spacing-img'\n />\n </label>\n </div>\n ))}\n </div>\n </AccordionTab>\n <AccordionTab header=\"Column Selector\" headerClassName=\"pb-0\">\n <SolidListColumnSelector listViewMetaData={listViewMetaData} customizeLayout={customizeLayout} />\n </AccordionTab>\n </Accordion>\n </div>\n </OverlayPanel>\n </div>\n </OverlayPanel>\n {openImportDialog &&\n <SolidGenericImport\n openImportDialog={openImportDialog}\n setOpenImportDialog={setOpenImportDialog}\n listViewMetaData={listViewMetaData}\n handleFetchUpdatedRecords={handleFetchUpdatedRecords}\n />\n }\n </div>\n )\n}\n"]}
|
|
1
|
+
{"version":3,"file":"SolidListViewConfigure.js","sourceRoot":"","sources":["../../../../src/components/core/list/SolidListViewConfigure.tsx"],"names":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../../hooks/useSession\";\nimport { permissionExpression } from \"../../../helpers/permissions\";\nimport Image from \"../../common/Image\";\nimport { usePathname } from \"../../../hooks/usePathname\";\nimport { useRouter } from \"../../../hooks/useRouter\";\nimport { Accordion, AccordionTab } from \"primereact/accordion\";\nimport { Button } from \"primereact/button\";\nimport { Checkbox } from \"primereact/checkbox\";\nimport { Divider } from \"primereact/divider\";\nimport { OverlayPanel } from \"primereact/overlaypanel\";\nimport { RadioButton } from \"primereact/radiobutton\";\nimport { useEffect, useRef, useState } from \"react\";\nimport { SolidListColumnSelector } from \"./SolidColumnSelector/SolidListColumnSelector\";\nimport { SolidExport } from \"../../../components/common/SolidExport\";\nimport { Dialog } from \"primereact/dialog\";\nimport { useHandleListCustomButtonClick } from \"../../../components/common/useHandleListCustomButtonClick\";\nimport { SolidListViewHeaderContextMenuButton } from \"./SolidListViewHeaderContextMenuButton\";\nimport \"../../common/solid-export.css\";\nimport { SolidGenericImport } from \"../common/SolidGenericImport/SolidGenericImport\";\nimport { hasAnyRole } from \"../../../helpers/rolesHelper\";\nimport { SolidListViewHeaderButton } from \"./SolidListViewHeaderButton\";\nimport { capitalize } from \"lodash\";\n\nexport type ViewMode = {\n actionId: string;\n actionName: string;\n menuItemId: string;\n menuItemName: string;\n type: string;\n}\n\nexport const SolidListViewConfigure = (\n { listViewMetaData,\n solidListViewLayout,\n setShowArchived,\n showArchived,\n viewData,\n sizeOptions,\n setSize,\n size,\n viewModes,\n params,\n actionsAllowed,\n selectedRecords,\n setDialogVisible,\n setShowSaveFilterPopup,\n filters,\n handleFetchUpdatedRecords,\n setRecoverDialogVisible,\n\n }:\n any) => {\n // const [visible, setVisible] = useState<boolean>(false);\n const handleCustomButtonClick = useHandleListCustomButtonClick();\n const [openImportDialog, setOpenImportDialog] = useState<boolean>(false);\n const op = useRef(null);\n const exportRef = useRef(null);\n const customizeLayout = useRef<OverlayPanel | null>(null);\n const pathname = usePathname();\n const router = useRouter();\n const [view, setView] = useState<string>(\"\");\n const [exportView, setExportView] = useState<boolean>(false);\n const [isOverlayOpen, setIsOverlayOpen] = useState(false);\n\n\n const handleViewChange = (newView: ViewMode) => {\n if (view === newView.type) return; // Prevent unnecessary updates\n const pathSegments = pathname.split('/').filter(Boolean);\n pathSegments[pathSegments.length - 1] = newView.type; // Replace the last part with new view\n const newPath = '/' + pathSegments.join('/') + `?menuItemId=${newView.menuItemId}&menuItemName=${newView.menuItemName}&actionId=${newView.actionId}&actionName=${newView.actionName}`;\n router.push(newPath);\n };\n\n useEffect(() => {\n if (typeof pathname === 'string') {\n const pathSegments = pathname.split('/').filter(Boolean);\n if (pathSegments.length > 0) {\n setView(pathSegments[pathSegments.length - 1]);\n }\n }\n }, [])\n\n useEffect(() => {\n const handleClickOutside = (event: MouseEvent) => {\n if (\n customizeLayout.current &&\n !customizeLayout.current.getElement()?.contains(event.target as Node)\n ) {\n setIsOverlayOpen(false);\n }\n };\n\n if (isOverlayOpen) {\n document.addEventListener(\"click\", handleClickOutside);\n } else {\n document.removeEventListener(\"click\", handleClickOutside);\n }\n\n return () => document.removeEventListener(\"click\", handleClickOutside);\n }, [isOverlayOpen])\n\n\n //Build a map of actionKey → boolean at the top level\n const headerActions = solidListViewLayout?.attrs ?? {};\n\n const normalizeAction = (value: boolean | string[]) => {\n if (value === true) return { enabled: true, roles: [] };\n if (value === false) return { enabled: false, roles: [] };\n if (Array.isArray(value)) return { enabled: true, roles: value };\n return { enabled: true, roles: [] }; // default\n };\n const normalized = {\n import: normalizeAction(headerActions.import),\n export: normalizeAction(headerActions.export),\n customizeLayout: normalizeAction(headerActions.customizeLayout),\n savedFilters: normalizeAction(headerActions.savedFilters),\n };\n\n // Role checks\n const { data: session, status } = useSession();\n const user = session?.user;\n const useRoleCheck = (roles: string[]) => hasAnyRole(user?.roles, roles);\n\n // Map of action → roleCheck\n const roleCheckMap = {\n import: useRoleCheck(normalized.import.roles),\n export: useRoleCheck(normalized.export.roles),\n customizeLayout: useRoleCheck(normalized.customizeLayout.roles),\n savedFilters: useRoleCheck(normalized.savedFilters.roles),\n };\n\n const isHeaderActionEnabled = (action: keyof typeof normalized) => {\n const { enabled, roles } = normalized[action];\n\n // 1. If explicitly disabled\n if (!enabled) return false;\n\n // 2. If roles list exists → must have at least one\n if (roles.length > 0) {\n return roleCheckMap[action] === true;\n }\n // 3. No restrictions → enabled\n return true;\n };\n\n const clearLocalstorageCache = () => {\n const currentPageUrl = window.location.pathname; // Get the current page URL\n localStorage.removeItem(currentPageUrl); // Remove from local storage with the URL as the key\n window.location.reload();\n };\n\n return (\n <div className=\"position-relative\">\n <Button\n type=\"button\"\n size=\"small\"\n icon=\"pi pi-cog\"\n severity=\"secondary\"\n className=\"solid-icon-button\"\n outlined\n // @ts-ignore\n onClick={(e) => op.current.toggle(e)}\n />\n <Dialog header=\"Export\" visible={exportView} headerClassName=\"solid-export-dialog-header\" className=\"ExportDialog p-0 m-0\" onHide={() => { if (!exportView) return; setExportView(false); }}>\n <SolidExport listViewMetaData={listViewMetaData} filters={filters} />\n </Dialog>\n <OverlayPanel ref={exportRef} className=\"listview-export-panel\">\n\n </OverlayPanel>\n <OverlayPanel ref={op} className=\"listview-cogwheel-panel\">\n {(\n (actionsAllowed.includes(`${permissionExpression(params.modelName, 'deleteMany')}`) &&\n viewData?.data?.solidView?.layout?.attrs?.delete !== false &&\n selectedRecords.length > 0) ||\n isHeaderActionEnabled('import') && actionsAllowed.includes(`${permissionExpression(params.modelName, 'create')}`) && actionsAllowed.includes(`${permissionExpression('importTransaction', 'create')}`) ||\n isHeaderActionEnabled('export') && actionsAllowed.includes(`${permissionExpression(params.modelName, 'findMany')}`) && actionsAllowed.includes(`${permissionExpression('exportTransaction', 'create')}`) ||\n isHeaderActionEnabled('customizeLayout') && actionsAllowed.includes(`${permissionExpression('userViewMetadata', 'create')}`) ||\n isHeaderActionEnabled('savedFilters') && actionsAllowed.includes(`${permissionExpression('savedFilters', 'create')}`) ||\n (solidListViewLayout?.attrs?.headerButtons\n ?.some((rb: any) => rb.attrs.actionInContextMenu === true)) ||\n viewData?.data?.solidView?.model?.enableSoftDelete\n ) && (\n <>\n <div className=\"p-2\">\n <div className=\"flex flex-column\">\n {actionsAllowed.includes(`${permissionExpression(params.modelName, 'deleteMany')}`) && viewData?.data?.solidView?.layout?.attrs?.delete !== false && selectedRecords.length > 0 &&\n <Button\n text\n type=\"button\"\n className=\"text-left gap-2 text-base\"\n label=\"Delete\"\n size=\"small\"\n iconPos=\"left\"\n severity=\"danger\"\n icon={'pi pi-trash'}\n onClick={() => setDialogVisible(true)}\n />}\n {isHeaderActionEnabled(\"import\") && actionsAllowed.includes(`${permissionExpression(params.modelName, 'create')}`) && actionsAllowed.includes(`${permissionExpression('importTransaction', 'create')}`) && (\n <Button text icon='pi pi-download' label=\"Import\" size=\"small\" severity=\"secondary\" className=\"text-left gap-2 text-base\"\n onClick={() => setOpenImportDialog(true)}\n />\n )}\n {isHeaderActionEnabled(\"export\") && actionsAllowed.includes(`${permissionExpression(params.modelName, 'findMany')}`) && actionsAllowed.includes(`${permissionExpression('exportTransaction', 'create')}`) && (\n <Button text icon='pi pi-upload' label=\"Export\" size=\"small\" severity=\"secondary\" className=\"text-left gap-2 text-base\"\n // @ts-ignore\n onClick={() => { setExportView((exportView) => !exportView); }} />\n )}\n {solidListViewLayout?.attrs?.headerButtons\n ?.filter((rb: any) => rb.attrs.actionInContextMenu === true)\n ?.map((button: any, index: number) => (\n <SolidListViewHeaderContextMenuButton\n key={index}\n button={button}\n params={params}\n solidListViewMetaData={listViewMetaData}\n handleCustomButtonClick={handleCustomButtonClick}\n />\n ))}\n {viewData?.data?.solidView?.model?.enableSoftDelete && (\n <div className=\"flex align-items-center px-3 gap-2 mt-2 mb-1\">\n <Checkbox\n inputId=\"showArchived\"\n checked={showArchived}\n onChange={() => setShowArchived(!showArchived)}\n />\n <label htmlFor=\"showArchived\" className=\"ml-2 text-base solid-secondary-text-color\">\n Show Archived Records\n </label>\n </div>\n )}\n {showArchived && (\n <Button text icon='pi pi-refresh' label=\"Recover\" size=\"small\" severity=\"secondary\" className=\"flex lg:hidden text-left gap-2 text-base \"\n onClick={() => setRecoverDialogVisible(true)} />\n )}\n\n <div className=\"flex flex-column lg:hidden\">\n {solidListViewLayout?.attrs?.headerButtons\n ?.filter((rb: any) => rb.attrs.actionInContextMenu != true)\n ?.map((button: any, index: number) => (\n <SolidListViewHeaderButton\n key={index}\n button={button}\n params={params}\n solidListViewMetaData={listViewMetaData}\n handleCustomButtonClick={handleCustomButtonClick}\n selectedRecords={selectedRecords}\n filters={filters}\n />\n ))}\n </div>\n\n </div>\n </div>\n <Divider className=\"m-0\" />\n </>\n )}\n <div className=\"p-2 relative flex flex-column gap-1\">\n {isHeaderActionEnabled('customizeLayout') && permissionExpression('userViewMetadata', 'create') && (<Button\n icon='pi pi-sliders-h'\n label=\"Customize Layout\"\n severity={isOverlayOpen ? undefined : \"secondary\"}\n size=\"small\"\n text={isOverlayOpen ? false : true}\n className=\"text-left gap-2 w-full text-base\"\n // @ts-ignore\n onClick={(e) => {\n customizeLayout.current?.toggle(e);\n setIsOverlayOpen((prev) => !prev); // ✅ Ensure state updates when toggled\n }}\n >\n <i className=\"pi pi-chevron-right text-sm\"></i>\n </Button>\n )}\n {isHeaderActionEnabled('savedFilters') && permissionExpression('savedFilters', 'create') && (\n <Button text icon='pi pi-save' label=\"Save Custom Filter\" size=\"small\" severity=\"secondary\" className=\"text-left gap-2 text-base\" onClick={() => setShowSaveFilterPopup(true)} />\n )}\n <Button text icon='pi pi-trash' label=\"Clear cache\" size=\"small\" severity=\"secondary\" className=\"text-left gap-2 text-base \"\n onClick={() => clearLocalstorageCache()} />\n\n <OverlayPanel ref={customizeLayout} className=\"customize-layout-panel\" style={{ minWidth: 250 }}\n onShow={() => setIsOverlayOpen(true)}\n onHide={() => {\n setTimeout(() => setIsOverlayOpen(false), 50); // ✅ Ensure state updates\n }}\n >\n <div className=\"solid-layout-accordion\">\n <Accordion multiple expandIcon=\"pi pi-chevron-down\" collapseIcon=\"pi pi-chevron-up\" activeIndex={[2]}>\n {viewModes && viewModes.length > 0 &&\n <AccordionTab header=\"Switch Type\">\n <div className=\"flex flex-column gap-1 p-1\">\n {viewModes.map((option: ViewMode) => (\n <div key={option.type} className={`flex align-items-center ${option.type === view ? 'solid-active-view' : 'solid-view'}`}>\n <RadioButton\n inputId={option.type}\n name=\"views\"\n value={option.type}\n // onChange={(e) => router}\n onChange={() => handleViewChange(option)}\n checked={option.type === view}\n />\n <label htmlFor={option.type} className=\"ml-2 flex align-items-center justify-content-between w-full\">\n {capitalize(option.type)}\n </label>\n </div>\n ))}\n </div>\n </AccordionTab>\n }\n <AccordionTab header=\"Row Spacing\">\n <div className=\"flex flex-column gap-1 p-1flex flex-column gap-1 p-1\">\n {sizeOptions.map((option: any) => (\n <div key={option.value} className={`flex align-items-center ${option.value === size ? 'solid-active-view' : 'solid-view'}`}>\n <RadioButton\n inputId={option.value}\n name=\"sizes\"\n value={option.value}\n onChange={(e) => setSize(e.value)}\n checked={option.value === size}\n />\n <label htmlFor={option.value} className=\"ml-2 flex align-items-center justify-content-between w-full\">\n {option.label}\n <Image\n src={option.image}\n alt={option.value}\n fill\n className='relative row-spacing-img'\n />\n </label>\n </div>\n ))}\n </div>\n </AccordionTab>\n <AccordionTab header=\"Column Selector\" headerClassName=\"pb-0\">\n <SolidListColumnSelector listViewMetaData={listViewMetaData} customizeLayout={customizeLayout} />\n </AccordionTab>\n </Accordion>\n </div>\n </OverlayPanel>\n </div>\n </OverlayPanel>\n {openImportDialog &&\n <SolidGenericImport\n openImportDialog={openImportDialog}\n setOpenImportDialog={setOpenImportDialog}\n listViewMetaData={listViewMetaData}\n handleFetchUpdatedRecords={handleFetchUpdatedRecords}\n />\n }\n </div>\n )\n}\n"]}
|