@evoke-platform/ui-components 1.10.0-testing.17 → 1.10.0-testing.18
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/FormRendererContainer.js +16 -39
- package/dist/published/components/custom/FormV2/components/FormFieldTypes/CollectionFiles/RepeatableField.js +0 -21
- package/dist/published/components/custom/FormV2/components/FormFieldTypes/relatedObjectFiles/ObjectPropertyInput.js +0 -15
- package/package.json +1 -1
|
@@ -123,49 +123,26 @@ function FormRendererContainer(props) {
|
|
|
123
123
|
onError(error);
|
|
124
124
|
});
|
|
125
125
|
}
|
|
126
|
-
else if (action) {
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
},
|
|
126
|
+
else if (action?.type === 'delete' && instance) {
|
|
127
|
+
setForm({
|
|
128
|
+
id: '',
|
|
129
|
+
name: '',
|
|
130
|
+
entries: [
|
|
131
|
+
{
|
|
132
|
+
type: 'content',
|
|
133
|
+
html: `<p>You are about to delete <strong>${instance.name}</strong>. Deleted records can't be restored. Are you sure you want to continue?</p>`,
|
|
135
134
|
},
|
|
135
|
+
],
|
|
136
|
+
objectId: objectId,
|
|
137
|
+
actionId: '_delete',
|
|
138
|
+
display: {
|
|
139
|
+
submitLabel: 'Delete',
|
|
136
140
|
},
|
|
137
|
-
})
|
|
138
|
-
.then((matchingForms) => {
|
|
139
|
-
if (matchingForms.length === 1) {
|
|
140
|
-
const form = matchingForms[0];
|
|
141
|
-
setForm(form);
|
|
142
|
-
// use this default form if no delete form is found
|
|
143
|
-
}
|
|
144
|
-
else if (action.type === 'delete' && instance) {
|
|
145
|
-
setForm({
|
|
146
|
-
id: '',
|
|
147
|
-
name: '',
|
|
148
|
-
entries: [
|
|
149
|
-
{
|
|
150
|
-
type: 'content',
|
|
151
|
-
html: `<p>You are about to delete <strong>${instance.name}</strong>. Deleted records can't be restored. Are you sure you want to continue?</p>`,
|
|
152
|
-
},
|
|
153
|
-
],
|
|
154
|
-
objectId: objectId,
|
|
155
|
-
actionId: '_delete',
|
|
156
|
-
display: {
|
|
157
|
-
submitLabel: 'Delete',
|
|
158
|
-
},
|
|
159
|
-
});
|
|
160
|
-
}
|
|
161
|
-
else if (instance || action.type === 'create') {
|
|
162
|
-
setError('Default action form could not be found');
|
|
163
|
-
}
|
|
164
|
-
})
|
|
165
|
-
.catch((error) => {
|
|
166
|
-
onError(error);
|
|
167
141
|
});
|
|
168
142
|
}
|
|
143
|
+
else {
|
|
144
|
+
setError('Action form could not be found');
|
|
145
|
+
}
|
|
169
146
|
}, [action, objectId, instance]);
|
|
170
147
|
useEffect(() => {
|
|
171
148
|
if (form?.id === 'documentForm') {
|
|
@@ -76,27 +76,6 @@ const RepeatableField = (props) => {
|
|
|
76
76
|
console.error(error);
|
|
77
77
|
});
|
|
78
78
|
}
|
|
79
|
-
else if (action) {
|
|
80
|
-
apiServices
|
|
81
|
-
.get(getPrefixedUrl('/forms'), {
|
|
82
|
-
params: {
|
|
83
|
-
filter: {
|
|
84
|
-
where: {
|
|
85
|
-
actionId: action.id,
|
|
86
|
-
objectId: fieldDefinition.objectId,
|
|
87
|
-
},
|
|
88
|
-
},
|
|
89
|
-
},
|
|
90
|
-
})
|
|
91
|
-
.then((matchingForms) => {
|
|
92
|
-
if (matchingForms.length === 1) {
|
|
93
|
-
setForm(matchingForms[0]);
|
|
94
|
-
}
|
|
95
|
-
})
|
|
96
|
-
.catch((error) => {
|
|
97
|
-
console.error(error);
|
|
98
|
-
});
|
|
99
|
-
}
|
|
100
79
|
}
|
|
101
80
|
const fetchRelatedInstances = useCallback(async (refetch = false) => {
|
|
102
81
|
let relatedObject;
|
|
@@ -171,21 +171,6 @@ const ObjectPropertyInput = (props) => {
|
|
|
171
171
|
if (formId || action?.defaultFormId) {
|
|
172
172
|
evokeForm = await apiServices.get(getPrefixedUrl(`/forms/${formId || action?.defaultFormId}`));
|
|
173
173
|
}
|
|
174
|
-
else if (action) {
|
|
175
|
-
const matchingForms = await apiServices.get(getPrefixedUrl('/forms'), {
|
|
176
|
-
params: {
|
|
177
|
-
filter: {
|
|
178
|
-
where: {
|
|
179
|
-
actionId: action.id,
|
|
180
|
-
objectId: fieldDefinition.objectId,
|
|
181
|
-
},
|
|
182
|
-
},
|
|
183
|
-
},
|
|
184
|
-
});
|
|
185
|
-
if (matchingForms.length === 1) {
|
|
186
|
-
evokeForm = matchingForms[0];
|
|
187
|
-
}
|
|
188
|
-
}
|
|
189
174
|
if (evokeForm) {
|
|
190
175
|
setForm(evokeForm);
|
|
191
176
|
setFetchedOptions({
|