umwd-components 0.1.818 → 0.1.820

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.
@@ -4,6 +4,6 @@
4
4
  * @license MIT
5
5
  */
6
6
 
7
- var safeBuffer = {exports: {}};
7
+ var scheduler = {exports: {}};
8
8
 
9
- export { safeBuffer as __module };
9
+ export { scheduler as __module };
@@ -4,6 +4,6 @@
4
4
  * @license MIT
5
5
  */
6
6
 
7
- var scheduler = {exports: {}};
7
+ var safeBuffer = {exports: {}};
8
8
 
9
- export { scheduler as __module };
9
+ export { safeBuffer as __module };
@@ -4,7 +4,7 @@
4
4
  * @license MIT
5
5
  */
6
6
 
7
- import { __module as safeBuffer } from '../../_virtual/index8.js';
7
+ import { __module as safeBuffer } from '../../_virtual/index9.js';
8
8
  import require$$0 from 'buffer';
9
9
 
10
10
  /*! safe-buffer. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> */
@@ -5,7 +5,7 @@
5
5
  */
6
6
 
7
7
  import { getDefaultExportFromCjs } from '../../_virtual/_commonjsHelpers.js';
8
- import { __module as scheduler } from '../../_virtual/index9.js';
8
+ import { __module as scheduler } from '../../_virtual/index8.js';
9
9
  import { __require as requireScheduler_production } from './cjs/scheduler.production.js';
10
10
  import { __require as requireScheduler_development } from './cjs/scheduler.development.js';
11
11
 
@@ -9,7 +9,6 @@ import { jsx, jsxs, Fragment as Fragment$1 } from 'react/jsx-runtime';
9
9
  import { useActionState, useState, useEffect, Suspense, Fragment, useTransition } from 'react';
10
10
  import { useSnackbar } from '../../../context/common/SnackbarContext.js';
11
11
  import { requestRmaAction } from '../../../data/actions/e-commerce/iro/requestRmaAction.js';
12
- import { StrapiErrors } from '../../StrapiErrors.js';
13
12
  import { SubmitButton } from '../../SubmitButton.js';
14
13
  import Typography from '@mui/material/Typography';
15
14
  import Grid from '@mui/material/Grid';
@@ -108,10 +107,11 @@ const ConfirmRMADialog = ({ open, onClose, items, formState, submitCallback, })
108
107
  if (submitCallback) {
109
108
  startTransition(() => {
110
109
  submitCallback();
110
+ onClose(); // Close the dialog after the transition
111
111
  });
112
112
  }
113
113
  };
114
- return (jsxs(Dialog, { open: open, onClose: onClose, children: [jsx(DialogTitle, { children: "Confirm RMA" }), jsxs(DialogContent, { children: [jsx(DialogContentText, { children: "Summary of items to be returned:" }), jsx(List, { children: items.map((item, index) => (jsx(ListItem, { children: `Product with ID ${item.product} - Quantity: ${item.returned_quantity}` }, index))) }), jsx(DialogContentText, { children: "Are you sure you want to request a return merchandise authorization for these items?" }), jsx(Checkbox, { onChange: (e) => setMissingConfirmations(!e.target.checked) }), jsx(Typography, { variant: "body1", children: "I confirm that the information I have provided is accurate and truthful. I understand that providing false or misleading information about the reason for returning goods may result in additional costs being charged to me. By checking this box, I acknowledge my legal responsibility for the accuracy of my declaration." })] }), jsxs(DialogActions, { children: [jsx(SubmitButton, { text: "Yes", loadingText: "Loading...", disabled: missingConfirmations, onClick: handleSubmit, loading: isPending }), jsx(Button, { onClick: onClose, children: "No" }), formState?.strapiErrors !== null && (jsx(StrapiErrors, { error: formState?.strapiErrors })), formState?.message && (jsx(Alert, { severity: "error", children: formState?.message }))] })] }));
114
+ return (jsxs(Dialog, { open: open, onClose: onClose, children: [jsx(DialogTitle, { children: "Confirm RMA" }), jsxs(DialogContent, { children: [jsx(DialogContentText, { children: "Summary of items to be returned:" }), jsx(List, { children: items.map((item, index) => (jsx(ListItem, { children: `Product with ID ${item.product} - Quantity: ${item.returned_quantity}` }, index))) }), jsx(DialogContentText, { children: "Are you sure you want to request a return merchandise authorization for these items?" }), jsx(Checkbox, { onChange: (e) => setMissingConfirmations(!e.target.checked) }), jsx(Typography, { variant: "body1", children: "I confirm that the information I have provided is accurate and truthful. I understand that providing false or misleading information about the reason for returning goods may result in additional costs being charged to me. By checking this box, I acknowledge my legal responsibility for the accuracy of my declaration." })] }), jsxs(DialogActions, { children: [jsx(SubmitButton, { text: "Yes", loadingText: "Loading...", disabled: missingConfirmations, onClick: handleSubmit, loading: isPending }), jsx(Button, { onClick: onClose, children: "No" })] })] }));
115
115
  };
116
116
  /* INFO Request RMA Return Merchandise Authorization for customers*/
117
117
  function RmaForm({ opo, sx, revalidateCallback, handleClose, }) {
@@ -154,11 +154,11 @@ function RmaForm({ opo, sx, revalidateCallback, handleClose, }) {
154
154
  formAction(new FormData());
155
155
  }
156
156
  setOpen(!open);
157
- } }), jsxs(Grid, { size: 12, children: [jsx(Button, { onClick: () => {
158
- console.log(formState);
159
- setOpen(!open);
160
- }, disabled: selectedItems.length === 0 ||
161
- selectedItems.reduce((acc, index) => acc + itemsToReturn[index].returned_quantity, 0) === 0, children: "Request RMA" }), formState?.strapiErrors !== null && (jsx(StrapiErrors, { error: formState?.strapiErrors })), formState?.message && (jsx(Alert, { severity: "error", children: formState?.message }))] })] }) }) }));
157
+ } }), jsx(Grid, { size: 12, children: jsx(Button, { onClick: () => {
158
+ console.log(formState);
159
+ setOpen(!open);
160
+ }, disabled: selectedItems.length === 0 ||
161
+ selectedItems.reduce((acc, index) => acc + itemsToReturn[index].returned_quantity, 0) === 0, children: "Request RMA" }) })] }) }) }));
162
162
  }
163
163
 
164
164
  export { RmaForm as default };
@@ -24,6 +24,7 @@ async function createIroAction(prevState, formData) {
24
24
  return {
25
25
  ...prevState,
26
26
  strapiErrors: null,
27
+ severity: "error",
27
28
  message: "Please add at least one item to the Iro.",
28
29
  };
29
30
  }
@@ -16,11 +16,9 @@ async function requestRmaAction(prevState, formData) {
16
16
  Object.fromEntries(formData);
17
17
  const parsedFormData = parseFormData(formData);
18
18
  if (parsedFormData.data.iro_items) {
19
- console.log("parsedFormData.data.iro_items", parsedFormData.data.iro_items);
20
19
  parsedFormData.data.iro_items = JSON.parse(parsedFormData.data.iro_items);
21
20
  }
22
21
  if (parsedFormData.data.opos) {
23
- console.log("parsedFormData.data.opos", parsedFormData.data.opos);
24
22
  parsedFormData.data.opos = parsedFormData.data.opos;
25
23
  }
26
24
  const responseData = await mutateData("POST", `/api/iros`, parsedFormData);
@@ -28,6 +26,7 @@ async function requestRmaAction(prevState, formData) {
28
26
  return {
29
27
  ...prevState,
30
28
  strapiErrors: null,
29
+ severity: "error",
31
30
  message: "Ops! Something went wrong. Please try again.",
32
31
  };
33
32
  }
@@ -35,6 +34,7 @@ async function requestRmaAction(prevState, formData) {
35
34
  return {
36
35
  ...prevState,
37
36
  strapiErrors: responseData.error,
37
+ severity: "error",
38
38
  message: "Failed to Create Iro.",
39
39
  };
40
40
  }
@@ -42,6 +42,7 @@ async function requestRmaAction(prevState, formData) {
42
42
  return {
43
43
  ...prevState,
44
44
  message: "Iro Created Successfully",
45
+ severity: "success",
45
46
  data: flattenedData,
46
47
  strapiErrors: null,
47
48
  };