@evoke-platform/ui-components 1.8.0-dev.11 → 1.8.0-dev.13
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/Form/FormComponents/ObjectComponent/ObjectPropertyInput.js +3 -1
- package/dist/published/components/custom/Form/FormComponents/RepeatableFieldComponent/ActionDialog.d.ts +2 -0
- package/dist/published/components/custom/Form/FormComponents/RepeatableFieldComponent/ActionDialog.js +2 -2
- package/dist/published/components/custom/Form/FormComponents/RepeatableFieldComponent/RepeatableField.d.ts +2 -0
- package/dist/published/components/custom/Form/FormComponents/RepeatableFieldComponent/RepeatableField.js +2 -2
- package/package.json +1 -1
package/dist/published/components/custom/Form/FormComponents/ObjectComponent/ObjectPropertyInput.js
CHANGED
|
@@ -270,10 +270,12 @@ export const ObjectPropertyInput = (props) => {
|
|
|
270
270
|
['DIV', 'INPUT'].includes(e.target?.nodeName) &&
|
|
271
271
|
(instance?.[property.id]?.id ||
|
|
272
272
|
selectedInstance?.id)) {
|
|
273
|
-
navigateTo
|
|
273
|
+
if (navigateTo) {
|
|
274
|
+
setOpenOptions(false);
|
|
274
275
|
navigateTo(navigationSlug.replace(':instanceId', instance?.[property.id]?.id ??
|
|
275
276
|
selectedInstance?.id ??
|
|
276
277
|
''));
|
|
278
|
+
}
|
|
277
279
|
}
|
|
278
280
|
}, sx: {
|
|
279
281
|
...(!loadingOptions &&
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { Action, ApiServices, Obj, UserAccount } from '@evoke-platform/context';
|
|
2
|
+
import { ReactComponent } from '@formio/react';
|
|
2
3
|
import React from 'react';
|
|
3
4
|
import { Address, ObjectPropertyInputProps } from '../../types';
|
|
4
5
|
export type ActionDialogProps = {
|
|
@@ -20,5 +21,6 @@ export type ActionDialogProps = {
|
|
|
20
21
|
instanceId: string;
|
|
21
22
|
propertyId: string;
|
|
22
23
|
};
|
|
24
|
+
richTextEditor?: typeof ReactComponent;
|
|
23
25
|
};
|
|
24
26
|
export declare const ActionDialog: (props: ActionDialogProps) => React.JSX.Element;
|
|
@@ -36,7 +36,7 @@ const styles = {
|
|
|
36
36
|
},
|
|
37
37
|
};
|
|
38
38
|
export const ActionDialog = (props) => {
|
|
39
|
-
const { open, onClose, action, instanceInput, handleSubmit, apiServices, object, instanceId, objectInputCommonProps, queryAddresses, associatedObject, user, } = props;
|
|
39
|
+
const { open, onClose, action, instanceInput, handleSubmit, apiServices, object, instanceId, objectInputCommonProps, queryAddresses, associatedObject, user, richTextEditor, } = props;
|
|
40
40
|
const [updatedObject, setUpdatedObject] = useState();
|
|
41
41
|
const [hasAccess, setHasAccess] = useState(false);
|
|
42
42
|
const [loading, setLoading] = useState(false);
|
|
@@ -76,7 +76,7 @@ export const ActionDialog = (props) => {
|
|
|
76
76
|
React.createElement(IconButton, { sx: styles.closeIcon, onClick: onClose },
|
|
77
77
|
React.createElement(Close, { fontSize: "small" })),
|
|
78
78
|
action && hasAccess && !loading ? action?.name : ''),
|
|
79
|
-
React.createElement(DialogContent, null, hasAccess ? (React.createElement(Box, { sx: { width: '100%', marginTop: '10px' } }, (updatedObject || isDeleteAction) && (React.createElement(Form, { actionId: action.id, actionType: action.type, apiServices: objectInputCommonProps.apiServices, object: !isDeleteAction ? updatedObject : object, instance: instanceInput, onSave: async (data, setSubmitting) => handleSubmit(action.type, data, instanceId, setSubmitting), objectInputCommonProps: objectInputCommonProps, closeModal: onClose, queryAddresses: queryAddresses, user: user, submitButtonLabel: isDeleteAction ? 'Delete' : undefined, associatedObject: associatedObject })))) : (React.createElement(React.Fragment, null, loading ? (React.createElement(React.Fragment, null,
|
|
79
|
+
React.createElement(DialogContent, null, hasAccess ? (React.createElement(Box, { sx: { width: '100%', marginTop: '10px' } }, (updatedObject || isDeleteAction) && (React.createElement(Form, { actionId: action.id, actionType: action.type, apiServices: objectInputCommonProps.apiServices, object: !isDeleteAction ? updatedObject : object, instance: instanceInput, onSave: async (data, setSubmitting) => handleSubmit(action.type, data, instanceId, setSubmitting), objectInputCommonProps: objectInputCommonProps, closeModal: onClose, queryAddresses: queryAddresses, user: user, submitButtonLabel: isDeleteAction ? 'Delete' : undefined, associatedObject: associatedObject, richTextEditor: richTextEditor })))) : (React.createElement(React.Fragment, null, loading ? (React.createElement(React.Fragment, null,
|
|
80
80
|
React.createElement(Skeleton, { height: '30px', animation: 'wave' }),
|
|
81
81
|
React.createElement(Skeleton, { height: '30px', animation: 'wave' }),
|
|
82
82
|
React.createElement(Skeleton, { height: '30px', animation: 'wave' }))) : (React.createElement(ErrorComponent, { code: 'AccessDenied', message: 'You do not have permission to perform this action.', styles: { boxShadow: 'none' } })))))));
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { ApiServices, ObjectInstance, Property, UserAccount, ViewLayoutEntityReference } from '@evoke-platform/context';
|
|
2
|
+
import { ReactComponent } from '@formio/react';
|
|
2
3
|
import React from 'react';
|
|
3
4
|
import { Address } from '../../types';
|
|
4
5
|
export type ObjectPropertyInputProps = {
|
|
@@ -9,6 +10,7 @@ export type ObjectPropertyInputProps = {
|
|
|
9
10
|
queryAddresses?: (query: string) => Promise<Address[]>;
|
|
10
11
|
user?: UserAccount;
|
|
11
12
|
viewLayout?: ViewLayoutEntityReference;
|
|
13
|
+
richTextEditor?: typeof ReactComponent;
|
|
12
14
|
};
|
|
13
15
|
declare const RepeatableField: (props: ObjectPropertyInputProps) => React.JSX.Element;
|
|
14
16
|
export default RepeatableField;
|
|
@@ -33,7 +33,7 @@ const styles = {
|
|
|
33
33
|
},
|
|
34
34
|
};
|
|
35
35
|
const RepeatableField = (props) => {
|
|
36
|
-
const { property, instance, canUpdateProperty, apiServices, queryAddresses, user, viewLayout } = props;
|
|
36
|
+
const { property, instance, canUpdateProperty, apiServices, queryAddresses, user, viewLayout, richTextEditor } = props;
|
|
37
37
|
const [relatedInstances, setRelatedInstances] = useState([]);
|
|
38
38
|
const [relatedObject, setRelatedObject] = useState();
|
|
39
39
|
const [hasCreateAction, setHasCreateAction] = useState(false);
|
|
@@ -433,7 +433,7 @@ const RepeatableField = (props) => {
|
|
|
433
433
|
objectInputCommonProps: { apiServices }, action: relatedObject?.actions?.find((a) => a.id ===
|
|
434
434
|
(dialogType === 'create' ? '_create' : dialogType === 'update' ? '_update' : '_delete')), instanceId: selectedRow, queryAddresses: queryAddresses, user: user, associatedObject: instance.id && property.relatedPropertyId
|
|
435
435
|
? { instanceId: instance.id, propertyId: property.relatedPropertyId }
|
|
436
|
-
: undefined })),
|
|
436
|
+
: undefined, richTextEditor: richTextEditor })),
|
|
437
437
|
React.createElement(Snackbar, { open: snackbarError.showAlert, handleClose: () => setSnackbarError({ isError: snackbarError.isError, showAlert: false }), message: snackbarError.message, error: snackbarError.isError })));
|
|
438
438
|
};
|
|
439
439
|
export default RepeatableField;
|