@solidstarters/solid-core-ui 1.1.67 → 1.1.68
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/core/common/SolidGlobalSearchElement.d.ts.map +1 -1
- package/dist/components/core/common/SolidGlobalSearchElement.js +25 -12
- package/dist/components/core/common/SolidGlobalSearchElement.js.map +1 -1
- package/dist/components/core/list/ListViewRowActionPopup.d.ts.map +1 -1
- package/dist/components/core/list/ListViewRowActionPopup.js +21 -5
- package/dist/components/core/list/ListViewRowActionPopup.js.map +1 -1
- package/dist/components/core/list/columns/SolidShortTextColumn.d.ts.map +1 -1
- package/dist/components/core/list/columns/SolidShortTextColumn.js +12 -1
- package/dist/components/core/list/columns/SolidShortTextColumn.js.map +1 -1
- package/dist/components/core/list/widgets/SolidShortTextFieldTextRenderModeWidget.d.ts +2 -0
- package/dist/components/core/list/widgets/SolidShortTextFieldTextRenderModeWidget.d.ts.map +1 -0
- package/dist/components/core/list/widgets/SolidShortTextFieldTextRenderModeWidget.js +7 -0
- package/dist/components/core/list/widgets/SolidShortTextFieldTextRenderModeWidget.js.map +1 -0
- package/dist/components/core/list/widgets/SolidUserNameAvatarWidget.d.ts +2 -0
- package/dist/components/core/list/widgets/SolidUserNameAvatarWidget.d.ts.map +1 -0
- package/dist/components/core/list/widgets/SolidUserNameAvatarWidget.js +36 -0
- package/dist/components/core/list/widgets/SolidUserNameAvatarWidget.js.map +1 -0
- package/dist/components/core/model/CreateModel.js +1 -1
- package/dist/components/core/model/CreateModel.js.map +1 -1
- package/dist/components/core/model/FieldMetaDataForm.d.ts.map +1 -1
- package/dist/components/core/model/FieldMetaDataForm.js +73 -50
- package/dist/components/core/model/FieldMetaDataForm.js.map +1 -1
- package/dist/components/core/model/ModelMetaData.d.ts.map +1 -1
- package/dist/components/core/model/ModelMetaData.js +17 -15
- package/dist/components/core/model/ModelMetaData.js.map +1 -1
- package/dist/helpers/registry.d.ts.map +1 -1
- package/dist/helpers/registry.js +8 -1
- package/dist/helpers/registry.js.map +1 -1
- package/dist/redux/api/modelApi.js +1 -1
- package/dist/redux/api/modelApi.js.map +1 -1
- package/package.json +1 -1
- package/src/components/core/common/SolidGlobalSearchElement.tsx +21 -13
- package/src/components/core/list/ListViewRowActionPopup.tsx +9 -2
- package/src/components/core/list/columns/SolidShortTextColumn.tsx +11 -2
- package/src/components/core/list/widgets/SolidUserNameAvatarWidget.tsx +52 -0
- package/src/components/core/model/CreateModel.tsx +1 -1
- package/src/components/core/model/FieldMetaDataForm.tsx +86 -12
- package/src/components/core/model/ModelMetaData.tsx +22 -9
- package/src/helpers/registry.ts +11 -1
- package/src/redux/api/modelApi.ts +1 -1
- /package/src/components/core/list/widgets/{SolidShortTextFieldTextRenderModeWidget copy.tsx → SolidShortTextFieldTextRenderModeWidget.tsx} +0 -0
|
@@ -19,7 +19,7 @@ export var modelsApi = createApi({
|
|
|
19
19
|
}
|
|
20
20
|
}),
|
|
21
21
|
getmodelById: builder.query({
|
|
22
|
-
query: function (id) { return "/model-metadata/".concat(id, "?populate[0]=fields&populate[1]=module
|
|
22
|
+
query: function (id) { return "/model-metadata/".concat(id, "?populate[0]=fields&populate[1]=module&&populate[2]=fields.mediaStorageProvider&populate[3]=parentModel"); },
|
|
23
23
|
}),
|
|
24
24
|
createmodel: builder.mutation({
|
|
25
25
|
query: function (model) { return ({
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"modelApi.js","sourceRoot":"","sources":["../../../src/redux/api/modelApi.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,8BAA8B,CAAC;AACzD,OAAO,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AAErD,MAAM,CAAC,IAAM,SAAS,GAAG,SAAS,CAAC;IAC/B,WAAW,EAAE,UAAU;IACvB,SAAS,EAAE,iBAAiB;IAC5B,SAAS,EAAE,UAAC,OAAO,IAAK,OAAA,CAAC;QACrB,SAAS,EAAE,OA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AAC;gBACZ,GAAG,EAAE,0BAAmB,EAAE,CAAE;gBAC5B,MAAM,EAAE,QAAQ;aACnB,CAAC,EAHa,CAGb;SACL,CAAC;QACF,aAAa,EAAE,OAAO,CAAC,QAAQ,CAAC;YAC5B,KAAK,EAAE,UAAC,IAAI,IAAK,OAAA,CAAC;gBACd,GAAG,EAAE,iCAAiC;gBACtC,MAAM,EAAE,MAAM;gBACd,IAAI,EAAE,IAAI;aACb,CAAC,EAJe,CAIf;SACL,CAAC;KACL,CAAC,EAnEsB,CAmEtB;CACL,CAAC,CAAA;AAEF,MAAM,CAAS,IAAA,iBAAiB,GAA6O,SAAS,kBAAtP,EAAC,qBAAqB,GAAuN,SAAS,sBAAhO,EAAE,wBAAwB,GAA6L,SAAS,yBAAtM,EAAE,oBAAoB,GAAuK,SAAS,qBAAhL,EAAE,sBAAsB,GAA+I,SAAS,uBAAxJ,EAAC,+BAA+B,GAA+G,SAAS,gCAAxH,EAAC,sBAAsB,GAAwF,SAAS,uBAAjG,EAAE,+BAA+B,GAAuD,SAAS,gCAAhE,EAAE,sBAAsB,GAA+B,SAAS,uBAAxC,EAAE,wBAAwB,GAAK,SAAS,yBAAd,CAAc"}
|
package/package.json
CHANGED
|
@@ -157,22 +157,30 @@ const transformRulesToFilters = (input: any) => {
|
|
|
157
157
|
}
|
|
158
158
|
|
|
159
159
|
const tranformSearchToFilters = (input: any) => {
|
|
160
|
+
if (!input || !input.$and) return input;
|
|
160
161
|
|
|
161
|
-
|
|
162
|
+
const grouped: Record<string, string[]> = {};
|
|
162
163
|
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
const { fieldName, matchMode, value } = condition;
|
|
164
|
+
input.$and.forEach(({ fieldName, value }: any) => {
|
|
165
|
+
const val = Array.isArray(value) && value.length === 1 ? value[0] : value;
|
|
166
166
|
|
|
167
|
-
|
|
168
|
-
|
|
167
|
+
if (!grouped[fieldName]) {
|
|
168
|
+
grouped[fieldName] = [];
|
|
169
|
+
}
|
|
169
170
|
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
171
|
+
if (Array.isArray(val)) {
|
|
172
|
+
grouped[fieldName].push(...val);
|
|
173
|
+
} else {
|
|
174
|
+
grouped[fieldName].push(val);
|
|
175
|
+
}
|
|
176
|
+
});
|
|
177
|
+
|
|
178
|
+
return {
|
|
179
|
+
$and: Object.entries(grouped).map(([fieldName, values]) => ({
|
|
180
|
+
[fieldName]: {
|
|
181
|
+
$containsi: values.length === 1 ? values[0] : values
|
|
182
|
+
}
|
|
183
|
+
}))
|
|
176
184
|
};
|
|
177
185
|
}
|
|
178
186
|
|
|
@@ -683,7 +691,7 @@ export const SolidGlobalSearchElement = forwardRef(({ viewData, handleApplyCusto
|
|
|
683
691
|
<span key={index} className="custom-chip-value">{value}
|
|
684
692
|
</span>
|
|
685
693
|
{values.length > 1 &&
|
|
686
|
-
<span className="custom-chip-or">
|
|
694
|
+
<span className="custom-chip-or">or</span>
|
|
687
695
|
}
|
|
688
696
|
</React.Fragment>
|
|
689
697
|
))}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
import { Button } from "primereact/button"
|
|
3
|
-
import {
|
|
3
|
+
import { getExtensionComponent } from "@/helpers/registry";
|
|
4
4
|
|
|
5
5
|
|
|
6
6
|
export const ListViewRowActionPopup = ({ context }: any) => {
|
|
@@ -13,11 +13,18 @@ export const ListViewRowActionPopup = ({ context }: any) => {
|
|
|
13
13
|
|
|
14
14
|
}
|
|
15
15
|
|
|
16
|
+
let DynamicWidget = getExtensionComponent(context?.rowAction?.action?.customComponent);
|
|
17
|
+
const widgetProps = {
|
|
18
|
+
context: context
|
|
19
|
+
}
|
|
20
|
+
|
|
16
21
|
return (
|
|
17
22
|
<div>
|
|
18
23
|
{
|
|
19
24
|
context?.rowAction?.action?.customComponent ?
|
|
20
|
-
<
|
|
25
|
+
DynamicWidget && <DynamicWidget {...widgetProps} />
|
|
26
|
+
|
|
27
|
+
// <LoadDynamicJsxComponent context={context}></LoadDynamicJsxComponent>
|
|
21
28
|
:
|
|
22
29
|
<>
|
|
23
30
|
<h1>{context?.modelName}</h1>
|
|
@@ -39,7 +39,7 @@ const SolidShortTextColumn = ({ solidListViewMetaData, fieldMetadata, column, se
|
|
|
39
39
|
)
|
|
40
40
|
};
|
|
41
41
|
|
|
42
|
-
const truncateAfter = solidListViewMetaData?.data?.solidView?.layout?.attrs?.truncateAfter
|
|
42
|
+
const truncateAfter = solidListViewMetaData?.data?.solidView?.layout?.attrs?.truncateAfter;
|
|
43
43
|
const header = column.attrs.label ?? fieldMetadata.displayName;
|
|
44
44
|
|
|
45
45
|
return (
|
|
@@ -63,7 +63,16 @@ const SolidShortTextColumn = ({ solidListViewMetaData, fieldMetadata, column, se
|
|
|
63
63
|
body={(rowData) => {
|
|
64
64
|
const renderMode = column.attrs.renderMode || "text";
|
|
65
65
|
const data = rowData;
|
|
66
|
-
|
|
66
|
+
let widgetName = column?.attrs?.widget;
|
|
67
|
+
if (renderMode === "image") {
|
|
68
|
+
widgetName = "SolidShortTextFieldImageRenderModeWidget"
|
|
69
|
+
}
|
|
70
|
+
if (renderMode === "text") {
|
|
71
|
+
widgetName = "SolidShortTextFieldTextRenderModeWidget"
|
|
72
|
+
};
|
|
73
|
+
if (column?.attrs?.widget) {
|
|
74
|
+
widgetName = column?.attrs?.widget;
|
|
75
|
+
}
|
|
67
76
|
let DynamicWidget = getExtensionComponent(widgetName);
|
|
68
77
|
const widgetProps = {
|
|
69
78
|
value: data[fieldMetadata.name],
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
|
|
2
|
+
export const SolidUserNameAvatarWidget = ({ value }: any) => {
|
|
3
|
+
|
|
4
|
+
// use "widget": "SolidUserNameAvatarWidget" in the list view field
|
|
5
|
+
|
|
6
|
+
const getInitials = (fullName: string) => {
|
|
7
|
+
const names = fullName.trim().split(' ');
|
|
8
|
+
const initials =
|
|
9
|
+
names.length === 1
|
|
10
|
+
? names[0][0]
|
|
11
|
+
: names[0][0] + names[names.length - 1][0];
|
|
12
|
+
return initials.toUpperCase();
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
const getColorFromInitials = (initials: string) => {
|
|
16
|
+
let hash = 0;
|
|
17
|
+
for (let i = 0; i < initials.length; i++) {
|
|
18
|
+
hash = initials.charCodeAt(i) + ((hash << 5) - hash);
|
|
19
|
+
}
|
|
20
|
+
const hue = Math.abs(hash) % 360;
|
|
21
|
+
return `hsl(${hue}, 60%, 60%)`; // nice pastel color
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
const initials = getInitials(value);
|
|
25
|
+
const bgColor = getColorFromInitials(initials);
|
|
26
|
+
|
|
27
|
+
return (
|
|
28
|
+
<div className="solid-table-row">
|
|
29
|
+
<div style={{ display: 'flex', alignItems: 'center', gap: '0.5rem' }}>
|
|
30
|
+
<div
|
|
31
|
+
style={{
|
|
32
|
+
width: 25,
|
|
33
|
+
height: 25,
|
|
34
|
+
borderRadius: '50%',
|
|
35
|
+
backgroundColor: bgColor,
|
|
36
|
+
color: 'white',
|
|
37
|
+
display: 'flex',
|
|
38
|
+
alignItems: 'center',
|
|
39
|
+
justifyContent: 'center',
|
|
40
|
+
fontWeight: 600,
|
|
41
|
+
fontSize: 25 * 0.4,
|
|
42
|
+
boxShadow: '0 0 0 2px rgba(0,0,0,0.1)',
|
|
43
|
+
}}
|
|
44
|
+
>
|
|
45
|
+
{initials}
|
|
46
|
+
</div>
|
|
47
|
+
<span>{value}</span>
|
|
48
|
+
</div>
|
|
49
|
+
</div>
|
|
50
|
+
);
|
|
51
|
+
};
|
|
52
|
+
|
|
@@ -394,16 +394,26 @@ const createValidationSchema = (currentFields: any, selectedType: any, allFields
|
|
|
394
394
|
"Relation Model Singular Name is required"
|
|
395
395
|
),
|
|
396
396
|
}),
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
397
|
+
...(currentFields.includes("relationCoModelFieldName") && {
|
|
398
|
+
relationCoModelFieldName: Yup.string()
|
|
399
|
+
// .required(
|
|
400
|
+
// "Relation Model Field Name is required"
|
|
401
|
+
// ),
|
|
402
|
+
}),
|
|
404
403
|
...(currentFields.includes("relationCreateInverse") && {
|
|
405
404
|
relationCreateInverse: Yup.boolean(),
|
|
406
405
|
}),
|
|
406
|
+
...(currentFields.includes("relationCoModelFieldName") && {
|
|
407
|
+
relationCoModelFieldName: Yup.string().when("relationCreateInverse", (relationCreateInverse: any, schema) => {
|
|
408
|
+
console.log("relationCreateInverse", relationCreateInverse);
|
|
409
|
+
if (relationCreateInverse.length > 0 && relationCreateInverse[0] == true) {
|
|
410
|
+
return schema.required("Relation Co Model Field Name is required")
|
|
411
|
+
} else {
|
|
412
|
+
return schema.notRequired();
|
|
413
|
+
}
|
|
414
|
+
}),
|
|
415
|
+
}),
|
|
416
|
+
|
|
407
417
|
// ...(currentFields.includes("relationCascade") && {
|
|
408
418
|
// relationCascade: Yup.string().required(
|
|
409
419
|
// "Relation Cascade Value is required"
|
|
@@ -425,6 +435,11 @@ const createValidationSchema = (currentFields: any, selectedType: any, allFields
|
|
|
425
435
|
"Relation Model Module Name Value is required"
|
|
426
436
|
),
|
|
427
437
|
}),
|
|
438
|
+
|
|
439
|
+
...(currentFields.includes("relationFieldFixedFilter") && {
|
|
440
|
+
relationFieldFixedFilter: Yup.string().nullable(),
|
|
441
|
+
}),
|
|
442
|
+
|
|
428
443
|
...(currentFields.includes("selectionDynamicProvider") && {
|
|
429
444
|
selectionDynamicProvider: Yup.string().required(
|
|
430
445
|
"Selection Dynamic Provider Value is required"
|
|
@@ -898,6 +913,7 @@ const FieldMetaDataForm = ({ setIsDirty, modelMetaData, fieldMetaData, setFieldM
|
|
|
898
913
|
relationCreateInverse: fieldMetaData ? fieldMetaData?.relationCreateInverse : false,
|
|
899
914
|
relationCascade: fieldMetaData ? fieldMetaData?.relationCascade : 'cascade',
|
|
900
915
|
relationModelModuleName: fieldMetaData ? fieldMetaData?.relationModelModuleName : modelMetaData?.module.name,
|
|
916
|
+
relationFieldFixedFilter: fieldMetaData ? fieldMetaData?.relationFieldFixedFilter : "",
|
|
901
917
|
selectionDynamicProvider: fieldMetaData ? fieldMetaData?.selectionDynamicProvider : null,
|
|
902
918
|
selectionDynamicProviderCtxt: fieldMetaData ? fieldMetaData?.selectionDynamicProviderCtxt : "",
|
|
903
919
|
selectionStaticValues: fieldMetaData ? fieldMetaData?.selectionStaticValues : [""],
|
|
@@ -1705,8 +1721,12 @@ const FieldMetaDataForm = ({ setIsDirty, modelMetaData, fieldMetaData, setFieldM
|
|
|
1705
1721
|
<SelectButton
|
|
1706
1722
|
value={formik.values.relationType}
|
|
1707
1723
|
options={fieldDefaultMetaData.data.relationTypes}
|
|
1708
|
-
onChange={(e) =>
|
|
1709
|
-
formik.setFieldValue("relationType", e.value)
|
|
1724
|
+
onChange={(e) => {
|
|
1725
|
+
formik.setFieldValue("relationType", e.value);
|
|
1726
|
+
if (e.value === "one-to-many") {
|
|
1727
|
+
formik.setFieldValue("relationCreateInverse", true);
|
|
1728
|
+
}
|
|
1729
|
+
}
|
|
1710
1730
|
}
|
|
1711
1731
|
className={classNames("", {
|
|
1712
1732
|
"p-invalid": isFormFieldValid(formik, "relationType"),
|
|
@@ -1869,6 +1889,56 @@ const FieldMetaDataForm = ({ setIsDirty, modelMetaData, fieldMetaData, setFieldM
|
|
|
1869
1889
|
</div>
|
|
1870
1890
|
)}
|
|
1871
1891
|
|
|
1892
|
+
{currentFields.includes(
|
|
1893
|
+
"relationFieldFixedFilter"
|
|
1894
|
+
) && (
|
|
1895
|
+
<div className="field col-6 flex-flex-column gap-2 mt-3">
|
|
1896
|
+
<label
|
|
1897
|
+
htmlFor="relationFieldFixedFilter"
|
|
1898
|
+
className="form-field-label"
|
|
1899
|
+
>
|
|
1900
|
+
Relation Field Fixed Filter
|
|
1901
|
+
</label>
|
|
1902
|
+
|
|
1903
|
+
<InputTextarea
|
|
1904
|
+
aria-describedby="Fixed Filter"
|
|
1905
|
+
id="relationFieldFixedFilter"
|
|
1906
|
+
name="relationFieldFixedFilter"
|
|
1907
|
+
onChange={formik.handleChange}
|
|
1908
|
+
value={formik.values.relationFieldFixedFilter}
|
|
1909
|
+
rows={5}
|
|
1910
|
+
cols={30}
|
|
1911
|
+
className={classNames("", {
|
|
1912
|
+
"p-invalid": isFormFieldValid(
|
|
1913
|
+
formik,
|
|
1914
|
+
"relationFieldFixedFilter"
|
|
1915
|
+
),
|
|
1916
|
+
})}
|
|
1917
|
+
/>
|
|
1918
|
+
{/*
|
|
1919
|
+
<InputText
|
|
1920
|
+
type="text"
|
|
1921
|
+
id="relationFieldFixedFilter"
|
|
1922
|
+
name="relationFieldFixedFilter"
|
|
1923
|
+
onChange={formik.handleChange}
|
|
1924
|
+
disabled={fieldMetaData?.id}
|
|
1925
|
+
value={formik.values.relationFieldFixedFilter}
|
|
1926
|
+
className={classNames("", {
|
|
1927
|
+
"p-invalid": isFormFieldValid(
|
|
1928
|
+
formik,
|
|
1929
|
+
"relationFieldFixedFilter"
|
|
1930
|
+
),
|
|
1931
|
+
})}
|
|
1932
|
+
/> */}
|
|
1933
|
+
{isFormFieldValid(formik, "relationFieldFixedFilter") && (
|
|
1934
|
+
<Message
|
|
1935
|
+
severity="error"
|
|
1936
|
+
text={formik?.errors?.relationFieldFixedFilter?.toString()}
|
|
1937
|
+
/>
|
|
1938
|
+
)}
|
|
1939
|
+
|
|
1940
|
+
</div>
|
|
1941
|
+
)}
|
|
1872
1942
|
{isUserKeyFields && (
|
|
1873
1943
|
<div className="field col-6 flex-flex-column gap-2 mt-3">
|
|
1874
1944
|
<label
|
|
@@ -1902,7 +1972,7 @@ const FieldMetaDataForm = ({ setIsDirty, modelMetaData, fieldMetaData, setFieldM
|
|
|
1902
1972
|
</div>
|
|
1903
1973
|
)}
|
|
1904
1974
|
|
|
1905
|
-
{currentFields.includes("relationCreateInverse") && (
|
|
1975
|
+
{currentFields.includes("relationCreateInverse") && (
|
|
1906
1976
|
<div className="field col-6 flex flex-column gap-2 mt-3">
|
|
1907
1977
|
<label htmlFor="relationCreateInverse" className="form-field-label">
|
|
1908
1978
|
Relation Create Inverse
|
|
@@ -1912,6 +1982,7 @@ const FieldMetaDataForm = ({ setIsDirty, modelMetaData, fieldMetaData, setFieldM
|
|
|
1912
1982
|
inputId="relationCreateInverse"
|
|
1913
1983
|
name="relationCreateInverse"
|
|
1914
1984
|
checked={formik.values.relationCreateInverse}
|
|
1985
|
+
disabled={formik.values.relationType === "one-to-many" ? true : false}
|
|
1915
1986
|
onChange={(e) => formik.setFieldValue("relationCreateInverse", e.checked)}
|
|
1916
1987
|
/>
|
|
1917
1988
|
<label htmlFor="relationCreateInverse" className="ml-2">Create Inverse</label>
|
|
@@ -1935,6 +2006,7 @@ const FieldMetaDataForm = ({ setIsDirty, modelMetaData, fieldMetaData, setFieldM
|
|
|
1935
2006
|
id="relationCoModelFieldName"
|
|
1936
2007
|
name="relationCoModelFieldName"
|
|
1937
2008
|
onChange={formik.handleChange}
|
|
2009
|
+
disabled={fieldMetaData?.id}
|
|
1938
2010
|
value={formik.values.relationCoModelFieldName}
|
|
1939
2011
|
className={classNames("", {
|
|
1940
2012
|
"p-invalid": isFormFieldValid(
|
|
@@ -1997,6 +2069,7 @@ const FieldMetaDataForm = ({ setIsDirty, modelMetaData, fieldMetaData, setFieldM
|
|
|
1997
2069
|
id="relationCoModelColumnName"
|
|
1998
2070
|
name="relationCoModelColumnName"
|
|
1999
2071
|
onChange={formik.handleChange}
|
|
2072
|
+
disabled={fieldMetaData?.id}
|
|
2000
2073
|
value={formik.values.relationCoModelColumnName}
|
|
2001
2074
|
className={classNames("", {
|
|
2002
2075
|
"p-invalid": isFormFieldValid(
|
|
@@ -2028,6 +2101,7 @@ const FieldMetaDataForm = ({ setIsDirty, modelMetaData, fieldMetaData, setFieldM
|
|
|
2028
2101
|
id="relationJoinTableName"
|
|
2029
2102
|
name="relationJoinTableName"
|
|
2030
2103
|
onChange={formik.handleChange}
|
|
2104
|
+
disabled={fieldMetaData?.id}
|
|
2031
2105
|
value={formik.values.relationJoinTableName}
|
|
2032
2106
|
className={classNames("", {
|
|
2033
2107
|
"p-invalid": isFormFieldValid(
|
|
@@ -2927,10 +3001,10 @@ const FieldMetaDataForm = ({ setIsDirty, modelMetaData, fieldMetaData, setFieldM
|
|
|
2927
3001
|
</TabView>
|
|
2928
3002
|
<div className="flex gap-3">
|
|
2929
3003
|
<div>
|
|
2930
|
-
<Button label="Finish" size="small" onClick={() => showError()} type="submit"
|
|
3004
|
+
<Button label="Finish" size="small" onClick={() => showError()} type="submit" />
|
|
2931
3005
|
</div>
|
|
2932
3006
|
<div>
|
|
2933
|
-
<Button label="Cancel" size="small" severity="secondary" type="reset" onClick={() => setVisiblePopup(false)} outlined
|
|
3007
|
+
<Button label="Cancel" size="small" severity="secondary" type="reset" onClick={() => setVisiblePopup(false)} outlined />
|
|
2934
3008
|
</div>
|
|
2935
3009
|
</div>
|
|
2936
3010
|
</div>
|
|
@@ -56,7 +56,7 @@ const ModelMetaData = React.forwardRef(({ modelMetaData, setModelMetaData, allMo
|
|
|
56
56
|
enableSoftDelete: modelMetaData ? modelMetaData?.enableSoftDelete : "",
|
|
57
57
|
enableAuditTracking: modelMetaData ? modelMetaData?.enableAuditTracking : "",
|
|
58
58
|
internationalisation: modelMetaData ? modelMetaData?.internationalisation : "",
|
|
59
|
-
isChild: modelMetaData ? modelMetaData?.isChild :
|
|
59
|
+
isChild: modelMetaData ? modelMetaData?.isChild : "",
|
|
60
60
|
parentModelId: modelMetaData ? modelMetaData?.parentModel?.id : "",
|
|
61
61
|
parentModel: modelMetaData ? modelMetaData?.parentModel : "",
|
|
62
62
|
|
|
@@ -138,7 +138,7 @@ const ModelMetaData = React.forwardRef(({ modelMetaData, setModelMetaData, allMo
|
|
|
138
138
|
enableSoftDelete: values.enableSoftDelete === true ? true : '',
|
|
139
139
|
enableAuditTracking: values.enableAuditTracking === true ? true : '',
|
|
140
140
|
internationalisation: values.internationalisation === true ? true : '',
|
|
141
|
-
isChild: values.isChild
|
|
141
|
+
isChild: values.isChild === true ? true : '',
|
|
142
142
|
...(values.isChild == true && {
|
|
143
143
|
parentModelId: values.parentModelId,
|
|
144
144
|
parentModel: values.parentModel,
|
|
@@ -455,14 +455,27 @@ const ModelMetaData = React.forwardRef(({ modelMetaData, setModelMetaData, allMo
|
|
|
455
455
|
/>
|
|
456
456
|
)}
|
|
457
457
|
|
|
458
|
-
<div className="mt-
|
|
459
|
-
<
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
isChild
|
|
463
|
-
|
|
464
|
-
|
|
458
|
+
<div className="flex align-items-center gap-2 mt-3">
|
|
459
|
+
<Checkbox
|
|
460
|
+
name="isChild"
|
|
461
|
+
onChange={(e) => {
|
|
462
|
+
formik.setFieldValue("isChild", e.checked);
|
|
463
|
+
}}
|
|
464
|
+
disabled={params.id !== 'new'}
|
|
465
|
+
checked={formik.values.isChild}
|
|
466
|
+
></Checkbox>
|
|
467
|
+
<label htmlFor="isChild" className="form-field-label">
|
|
468
|
+
Is Child
|
|
469
|
+
</label>
|
|
465
470
|
</div>
|
|
471
|
+
{params.id !== 'new' && <p className="form-field-label mt-1 text-sm">Is Current Model child of another Model</p>}
|
|
472
|
+
{(isFormFieldValid(formik, "isChild") || (formErrors["isChild"])) && (
|
|
473
|
+
<Message
|
|
474
|
+
severity="error"
|
|
475
|
+
text={formik?.errors?.isChild?.toString()}
|
|
476
|
+
className="mt-2"
|
|
477
|
+
/>
|
|
478
|
+
)}
|
|
466
479
|
{showParentModel &&
|
|
467
480
|
<div className="flex flex-column gap-2 mt-3">
|
|
468
481
|
<label htmlFor="type" className="form-field-label">
|
package/src/helpers/registry.ts
CHANGED
|
@@ -9,7 +9,7 @@ import { SolidBooleanFieldCheckboxWidget } from "@/components/core/form/fields/w
|
|
|
9
9
|
import { SolidBooleanFieldSelectWidget } from "@/components/core/form/fields/widgets/SolidBooleanSelectFieldWidget";
|
|
10
10
|
import { SolidSelectionStaticAutocompleteWidget } from "@/components/core/form/fields/widgets/SolidSelectionStaticAutocompleteFieldWidget";
|
|
11
11
|
import { SolidSelectionStaticRadioWidget } from "@/components/core/form/fields/widgets/SolidSelectionStaticRadioFieldWidget";
|
|
12
|
-
import { SolidShortTextFieldTextRenderModeWidget } from "@/components/core/list/widgets/SolidShortTextFieldTextRenderModeWidget
|
|
12
|
+
import { SolidShortTextFieldTextRenderModeWidget } from "@/components/core/list/widgets/SolidShortTextFieldTextRenderModeWidget";
|
|
13
13
|
import { SolidShortTextFieldImageRenderModeWidget } from "@/components/core/list/widgets/SolidShortTextFieldImageRenderModeWidget";
|
|
14
14
|
import { SolidFormFieldViewModeWidget } from "@/components/core/form/fields/widgets/SolidFormFieldViewModeWidget";
|
|
15
15
|
import { SolidFormFieldJsonViewModeWidget } from "@/components/core/form/fields/widgets/SolidFormFieldJsonViewModeWidget";
|
|
@@ -19,6 +19,9 @@ import { SolidFormFieldMediaViewModeWidget } from "@/components/core/form/fields
|
|
|
19
19
|
import { SolidFormFieldRelationViewModeWidget } from "@/components/core/form/fields/widgets/SolidFormFieldRelationViewModeWidget";
|
|
20
20
|
import { SolidFormFieldViewMediaSingleWidget } from "@/components/core/form/fields/widgets/SolidFormFieldViewMediaSingleWidget";
|
|
21
21
|
import { SolidFormFieldViewMediaMultipleWidget } from "@/components/core/form/fields/widgets/SolidFormFieldViewMediaMultipleWidget";
|
|
22
|
+
import { SolidUserNameAvatarWidget } from "@/components/core/list/widgets/SolidUserNameAvatarWidget";
|
|
23
|
+
import GenerateModelCodeRowAction from "@/components/core/extension/solid-core/modelMetadata/list/GenerateModelCodeRowAction";
|
|
24
|
+
import GenerateModuleCodeRowAction from "@/components/core/extension/solid-core/moduleMetadata/list/GenerateModuleCodeRowAction";
|
|
22
25
|
|
|
23
26
|
type ExtensionRegistry = {
|
|
24
27
|
components: Record<string, React.ComponentType<any>>;
|
|
@@ -79,6 +82,11 @@ export const getExtensionFunction = (name: string) => {
|
|
|
79
82
|
// Register all the dynamic widget & functions from inside solid-core-ui
|
|
80
83
|
// Common
|
|
81
84
|
registerExtensionComponent("CustomHtml", CustomHtml, []);
|
|
85
|
+
|
|
86
|
+
|
|
87
|
+
|
|
88
|
+
registerExtensionComponent("GenerateModelCodeRowAction", GenerateModelCodeRowAction, []);
|
|
89
|
+
registerExtensionComponent("GenerateModuleCodeRowAction", GenerateModuleCodeRowAction, []);
|
|
82
90
|
registerExtensionComponent("SolidRelationManyToManyCheckboxWidget", SolidRelationManyToManyCheckboxWidget, ["checkbox"]);
|
|
83
91
|
registerExtensionComponent("SolidRelationManyToManyAutocompleteWidget", SolidRelationManyToManyAutocompleteWidget, ["autocomplete"]);
|
|
84
92
|
registerExtensionComponent("SolidBooleanFieldCheckboxWidget", SolidBooleanFieldCheckboxWidget, ["field-checkbox"]);
|
|
@@ -95,6 +103,8 @@ registerExtensionComponent("SolidFormFieldMediaViewModeWidget", SolidFormFieldMe
|
|
|
95
103
|
registerExtensionComponent("SolidFormFieldRelationViewModeWidget", SolidFormFieldRelationViewModeWidget, []);
|
|
96
104
|
registerExtensionComponent("SolidFormFieldViewMediaSingleWidget", SolidFormFieldViewMediaSingleWidget, []);
|
|
97
105
|
registerExtensionComponent("SolidFormFieldViewMediaMultipleWidget", SolidFormFieldViewMediaMultipleWidget, []);
|
|
106
|
+
registerExtensionComponent("SolidFormFieldViewMediaMultipleWidget", SolidFormFieldViewMediaMultipleWidget, []);
|
|
107
|
+
registerExtensionComponent("SolidUserNameAvatarWidget", SolidUserNameAvatarWidget, []);
|
|
98
108
|
|
|
99
109
|
|
|
100
110
|
// ModuleMetadata
|
|
@@ -20,7 +20,7 @@ export const modelsApi = createApi({
|
|
|
20
20
|
}
|
|
21
21
|
}),
|
|
22
22
|
getmodelById: builder.query({
|
|
23
|
-
query: (id) => `/model-metadata/${id}?populate[0]=fields&populate[1]=module
|
|
23
|
+
query: (id) => `/model-metadata/${id}?populate[0]=fields&populate[1]=module&&populate[2]=fields.mediaStorageProvider&populate[3]=parentModel`,
|
|
24
24
|
}),
|
|
25
25
|
createmodel: builder.mutation({
|
|
26
26
|
query: (model) => ({
|