@evoke-platform/ui-components 1.10.0-dev.29 → 1.10.0-dev.30
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/published/components/custom/FormV2/FormRenderer.js +1 -1
- package/dist/published/components/custom/FormV2/FormRendererContainer.js +2 -1
- package/dist/published/components/custom/FormV2/components/RecursiveEntryRenderer.js +2 -0
- package/dist/published/components/custom/FormV2/components/utils.d.ts +2 -2
- package/dist/published/components/custom/FormV2/components/utils.js +2 -2
- package/dist/published/components/custom/ViewDetailsV2/ViewDetailsV2Container.js +6 -2
- package/package.json +1 -1
|
@@ -46,7 +46,7 @@ const FormRendererInternal = (props) => {
|
|
|
46
46
|
setExpandAll(false);
|
|
47
47
|
}
|
|
48
48
|
const updatedEntries = useMemo(() => {
|
|
49
|
-
return assignIdsToSectionsAndRichText(entries, object, parameters);
|
|
49
|
+
return object ? assignIdsToSectionsAndRichText(entries, object, parameters) : [];
|
|
50
50
|
}, [entries, object, parameters]);
|
|
51
51
|
useEffect(() => {
|
|
52
52
|
(async () => {
|
|
@@ -468,7 +468,8 @@ function FormRendererContainer(props) {
|
|
|
468
468
|
padding: '0px',
|
|
469
469
|
border: !isLoading ? '1px solid #dbe0e4' : undefined,
|
|
470
470
|
...sx,
|
|
471
|
-
} }, !isLoading ? (React.createElement(React.Fragment, null,
|
|
471
|
+
} }, !isLoading ? (React.createElement(React.Fragment, null,
|
|
472
|
+
React.createElement(FormRenderer, { onSubmit: onSubmit ? (data) => onSubmit(data, saveHandler) : saveHandler, onSubmitError: onSubmitError, onDiscardChanges: onDiscardChanges, richTextEditor: richTextEditor, fieldHeight: display?.fieldHeight ?? 'medium', value: formDataRef.current, form: form, instance: dataType !== 'documents' ? instance : document, onChange: onChange, onAutosave: onAutosave, associatedObject: associatedObject, renderHeader: composedRenderHeader, renderBody: renderBody, renderFooter: document && !hasDocumentUpdateAccess ? () => React.createElement(React.Fragment, null) : renderFooter }))) : (React.createElement(Box, { sx: { padding: '20px' } },
|
|
472
473
|
React.createElement(Box, { display: 'flex', width: '100%', justifyContent: 'space-between' },
|
|
473
474
|
React.createElement(Skeleton, { width: '78%', sx: { borderRadius: '8px', height: '40px' } }),
|
|
474
475
|
React.createElement(Skeleton, { width: '20%', sx: { borderRadius: '8px', height: '40px' } })),
|
|
@@ -53,6 +53,8 @@ export function RecursiveEntryRenderer(props) {
|
|
|
53
53
|
const initialMiddleObjectInstances = fetchedOptions[`${entryId}InitialMiddleObjectInstances`];
|
|
54
54
|
const middleObject = fetchedOptions[`${entryId}MiddleObject`];
|
|
55
55
|
const fieldDefinition = useMemo(() => {
|
|
56
|
+
if (!object)
|
|
57
|
+
return undefined;
|
|
56
58
|
return getFieldDefinition(entry, object, parameters, form?.id === 'documentForm');
|
|
57
59
|
}, [entry, parameters, object]);
|
|
58
60
|
const validation = fieldDefinition?.validation || {};
|
|
@@ -87,7 +87,7 @@ export declare function formatSubmission(submission: FieldValues, apiServices?:
|
|
|
87
87
|
isError: boolean;
|
|
88
88
|
}>>): Promise<FieldValues>;
|
|
89
89
|
export declare function filterEmptySections(entry: Sections | Columns, instance?: FieldValues, formData?: FieldValues): Sections | Columns | null;
|
|
90
|
-
export declare function assignIdsToSectionsAndRichText(entries: FormEntry[], object
|
|
90
|
+
export declare function assignIdsToSectionsAndRichText(entries: FormEntry[], object: Obj, parameters?: InputParameter[]): FormEntry[];
|
|
91
91
|
/**
|
|
92
92
|
* Converts a plain text string to RTF format suitable for a RichTextEditor.
|
|
93
93
|
*
|
|
@@ -101,4 +101,4 @@ export declare function assignIdsToSectionsAndRichText(entries: FormEntry[], obj
|
|
|
101
101
|
* This ensures that any plain text input will be safely represented in RTF without losing formatting or characters.
|
|
102
102
|
*/
|
|
103
103
|
export declare function plainTextToRtf(plainText: string): string;
|
|
104
|
-
export declare function getFieldDefinition(entry: FormEntry, object
|
|
104
|
+
export declare function getFieldDefinition(entry: FormEntry, object: Obj, parameters?: InputParameter[], isDocument?: boolean): InputParameter | Property | undefined;
|
|
@@ -810,8 +810,8 @@ export function getFieldDefinition(entry, object, parameters, isDocument) {
|
|
|
810
810
|
def = isDocument
|
|
811
811
|
? docProperties.find((prop) => prop.id === entry.propertyId)
|
|
812
812
|
: isAddressProperty(entry.propertyId)
|
|
813
|
-
? object
|
|
814
|
-
: object
|
|
813
|
+
? object.properties?.find((prop) => prop.id === entry.propertyId.split('.')[0])
|
|
814
|
+
: object.properties?.find((prop) => prop.id === entry.propertyId);
|
|
815
815
|
}
|
|
816
816
|
else if (entry.type === 'inputField') {
|
|
817
817
|
def = entry.input;
|
|
@@ -74,10 +74,14 @@ function ViewDetailsV2Container(props) {
|
|
|
74
74
|
onError(error);
|
|
75
75
|
});
|
|
76
76
|
}
|
|
77
|
+
else {
|
|
78
|
+
console.error('Panel Layout could not be found');
|
|
79
|
+
setError(true);
|
|
80
|
+
}
|
|
77
81
|
}, [panelLayoutId, sanitizedObject, objectId]);
|
|
78
82
|
const updatedEntries = useMemo(() => {
|
|
79
|
-
return assignIdsToSectionsAndRichText(panelLayout?.entries || []);
|
|
80
|
-
}, [panelLayout?.
|
|
83
|
+
return sanitizedObject ? assignIdsToSectionsAndRichText(panelLayout?.entries || [], sanitizedObject) : [];
|
|
84
|
+
}, [panelLayout?.entries, sanitizedObject]);
|
|
81
85
|
const isLoading = (instanceId && !instance) || !panelLayout || !sanitizedObject;
|
|
82
86
|
const hasSections = updatedEntries.some((entry) => entry.type === 'sections');
|
|
83
87
|
const headerProps = {
|