@evoke-platform/ui-components 1.10.0-testing.22 → 1.10.0-testing.23
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.
|
@@ -104,11 +104,14 @@ function FormRendererContainer(props) {
|
|
|
104
104
|
}
|
|
105
105
|
}, []);
|
|
106
106
|
useEffect(() => {
|
|
107
|
+
const needsInstance = action?.type !== 'create' && !!instanceId;
|
|
108
|
+
// Instance and Action are loaded in the side effect above; wait for them to complete.
|
|
109
|
+
const loading = (actionId && !action) || (needsInstance && !instance);
|
|
107
110
|
if (dataType === 'documents' || form)
|
|
108
111
|
return;
|
|
109
|
-
if (
|
|
110
|
-
return;
|
|
111
|
-
if ((formId && formId !== '_auto_')
|
|
112
|
+
if (loading)
|
|
113
|
+
return;
|
|
114
|
+
if ((formId || action?.defaultFormId) && formId !== '_auto_') {
|
|
112
115
|
apiServices
|
|
113
116
|
.get(getPrefixedUrl(`/forms/${formId || action?.defaultFormId}`))
|
|
114
117
|
.then((evokeForm) => {
|
|
@@ -125,14 +128,14 @@ function FormRendererContainer(props) {
|
|
|
125
128
|
onError(error);
|
|
126
129
|
});
|
|
127
130
|
}
|
|
128
|
-
else if (action?.type === 'delete' && formId === '_auto_'
|
|
131
|
+
else if (action?.type === 'delete' && formId === '_auto_') {
|
|
129
132
|
setForm({
|
|
130
133
|
id: '',
|
|
131
134
|
name: '',
|
|
132
135
|
entries: [
|
|
133
136
|
{
|
|
134
137
|
type: 'content',
|
|
135
|
-
html: `<p>You are about to delete <strong>${instance
|
|
138
|
+
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>`,
|
|
136
139
|
},
|
|
137
140
|
],
|
|
138
141
|
objectId: objectId,
|