@evoke-platform/ui-components 1.10.0-testing.4 → 1.10.0-testing.6
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/components/RecursiveEntryRenderer.js +2 -11
- package/dist/published/components/custom/FormV2/components/utils.js +2 -7
- package/dist/published/components/custom/FormV2/tests/FormRenderer.test.js +1 -0
- package/dist/published/stories/FormRendererData.js +1 -43
- package/package.json +1 -1
|
@@ -154,18 +154,9 @@ export function RecursiveEntryRenderer(props) {
|
|
|
154
154
|
: `${entryId}-reset-false`, ...getFieldWrapperProps(fieldDefinition, entry, entryId, fieldValue, display, errors), errorMessage: undefined },
|
|
155
155
|
React.createElement(FormField, { id: entryId,
|
|
156
156
|
// TODO: Ideally the FormField prop should be called parameter but can't change the name for backwards compatibility reasons
|
|
157
|
-
property: fieldDefinition, defaultValue: fieldValue || getValues(entryId), onChange: handleChange, readOnly: entry.type === 'readonlyField', placeholder: display?.placeholder, mask: validation?.mask, isOptionEqualToValue: isOptionEqualToValue, error: !!errors?.[entryId], errorMessage: errors?.[entryId]?.message, isMultiLineText: !!display?.rowCount, rows: display?.rowCount, required: entry.display?.required || false,
|
|
158
|
-
if (typeof option === 'string') {
|
|
159
|
-
return (entry?.enumWithLabels?.find((e) => e.value === option)
|
|
160
|
-
?.label ?? option);
|
|
161
|
-
}
|
|
162
|
-
else {
|
|
163
|
-
return (entry?.enumWithLabels?.find((e) => e.value === option.value)?.label ?? String(option.value));
|
|
164
|
-
}
|
|
165
|
-
}, size: fieldHeight, sortBy: display?.choicesDisplay?.sortBy && display.choicesDisplay.sortBy, displayOption: fieldDefinition.type === 'boolean'
|
|
157
|
+
property: fieldDefinition, defaultValue: fieldValue || getValues(entryId), onChange: handleChange, readOnly: entry.type === 'readonlyField', placeholder: display?.placeholder, mask: validation?.mask, isOptionEqualToValue: isOptionEqualToValue, error: !!errors?.[entryId], errorMessage: errors?.[entryId]?.message, isMultiLineText: !!display?.rowCount, rows: display?.rowCount, required: entry.display?.required || false, size: fieldHeight, sortBy: display?.choicesDisplay?.sortBy && display.choicesDisplay.sortBy, displayOption: fieldDefinition.type === 'boolean'
|
|
166
158
|
? display?.booleanDisplay
|
|
167
|
-
: display?.choicesDisplay?.type && display.choicesDisplay.type, label: display?.label, description: display?.description, tooltip: display?.tooltip, selectOptions:
|
|
168
|
-
entry.enumWithLabels, additionalProps: additionalProps, isCombobox: fieldDefinition.nonStrictEnum, strictlyTrue: fieldDefinition.strictlyTrue })));
|
|
159
|
+
: display?.choicesDisplay?.type && display.choicesDisplay.type, label: display?.label, description: display?.description, tooltip: display?.tooltip, selectOptions: fieldDefinition?.enum, additionalProps: additionalProps, isCombobox: fieldDefinition.nonStrictEnum, strictlyTrue: fieldDefinition.strictlyTrue })));
|
|
169
160
|
}
|
|
170
161
|
}
|
|
171
162
|
else if (entry.type === 'columns') {
|
|
@@ -482,11 +482,6 @@ export function convertDocToEntries(document) {
|
|
|
482
482
|
sortBy: 'ASC',
|
|
483
483
|
},
|
|
484
484
|
},
|
|
485
|
-
enumWithLabels: [
|
|
486
|
-
{ label: 'Public', value: 'Public' },
|
|
487
|
-
{ label: 'Private', value: 'Private' },
|
|
488
|
-
{ label: 'Portal', value: 'Portal' },
|
|
489
|
-
],
|
|
490
485
|
});
|
|
491
486
|
}
|
|
492
487
|
entries.push({
|
|
@@ -507,8 +502,8 @@ export function formatDataToDoc(data) {
|
|
|
507
502
|
uploadedDate: data.uploadedDate,
|
|
508
503
|
versionId: data.versionId,
|
|
509
504
|
metadata: {
|
|
510
|
-
type: data.type,
|
|
511
|
-
view_permission: data.view_permission,
|
|
505
|
+
type: data.type ?? '',
|
|
506
|
+
view_permission: data.view_permission ?? '',
|
|
512
507
|
},
|
|
513
508
|
};
|
|
514
509
|
}
|
|
@@ -196,7 +196,7 @@ export const mockMovieObject = {
|
|
|
196
196
|
id: 'customers',
|
|
197
197
|
name: 'Customers',
|
|
198
198
|
type: 'collection',
|
|
199
|
-
objectId: '
|
|
199
|
+
objectId: 'customerMovie',
|
|
200
200
|
relatedPropertyId: 'movie',
|
|
201
201
|
manyToManyPropertyId: 'customer',
|
|
202
202
|
},
|
|
@@ -533,20 +533,6 @@ export const mockEvokeForm = {
|
|
|
533
533
|
display: {
|
|
534
534
|
label: 'Multi-Select',
|
|
535
535
|
},
|
|
536
|
-
enumWithLabels: [
|
|
537
|
-
{
|
|
538
|
-
label: '1',
|
|
539
|
-
value: '1',
|
|
540
|
-
},
|
|
541
|
-
{
|
|
542
|
-
label: '2',
|
|
543
|
-
value: '2',
|
|
544
|
-
},
|
|
545
|
-
{
|
|
546
|
-
label: '3',
|
|
547
|
-
value: '3',
|
|
548
|
-
},
|
|
549
|
-
],
|
|
550
536
|
},
|
|
551
537
|
{
|
|
552
538
|
type: 'input',
|
|
@@ -817,20 +803,6 @@ export const mockDocEvokeForm = {
|
|
|
817
803
|
sortBy: 'ASC',
|
|
818
804
|
},
|
|
819
805
|
},
|
|
820
|
-
enumWithLabels: [
|
|
821
|
-
{
|
|
822
|
-
label: 'Public',
|
|
823
|
-
value: 'Public',
|
|
824
|
-
},
|
|
825
|
-
{
|
|
826
|
-
label: 'Private',
|
|
827
|
-
value: 'Private',
|
|
828
|
-
},
|
|
829
|
-
{
|
|
830
|
-
label: 'Portal',
|
|
831
|
-
value: 'Portal',
|
|
832
|
-
},
|
|
833
|
-
],
|
|
834
806
|
},
|
|
835
807
|
{
|
|
836
808
|
type: 'readonlyField',
|
|
@@ -889,20 +861,6 @@ export const mockEvokeFormWithSections = {
|
|
|
889
861
|
display: {
|
|
890
862
|
label: 'Multi-Select',
|
|
891
863
|
},
|
|
892
|
-
enumWithLabels: [
|
|
893
|
-
{
|
|
894
|
-
label: '1',
|
|
895
|
-
value: '1',
|
|
896
|
-
},
|
|
897
|
-
{
|
|
898
|
-
label: '2',
|
|
899
|
-
value: '2',
|
|
900
|
-
},
|
|
901
|
-
{
|
|
902
|
-
label: '3',
|
|
903
|
-
value: '3',
|
|
904
|
-
},
|
|
905
|
-
],
|
|
906
864
|
},
|
|
907
865
|
{
|
|
908
866
|
type: 'input',
|