@solidxai/core-ui 0.1.3 → 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/auth/SolidInitialLoginOtp.d.ts.map +1 -1
- package/dist/components/auth/SolidInitialLoginOtp.js +0 -5
- package/dist/components/auth/SolidInitialLoginOtp.js.map +1 -1
- package/dist/components/auth/SolidInitialLoginOtp.tsx +0 -5
- package/dist/components/auth/SolidLogin.d.ts.map +1 -1
- package/dist/components/auth/SolidLogin.js +7 -5
- package/dist/components/auth/SolidLogin.js.map +1 -1
- package/dist/components/auth/SolidLogin.tsx +10 -8
- package/dist/components/common/GeneralSettings.d.ts.map +1 -1
- package/dist/components/common/GeneralSettings.js +48 -47
- package/dist/components/common/GeneralSettings.js.map +1 -1
- package/dist/components/common/GeneralSettings.tsx +41 -10
- package/dist/components/core/common/FilterComponent.js.map +1 -1
- package/dist/components/core/common/FilterComponent.tsx +1 -1
- package/dist/components/core/common/GroupingComponent.d.ts +54 -0
- package/dist/components/core/common/GroupingComponent.d.ts.map +1 -0
- package/dist/components/core/common/GroupingComponent.js +196 -0
- package/dist/components/core/common/GroupingComponent.js.map +1 -0
- package/dist/components/core/common/GroupingComponent.tsx +452 -0
- package/dist/components/core/common/SolidGlobalSearchElement.d.ts +18 -1
- package/dist/components/core/common/SolidGlobalSearchElement.d.ts.map +1 -1
- package/dist/components/core/common/SolidGlobalSearchElement.js +152 -52
- package/dist/components/core/common/SolidGlobalSearchElement.js.map +1 -1
- package/dist/components/core/common/SolidGlobalSearchElement.tsx +212 -35
- package/dist/components/core/extension/solid-core/modelSequence/modelSequenceFormViewChangeHandler.d.ts +19 -0
- package/dist/components/core/extension/solid-core/modelSequence/modelSequenceFormViewChangeHandler.d.ts.map +1 -0
- package/dist/components/core/extension/solid-core/modelSequence/modelSequenceFormViewChangeHandler.js +90 -0
- package/dist/components/core/extension/solid-core/modelSequence/modelSequenceFormViewChangeHandler.js.map +1 -0
- package/dist/components/core/extension/solid-core/modelSequence/modelSequenceFormViewChangeHandler.tsx +59 -0
- package/dist/components/core/extension/solid-core/roleMetadata/RolePermissionsManyToManyFieldWidget.d.ts.map +1 -1
- package/dist/components/core/extension/solid-core/roleMetadata/RolePermissionsManyToManyFieldWidget.js +17 -28
- package/dist/components/core/extension/solid-core/roleMetadata/RolePermissionsManyToManyFieldWidget.js.map +1 -1
- package/dist/components/core/extension/solid-core/roleMetadata/RolePermissionsManyToManyFieldWidget.tsx +71 -56
- package/dist/components/core/filter/SolidOneToManyFilterElement.d.ts +2 -0
- package/dist/components/core/filter/SolidOneToManyFilterElement.d.ts.map +1 -0
- package/dist/components/core/filter/SolidOneToManyFilterElement.js +86 -0
- package/dist/components/core/filter/SolidOneToManyFilterElement.js.map +1 -0
- package/dist/components/core/filter/SolidOneToManyFilterElement.tsx +62 -0
- package/dist/components/core/filter/SolidVarInputsFilterElement.d.ts +1 -0
- package/dist/components/core/filter/SolidVarInputsFilterElement.d.ts.map +1 -1
- package/dist/components/core/filter/SolidVarInputsFilterElement.js +4 -1
- package/dist/components/core/filter/SolidVarInputsFilterElement.js.map +1 -1
- package/dist/components/core/filter/SolidVarInputsFilterElement.tsx +10 -0
- package/dist/components/core/filter/fields/SolidRelationField.d.ts.map +1 -1
- package/dist/components/core/filter/fields/SolidRelationField.js +4 -2
- package/dist/components/core/filter/fields/SolidRelationField.js.map +1 -1
- package/dist/components/core/filter/fields/SolidRelationField.tsx +4 -2
- package/dist/components/core/filter/fields/relations/SolidRelationOneToManyField.d.ts +4 -0
- package/dist/components/core/filter/fields/relations/SolidRelationOneToManyField.d.ts.map +1 -0
- package/dist/components/core/filter/fields/relations/SolidRelationOneToManyField.js +25 -0
- package/dist/components/core/filter/fields/relations/SolidRelationOneToManyField.js.map +1 -0
- package/dist/components/core/filter/fields/relations/SolidRelationOneToManyField.tsx +60 -0
- package/dist/components/core/form/SolidFormFooter.js +4 -4
- package/dist/components/core/form/SolidFormFooter.js.map +1 -1
- package/dist/components/core/form/SolidFormFooter.tsx +4 -4
- package/dist/components/core/form/fields/SolidBooleanField.d.ts.map +1 -1
- package/dist/components/core/form/fields/SolidBooleanField.js +11 -8
- package/dist/components/core/form/fields/SolidBooleanField.js.map +1 -1
- package/dist/components/core/form/fields/SolidBooleanField.tsx +20 -8
- 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 +317 -157
- package/dist/components/core/form/fields/relations/SolidRelationManyToManyField.js.map +1 -1
- package/dist/components/core/form/fields/relations/SolidRelationManyToManyField.tsx +463 -243
- 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 -4
- 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 +220 -33
- 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 +167 -36
- package/dist/components/core/kanban/SolidKanbanView.d.ts.map +1 -1
- package/dist/components/core/kanban/SolidKanbanView.js +13 -12
- package/dist/components/core/kanban/SolidKanbanView.js.map +1 -1
- package/dist/components/core/kanban/SolidKanbanView.tsx +8 -7
- package/dist/components/core/list/SolidListView.d.ts +18 -10
- package/dist/components/core/list/SolidListView.d.ts.map +1 -1
- package/dist/components/core/list/SolidListView.js +176 -177
- package/dist/components/core/list/SolidListView.js.map +1 -1
- package/dist/components/core/list/SolidListView.tsx +130 -143
- 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/list/listViewRegistry.js.map +1 -1
- package/dist/components/core/list/listViewRegistry.ts +1 -2
- package/dist/components/core/tree/SolidTreeView.d.ts +38 -0
- package/dist/components/core/tree/SolidTreeView.d.ts.map +1 -0
- package/dist/components/core/tree/SolidTreeView.js +1179 -0
- package/dist/components/core/tree/SolidTreeView.js.map +1 -0
- package/dist/components/core/tree/SolidTreeView.tsx +1637 -0
- package/dist/components/core/tree/treeViewRegistry.d.ts +7 -0
- package/dist/components/core/tree/treeViewRegistry.d.ts.map +1 -0
- package/dist/components/core/tree/treeViewRegistry.js +17 -0
- package/dist/components/core/tree/treeViewRegistry.js.map +1 -0
- package/dist/components/core/tree/treeViewRegistry.ts +23 -0
- package/dist/components/core/users/CreateUser.d.ts.map +1 -1
- package/dist/components/core/users/CreateUser.js +19 -6
- package/dist/components/core/users/CreateUser.js.map +1 -1
- package/dist/components/core/users/CreateUser.tsx +39 -0
- package/dist/helpers/helpers.d.ts +2 -0
- package/dist/helpers/helpers.d.ts.map +1 -1
- package/dist/helpers/helpers.js +3 -1
- package/dist/helpers/helpers.js.map +1 -1
- package/dist/helpers/helpers.ts +4 -1
- package/dist/helpers/registry.d.ts.map +1 -1
- package/dist/helpers/registry.js +5 -1
- package/dist/helpers/registry.js.map +1 -1
- package/dist/helpers/registry.ts +7 -2
- package/dist/index.d.ts +3 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -0
- package/dist/index.js.map +1 -1
- package/dist/index.ts +6 -1
- package/dist/resources/globals.css +32 -4
- package/dist/routes/pages/admin/core/ListPage.d.ts.map +1 -1
- package/dist/routes/pages/admin/core/ListPage.js +2 -2
- package/dist/routes/pages/admin/core/ListPage.js.map +1 -1
- package/dist/routes/pages/admin/core/ListPage.tsx +3 -2
- 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/routes/pages/admin/core/TreePage.d.ts +2 -0
- package/dist/routes/pages/admin/core/TreePage.d.ts.map +1 -0
- package/dist/routes/pages/admin/core/TreePage.js +37 -0
- package/dist/routes/pages/admin/core/TreePage.js.map +1 -0
- package/dist/routes/pages/admin/core/TreePage.tsx +30 -0
- package/dist/routes/solidRoutes.d.ts.map +1 -1
- package/dist/routes/solidRoutes.js +2 -0
- package/dist/routes/solidRoutes.js.map +1 -1
- package/dist/routes/solidRoutes.tsx +3 -1
- package/dist/routes/types.d.ts +1 -1
- package/dist/routes/types.d.ts.map +1 -1
- package/dist/routes/types.js.map +1 -1
- package/dist/routes/types.ts +1 -0
- package/dist/types/index.d.ts +8 -2
- package/dist/types/solid-core.d.ts +40 -0
- package/package.json +1 -1
package/dist/components/core/form/fields/relations/widgets/helpers/useRelationEntityHandler.ts
CHANGED
|
@@ -2,7 +2,13 @@ import { useState } from "react";
|
|
|
2
2
|
import qs from "qs";
|
|
3
3
|
import { createSolidEntityApi } from "../../../../../../../redux/api/solidEntityApi";
|
|
4
4
|
|
|
5
|
-
export
|
|
5
|
+
export type RelationItem = {
|
|
6
|
+
label: string;
|
|
7
|
+
value: any;
|
|
8
|
+
original?: any;
|
|
9
|
+
};
|
|
10
|
+
|
|
11
|
+
export const useRelationEntityHandler = ({ fieldContext, autoCompleteLimit = 1000 }: any) => {
|
|
6
12
|
const fieldMetadata = fieldContext.fieldMetadata;
|
|
7
13
|
const fieldLayoutInfo = fieldContext.field;
|
|
8
14
|
|
|
@@ -10,55 +16,180 @@ export const useRelationEntityHandler = ({ fieldContext, formik, autoCompleteLim
|
|
|
10
16
|
const { useLazyGetSolidEntitiesQuery } = entityApi;
|
|
11
17
|
const [triggerGetSolidEntities] = useLazyGetSolidEntitiesQuery();
|
|
12
18
|
|
|
13
|
-
const
|
|
19
|
+
const parentEntityApi = createSolidEntityApi(fieldContext.modelName);
|
|
20
|
+
const { usePatchUpdateSolidEntityMutation, useUpdateSolidEntityMutation } = parentEntityApi;
|
|
21
|
+
const [updateSolidEntity] = usePatchUpdateSolidEntityMutation();
|
|
14
22
|
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
// '$containsi': query
|
|
22
|
-
// }
|
|
23
|
-
// }
|
|
24
|
-
// };
|
|
23
|
+
/**
|
|
24
|
+
* AUTOCOMPLETE & CHECKBOX:
|
|
25
|
+
* The currently linked items — drives what chips are shown in the autocomplete
|
|
26
|
+
* and which checkboxes are checked.
|
|
27
|
+
*/
|
|
28
|
+
const [currentValues, setCurrentValues] = useState<RelationItem[]>([]);
|
|
25
29
|
|
|
26
|
-
|
|
30
|
+
/**
|
|
31
|
+
* CHECKBOX ONLY:
|
|
32
|
+
* All possible options to render as checkboxes.
|
|
33
|
+
* For autocomplete this is not needed — options are fetched on user search input.
|
|
34
|
+
*/
|
|
35
|
+
const [allOptions, setAllOptions] = useState<RelationItem[]>([]);
|
|
27
36
|
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
37
|
+
/**
|
|
38
|
+
* AUTOCOMPLETE ONLY:
|
|
39
|
+
* The live suggestion list shown in the dropdown while the user is typing.
|
|
40
|
+
* Populated by `fetchSuggestions` on each keystroke.
|
|
41
|
+
*/
|
|
42
|
+
const [suggestions, setSuggestions] = useState<RelationItem[]>([]);
|
|
43
|
+
|
|
44
|
+
// ─── Internal ────────────────────────────────────────────────────────────────
|
|
45
|
+
|
|
46
|
+
const sendLinkCommand = async (item: RelationItem, command: "link" | "unlink") => {
|
|
47
|
+
const parentId = fieldContext.data?.id;
|
|
48
|
+
const fieldName = fieldLayoutInfo.attrs.name;
|
|
49
|
+
|
|
50
|
+
if (!parentId || parentId === "new") return;
|
|
51
|
+
|
|
52
|
+
const formData = new FormData();
|
|
53
|
+
formData.append(`${fieldName}Ids[0]`, item.value);
|
|
54
|
+
formData.append(`${fieldName}Command`, command);
|
|
55
|
+
|
|
56
|
+
await updateSolidEntity({ id: parentId, data: formData }).unwrap();
|
|
57
|
+
};
|
|
58
|
+
|
|
59
|
+
// ─── Shared ──────────────────────────────────────────────────────────────────
|
|
60
|
+
|
|
61
|
+
/**
|
|
62
|
+
* Fetch currently linked items and populate `currentValues`.
|
|
63
|
+
* Call on mount for both autocomplete and checkbox widgets.
|
|
64
|
+
*/
|
|
65
|
+
const fetchCurrentValues = async () => {
|
|
66
|
+
const relationFieldName =
|
|
67
|
+
fieldContext.fieldMetadata?.relationCoModelFieldName ?? fieldContext.modelName;
|
|
68
|
+
|
|
69
|
+
const parentId = fieldContext.data?.id ?? -1;
|
|
70
|
+
|
|
71
|
+
const queryData = {
|
|
72
|
+
offset: 0,
|
|
73
|
+
limit: autoCompleteLimit,
|
|
74
|
+
filters: {
|
|
75
|
+
$and: [{ [relationFieldName]: { id: { $eq: parentId } } }],
|
|
76
|
+
},
|
|
77
|
+
};
|
|
78
|
+
|
|
79
|
+
const response = await triggerGetSolidEntities(qs.stringify(queryData, { encodeValuesOnly: true }));
|
|
80
|
+
if (!response.data) return;
|
|
81
|
+
|
|
82
|
+
const mapped: RelationItem[] = response.data.records.map((item: any) => ({
|
|
83
|
+
label: item[fieldMetadata?.relationModel?.userKeyField?.name],
|
|
84
|
+
value: item.id,
|
|
85
|
+
original: item,
|
|
86
|
+
}));
|
|
87
|
+
|
|
88
|
+
setCurrentValues(mapped);
|
|
89
|
+
};
|
|
90
|
+
|
|
91
|
+
/**
|
|
92
|
+
* Link an item: fire the API call, and on success update `currentValues`.
|
|
93
|
+
* Used by both autocomplete (onSelect) and checkbox (onChange when unchecked).
|
|
94
|
+
*/
|
|
95
|
+
const linkItem = async (item: RelationItem) => {
|
|
96
|
+
try {
|
|
97
|
+
await sendLinkCommand(item, "link");
|
|
98
|
+
setCurrentValues((prev) =>
|
|
99
|
+
prev.some((s) => s.value === item.value) ? prev : [...prev, item]
|
|
100
|
+
);
|
|
101
|
+
} catch (error: any) {
|
|
102
|
+
console.error(error?.data?.message || error?.message || `Failed to link ${fieldMetadata.displayName}`);
|
|
38
103
|
}
|
|
39
104
|
};
|
|
40
105
|
|
|
41
|
-
|
|
42
|
-
|
|
106
|
+
/**
|
|
107
|
+
* Unlink an item: fire the API call, and on success update `currentValues`.
|
|
108
|
+
* Used by both autocomplete (onUnselect) and checkbox (onChange when checked).
|
|
109
|
+
*/
|
|
110
|
+
const unlinkItem = async (item: RelationItem) => {
|
|
111
|
+
try {
|
|
112
|
+
await sendLinkCommand(item, "unlink");
|
|
113
|
+
setCurrentValues((prev) => prev.filter((s) => s.value !== item.value));
|
|
114
|
+
} catch (error: any) {
|
|
115
|
+
console.error(error?.data?.message || error?.message || `Failed to unlink ${fieldMetadata.displayName}`);
|
|
116
|
+
}
|
|
117
|
+
};
|
|
118
|
+
|
|
119
|
+
// ─── Autocomplete-specific ───────────────────────────────────────────────────
|
|
120
|
+
|
|
121
|
+
/**
|
|
122
|
+
* Fetch suggestions for the autocomplete dropdown based on the user's search query.
|
|
123
|
+
* Call this inside `completeMethod` of the AutoComplete component.
|
|
124
|
+
*/
|
|
125
|
+
const fetchSuggestions = async (autocompleteQs = "") => {
|
|
126
|
+
const response = await triggerGetSolidEntities(autocompleteQs);
|
|
127
|
+
if (!response.data) return;
|
|
128
|
+
|
|
129
|
+
const mapped: RelationItem[] = response.data.records.map((item: any) => ({
|
|
130
|
+
label: item[fieldMetadata?.relationModel?.userKeyField?.name],
|
|
131
|
+
value: item["id"],
|
|
132
|
+
original: item,
|
|
133
|
+
}));
|
|
134
|
+
|
|
135
|
+
setSuggestions(mapped);
|
|
136
|
+
};
|
|
137
|
+
|
|
138
|
+
// ─── Checkbox-specific ───────────────────────────────────────────────────────
|
|
139
|
+
|
|
140
|
+
/**
|
|
141
|
+
* Fetch all possible options for the checkbox list.
|
|
142
|
+
* Call this on mount for the checkbox widget.
|
|
143
|
+
*/
|
|
144
|
+
const fetchAllOptions = async (autocompleteQs = "") => {
|
|
145
|
+
const response = await triggerGetSolidEntities(autocompleteQs);
|
|
146
|
+
if (!response.data) return;
|
|
147
|
+
|
|
148
|
+
const mapped: RelationItem[] = response.data.records.map((item: any) => ({
|
|
149
|
+
label: item[fieldMetadata?.relationModel?.userKeyField?.name],
|
|
150
|
+
value: item["id"],
|
|
151
|
+
original: item,
|
|
152
|
+
}));
|
|
153
|
+
|
|
154
|
+
setAllOptions(mapped);
|
|
155
|
+
};
|
|
156
|
+
|
|
157
|
+
// ─── Inline create ───────────────────────────────────────────────────────────
|
|
158
|
+
|
|
159
|
+
/**
|
|
160
|
+
* Handle an inline-created entity: link it and add to both `currentValues`
|
|
161
|
+
* and `allOptions` (so it shows up in the checkbox list immediately).
|
|
162
|
+
*/
|
|
163
|
+
const addNewRelation = async (values: any) => {
|
|
43
164
|
const jsonValues = Object.fromEntries(values.entries());
|
|
44
|
-
const newItem = {
|
|
165
|
+
const newItem: RelationItem = {
|
|
45
166
|
label: jsonValues[fieldMetadata?.relationModel?.userKeyField?.name],
|
|
46
167
|
value: "new",
|
|
47
168
|
original: jsonValues,
|
|
48
169
|
};
|
|
49
170
|
|
|
50
|
-
|
|
171
|
+
await linkItem(newItem);
|
|
51
172
|
|
|
52
|
-
//
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
});
|
|
173
|
+
// Also add to allOptions so checkbox widget shows the new item
|
|
174
|
+
setAllOptions((prev) =>
|
|
175
|
+
prev.some((s) => s.value === newItem.value) ? prev : [...prev, newItem]
|
|
176
|
+
);
|
|
57
177
|
};
|
|
58
178
|
|
|
59
179
|
return {
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
180
|
+
// State
|
|
181
|
+
currentValues,
|
|
182
|
+
allOptions,
|
|
183
|
+
suggestions,
|
|
184
|
+
// Shared
|
|
185
|
+
fetchCurrentValues,
|
|
186
|
+
linkItem,
|
|
187
|
+
unlinkItem,
|
|
188
|
+
// Autocomplete-specific
|
|
189
|
+
fetchSuggestions,
|
|
190
|
+
// Checkbox-specific
|
|
191
|
+
fetchAllOptions,
|
|
192
|
+
// Inline create
|
|
193
|
+
addNewRelation,
|
|
63
194
|
};
|
|
64
|
-
};
|
|
195
|
+
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SolidKanbanView.d.ts","sourceRoot":"","sources":["../../../../src/components/core/kanban/SolidKanbanView.tsx"],"names":[],"mappings":"AAoBA,OAAO,uCAAuC,CAAC;AAC/C,OAAO,gDAAgD,CAAC;AAaxD,KAAK,qBAAqB,GAAG;IAC3B,UAAU,EAAE,MAAM,CAAC;IACnB,SAAS,EAAE,MAAM,CAAC;IAClB,OAAO,EAAE,OAAO,CAAC;CAClB,CAAC;AAGF,eAAO,MAAM,eAAe,WAAY,qBAAqB,
|
|
1
|
+
{"version":3,"file":"SolidKanbanView.d.ts","sourceRoot":"","sources":["../../../../src/components/core/kanban/SolidKanbanView.tsx"],"names":[],"mappings":"AAoBA,OAAO,uCAAuC,CAAC;AAC/C,OAAO,gDAAgD,CAAC;AAaxD,KAAK,qBAAqB,GAAG;IAC3B,UAAU,EAAE,MAAM,CAAC;IACnB,SAAS,EAAE,MAAM,CAAC;IAClB,OAAO,EAAE,OAAO,CAAC;CAClB,CAAC;AAGF,eAAO,MAAM,eAAe,WAAY,qBAAqB,4CAkzB5D,CAAC"}
|
|
@@ -80,7 +80,7 @@ import { useRouter } from "../../../hooks/useRouter";
|
|
|
80
80
|
import { SolidKanbanViewConfigure } from "./SolidKanbanViewConfigure";
|
|
81
81
|
import { KanbanUserViewLayout } from "./KanbanUserViewLayout";
|
|
82
82
|
import { useDispatch, useSelector } from "react-redux";
|
|
83
|
-
import {
|
|
83
|
+
import { setFilterObjectToLocalStorage, getFilterObjectFromLocalStorage } from "../list/SolidListView";
|
|
84
84
|
import { Toast } from "primereact/toast";
|
|
85
85
|
import { ERROR_MESSAGES } from "../../../constants/error-messages";
|
|
86
86
|
import { showNavbar, toggleNavbar } from "../../../redux/features/navbarSlice";
|
|
@@ -222,13 +222,14 @@ export var SolidKanbanView = function (params) {
|
|
|
222
222
|
};
|
|
223
223
|
// Initial Filter data
|
|
224
224
|
useEffect(function () {
|
|
225
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j
|
|
225
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
226
226
|
if (solidKanbanViewMetaData) {
|
|
227
227
|
setKanbanViewMetaData(solidKanbanViewMetaData);
|
|
228
|
-
|
|
229
|
-
setViewModes(
|
|
230
|
-
|
|
231
|
-
|
|
228
|
+
// const viewModes = solidKanbanViewMetaData?.data?.solidView?.layout?.attrs?.allowedViews && solidKanbanViewMetaData?.data?.solidView?.layout?.attrs?.allowedViews.length > 0 && solidKanbanViewMetaData?.data?.solidView?.layout?.attrs?.allowedViews.map((view: any) => { return { label: capitalize(view), value: view } });
|
|
229
|
+
setViewModes((_a = solidKanbanViewMetaData === null || solidKanbanViewMetaData === void 0 ? void 0 : solidKanbanViewMetaData.data) === null || _a === void 0 ? void 0 : _a.viewModes);
|
|
230
|
+
// setViewModes(viewModes);
|
|
231
|
+
if (((_e = (_d = (_c = (_b = solidKanbanViewMetaData === null || solidKanbanViewMetaData === void 0 ? void 0 : solidKanbanViewMetaData.data) === null || _b === void 0 ? void 0 : _b.solidView) === null || _c === void 0 ? void 0 : _c.layout) === null || _d === void 0 ? void 0 : _d.attrs) === null || _e === void 0 ? void 0 : _e.grouped) !== false) {
|
|
232
|
+
setGroupByFieldName((_j = (_h = (_g = (_f = solidKanbanViewMetaData === null || solidKanbanViewMetaData === void 0 ? void 0 : solidKanbanViewMetaData.data) === null || _f === void 0 ? void 0 : _f.solidView) === null || _g === void 0 ? void 0 : _g.layout) === null || _h === void 0 ? void 0 : _h.attrs) === null || _j === void 0 ? void 0 : _j.groupBy);
|
|
232
233
|
}
|
|
233
234
|
else {
|
|
234
235
|
setGroupByFieldName("deletedTracker");
|
|
@@ -320,7 +321,7 @@ export var SolidKanbanView = function (params) {
|
|
|
320
321
|
if (solidKanbanViewMetaData) {
|
|
321
322
|
var swimlanesCount = ((_c = (_b = (_a = solidKanbanViewMetaData === null || solidKanbanViewMetaData === void 0 ? void 0 : solidKanbanViewMetaData.data.solidView) === null || _a === void 0 ? void 0 : _a.layout) === null || _b === void 0 ? void 0 : _b.attrs) === null || _c === void 0 ? void 0 : _c.swimlanesCount) || 5;
|
|
322
323
|
if (groupByFieldName) {
|
|
323
|
-
var queryObject =
|
|
324
|
+
var queryObject = getFilterObjectFromLocalStorage();
|
|
324
325
|
var queryString = "";
|
|
325
326
|
if (queryObject) {
|
|
326
327
|
var filters_1 = {
|
|
@@ -676,7 +677,7 @@ export var SolidKanbanView = function (params) {
|
|
|
676
677
|
// @ts-ignore
|
|
677
678
|
urlData.search_predicate = customFilter.search_predicate || {};
|
|
678
679
|
// @ts-ignore
|
|
679
|
-
|
|
680
|
+
setFilterObjectToLocalStorage(urlData);
|
|
680
681
|
}
|
|
681
682
|
return [4 /*yield*/, triggerGetSolidEntities(queryString)];
|
|
682
683
|
case 1:
|
|
@@ -699,8 +700,8 @@ export var SolidKanbanView = function (params) {
|
|
|
699
700
|
if (solidKanbanViewMetaData) {
|
|
700
701
|
var createActionUrl = ((_d = (_c = (_b = (_a = solidKanbanViewMetaData === null || solidKanbanViewMetaData === void 0 ? void 0 : solidKanbanViewMetaData.data) === null || _a === void 0 ? void 0 : _a.solidView) === null || _b === void 0 ? void 0 : _b.layout) === null || _c === void 0 ? void 0 : _c.attrs) === null || _d === void 0 ? void 0 : _d.createAction) && ((_j = (_h = (_g = (_f = (_e = solidKanbanViewMetaData === null || solidKanbanViewMetaData === void 0 ? void 0 : solidKanbanViewMetaData.data) === null || _e === void 0 ? void 0 : _e.solidView) === null || _f === void 0 ? void 0 : _f.layout) === null || _g === void 0 ? void 0 : _g.attrs) === null || _h === void 0 ? void 0 : _h.createAction) === null || _j === void 0 ? void 0 : _j.type) === "custom" ? (_p = (_o = (_m = (_l = (_k = solidKanbanViewMetaData === null || solidKanbanViewMetaData === void 0 ? void 0 : solidKanbanViewMetaData.data) === null || _k === void 0 ? void 0 : _k.solidView) === null || _l === void 0 ? void 0 : _l.layout) === null || _m === void 0 ? void 0 : _m.attrs) === null || _o === void 0 ? void 0 : _o.createAction) === null || _p === void 0 ? void 0 : _p.customComponent : "form/new";
|
|
701
702
|
var editActionUrl = ((_t = (_s = (_r = (_q = solidKanbanViewMetaData === null || solidKanbanViewMetaData === void 0 ? void 0 : solidKanbanViewMetaData.data) === null || _q === void 0 ? void 0 : _q.solidView) === null || _r === void 0 ? void 0 : _r.layout) === null || _s === void 0 ? void 0 : _s.attrs) === null || _t === void 0 ? void 0 : _t.editAction) && ((_y = (_x = (_w = (_v = (_u = solidKanbanViewMetaData === null || solidKanbanViewMetaData === void 0 ? void 0 : solidKanbanViewMetaData.data) === null || _u === void 0 ? void 0 : _u.solidView) === null || _v === void 0 ? void 0 : _v.layout) === null || _w === void 0 ? void 0 : _w.attrs) === null || _x === void 0 ? void 0 : _x.editAction) === null || _y === void 0 ? void 0 : _y.type) === "custom" ? (_3 = (_2 = (_1 = (_0 = (_z = solidKanbanViewMetaData === null || solidKanbanViewMetaData === void 0 ? void 0 : solidKanbanViewMetaData.data) === null || _z === void 0 ? void 0 : _z.solidView) === null || _0 === void 0 ? void 0 : _0.layout) === null || _1 === void 0 ? void 0 : _1.attrs) === null || _2 === void 0 ? void 0 : _2.editAction) === null || _3 === void 0 ? void 0 : _3.customComponent : "form";
|
|
702
|
-
var
|
|
703
|
-
setViewModes(
|
|
703
|
+
var viewModes_1 = ((_7 = (_6 = (_5 = (_4 = solidKanbanViewMetaData === null || solidKanbanViewMetaData === void 0 ? void 0 : solidKanbanViewMetaData.data) === null || _4 === void 0 ? void 0 : _4.solidView) === null || _5 === void 0 ? void 0 : _5.layout) === null || _6 === void 0 ? void 0 : _6.attrs) === null || _7 === void 0 ? void 0 : _7.allowedViews) && ((_11 = (_10 = (_9 = (_8 = solidKanbanViewMetaData === null || solidKanbanViewMetaData === void 0 ? void 0 : solidKanbanViewMetaData.data) === null || _8 === void 0 ? void 0 : _8.solidView) === null || _9 === void 0 ? void 0 : _9.layout) === null || _10 === void 0 ? void 0 : _10.attrs) === null || _11 === void 0 ? void 0 : _11.allowedViews.length) > 0 && ((_15 = (_14 = (_13 = (_12 = solidKanbanViewMetaData === null || solidKanbanViewMetaData === void 0 ? void 0 : solidKanbanViewMetaData.data) === null || _12 === void 0 ? void 0 : _12.solidView) === null || _13 === void 0 ? void 0 : _13.layout) === null || _14 === void 0 ? void 0 : _14.attrs) === null || _15 === void 0 ? void 0 : _15.allowedViews.map(function (view) { return { label: capitalize(view), value: view }; }));
|
|
704
|
+
setViewModes(viewModes_1);
|
|
704
705
|
if (createActionUrl) {
|
|
705
706
|
setCreateButtonUrl(createActionUrl);
|
|
706
707
|
}
|
|
@@ -721,11 +722,11 @@ export var SolidKanbanView = function (params) {
|
|
|
721
722
|
return (_jsxs("div", { className: "page-parent-wrapper", children: [_jsx(Toast, { ref: toast }), _jsxs("div", { className: "page-header flex-column lg:flex-row", children: [_jsxs("div", { className: "flex justify-content-between w-full ", children: [_jsxs("div", { className: "flex align-items-center solid-header-buttons-wrapper", children: [params.embeded !== true &&
|
|
722
723
|
_jsx("div", { className: "apps-icon block md:hidden cursor-pointer", onClick: toggleBothSidebars, children: _jsx("i", { className: "pi pi-th-large" }) }), _jsx("p", { className: "m-0 view-title solid-text-wrapper", children: kanbanViewTitle }), ((_e = (_d = (_c = solidKanbanViewMetaData === null || solidKanbanViewMetaData === void 0 ? void 0 : solidKanbanViewMetaData.data) === null || _c === void 0 ? void 0 : _c.solidView) === null || _d === void 0 ? void 0 : _d.layout) === null || _e === void 0 ? void 0 : _e.attrs.enableGlobalSearch) === true &&
|
|
723
724
|
// <SolidGlobalSearchElement viewData={solidKanbanViewMetaData} handleApplyCustomFilter={handleApplyCustomFilter} ></SolidGlobalSearchElement>
|
|
724
|
-
_jsx("div", { className: "hidden lg:flex", children: _jsx(SolidGlobalSearchElement, { showSaveFilterPopup: showSaveFilterPopup, setShowSaveFilterPopup: setShowSaveFilterPopup, ref: solidGlobalSearchElementRef, viewData: solidKanbanViewMetaData, handleApplyCustomFilter: handleApplyCustomFilter }) })] }), _jsxs("div", { className: "flex align-items-center solid-header-buttons-wrapper", children: [((_h = (_g = (_f = solidKanbanViewMetaData === null || solidKanbanViewMetaData === void 0 ? void 0 : solidKanbanViewMetaData.data) === null || _f === void 0 ? void 0 : _f.solidView) === null || _g === void 0 ? void 0 : _g.layout) === null || _h === void 0 ? void 0 : _h.attrs.enableGlobalSearch) === true &&
|
|
725
|
+
_jsx("div", { className: "hidden lg:flex", children: _jsx(SolidGlobalSearchElement, { viewType: "kanban", showSaveFilterPopup: showSaveFilterPopup, setShowSaveFilterPopup: setShowSaveFilterPopup, ref: solidGlobalSearchElementRef, viewData: solidKanbanViewMetaData, handleApplyCustomFilter: handleApplyCustomFilter }) })] }), _jsxs("div", { className: "flex align-items-center solid-header-buttons-wrapper", children: [((_h = (_g = (_f = solidKanbanViewMetaData === null || solidKanbanViewMetaData === void 0 ? void 0 : solidKanbanViewMetaData.data) === null || _f === void 0 ? void 0 : _f.solidView) === null || _g === void 0 ? void 0 : _g.layout) === null || _h === void 0 ? void 0 : _h.attrs.enableGlobalSearch) === true &&
|
|
725
726
|
_jsx("div", { className: "flex lg:hidden", children: _jsx(Button, { type: "button", size: "small", icon: "pi pi-search", severity: "secondary", outlined: true, className: "solid-icon-button", onClick: function () { return setShowGlobalSearchElement(!showGlobalSearchElement); } }) }), actionsAllowed.includes("".concat(permissionExpression(params.modelName, 'create'))) && ((_l = (_k = (_j = solidKanbanViewMetaData === null || solidKanbanViewMetaData === void 0 ? void 0 : solidKanbanViewMetaData.data) === null || _j === void 0 ? void 0 : _j.solidView) === null || _k === void 0 ? void 0 : _k.layout) === null || _l === void 0 ? void 0 : _l.attrs.create) !== false &&
|
|
726
727
|
_jsx(SolidCreateButton, { createButtonUrl: createButtonUrl, createActionQueryParams: createActionQueryParams, responsiveIconOnly: true }), actionsAllowed.includes("".concat(permissionExpression(params.modelName, 'delete'))) && ((_p = (_o = (_m = solidKanbanViewMetaData === null || solidKanbanViewMetaData === void 0 ? void 0 : solidKanbanViewMetaData.data) === null || _m === void 0 ? void 0 : _m.solidView) === null || _o === void 0 ? void 0 : _o.layout) === null || _p === void 0 ? void 0 : _p.attrs.delete) !== false && selectedRecords.length > 0 && _jsx(Button, { type: "button", label: "Delete", size: "small", onClick: function () { return setDialogVisible(true); }, className: "small-button ", severity: "danger" }), _jsx(Button, { type: "button", size: "small", icon: "pi pi-refresh", severity: "secondary", className: "solid-icon-button", outlined: true, onClick: function () {
|
|
727
728
|
window.location.reload();
|
|
728
|
-
} }), _jsx(SolidKanbanViewConfigure, { solidKanbanViewMetaData: solidKanbanViewMetaData, actionsAllowed: actionsAllowed, viewModes: viewModes, setLayoutDialogVisible: setLayoutDialogVisible, setShowSaveFilterPopup: setShowSaveFilterPopup })] })] }), ((_s = (_r = (_q = solidKanbanViewMetaData === null || solidKanbanViewMetaData === void 0 ? void 0 : solidKanbanViewMetaData.data) === null || _q === void 0 ? void 0 : _q.solidView) === null || _r === void 0 ? void 0 : _r.layout) === null || _s === void 0 ? void 0 : _s.attrs.enableGlobalSearch) === true && showGlobalSearchElement && (_jsx("div", { className: "flex lg:hidden", children: _jsx(SolidGlobalSearchElement, { showSaveFilterPopup: showSaveFilterPopup, setShowSaveFilterPopup: setShowSaveFilterPopup, ref: solidGlobalSearchElementRef, viewData: solidKanbanViewMetaData, handleApplyCustomFilter: handleApplyCustomFilter }) }))] }), _jsx("style", { children: ".p-datatable .p-datatable-loading-overlay {background-color: rgba(0, 0, 0, 0.0);}" }), solidKanbanViewMetaData && kanbanViewData &&
|
|
729
|
+
} }), _jsx(SolidKanbanViewConfigure, { solidKanbanViewMetaData: solidKanbanViewMetaData, actionsAllowed: actionsAllowed, viewModes: viewModes, setLayoutDialogVisible: setLayoutDialogVisible, setShowSaveFilterPopup: setShowSaveFilterPopup })] })] }), ((_s = (_r = (_q = solidKanbanViewMetaData === null || solidKanbanViewMetaData === void 0 ? void 0 : solidKanbanViewMetaData.data) === null || _q === void 0 ? void 0 : _q.solidView) === null || _r === void 0 ? void 0 : _r.layout) === null || _s === void 0 ? void 0 : _s.attrs.enableGlobalSearch) === true && showGlobalSearchElement && (_jsx("div", { className: "flex lg:hidden", children: _jsx(SolidGlobalSearchElement, { viewType: "kanban", showSaveFilterPopup: showSaveFilterPopup, setShowSaveFilterPopup: setShowSaveFilterPopup, ref: solidGlobalSearchElementRef, viewData: solidKanbanViewMetaData, handleApplyCustomFilter: handleApplyCustomFilter }) }))] }), _jsx("style", { children: ".p-datatable .p-datatable-loading-overlay {background-color: rgba(0, 0, 0, 0.0);}" }), solidKanbanViewMetaData && kanbanViewData &&
|
|
729
730
|
_jsx(KanbanBoard, { groupByFieldName: groupByFieldName, groupedView: groupedView, kanbanViewData: kanbanViewData, maxSwimLanesCount: maxSwimLanesCount, solidKanbanViewMetaData: solidKanbanViewMetaData === null || solidKanbanViewMetaData === void 0 ? void 0 : solidKanbanViewMetaData.data, setKanbanViewData: setKanbanViewData, handleLoadMore: handleLoadMore, onDragEnd: onDragEnd, handleSwimLanePagination: handleSwimLanePagination, setLightboxUrls: setLightboxUrls, setOpenLightbox: setOpenLightbox, editButtonUrl: editBaseUrl }), _jsx(Dialog, { visible: isDialogVisible, header: "Confirm Delete", modal: true, className: "solid-confirm-dialog", footer: function () { return (_jsxs("div", { className: "flex justify-content-center", children: [_jsx(Button, { label: "Yes", icon: "pi pi-check", className: 'small-button', severity: "danger", autoFocus: true, onClick: deleteBulk }), _jsx(Button, { label: "No", icon: "pi pi-times", className: 'small-button', onClick: onDeleteClose })] })); }, onHide: function () { return setDialogVisible(false); }, children: _jsx("p", { children: "Are you sure you want to delete the selected records?" }) }), openLightbox &&
|
|
730
731
|
_jsx(Lightbox, { open: openLightbox, plugins: [Counter, Download], close: function () { return setOpenLightbox(false); },
|
|
731
732
|
// @ts-ignore
|