umwd-components 0.1.650 → 0.1.651
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,4 +4,4 @@
|
|
|
4
4
|
* @copyright Jelle Paulus
|
|
5
5
|
* @license MIT
|
|
6
6
|
*/
|
|
7
|
-
import{__read as e,__spreadArray as r}from"../../../../node_modules/tslib/tslib.es6.js";import t,{useState as o,useEffect as a}from"react";import{useFormState as m}from"react-dom";import{useSnackbar as n}from"../../../context/common/SnackbarContext.js";import{createIroAction as i}from"../../../data/actions/e-commerce/iro/createIroAction.js";import{StrapiErrors as s}from"../../StrapiErrors.js";import{SubmitButton as l}from"../../SubmitButton.js";import{CustomerSelector as c}from"../customer/CustomerSelector.js";import{IROItemFields as u}from"./IROItemFields.js";import d from"@mui/material/Typography";import p from"@mui/material/Grid";import E from"@mui/material/Box";import f from"@mui/material/TextField";import h from"@mui/material/Checkbox";import v from"@mui/material/Alert";import g from"@mui/material/Stack";var
|
|
7
|
+
import{__read as e,__spreadArray as r}from"../../../../node_modules/tslib/tslib.es6.js";import t,{useState as o,useEffect as a}from"react";import{useFormState as m}from"react-dom";import{useSnackbar as n}from"../../../context/common/SnackbarContext.js";import{createIroAction as i}from"../../../data/actions/e-commerce/iro/createIroAction.js";import{StrapiErrors as s}from"../../StrapiErrors.js";import{SubmitButton as l}from"../../SubmitButton.js";import{CustomerSelector as c}from"../customer/CustomerSelector.js";import{IROItemFields as u}from"./IROItemFields.js";import d from"@mui/material/Typography";import p from"@mui/material/Grid";import E from"@mui/material/Box";import f from"@mui/material/TextField";import h from"@mui/material/Checkbox";import v from"@mui/material/Alert";import g from"@mui/material/Stack";import y from"@mui/material/Button";var x={zodErrors:null,strapiErrors:null,data:null,message:null,severity:null};function C(C){var b=C.sx,j=C.revalidateCallback,w=C.handleClose,A=C.customerLabels,I=C.productLabels,k=e(o(!1),2),S=k[0],L=k[1],B=e(m(i,x),2),T=B[0],_=B[1],z=n().handleAddMessage;return a((function(){(null==T?void 0:T.message)&&(z({message:T.message,severity:T.severity||"error"}),"success"===T.severity&&(j&&j(),w&&w()))}),[null==T?void 0:T.message]),a((function(){(null==T?void 0:T.strapiErrors)&&z({message:T.strapiErrors.message||"Error creating return order",severity:T.severity||"error"})}),[null==T?void 0:T.strapiErrors]),t.createElement(E,{sx:r([{p:2}],e(Array.isArray(b)?b:[b]),!1)},t.createElement("form",{action:_},t.createElement(p,{container:!0,spacing:2},t.createElement(p,{item:!0,xs:12},t.createElement(g,{spacing:2},t.createElement(d,{variant:"h6"},"Choose a customer"),t.createElement(d,{variant:"body2"},"Select the customer for which you want to create a return order"),t.createElement(c,{customerLabels:A}))),t.createElement(p,{item:!0,xs:12},t.createElement(g,{spacing:2},t.createElement(d,{variant:"h6"},"Customer reference"),t.createElement(d,null,"If the customer utilizes a custom reference for inbound order management it should be left here"),t.createElement(f,{id:"customer_reference",name:"customer_reference",sx:{width:"100%"}}))),t.createElement(p,{item:!0,xs:12},t.createElement(d,{variant:"h6"},"Choose products that should be in this return order"),t.createElement(u,{productsArr:I})),t.createElement(p,{item:!0,xs:12},t.createElement(d,{variant:"h6"},"Confirm Order"),t.createElement(d,null,"Are you sure you want to confirm this return? Confirming this order means you are sure the customer wants to return the products and you are ready to process the return."),t.createElement(g,{direction:"row",spacing:1,alignItems:"center"},t.createElement(h,{value:S,checked:S,onChange:function(){return L(!S)}}),S&&t.createElement(d,{color:"primary"},"I am sure I want to confirm this return order")),t.createElement("input",{name:"status",type:"hidden",value:S?"returning":"requested"})),t.createElement(p,{item:!0,xs:12},t.createElement(l,{text:"Confirm",loadingText:"Loading..."}),t.createElement(y,{onClick:w,variant:"outlined"},"Cancel")),t.createElement(p,{item:!0,xs:12},null!==(null==T?void 0:T.strapiErrors)&&t.createElement(s,{error:null==T?void 0:T.strapiErrors}),(null==T?void 0:T.message)&&t.createElement(v,{severity:"error"},null==T?void 0:T.message)))))}export{C as default};
|