@evoke-platform/ui-components 1.9.0-testing.2 → 1.9.0-testing.4

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.
@@ -1,14 +1,15 @@
1
- import { Snackbar as MUISnackbar } from '@mui/material';
1
+ import { Portal, Snackbar as MUISnackbar } from '@mui/material';
2
2
  import React from 'react';
3
3
  import UIThemeProvider from '../../../theme';
4
4
  import { Alert } from '../Alert';
5
5
  export const Snackbar = (props) => {
6
6
  const { handleClose, error, message, autoHideDuration, action, children } = props;
7
- return (React.createElement(UIThemeProvider, null, children ? (React.createElement(MUISnackbar, { ...props })) : (React.createElement(MUISnackbar, { autoHideDuration: autoHideDuration ?? 6000, onClose: () => handleClose(), anchorOrigin: {
8
- vertical: 'bottom',
9
- horizontal: 'center',
10
- }, ...props },
11
- React.createElement("div", null,
12
- React.createElement(Alert, { variant: "outlined", severity: error ? 'error' : 'success', onClose: () => handleClose(), action: action }, message))))));
7
+ return (React.createElement(UIThemeProvider, null,
8
+ React.createElement(Portal, null, children ? (React.createElement(MUISnackbar, { ...props })) : (React.createElement(MUISnackbar, { autoHideDuration: autoHideDuration ?? 6000, onClose: () => handleClose(), anchorOrigin: {
9
+ vertical: 'bottom',
10
+ horizontal: 'center',
11
+ }, ...props },
12
+ React.createElement("div", null,
13
+ React.createElement(Alert, { variant: "outlined", severity: error ? 'error' : 'success', onClose: () => handleClose(), action: action }, message)))))));
13
14
  };
14
15
  export default Snackbar;
@@ -269,13 +269,17 @@ function FormRendererContainer(props) {
269
269
  ?.filter((property) => !property.formula && property.type !== 'collection')
270
270
  .map((property) => property.id) ?? []),
271
271
  });
272
- if (response && sanitizedObject && instance) {
272
+ if (sanitizedObject && instance) {
273
273
  onSubmissionSuccess(response);
274
- deleteDocuments(submission, !!response, apiServices, sanitizedObject, instance, action ?? undefined, setSnackbarError);
274
+ deleteDocuments(submission, true, apiServices, sanitizedObject, instance, action, setSnackbarError);
275
275
  }
276
276
  }
277
277
  }
278
278
  catch (error) {
279
+ // Handle deleteDocuments for uploaded documents if the main submission fails
280
+ if (instanceId && action && sanitizedObject && instance) {
281
+ deleteDocuments(submission, false, apiServices, sanitizedObject, instance, action, setSnackbarError);
282
+ }
279
283
  setSnackbarError({
280
284
  isError: true,
281
285
  showAlert: true,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@evoke-platform/ui-components",
3
- "version": "1.9.0-testing.2",
3
+ "version": "1.9.0-testing.4",
4
4
  "description": "",
5
5
  "main": "dist/published/index.js",
6
6
  "module": "dist/published/index.js",