@solidxai/core-ui 0.1.12-beta.1 → 0.1.12-beta.2
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.d.ts.map +1 -1
- package/dist/components/auth/AuthLayout.js +15 -19
- package/dist/components/auth/AuthLayout.js.map +1 -1
- package/dist/components/auth/AuthLayout.tsx +26 -20
- package/dist/components/common/BackButton.js +1 -1
- package/dist/components/common/BackButton.js.map +1 -1
- package/dist/components/common/BackButton.tsx +1 -1
- package/dist/components/common/CancelButton.js +1 -1
- package/dist/components/common/CancelButton.js.map +1 -1
- package/dist/components/common/CancelButton.tsx +1 -1
- package/dist/components/common/GeneralSettings.d.ts.map +1 -1
- package/dist/components/common/GeneralSettings.js +6 -33
- package/dist/components/common/GeneralSettings.js.map +1 -1
- package/dist/components/common/GeneralSettings.tsx +20 -57
- package/dist/components/common/SettingsComponent.d.ts.map +1 -1
- package/dist/components/common/SettingsComponent.js +1 -9
- package/dist/components/common/SettingsComponent.js.map +1 -1
- package/dist/components/common/SettingsComponent.tsx +1 -8
- package/dist/components/common/SolidBreadcrumb.js +1 -1
- package/dist/components/common/SolidBreadcrumb.js.map +1 -1
- package/dist/components/common/SolidBreadcrumb.tsx +2 -2
- package/dist/components/common/SolidFaviconProvider.d.ts.map +1 -1
- package/dist/components/common/SolidFaviconProvider.js +1 -8
- package/dist/components/common/SolidFaviconProvider.js.map +1 -1
- package/dist/components/common/SolidFaviconProvider.tsx +1 -7
- package/dist/components/core/card/CardItem.d.ts.map +1 -1
- package/dist/components/core/card/CardItem.js +3 -4
- package/dist/components/core/card/CardItem.js.map +1 -1
- package/dist/components/core/card/CardItem.tsx +3 -4
- package/dist/components/core/card/SolidCardView.d.ts.map +1 -1
- package/dist/components/core/card/SolidCardView.js +6 -1
- package/dist/components/core/card/SolidCardView.js.map +1 -1
- package/dist/components/core/card/SolidCardView.tsx +6 -1
- package/dist/components/core/card/SolidCardViewConfigure.d.ts.map +1 -1
- package/dist/components/core/card/SolidCardViewConfigure.js +4 -1
- package/dist/components/core/card/SolidCardViewConfigure.js.map +1 -1
- package/dist/components/core/card/SolidCardViewConfigure.tsx +4 -1
- package/dist/components/core/common/SolidCreateButton.d.ts.map +1 -1
- package/dist/components/core/common/SolidCreateButton.js +2 -13
- package/dist/components/core/common/SolidCreateButton.js.map +1 -1
- package/dist/components/core/common/SolidCreateButton.tsx +2 -15
- package/dist/components/core/common/SolidGlobalSearchElement.d.ts.map +1 -1
- package/dist/components/core/common/SolidGlobalSearchElement.js +34 -15
- package/dist/components/core/common/SolidGlobalSearchElement.js.map +1 -1
- package/dist/components/core/common/SolidGlobalSearchElement.tsx +37 -17
- package/dist/components/core/extension/solid-core/modelMetadata/list/GenerateModelCodeRowAction.js +15 -13
- package/dist/components/core/extension/solid-core/modelMetadata/list/GenerateModelCodeRowAction.js.map +1 -1
- package/dist/components/core/extension/solid-core/modelMetadata/list/GenerateModelCodeRowAction.tsx +4 -4
- package/dist/components/core/extension/solid-core/moduleMetadata/list/GenerateModuleCodeRowAction.js +6 -5
- package/dist/components/core/extension/solid-core/moduleMetadata/list/GenerateModuleCodeRowAction.js.map +1 -1
- package/dist/components/core/extension/solid-core/moduleMetadata/list/GenerateModuleCodeRowAction.tsx +1 -1
- package/dist/components/core/form/SolidFormFooter.d.ts +2 -1
- package/dist/components/core/form/SolidFormFooter.d.ts.map +1 -1
- package/dist/components/core/form/SolidFormFooter.js +48 -14
- package/dist/components/core/form/SolidFormFooter.js.map +1 -1
- package/dist/components/core/form/SolidFormFooter.tsx +50 -4
- package/dist/components/core/form/SolidFormView.d.ts.map +1 -1
- package/dist/components/core/form/SolidFormView.js +52 -50
- package/dist/components/core/form/SolidFormView.js.map +1 -1
- package/dist/components/core/form/SolidFormView.tsx +16 -9
- package/dist/components/core/kanban/KanbanCard.d.ts.map +1 -1
- package/dist/components/core/kanban/KanbanCard.js +2 -10
- package/dist/components/core/kanban/KanbanCard.js.map +1 -1
- package/dist/components/core/kanban/KanbanCard.tsx +2 -10
- package/dist/components/core/kanban/SolidKanbanView.d.ts.map +1 -1
- package/dist/components/core/kanban/SolidKanbanView.js +11 -4
- package/dist/components/core/kanban/SolidKanbanView.js.map +1 -1
- package/dist/components/core/kanban/SolidKanbanView.tsx +13 -5
- package/dist/components/core/list/SolidListView.d.ts +2 -0
- package/dist/components/core/list/SolidListView.d.ts.map +1 -1
- package/dist/components/core/list/SolidListView.js +195 -111
- package/dist/components/core/list/SolidListView.js.map +1 -1
- package/dist/components/core/list/SolidListView.tsx +136 -39
- package/dist/components/core/list/SolidListViewConfigure.d.ts.map +1 -1
- package/dist/components/core/list/SolidListViewConfigure.js +2 -0
- package/dist/components/core/list/SolidListViewConfigure.js.map +1 -1
- package/dist/components/core/list/SolidListViewConfigure.tsx +2 -0
- package/dist/components/core/list/columns/relations/SolidRelationManyToOneColumn.d.ts.map +1 -1
- package/dist/components/core/list/columns/relations/SolidRelationManyToOneColumn.js +16 -19
- package/dist/components/core/list/columns/relations/SolidRelationManyToOneColumn.js.map +1 -1
- package/dist/components/core/list/columns/relations/SolidRelationManyToOneColumn.tsx +16 -22
- package/dist/components/core/locales/SolidChatterLocaleTabView.d.ts.map +1 -1
- package/dist/components/core/locales/SolidChatterLocaleTabView.js +9 -8
- package/dist/components/core/locales/SolidChatterLocaleTabView.js.map +1 -1
- package/dist/components/core/locales/SolidChatterLocaleTabView.tsx +4 -1
- package/dist/components/core/locales/SolidLocale.d.ts.map +1 -1
- package/dist/components/core/locales/SolidLocale.js +1 -2
- package/dist/components/core/locales/SolidLocale.js.map +1 -1
- package/dist/components/core/locales/SolidLocale.tsx +1 -2
- package/dist/components/core/model/CreateModel.d.ts.map +1 -1
- package/dist/components/core/model/CreateModel.js +1 -1
- package/dist/components/core/model/CreateModel.js.map +1 -1
- package/dist/components/core/model/CreateModel.tsx +0 -1
- package/dist/components/core/model/ModelMetaData.d.ts.map +1 -1
- package/dist/components/core/model/ModelMetaData.js +1 -2
- package/dist/components/core/model/ModelMetaData.js.map +1 -1
- package/dist/components/core/model/ModelMetaData.tsx +1 -3
- package/dist/components/core/tree/SolidTreeView.d.ts.map +1 -1
- package/dist/components/core/tree/SolidTreeView.js +47 -26
- package/dist/components/core/tree/SolidTreeView.js.map +1 -1
- package/dist/components/core/tree/SolidTreeView.tsx +55 -23
- package/dist/components/layout/AdminTopHeader.js +2 -3
- package/dist/components/layout/AdminTopHeader.js.map +1 -1
- package/dist/components/layout/AdminTopHeader.tsx +2 -2
- package/dist/components/layout/AppSidebar.d.ts.map +1 -1
- package/dist/components/layout/AppSidebar.js +5 -2
- package/dist/components/layout/AppSidebar.js.map +1 -1
- package/dist/components/layout/AppSidebar.tsx +7 -4
- package/dist/components/layout/navbar-two-menu.d.ts.map +1 -1
- package/dist/components/layout/navbar-two-menu.js +6 -4
- package/dist/components/layout/navbar-two-menu.js.map +1 -1
- package/dist/components/layout/navbar-two-menu.tsx +4 -2
- package/dist/constants/error-messages.d.ts +1 -0
- package/dist/constants/error-messages.d.ts.map +1 -1
- package/dist/constants/error-messages.js +1 -0
- package/dist/constants/error-messages.js.map +1 -1
- package/dist/constants/error-messages.ts +1 -0
- package/dist/helpers/assetUrl.d.ts +3 -0
- package/dist/helpers/assetUrl.d.ts.map +1 -0
- package/dist/helpers/assetUrl.js +22 -0
- package/dist/helpers/assetUrl.js.map +1 -0
- package/dist/helpers/assetUrl.ts +26 -0
- package/dist/helpers/modelViewPersistence.d.ts +5 -0
- package/dist/helpers/modelViewPersistence.d.ts.map +1 -0
- package/dist/helpers/modelViewPersistence.js +168 -0
- package/dist/helpers/modelViewPersistence.js.map +1 -0
- package/dist/helpers/modelViewPersistence.ts +201 -0
- package/dist/helpers/routePaths.d.ts +6 -0
- package/dist/helpers/routePaths.d.ts.map +1 -1
- package/dist/helpers/routePaths.js +13 -0
- package/dist/helpers/routePaths.js.map +1 -1
- package/dist/helpers/routePaths.ts +25 -0
- package/dist/redux/api/solidServiceApi.d.ts +10 -2
- package/dist/redux/api/solidServiceApi.d.ts.map +1 -1
- package/dist/redux/api/solidServiceApi.js +2 -4
- package/dist/redux/api/solidServiceApi.js.map +1 -1
- package/dist/redux/api/solidServiceApi.ts +4 -6
- package/dist/redux/store/defaultStoreConfig.d.ts +5 -1
- package/dist/redux/store/defaultStoreConfig.d.ts.map +1 -1
- package/dist/resources/solid-custom.css +3 -0
- package/dist/routes/pages/admin/core/CardPage.d.ts.map +1 -1
- package/dist/routes/pages/admin/core/CardPage.js +11 -0
- package/dist/routes/pages/admin/core/CardPage.js.map +1 -1
- package/dist/routes/pages/admin/core/CardPage.tsx +13 -0
- package/dist/routes/pages/admin/core/KanbanPage.d.ts.map +1 -1
- package/dist/routes/pages/admin/core/KanbanPage.js +11 -0
- package/dist/routes/pages/admin/core/KanbanPage.js.map +1 -1
- package/dist/routes/pages/admin/core/KanbanPage.tsx +13 -0
- package/dist/routes/pages/admin/core/ListPage.d.ts.map +1 -1
- package/dist/routes/pages/admin/core/ListPage.js +25 -2
- package/dist/routes/pages/admin/core/ListPage.js.map +1 -1
- package/dist/routes/pages/admin/core/ListPage.tsx +29 -2
- package/dist/routes/pages/admin/core/TreePage.d.ts.map +1 -1
- package/dist/routes/pages/admin/core/TreePage.js +10 -2
- package/dist/routes/pages/admin/core/TreePage.js.map +1 -1
- package/dist/routes/pages/admin/core/TreePage.tsx +11 -2
- package/package.json +1 -1
|
@@ -34,6 +34,7 @@ import { ERROR_MESSAGES } from "../../../constants/error-messages";
|
|
|
34
34
|
// import { SolidAiMainWrapper } from "../solid-ai/SolidAiMainWrapper"; // moved to SolidX Studio panel
|
|
35
35
|
import { showNavbar, toggleNavbar } from "../../../redux/features/navbarSlice";
|
|
36
36
|
import { normalizeSolidListTreeKanbanActionPath } from "../../../helpers/routePaths";
|
|
37
|
+
import { storeCurrentModelViewContext } from "../../../helpers/modelViewPersistence";
|
|
37
38
|
import { getMediaTypeFromUrl } from "../../../helpers/mediaType";
|
|
38
39
|
import { SolidListViewRowActionsMenu } from "./SolidListViewRowActionsMenu";
|
|
39
40
|
import { SolidHeaderRequestStatus } from "../../common/SolidHeaderRequestStatus";
|
|
@@ -56,6 +57,39 @@ const getRandomInt = (min: number, max: number) => {
|
|
|
56
57
|
return Math.floor(Math.random() * (max - min + 1)) + min;
|
|
57
58
|
};
|
|
58
59
|
|
|
60
|
+
const hasMeaningfulPersistedFilterValue = (value: any): boolean => {
|
|
61
|
+
if (value === null || value === undefined) return false;
|
|
62
|
+
if (typeof value === "string") return value.trim().length > 0;
|
|
63
|
+
if (typeof value === "number" || typeof value === "boolean") return true;
|
|
64
|
+
if (Array.isArray(value)) return value.some((item) => hasMeaningfulPersistedFilterValue(item));
|
|
65
|
+
if (typeof value === "object") return hasMeaningfulPersistedFilter(value);
|
|
66
|
+
return false;
|
|
67
|
+
};
|
|
68
|
+
|
|
69
|
+
export const hasMeaningfulPersistedFilter = (filterObject: any): boolean => {
|
|
70
|
+
if (!filterObject || typeof filterObject !== "object") return false;
|
|
71
|
+
|
|
72
|
+
if (Array.isArray(filterObject)) {
|
|
73
|
+
return filterObject.some((item) => hasMeaningfulPersistedFilter(item) || hasMeaningfulPersistedFilterValue(item));
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
return Object.entries(filterObject).some(([key, val]) => {
|
|
77
|
+
if (key === "matchMode" || key === "operator") return false;
|
|
78
|
+
if (key === "value") return hasMeaningfulPersistedFilterValue(val);
|
|
79
|
+
if ((key === "$and" || key === "$or") && Array.isArray(val)) {
|
|
80
|
+
return val.some((item) => hasMeaningfulPersistedFilter(item) || hasMeaningfulPersistedFilterValue(item));
|
|
81
|
+
}
|
|
82
|
+
if (typeof val === "object") return hasMeaningfulPersistedFilter(val);
|
|
83
|
+
return hasMeaningfulPersistedFilterValue(val);
|
|
84
|
+
});
|
|
85
|
+
};
|
|
86
|
+
|
|
87
|
+
export const hasStoredFilterPredicates = (queryObject: any): boolean =>
|
|
88
|
+
hasMeaningfulPersistedFilter(queryObject?.custom_filter_predicate) ||
|
|
89
|
+
hasMeaningfulPersistedFilter(queryObject?.search_predicate) ||
|
|
90
|
+
hasMeaningfulPersistedFilter(queryObject?.saved_filter_predicate) ||
|
|
91
|
+
hasMeaningfulPersistedFilter(queryObject?.predefined_search_predicate);
|
|
92
|
+
|
|
59
93
|
export const getFilterObjectFromLocalStorage = () => {
|
|
60
94
|
const currentPageUrl = window.location.pathname; // Get the current page URL
|
|
61
95
|
const encodedQueryString = localStorage.getItem(currentPageUrl); // Retrieve the encoded query string from local storage
|
|
@@ -209,6 +243,7 @@ export const SolidListView = forwardRef<SolidListViewHandle, SolidListViewParams
|
|
|
209
243
|
const [solidListViewMetaData, setSolidListViewMetaData] = useState<any>(null);
|
|
210
244
|
const [solidListViewLayout, setSolidListViewLayout] = useState<any>(null);
|
|
211
245
|
const [isDraftPublishWorkflowEnabled, setIsDraftPublishWorkflowEnabled] = useState(false);
|
|
246
|
+
const internationalisationEnabled = Boolean(solidListViewMetaData?.data?.solidView?.model?.internationalisation);
|
|
212
247
|
|
|
213
248
|
// Filter query realted states
|
|
214
249
|
const [filters, setFilters] = useState<any>(null);
|
|
@@ -265,6 +300,67 @@ export const SolidListView = forwardRef<SolidListViewHandle, SolidListViewParams
|
|
|
265
300
|
[editButtonUrl, pathname]
|
|
266
301
|
);
|
|
267
302
|
|
|
303
|
+
const resolveLocaleFromFilter = (filterNode: any): string | null => {
|
|
304
|
+
if (!filterNode || typeof filterNode !== "object") return null;
|
|
305
|
+
|
|
306
|
+
if (Array.isArray(filterNode)) {
|
|
307
|
+
for (const item of filterNode) {
|
|
308
|
+
const resolved = resolveLocaleFromFilter(item);
|
|
309
|
+
if (resolved) return resolved;
|
|
310
|
+
}
|
|
311
|
+
return null;
|
|
312
|
+
}
|
|
313
|
+
|
|
314
|
+
if (Object.prototype.hasOwnProperty.call(filterNode, "localeName")) {
|
|
315
|
+
const localeFilter = filterNode.localeName;
|
|
316
|
+
|
|
317
|
+
if (typeof localeFilter === "string") {
|
|
318
|
+
return localeFilter;
|
|
319
|
+
}
|
|
320
|
+
|
|
321
|
+
if (localeFilter && typeof localeFilter === "object") {
|
|
322
|
+
for (const key of ["$eqi", "$eq", "$in", "$containsi", "$contains"]) {
|
|
323
|
+
const localeValue = localeFilter[key];
|
|
324
|
+
if (typeof localeValue === "string" && localeValue.trim()) {
|
|
325
|
+
return localeValue;
|
|
326
|
+
}
|
|
327
|
+
if (Array.isArray(localeValue) && localeValue.length > 0) {
|
|
328
|
+
const firstValue = localeValue[0];
|
|
329
|
+
if (typeof firstValue === "string" && firstValue.trim()) {
|
|
330
|
+
return firstValue;
|
|
331
|
+
}
|
|
332
|
+
}
|
|
333
|
+
}
|
|
334
|
+
}
|
|
335
|
+
}
|
|
336
|
+
|
|
337
|
+
for (const value of Object.values(filterNode)) {
|
|
338
|
+
const resolved = resolveLocaleFromFilter(value);
|
|
339
|
+
if (resolved) return resolved;
|
|
340
|
+
}
|
|
341
|
+
|
|
342
|
+
return null;
|
|
343
|
+
};
|
|
344
|
+
|
|
345
|
+
const getResolvedListLocale = () => resolveLocaleFromFilter(latestFiltersRef.current) || localeName || null;
|
|
346
|
+
|
|
347
|
+
const buildEditNavigationQueryString = (rowData: any) => {
|
|
348
|
+
const queryParams = new URLSearchParams(editActionQueryParams);
|
|
349
|
+
if (internationalisationEnabled) {
|
|
350
|
+
const resolvedLocale = rowData?.localeName || getResolvedListLocale();
|
|
351
|
+
if (resolvedLocale) {
|
|
352
|
+
queryParams.set("locale", resolvedLocale);
|
|
353
|
+
}
|
|
354
|
+
|
|
355
|
+
const defaultEntityLocaleId = rowData?.defaultEntityLocaleId ?? rowData?.id;
|
|
356
|
+
if (defaultEntityLocaleId !== undefined && defaultEntityLocaleId !== null && defaultEntityLocaleId !== "") {
|
|
357
|
+
queryParams.set("defaultEntityLocaleId", String(defaultEntityLocaleId));
|
|
358
|
+
}
|
|
359
|
+
}
|
|
360
|
+
|
|
361
|
+
return queryParams.toString();
|
|
362
|
+
};
|
|
363
|
+
|
|
268
364
|
useEffect(() => {
|
|
269
365
|
const fetchPermissions = async () => {
|
|
270
366
|
if (params.modelName) {
|
|
@@ -446,12 +542,14 @@ export const SolidListView = forwardRef<SolidListViewHandle, SolidListViewParams
|
|
|
446
542
|
const listLayoutAttrs = solidListViewLayout.attrs;
|
|
447
543
|
const createActionUrl = listLayoutAttrs?.createAction && listLayoutAttrs?.createAction?.type === "custom" ? listLayoutAttrs?.createAction?.customComponent : "form/new";
|
|
448
544
|
const editActionUrl = listLayoutAttrs?.editAction && listLayoutAttrs?.editAction?.type === "custom" ? listLayoutAttrs?.editAction?.customComponent : "form";
|
|
545
|
+
const resolvedListLocale = getResolvedListLocale();
|
|
449
546
|
|
|
450
547
|
if (listLayoutAttrs?.createAction) {
|
|
451
548
|
setCreateActionQueryParams({
|
|
452
549
|
actionName: listLayoutAttrs.createAction.name,
|
|
453
550
|
actionType: listLayoutAttrs.createAction.type,
|
|
454
551
|
actionContext: listLayoutAttrs.createAction.context,
|
|
552
|
+
...(internationalisationEnabled && resolvedListLocale ? { locale: resolvedListLocale } : {}),
|
|
455
553
|
});
|
|
456
554
|
}
|
|
457
555
|
if (listLayoutAttrs?.editAction) {
|
|
@@ -459,6 +557,7 @@ export const SolidListView = forwardRef<SolidListViewHandle, SolidListViewParams
|
|
|
459
557
|
actionName: listLayoutAttrs.editAction.name,
|
|
460
558
|
actionType: listLayoutAttrs.editAction.type,
|
|
461
559
|
actionContext: listLayoutAttrs.editAction.context,
|
|
560
|
+
...(internationalisationEnabled && resolvedListLocale ? { locale: resolvedListLocale } : {}),
|
|
462
561
|
});
|
|
463
562
|
}
|
|
464
563
|
|
|
@@ -598,6 +697,7 @@ export const SolidListView = forwardRef<SolidListViewHandle, SolidListViewParams
|
|
|
598
697
|
}
|
|
599
698
|
setSortField(restoredSortField);
|
|
600
699
|
setSortOrder(restoredSortOrder);
|
|
700
|
+
setShowArchived(queryObject.showArchived === true || queryObject.showArchived === "true" || queryObject.showSoftDeleted === "inclusive");
|
|
601
701
|
const { populate, populateMedia } = initialFilterMethod();
|
|
602
702
|
setToPopulate(populate);
|
|
603
703
|
setToPopulateMedia(populateMedia);
|
|
@@ -609,6 +709,7 @@ export const SolidListView = forwardRef<SolidListViewHandle, SolidListViewParams
|
|
|
609
709
|
setToPopulate(populate);
|
|
610
710
|
setToPopulateMedia(populateMedia);
|
|
611
711
|
setFirst(0);
|
|
712
|
+
setShowArchived(false);
|
|
612
713
|
}
|
|
613
714
|
//below line was added to handle state stale issue when we converted boilerplate to vite
|
|
614
715
|
//since now we dont need it becuase our component is remounted on every router change
|
|
@@ -767,6 +868,7 @@ export const SolidListView = forwardRef<SolidListViewHandle, SolidListViewParams
|
|
|
767
868
|
const setQueryString = async () => {
|
|
768
869
|
const solidFieldsMetadata =
|
|
769
870
|
solidListViewMetaData?.data?.solidFieldsMetadata;
|
|
871
|
+
const explicitLocale = resolveLocaleFromFilter(latestFiltersRef.current);
|
|
770
872
|
|
|
771
873
|
let queryData: any = {
|
|
772
874
|
offset: first,
|
|
@@ -774,9 +876,13 @@ export const SolidListView = forwardRef<SolidListViewHandle, SolidListViewParams
|
|
|
774
876
|
filters: latestFiltersRef.current ?? latestFiltersRef.current,
|
|
775
877
|
populate: toPopulate,
|
|
776
878
|
populateMedia: toPopulateMedia,
|
|
777
|
-
locale: localeName ? localeName : "en",
|
|
778
879
|
};
|
|
779
880
|
|
|
881
|
+
const resolvedLocale = explicitLocale || localeName;
|
|
882
|
+
if (resolvedLocale) {
|
|
883
|
+
queryData.locale = resolvedLocale;
|
|
884
|
+
}
|
|
885
|
+
|
|
780
886
|
|
|
781
887
|
|
|
782
888
|
const currentSortField = latestSortFieldRef.current;
|
|
@@ -954,6 +1060,7 @@ export const SolidListView = forwardRef<SolidListViewHandle, SolidListViewParams
|
|
|
954
1060
|
setToPopulate(populate);
|
|
955
1061
|
setToPopulateMedia(populateMedia);
|
|
956
1062
|
}
|
|
1063
|
+
setFirst(0);
|
|
957
1064
|
latestFiltersRef.current = {
|
|
958
1065
|
$and: []
|
|
959
1066
|
};
|
|
@@ -1263,6 +1370,11 @@ export const SolidListView = forwardRef<SolidListViewHandle, SolidListViewParams
|
|
|
1263
1370
|
// }
|
|
1264
1371
|
|
|
1265
1372
|
const handleFetchUpdatedRecords = () => {
|
|
1373
|
+
if (hasAnyActiveFilters) {
|
|
1374
|
+
clearFilter();
|
|
1375
|
+
return;
|
|
1376
|
+
}
|
|
1377
|
+
|
|
1266
1378
|
setQueryString();
|
|
1267
1379
|
};
|
|
1268
1380
|
|
|
@@ -1438,7 +1550,7 @@ export const SolidListView = forwardRef<SolidListViewHandle, SolidListViewParams
|
|
|
1438
1550
|
leftIcon={<RefreshCw size={14} />}
|
|
1439
1551
|
/>
|
|
1440
1552
|
)}
|
|
1441
|
-
{showArchived && (
|
|
1553
|
+
{showArchived && selectedRecoverRecords.length > 0 && (
|
|
1442
1554
|
<SolidButton
|
|
1443
1555
|
type="button"
|
|
1444
1556
|
size="small"
|
|
@@ -1476,7 +1588,7 @@ export const SolidListView = forwardRef<SolidListViewHandle, SolidListViewParams
|
|
|
1476
1588
|
</div>
|
|
1477
1589
|
</div>
|
|
1478
1590
|
{/* </div> */}
|
|
1479
|
-
{showGlobalSearchElement && params.embeded === false && (
|
|
1591
|
+
{showGlobalSearchElement && params.embeded === false && window.innerWidth < 991 && (
|
|
1480
1592
|
<div className="flex lg:hidden">
|
|
1481
1593
|
<SolidGlobalSearchElement
|
|
1482
1594
|
viewType="list"
|
|
@@ -1560,6 +1672,7 @@ export const SolidListView = forwardRef<SolidListViewHandle, SolidListViewParams
|
|
|
1560
1672
|
const rowData = e.data;
|
|
1561
1673
|
|
|
1562
1674
|
if (solidListViewLayout?.attrs?.disableRowClick === true) return;
|
|
1675
|
+
if (rowData?.deletedAt) return;
|
|
1563
1676
|
|
|
1564
1677
|
const hasFindPermission = actionsAllowed.includes(
|
|
1565
1678
|
permissionExpression(params.modelName, 'findOne')
|
|
@@ -1573,18 +1686,8 @@ export const SolidListView = forwardRef<SolidListViewHandle, SolidListViewParams
|
|
|
1573
1686
|
if (params.embeded === true) {
|
|
1574
1687
|
params.handleEditClickForEmbeddedView(rowData?.id);
|
|
1575
1688
|
} else {
|
|
1576
|
-
|
|
1577
|
-
|
|
1578
|
-
|
|
1579
|
-
// also store the full current URL so Back can restore exact state (including action params)
|
|
1580
|
-
try {
|
|
1581
|
-
sessionStorage.setItem("fromView", "list");
|
|
1582
|
-
sessionStorage.setItem("fromViewUrl", window.location.pathname + window.location.search);
|
|
1583
|
-
} catch (e) {
|
|
1584
|
-
// ignore storage errors
|
|
1585
|
-
}
|
|
1586
|
-
}
|
|
1587
|
-
router.push(`${editBaseUrl}/${rowData?.id}?viewMode=view&${new URLSearchParams(editActionQueryParams).toString()}`);
|
|
1689
|
+
storeCurrentModelViewContext();
|
|
1690
|
+
router.push(`${editBaseUrl}/${rowData?.id}?viewMode=view&${buildEditNavigationQueryString(rowData)}`);
|
|
1588
1691
|
}
|
|
1589
1692
|
}
|
|
1590
1693
|
}
|
|
@@ -1680,14 +1783,9 @@ export const SolidListView = forwardRef<SolidListViewHandle, SolidListViewParams
|
|
|
1680
1783
|
if (params.embeded == true) {
|
|
1681
1784
|
params.handleEditClickForEmbeddedView(rowData?.id);
|
|
1682
1785
|
} else {
|
|
1683
|
-
|
|
1684
|
-
try {
|
|
1685
|
-
sessionStorage.setItem("fromView", "list");
|
|
1686
|
-
sessionStorage.setItem("fromViewUrl", window.location.pathname + window.location.search);
|
|
1687
|
-
} catch (e) { }
|
|
1688
|
-
}
|
|
1786
|
+
storeCurrentModelViewContext();
|
|
1689
1787
|
router.push(
|
|
1690
|
-
`${editBaseUrl}/${rowData?.id}?viewMode=edit&${
|
|
1788
|
+
`${editBaseUrl}/${rowData?.id}?viewMode=edit&${buildEditNavigationQueryString(rowData)}`
|
|
1691
1789
|
);
|
|
1692
1790
|
}
|
|
1693
1791
|
}}
|
|
@@ -1744,15 +1842,17 @@ export const SolidListView = forwardRef<SolidListViewHandle, SolidListViewParams
|
|
|
1744
1842
|
alignFrozen="right"
|
|
1745
1843
|
body={(rowData) =>
|
|
1746
1844
|
rowData?.deletedAt ? (
|
|
1747
|
-
<
|
|
1748
|
-
|
|
1749
|
-
event
|
|
1750
|
-
|
|
1751
|
-
|
|
1752
|
-
|
|
1753
|
-
|
|
1754
|
-
|
|
1755
|
-
|
|
1845
|
+
<div className="flex justify-content-center align-items-center" data-no-row-click="true">
|
|
1846
|
+
<a
|
|
1847
|
+
onClick={(event) => {
|
|
1848
|
+
event.stopPropagation();
|
|
1849
|
+
recoverById(rowData.id);
|
|
1850
|
+
}}
|
|
1851
|
+
className="retrieve-button solid-row-menu-trigger"
|
|
1852
|
+
>
|
|
1853
|
+
<RotateCcw size={14} className={styles.retrieveIcon} />
|
|
1854
|
+
</a>
|
|
1855
|
+
</div>
|
|
1756
1856
|
) : (
|
|
1757
1857
|
<>
|
|
1758
1858
|
{solidListViewLayout?.attrs?.showRowContextMenu !==
|
|
@@ -1776,12 +1876,9 @@ export const SolidListView = forwardRef<SolidListViewHandle, SolidListViewParams
|
|
|
1776
1876
|
if (params.embeded == true) {
|
|
1777
1877
|
params.handleEditClickForEmbeddedView(selectedRow?.id);
|
|
1778
1878
|
} else {
|
|
1779
|
-
|
|
1780
|
-
sessionStorage.setItem("fromView", "list");
|
|
1781
|
-
sessionStorage.setItem("fromViewUrl", window.location.pathname + window.location.search);
|
|
1782
|
-
} catch (e) { }
|
|
1879
|
+
storeCurrentModelViewContext();
|
|
1783
1880
|
router.push(
|
|
1784
|
-
`${editBaseUrl}/${selectedRow?.id}?viewMode=edit&${
|
|
1881
|
+
`${editBaseUrl}/${selectedRow?.id}?viewMode=edit&${buildEditNavigationQueryString(selectedRow)}`
|
|
1785
1882
|
);
|
|
1786
1883
|
}
|
|
1787
1884
|
}}
|
|
@@ -1862,9 +1959,9 @@ export const SolidListView = forwardRef<SolidListViewHandle, SolidListViewParams
|
|
|
1862
1959
|
</SolidDialogHeader>
|
|
1863
1960
|
<SolidDialogSeparator />
|
|
1864
1961
|
<SolidDialogBody>
|
|
1865
|
-
|
|
1866
|
-
|
|
1867
|
-
|
|
1962
|
+
<ListViewRowActionPopup
|
|
1963
|
+
context={listViewRowActionData}
|
|
1964
|
+
></ListViewRowActionPopup>
|
|
1868
1965
|
</SolidDialogBody>
|
|
1869
1966
|
</SolidDialog>
|
|
1870
1967
|
)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SolidListViewConfigure.d.ts","sourceRoot":"","sources":["../../../../src/components/core/list/SolidListViewConfigure.tsx"],"names":[],"mappings":"AAUA,OAAO,+BAA+B,CAAC;
|
|
1
|
+
{"version":3,"file":"SolidListViewConfigure.d.ts","sourceRoot":"","sources":["../../../../src/components/core/list/SolidListViewConfigure.tsx"],"names":[],"mappings":"AAUA,OAAO,+BAA+B,CAAC;AA6BvC,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,4CAyVV,CAAA"}
|
|
@@ -14,6 +14,7 @@ import { SolidGenericImport } from "../common/SolidGenericImport/SolidGenericImp
|
|
|
14
14
|
import { hasAnyRole } from "../../../helpers/rolesHelper";
|
|
15
15
|
import { capitalize } from "lodash";
|
|
16
16
|
import { Cog, Download, RefreshCw, Save, SlidersHorizontal, Table, Trash2, Upload } from "lucide-react";
|
|
17
|
+
import { storeCurrentModelViewContext } from "../../../helpers/modelViewPersistence";
|
|
17
18
|
import { SolidDialog, SolidDialogBody, SolidDialogClose, SolidDialogDescription, SolidDialogHeader, SolidDialogSeparator, SolidDialogTitle, SolidDropdownMenu, SolidDropdownMenuCheckboxItem, SolidDropdownMenuContent, SolidDropdownMenuItem, SolidDropdownMenuLabel, SolidDropdownMenuRadioGroup, SolidDropdownMenuRadioItem, SolidDropdownMenuSeparator, SolidDropdownMenuSub, SolidDropdownMenuSubContent, SolidDropdownMenuSubTrigger, SolidDropdownMenuTrigger, } from "../../shad-cn-ui";
|
|
18
19
|
export var SolidListViewConfigure = function (_a) {
|
|
19
20
|
var _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x;
|
|
@@ -33,6 +34,7 @@ export var SolidListViewConfigure = function (_a) {
|
|
|
33
34
|
var pathSegments = pathname.split('/').filter(Boolean);
|
|
34
35
|
pathSegments[pathSegments.length - 1] = newView.type; // Replace the last part with new view
|
|
35
36
|
var newPath = '/' + pathSegments.join('/') + "?menuItemId=".concat(newView.menuItemId, "&menuItemName=").concat(newView.menuItemName, "&actionId=").concat(newView.actionId, "&actionName=").concat(newView.actionName);
|
|
37
|
+
storeCurrentModelViewContext(newPath);
|
|
36
38
|
router.push(newPath);
|
|
37
39
|
};
|
|
38
40
|
useEffect(function () {
|
|
@@ -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,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAC;AACzD,OAAO,EAAE,SAAS,EAAE,MAAM,0BAA0B,CAAC;AACrD,OAAO,EAAE,SAAS,EAAU,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,8BAA8B,EAAE,MAAM,2DAA2D,CAAC;AAC3G,OAAO,EAAE,oCAAoC,EAAE,MAAM,wCAAwC,CAAC;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BAAkB,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 { usePathname } from \"../../../hooks/usePathname\";\nimport { useRouter } from \"../../../hooks/useRouter\";\nimport { useEffect, useRef, useState } from \"react\";\nimport { SolidListColumnSelector } from \"./SolidColumnSelector/SolidListColumnSelector\";\nimport { SolidExport } from \"../../../components/common/SolidExport\";\nimport { useHandleListCustomButtonClick } from \"../../../components/common/useHandleListCustomButtonClick\";\nimport { SolidListViewHeaderContextMenuButton } from \"./SolidListViewHeaderContextMenuButton\";\nimport { isButtonVisibleInCurrentEnv } from \"../../../helpers/buttonEnvironment\";\nimport \"../../common/solid-export.css\";\nimport { SolidGenericImport } from \"../common/SolidGenericImport/SolidGenericImport\";\nimport { hasAnyRole } from \"../../../helpers/rolesHelper\";\nimport { SolidListViewHeaderButton } from \"./SolidListViewHeaderButton\";\nimport { capitalize } from \"lodash\";\nimport { Cog, Download, RefreshCw, Save, SlidersHorizontal, Table, Trash2, Upload } from \"lucide-react\";\nimport {\n SolidDialog,\n SolidDialogBody,\n SolidDialogClose,\n SolidDialogDescription,\n SolidDialogHeader,\n SolidDialogSeparator,\n SolidDialogTitle,\n SolidDropdownMenu,\n SolidDropdownMenuCheckboxItem,\n SolidDropdownMenuContent,\n SolidDropdownMenuItem,\n SolidDropdownMenuLabel,\n SolidDropdownMenuRadioGroup,\n SolidDropdownMenuRadioItem,\n SolidDropdownMenuSeparator,\n SolidDropdownMenuSub,\n SolidDropdownMenuSubContent,\n SolidDropdownMenuSubTrigger,\n SolidDropdownMenuTrigger,\n} from \"../../shad-cn-ui\";\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 pathname = usePathname();\n const router = useRouter();\n const [view, setView] = useState<string>(\"\");\n const [exportView, setExportView] = useState<boolean>(false);\n const [isCogMenuOpen, setIsCogMenuOpen] = useState(false);\n const [showColumnSelectorDialog, setShowColumnSelectorDialog] = useState(false);\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 //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 const visibleViewModes = (() => {\n if (!Array.isArray(viewModes)) return [];\n\n const uniqueByType = new Map<string, ViewMode>();\n const currentActionId = String(params?.actionId ?? \"\");\n const currentMenuItemId = String(params?.menuItemId ?? \"\");\n\n for (const mode of viewModes) {\n if (!mode || typeof mode.type !== \"string\") continue;\n\n const existing = uniqueByType.get(mode.type);\n if (!existing) {\n uniqueByType.set(mode.type, mode);\n continue;\n }\n\n const modeActionId = String(mode.actionId ?? \"\");\n const modeMenuItemId = String(mode.menuItemId ?? \"\");\n const existingActionId = String(existing.actionId ?? \"\");\n const existingMenuItemId = String(existing.menuItemId ?? \"\");\n\n const modeIsCurrent = (currentActionId && modeActionId === currentActionId) ||\n (currentMenuItemId && modeMenuItemId === currentMenuItemId);\n const existingIsCurrent = (currentActionId && existingActionId === currentActionId) ||\n (currentMenuItemId && existingMenuItemId === currentMenuItemId);\n\n if (modeIsCurrent && !existingIsCurrent) {\n uniqueByType.set(mode.type, mode);\n }\n }\n\n return Array.from(uniqueByType.values());\n })();\n const showSwitchType = visibleViewModes.length > 0;\n const handleViewTypeChange = (nextType: string) => {\n const nextView = visibleViewModes.find((option: ViewMode) => option.type === nextType);\n if (nextView) {\n handleViewChange(nextView);\n }\n };\n\n return (\n <div className=\"position-relative\">\n <SolidDropdownMenu open={isCogMenuOpen} onOpenChange={setIsCogMenuOpen}>\n <SolidDropdownMenuTrigger asChild>\n <button\n type=\"button\"\n className=\"solid-icon-button solid-header-cog-trigger\"\n aria-label=\"Open list options\"\n >\n <Cog size={16} />\n </button>\n </SolidDropdownMenuTrigger>\n <SolidDropdownMenuContent 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 && isButtonVisibleInCurrentEnv(rb?.attrs))) ||\n viewData?.data?.solidView?.model?.enableSoftDelete\n ) && (\n <>\n {actionsAllowed.includes(`${permissionExpression(params.modelName, 'deleteMany')}`) && viewData?.data?.solidView?.layout?.attrs?.delete !== false && selectedRecords.length > 0 && (\n <SolidDropdownMenuItem\n className=\"solid-header-dropdown-item solid-header-dropdown-item-danger\"\n onSelect={() => {\n setDialogVisible(true);\n setIsCogMenuOpen(false);\n }}\n >\n <Trash2 size={14} className=\"solid-header-action-button-icon\" />\n <span className=\"solid-header-action-button-label\">Delete</span>\n </SolidDropdownMenuItem>\n )}\n {isHeaderActionEnabled(\"import\") && actionsAllowed.includes(`${permissionExpression(params.modelName, 'create')}`) && actionsAllowed.includes(`${permissionExpression('importTransaction', 'create')}`) && (\n <SolidDropdownMenuItem\n className=\"solid-header-dropdown-item\"\n onSelect={() => {\n setOpenImportDialog(true);\n setIsCogMenuOpen(false);\n }}\n >\n <Download size={14} className=\"solid-header-action-button-icon\" />\n <span className=\"solid-header-action-button-label\">Import</span>\n </SolidDropdownMenuItem>\n )}\n {isHeaderActionEnabled(\"export\") && actionsAllowed.includes(`${permissionExpression(params.modelName, 'findMany')}`) && actionsAllowed.includes(`${permissionExpression('exportTransaction', 'create')}`) && (\n <SolidDropdownMenuItem\n className=\"solid-header-dropdown-item\"\n onSelect={() => {\n setExportView((current) => !current);\n setIsCogMenuOpen(false);\n }}\n >\n <Upload size={14} className=\"solid-header-action-button-icon\" />\n <span className=\"solid-header-action-button-label\">Export</span>\n </SolidDropdownMenuItem>\n )}\n {solidListViewLayout?.attrs?.headerButtons\n ?.filter((rb: any) => isButtonVisibleInCurrentEnv(rb?.attrs))\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 onActionComplete={() => setIsCogMenuOpen(false)}\n />\n ))}\n {viewData?.data?.solidView?.model?.enableSoftDelete && (\n <SolidDropdownMenuCheckboxItem\n checked={showArchived}\n onCheckedChange={() => setShowArchived(!showArchived)}\n >\n Show Archived Records\n </SolidDropdownMenuCheckboxItem>\n )}\n {showArchived && (\n <SolidDropdownMenuItem\n className=\"solid-header-dropdown-item lg:hidden\"\n onSelect={() => {\n setRecoverDialogVisible(true);\n setIsCogMenuOpen(false);\n }}\n >\n <RefreshCw size={14} className=\"solid-header-action-button-icon\" />\n <span className=\"solid-header-action-button-label\">Recover</span>\n </SolidDropdownMenuItem>\n )}\n\n {(\n isHeaderActionEnabled('customizeLayout') && actionsAllowed.includes(`${permissionExpression('userViewMetadata', 'create')}`) ||\n isHeaderActionEnabled('savedFilters') && actionsAllowed.includes(`${permissionExpression('savedFilters', 'create')}`) ||\n true\n ) && <SolidDropdownMenuSeparator />}\n\n {isHeaderActionEnabled('customizeLayout') && actionsAllowed.includes(`${permissionExpression('userViewMetadata', 'create')}`) && (\n <SolidDropdownMenuSub>\n <SolidDropdownMenuSubTrigger className=\"solid-header-dropdown-item\">\n <SlidersHorizontal size={14} className=\"solid-header-action-button-icon\" />\n <span className=\"solid-header-action-button-label\">Layout</span>\n </SolidDropdownMenuSubTrigger>\n <SolidDropdownMenuSubContent className=\"customize-layout-panel\">\n {showSwitchType && (\n <>\n <SolidDropdownMenuLabel>Switch Type</SolidDropdownMenuLabel>\n <SolidDropdownMenuRadioGroup value={view} onValueChange={handleViewTypeChange}>\n {visibleViewModes.map((option: ViewMode) => (\n <SolidDropdownMenuRadioItem key={option.type} value={option.type}>\n {capitalize(option.type)}\n </SolidDropdownMenuRadioItem>\n ))}\n </SolidDropdownMenuRadioGroup>\n <SolidDropdownMenuSeparator />\n </>\n )}\n <SolidDropdownMenuLabel>Row Spacing</SolidDropdownMenuLabel>\n <SolidDropdownMenuRadioGroup value={size} onValueChange={(value: string) => setSize(value)}>\n {sizeOptions.map((option: any) => (\n <SolidDropdownMenuRadioItem key={option.value} value={option.value}>\n {option.label}\n </SolidDropdownMenuRadioItem>\n ))}\n </SolidDropdownMenuRadioGroup>\n <SolidDropdownMenuSeparator />\n <SolidDropdownMenuItem\n onSelect={() => {\n setShowColumnSelectorDialog(true);\n setIsCogMenuOpen(false);\n }}\n >\n <Table size={14} className=\"solid-header-action-button-icon\" />\n <span className=\"solid-header-action-button-label\">Column Selector</span>\n </SolidDropdownMenuItem>\n </SolidDropdownMenuSubContent>\n </SolidDropdownMenuSub>\n )}\n {isHeaderActionEnabled('savedFilters') && actionsAllowed.includes(`${permissionExpression('savedFilters', 'create')}`) && (\n <SolidDropdownMenuItem\n className=\"solid-header-dropdown-item\"\n onSelect={() => {\n setShowSaveFilterPopup(true);\n setIsCogMenuOpen(false);\n }}\n >\n <Save size={14} className=\"solid-header-action-button-icon\" />\n <span className=\"solid-header-action-button-label\">Save Custom Filter</span>\n </SolidDropdownMenuItem>\n )}\n <SolidDropdownMenuItem\n className=\"solid-header-dropdown-item\"\n onSelect={() => {\n clearLocalstorageCache();\n setIsCogMenuOpen(false);\n }}\n >\n <Trash2 size={14} className=\"solid-header-action-button-icon\" />\n <span className=\"solid-header-action-button-label\">Reset View</span>\n </SolidDropdownMenuItem>\n </>\n )}\n </SolidDropdownMenuContent>\n </SolidDropdownMenu>\n <SolidDialog\n open={exportView}\n onOpenChange={setExportView}\n className=\"solid-kanban-export-dialog solid-list-export-dialog\"\n style={{ width: \"min(980px, calc(100vw - 32px))\" }}\n >\n <SolidDialogHeader className=\"solid-export-dialog-header\">\n <div>\n <SolidDialogTitle>Export</SolidDialogTitle>\n <SolidDialogDescription className=\"solid-filter-dialog-subtitle m-0\">\n Choose the file format, refine the field set, and save reusable export templates.\n </SolidDialogDescription>\n </div>\n <SolidDialogClose />\n </SolidDialogHeader>\n <SolidDialogSeparator />\n <SolidDialogBody className=\"solid-kanban-export-dialog-body\">\n <SolidExport\n listViewMetaData={listViewMetaData}\n filters={filters}\n onExportComplete={() => setExportView(false)}\n />\n </SolidDialogBody>\n </SolidDialog>\n <SolidDialog\n open={showColumnSelectorDialog}\n onOpenChange={setShowColumnSelectorDialog}\n className=\"solid-column-selector-dialog\"\n style={{ width: \"min(388px, calc(100vw - 2rem))\" }}\n >\n <SolidDialogHeader className=\"solid-filter-dialog-head\">\n <div>\n <SolidDialogTitle className=\"solid-filter-dialog-title m-0\">Column Selector</SolidDialogTitle>\n <SolidDialogDescription className=\"solid-filter-dialog-subtitle m-0\">\n Choose visible columns and reorder them for this list view.\n </SolidDialogDescription>\n </div>\n <SolidDialogClose className=\"solid-filter-dialog-close\" />\n </SolidDialogHeader>\n <SolidDialogSeparator className=\"solid-filter-dialog-sep\" />\n <SolidDialogBody className=\"solid-filter-dialog-body\">\n <SolidListColumnSelector\n listViewMetaData={listViewMetaData}\n onClose={() => setShowColumnSelectorDialog(false)}\n />\n </SolidDialogBody>\n </SolidDialog>\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":[],"mappings":";AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,2BAA2B,CAAC;AACvD,OAAO,EAAE,oBAAoB,EAAE,MAAM,8BAA8B,CAAC;AACpE,OAAO,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAC;AACzD,OAAO,EAAE,SAAS,EAAE,MAAM,0BAA0B,CAAC;AACrD,OAAO,EAAE,SAAS,EAAU,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,8BAA8B,EAAE,MAAM,2DAA2D,CAAC;AAC3G,OAAO,EAAE,oCAAoC,EAAE,MAAM,wCAAwC,CAAC;AAC9F,OAAO,EAAE,2BAA2B,EAAE,MAAM,oCAAoC,CAAC;AACjF,OAAO,+BAA+B,CAAC;AACvC,OAAO,EAAE,kBAAkB,EAAE,MAAM,iDAAiD,CAAC;AACrF,OAAO,EAAE,UAAU,EAAE,MAAM,8BAA8B,CAAC;AAE1D,OAAO,EAAE,UAAU,EAAE,MAAM,QAAQ,CAAC;AACpC,OAAO,EAAE,GAAG,EAAE,QAAQ,EAAE,SAAS,EAAE,IAAI,EAAE,iBAAiB,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AACxG,OAAO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AsB,IAAC,SAAS,EAAC,kCAAkC,kGAE3C,IACvB,EACN,KAAC,gBAAgB,KAAG,IACJ,EACpB,KAAC,oBAAoB,KAAG,EACxB,KAAC,eAAe,IAAC,SAAS,EAAC,iCAAiC,YACxD,KAAC,WAAW,IACR,gBAAgB,EAAE,gBAAgB,EAClC,OAAO,EAAE,OAAO,EAChB,gBAAgB,EAAE,cAAM,OAAA,aAAa,CAAC,KAAK,CAAC,EAApB,CAAoB,GAC9C,GACY,IACR,EACd,MAAC,WAAW,IACR,IAAI,EAAE,wBAAwB,EAC9B,YAAY,EAAE,2BAA2B,EACzC,SAAS,EAAC,8BAA8B,EACxC,KAAK,EAAE,EAAE,KAAK,EAAE,gCAAgC,EAAE,aAElD,MAAC,iBAAiB,IAAC,SAAS,EAAC,0BAA0B,aACnD,0BACI,KAAC,gBAAgB,IAAC,SAAS,EAAC,+BAA+B,gCAAmC,EAC9F,KAAC,sBAAsB,IAAC,SAAS,EAAC,kCAAkC,4EAE3C,IACvB,EACN,KAAC,gBAAgB,IAAC,SAAS,EAAC,2BAA2B,GAAG,IAC1C,EACpB,KAAC,oBAAoB,IAAC,SAAS,EAAC,yBAAyB,GAAG,EAC5D,KAAC,eAAe,IAAC,SAAS,EAAC,0BAA0B,YACjD,KAAC,uBAAuB,IACpB,gBAAgB,EAAE,gBAAgB,EAClC,OAAO,EAAE,cAAM,OAAA,2BAA2B,CAAC,KAAK,CAAC,EAAlC,CAAkC,GACnD,GACY,IACR,EACb,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 { usePathname } from \"../../../hooks/usePathname\";\nimport { useRouter } from \"../../../hooks/useRouter\";\nimport { useEffect, useRef, useState } from \"react\";\nimport { SolidListColumnSelector } from \"./SolidColumnSelector/SolidListColumnSelector\";\nimport { SolidExport } from \"../../../components/common/SolidExport\";\nimport { useHandleListCustomButtonClick } from \"../../../components/common/useHandleListCustomButtonClick\";\nimport { SolidListViewHeaderContextMenuButton } from \"./SolidListViewHeaderContextMenuButton\";\nimport { isButtonVisibleInCurrentEnv } from \"../../../helpers/buttonEnvironment\";\nimport \"../../common/solid-export.css\";\nimport { SolidGenericImport } from \"../common/SolidGenericImport/SolidGenericImport\";\nimport { hasAnyRole } from \"../../../helpers/rolesHelper\";\nimport { SolidListViewHeaderButton } from \"./SolidListViewHeaderButton\";\nimport { capitalize } from \"lodash\";\nimport { Cog, Download, RefreshCw, Save, SlidersHorizontal, Table, Trash2, Upload } from \"lucide-react\";\nimport { storeCurrentModelViewContext } from \"../../../helpers/modelViewPersistence\";\nimport {\n SolidDialog,\n SolidDialogBody,\n SolidDialogClose,\n SolidDialogDescription,\n SolidDialogHeader,\n SolidDialogSeparator,\n SolidDialogTitle,\n SolidDropdownMenu,\n SolidDropdownMenuCheckboxItem,\n SolidDropdownMenuContent,\n SolidDropdownMenuItem,\n SolidDropdownMenuLabel,\n SolidDropdownMenuRadioGroup,\n SolidDropdownMenuRadioItem,\n SolidDropdownMenuSeparator,\n SolidDropdownMenuSub,\n SolidDropdownMenuSubContent,\n SolidDropdownMenuSubTrigger,\n SolidDropdownMenuTrigger,\n} from \"../../shad-cn-ui\";\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 pathname = usePathname();\n const router = useRouter();\n const [view, setView] = useState<string>(\"\");\n const [exportView, setExportView] = useState<boolean>(false);\n const [isCogMenuOpen, setIsCogMenuOpen] = useState(false);\n const [showColumnSelectorDialog, setShowColumnSelectorDialog] = useState(false);\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 storeCurrentModelViewContext(newPath);\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 //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 const visibleViewModes = (() => {\n if (!Array.isArray(viewModes)) return [];\n\n const uniqueByType = new Map<string, ViewMode>();\n const currentActionId = String(params?.actionId ?? \"\");\n const currentMenuItemId = String(params?.menuItemId ?? \"\");\n\n for (const mode of viewModes) {\n if (!mode || typeof mode.type !== \"string\") continue;\n\n const existing = uniqueByType.get(mode.type);\n if (!existing) {\n uniqueByType.set(mode.type, mode);\n continue;\n }\n\n const modeActionId = String(mode.actionId ?? \"\");\n const modeMenuItemId = String(mode.menuItemId ?? \"\");\n const existingActionId = String(existing.actionId ?? \"\");\n const existingMenuItemId = String(existing.menuItemId ?? \"\");\n\n const modeIsCurrent = (currentActionId && modeActionId === currentActionId) ||\n (currentMenuItemId && modeMenuItemId === currentMenuItemId);\n const existingIsCurrent = (currentActionId && existingActionId === currentActionId) ||\n (currentMenuItemId && existingMenuItemId === currentMenuItemId);\n\n if (modeIsCurrent && !existingIsCurrent) {\n uniqueByType.set(mode.type, mode);\n }\n }\n\n return Array.from(uniqueByType.values());\n })();\n const showSwitchType = visibleViewModes.length > 0;\n const handleViewTypeChange = (nextType: string) => {\n const nextView = visibleViewModes.find((option: ViewMode) => option.type === nextType);\n if (nextView) {\n handleViewChange(nextView);\n }\n };\n\n return (\n <div className=\"position-relative\">\n <SolidDropdownMenu open={isCogMenuOpen} onOpenChange={setIsCogMenuOpen}>\n <SolidDropdownMenuTrigger asChild>\n <button\n type=\"button\"\n className=\"solid-icon-button solid-header-cog-trigger\"\n aria-label=\"Open list options\"\n >\n <Cog size={16} />\n </button>\n </SolidDropdownMenuTrigger>\n <SolidDropdownMenuContent 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 && isButtonVisibleInCurrentEnv(rb?.attrs))) ||\n viewData?.data?.solidView?.model?.enableSoftDelete\n ) && (\n <>\n {actionsAllowed.includes(`${permissionExpression(params.modelName, 'deleteMany')}`) && viewData?.data?.solidView?.layout?.attrs?.delete !== false && selectedRecords.length > 0 && (\n <SolidDropdownMenuItem\n className=\"solid-header-dropdown-item solid-header-dropdown-item-danger\"\n onSelect={() => {\n setDialogVisible(true);\n setIsCogMenuOpen(false);\n }}\n >\n <Trash2 size={14} className=\"solid-header-action-button-icon\" />\n <span className=\"solid-header-action-button-label\">Delete</span>\n </SolidDropdownMenuItem>\n )}\n {isHeaderActionEnabled(\"import\") && actionsAllowed.includes(`${permissionExpression(params.modelName, 'create')}`) && actionsAllowed.includes(`${permissionExpression('importTransaction', 'create')}`) && (\n <SolidDropdownMenuItem\n className=\"solid-header-dropdown-item\"\n onSelect={() => {\n setOpenImportDialog(true);\n setIsCogMenuOpen(false);\n }}\n >\n <Download size={14} className=\"solid-header-action-button-icon\" />\n <span className=\"solid-header-action-button-label\">Import</span>\n </SolidDropdownMenuItem>\n )}\n {isHeaderActionEnabled(\"export\") && actionsAllowed.includes(`${permissionExpression(params.modelName, 'findMany')}`) && actionsAllowed.includes(`${permissionExpression('exportTransaction', 'create')}`) && (\n <SolidDropdownMenuItem\n className=\"solid-header-dropdown-item\"\n onSelect={() => {\n setExportView((current) => !current);\n setIsCogMenuOpen(false);\n }}\n >\n <Upload size={14} className=\"solid-header-action-button-icon\" />\n <span className=\"solid-header-action-button-label\">Export</span>\n </SolidDropdownMenuItem>\n )}\n {solidListViewLayout?.attrs?.headerButtons\n ?.filter((rb: any) => isButtonVisibleInCurrentEnv(rb?.attrs))\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 onActionComplete={() => setIsCogMenuOpen(false)}\n />\n ))}\n {viewData?.data?.solidView?.model?.enableSoftDelete && (\n <SolidDropdownMenuCheckboxItem\n checked={showArchived}\n onCheckedChange={() => setShowArchived(!showArchived)}\n >\n Show Archived Records\n </SolidDropdownMenuCheckboxItem>\n )}\n {showArchived && (\n <SolidDropdownMenuItem\n className=\"solid-header-dropdown-item lg:hidden\"\n onSelect={() => {\n setRecoverDialogVisible(true);\n setIsCogMenuOpen(false);\n }}\n >\n <RefreshCw size={14} className=\"solid-header-action-button-icon\" />\n <span className=\"solid-header-action-button-label\">Recover</span>\n </SolidDropdownMenuItem>\n )}\n\n {(\n isHeaderActionEnabled('customizeLayout') && actionsAllowed.includes(`${permissionExpression('userViewMetadata', 'create')}`) ||\n isHeaderActionEnabled('savedFilters') && actionsAllowed.includes(`${permissionExpression('savedFilters', 'create')}`) ||\n true\n ) && <SolidDropdownMenuSeparator />}\n\n {isHeaderActionEnabled('customizeLayout') && actionsAllowed.includes(`${permissionExpression('userViewMetadata', 'create')}`) && (\n <SolidDropdownMenuSub>\n <SolidDropdownMenuSubTrigger className=\"solid-header-dropdown-item\">\n <SlidersHorizontal size={14} className=\"solid-header-action-button-icon\" />\n <span className=\"solid-header-action-button-label\">Layout</span>\n </SolidDropdownMenuSubTrigger>\n <SolidDropdownMenuSubContent className=\"customize-layout-panel\">\n {showSwitchType && (\n <>\n <SolidDropdownMenuLabel>Switch Type</SolidDropdownMenuLabel>\n <SolidDropdownMenuRadioGroup value={view} onValueChange={handleViewTypeChange}>\n {visibleViewModes.map((option: ViewMode) => (\n <SolidDropdownMenuRadioItem key={option.type} value={option.type}>\n {capitalize(option.type)}\n </SolidDropdownMenuRadioItem>\n ))}\n </SolidDropdownMenuRadioGroup>\n <SolidDropdownMenuSeparator />\n </>\n )}\n <SolidDropdownMenuLabel>Row Spacing</SolidDropdownMenuLabel>\n <SolidDropdownMenuRadioGroup value={size} onValueChange={(value: string) => setSize(value)}>\n {sizeOptions.map((option: any) => (\n <SolidDropdownMenuRadioItem key={option.value} value={option.value}>\n {option.label}\n </SolidDropdownMenuRadioItem>\n ))}\n </SolidDropdownMenuRadioGroup>\n <SolidDropdownMenuSeparator />\n <SolidDropdownMenuItem\n onSelect={() => {\n setShowColumnSelectorDialog(true);\n setIsCogMenuOpen(false);\n }}\n >\n <Table size={14} className=\"solid-header-action-button-icon\" />\n <span className=\"solid-header-action-button-label\">Column Selector</span>\n </SolidDropdownMenuItem>\n </SolidDropdownMenuSubContent>\n </SolidDropdownMenuSub>\n )}\n {isHeaderActionEnabled('savedFilters') && actionsAllowed.includes(`${permissionExpression('savedFilters', 'create')}`) && (\n <SolidDropdownMenuItem\n className=\"solid-header-dropdown-item\"\n onSelect={() => {\n setShowSaveFilterPopup(true);\n setIsCogMenuOpen(false);\n }}\n >\n <Save size={14} className=\"solid-header-action-button-icon\" />\n <span className=\"solid-header-action-button-label\">Save Custom Filter</span>\n </SolidDropdownMenuItem>\n )}\n <SolidDropdownMenuItem\n className=\"solid-header-dropdown-item\"\n onSelect={() => {\n clearLocalstorageCache();\n setIsCogMenuOpen(false);\n }}\n >\n <Trash2 size={14} className=\"solid-header-action-button-icon\" />\n <span className=\"solid-header-action-button-label\">Reset View</span>\n </SolidDropdownMenuItem>\n </>\n )}\n </SolidDropdownMenuContent>\n </SolidDropdownMenu>\n <SolidDialog\n open={exportView}\n onOpenChange={setExportView}\n className=\"solid-kanban-export-dialog solid-list-export-dialog\"\n style={{ width: \"min(980px, calc(100vw - 32px))\" }}\n >\n <SolidDialogHeader className=\"solid-export-dialog-header\">\n <div>\n <SolidDialogTitle>Export</SolidDialogTitle>\n <SolidDialogDescription className=\"solid-filter-dialog-subtitle m-0\">\n Choose the file format, refine the field set, and save reusable export templates.\n </SolidDialogDescription>\n </div>\n <SolidDialogClose />\n </SolidDialogHeader>\n <SolidDialogSeparator />\n <SolidDialogBody className=\"solid-kanban-export-dialog-body\">\n <SolidExport\n listViewMetaData={listViewMetaData}\n filters={filters}\n onExportComplete={() => setExportView(false)}\n />\n </SolidDialogBody>\n </SolidDialog>\n <SolidDialog\n open={showColumnSelectorDialog}\n onOpenChange={setShowColumnSelectorDialog}\n className=\"solid-column-selector-dialog\"\n style={{ width: \"min(388px, calc(100vw - 2rem))\" }}\n >\n <SolidDialogHeader className=\"solid-filter-dialog-head\">\n <div>\n <SolidDialogTitle className=\"solid-filter-dialog-title m-0\">Column Selector</SolidDialogTitle>\n <SolidDialogDescription className=\"solid-filter-dialog-subtitle m-0\">\n Choose visible columns and reorder them for this list view.\n </SolidDialogDescription>\n </div>\n <SolidDialogClose className=\"solid-filter-dialog-close\" />\n </SolidDialogHeader>\n <SolidDialogSeparator className=\"solid-filter-dialog-sep\" />\n <SolidDialogBody className=\"solid-filter-dialog-body\">\n <SolidListColumnSelector\n listViewMetaData={listViewMetaData}\n onClose={() => setShowColumnSelectorDialog(false)}\n />\n </SolidDialogBody>\n </SolidDialog>\n {openImportDialog &&\n <SolidGenericImport\n openImportDialog={openImportDialog}\n setOpenImportDialog={setOpenImportDialog}\n listViewMetaData={listViewMetaData}\n handleFetchUpdatedRecords={handleFetchUpdatedRecords}\n />\n }\n </div>\n )\n}\n"]}
|
|
@@ -14,6 +14,7 @@ import { hasAnyRole } from "../../../helpers/rolesHelper";
|
|
|
14
14
|
import { SolidListViewHeaderButton } from "./SolidListViewHeaderButton";
|
|
15
15
|
import { capitalize } from "lodash";
|
|
16
16
|
import { Cog, Download, RefreshCw, Save, SlidersHorizontal, Table, Trash2, Upload } from "lucide-react";
|
|
17
|
+
import { storeCurrentModelViewContext } from "../../../helpers/modelViewPersistence";
|
|
17
18
|
import {
|
|
18
19
|
SolidDialog,
|
|
19
20
|
SolidDialogBody,
|
|
@@ -80,6 +81,7 @@ export const SolidListViewConfigure = (
|
|
|
80
81
|
const pathSegments = pathname.split('/').filter(Boolean);
|
|
81
82
|
pathSegments[pathSegments.length - 1] = newView.type; // Replace the last part with new view
|
|
82
83
|
const newPath = '/' + pathSegments.join('/') + `?menuItemId=${newView.menuItemId}&menuItemName=${newView.menuItemName}&actionId=${newView.actionId}&actionName=${newView.actionName}`;
|
|
84
|
+
storeCurrentModelViewContext(newPath);
|
|
83
85
|
router.push(newPath);
|
|
84
86
|
};
|
|
85
87
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SolidRelationManyToOneColumn.d.ts","sourceRoot":"","sources":["../../../../../../src/components/core/list/columns/relations/SolidRelationManyToOneColumn.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,yBAAyB,EAAE,MAAM,yDAAyD,CAAC;
|
|
1
|
+
{"version":3,"file":"SolidRelationManyToOneColumn.d.ts","sourceRoot":"","sources":["../../../../../../src/components/core/list/columns/relations/SolidRelationManyToOneColumn.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,yBAAyB,EAAE,MAAM,yDAAyD,CAAC;AAGpG,OAAO,EAAE,yBAAyB,EAAE,MAAM,iCAAiC,CAAC;AAG5E,QAAA,MAAM,4BAA4B,8DAA+D,yBAAyB,4CAqCzH,CAAC;AAEF,eAAe,4BAA4B,CAAC;AAG5C,eAAO,MAAM,kCAAkC,uEAAwE,yBAAyB,4CA+C/I,CAAC"}
|
|
@@ -12,7 +12,7 @@ var __assign = (this && this.__assign) || function () {
|
|
|
12
12
|
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
13
13
|
import { Column } from "../../SolidDataTable";
|
|
14
14
|
import { getExtensionComponent } from '../../../../../helpers/registry';
|
|
15
|
-
import {
|
|
15
|
+
import { buildAdminRecordFormPath } from '../../../../../helpers/routePaths';
|
|
16
16
|
import { ExternalLink } from "lucide-react";
|
|
17
17
|
var SolidRelationManyToOneColumn = function (_a) {
|
|
18
18
|
var _b;
|
|
@@ -38,7 +38,7 @@ var SolidRelationManyToOneColumn = function (_a) {
|
|
|
38
38
|
};
|
|
39
39
|
export default SolidRelationManyToOneColumn;
|
|
40
40
|
export var DefaultRelationManyToOneListWidget = function (_a) {
|
|
41
|
-
var _b, _c, _d, _e, _f;
|
|
41
|
+
var _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
|
|
42
42
|
var rowData = _a.rowData, solidListViewMetaData = _a.solidListViewMetaData, fieldMetadata = _a.fieldMetadata, column = _a.column, embeded = _a.embeded;
|
|
43
43
|
var manyToOneFieldData = rowData[column.attrs.name];
|
|
44
44
|
// This is the userkey that will be present within the rowData.
|
|
@@ -46,26 +46,23 @@ export var DefaultRelationManyToOneListWidget = function (_a) {
|
|
|
46
46
|
// Since this is a many-to-one field, we fetch the user key field of the associated model.
|
|
47
47
|
var userKeyField = ((_b = column === null || column === void 0 ? void 0 : column.attrs) === null || _b === void 0 ? void 0 : _b.coModelFieldToDisplay) ? (_c = column === null || column === void 0 ? void 0 : column.attrs) === null || _c === void 0 ? void 0 : _c.coModelFieldToDisplay : (_e = (_d = fieldMetadata === null || fieldMetadata === void 0 ? void 0 : fieldMetadata.relationModel) === null || _d === void 0 ? void 0 : _d.userKeyField) === null || _e === void 0 ? void 0 : _e.name;
|
|
48
48
|
var manyToOneColVal = manyToOneFieldData[userKeyField];
|
|
49
|
-
var
|
|
50
|
-
|
|
49
|
+
var relatedModuleName = (fieldMetadata === null || fieldMetadata === void 0 ? void 0 : fieldMetadata.relationModelModuleName) ||
|
|
50
|
+
((_g = (_f = fieldMetadata === null || fieldMetadata === void 0 ? void 0 : fieldMetadata.relationModel) === null || _f === void 0 ? void 0 : _f.module) === null || _g === void 0 ? void 0 : _g.name) ||
|
|
51
|
+
((_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.module) === null || _k === void 0 ? void 0 : _k.name);
|
|
52
|
+
var relatedModelName = ((_l = fieldMetadata === null || fieldMetadata === void 0 ? void 0 : fieldMetadata.relationModel) === null || _l === void 0 ? void 0 : _l.singularName) ||
|
|
53
|
+
(fieldMetadata === null || fieldMetadata === void 0 ? void 0 : fieldMetadata.relationCoModelSingularName);
|
|
54
|
+
var relationRecordPath_1 = buildAdminRecordFormPath({
|
|
55
|
+
moduleName: relatedModuleName,
|
|
56
|
+
modelName: relatedModelName,
|
|
57
|
+
recordId: manyToOneFieldData === null || manyToOneFieldData === void 0 ? void 0 : manyToOneFieldData.id,
|
|
58
|
+
viewMode: "view",
|
|
59
|
+
});
|
|
60
|
+
var isDisabled = ((_m = column === null || column === void 0 ? void 0 : column.attrs) === null || _m === void 0 ? void 0 : _m.disabled) === true;
|
|
61
|
+
if (embeded === true || isDisabled || !relationRecordPath_1) {
|
|
51
62
|
return (_jsx("span", { className: "solid-list-external-link-text", children: manyToOneColVal }));
|
|
52
63
|
}
|
|
53
64
|
return (_jsxs("button", { type: "button", className: "solid-list-external-link", onClick: function () {
|
|
54
|
-
|
|
55
|
-
var pathSegments = window.location.pathname.split('/').filter(Boolean);
|
|
56
|
-
var listIndex = pathSegments.lastIndexOf('list');
|
|
57
|
-
if (listIndex > 0) {
|
|
58
|
-
pathSegments[listIndex - 1] = kebabCase((_a = fieldMetadata === null || fieldMetadata === void 0 ? void 0 : fieldMetadata.relationModel) === null || _a === void 0 ? void 0 : _a.singularName);
|
|
59
|
-
pathSegments[listIndex] = "form/".concat(manyToOneFieldData === null || manyToOneFieldData === void 0 ? void 0 : manyToOneFieldData.id);
|
|
60
|
-
}
|
|
61
|
-
else if (pathSegments[pathSegments.length - 2] === "form") {
|
|
62
|
-
pathSegments[pathSegments.length - 3] = kebabCase((_b = fieldMetadata === null || fieldMetadata === void 0 ? void 0 : fieldMetadata.relationModel) === null || _b === void 0 ? void 0 : _b.singularName);
|
|
63
|
-
pathSegments[pathSegments.length - 2] = "form";
|
|
64
|
-
pathSegments[pathSegments.length - 1] = manyToOneFieldData === null || manyToOneFieldData === void 0 ? void 0 : manyToOneFieldData.id;
|
|
65
|
-
}
|
|
66
|
-
var newPath = "/".concat(pathSegments.join('/'), "?viewMode=view");
|
|
67
|
-
// open in new tab
|
|
68
|
-
window.open(newPath, "_blank");
|
|
65
|
+
window.open(relationRecordPath_1, "_blank");
|
|
69
66
|
}, children: [_jsx("span", { className: "solid-list-external-link-text", children: manyToOneColVal }), _jsx(ExternalLink, { size: 13, strokeWidth: 2, className: "solid-list-external-link-icon" })] }));
|
|
70
67
|
}
|
|
71
68
|
else {
|