umwd-components 0.1.697 → 0.1.698
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/src/components/common/AmountIndicator.js +0 -1
- package/dist/src/components/common/EnhancedTable/EnhancedTable.js +0 -1
- package/dist/src/components/e-commerce/customer/CustomerProfileDisplay.js +1 -1
- package/dist/src/components/e-commerce/opo/PaymentStatusIndicator.js +1 -2
- package/dist/src/data/actions/e-commerce/iro/updateIroAction.js +1 -1
- package/dist/tsconfig.build.tsbuildinfo +1 -1
- package/dist/types/components/e-commerce/customer/BackendCustomerProfileDisplay.d.ts +18 -0
- package/dist/types/components/e-commerce/customer/FrontendCustomerProfileDisplay.d.ts +13 -0
- package/dist/types/types/e-commerce/customer/types.d.ts +2 -2
- package/package.json +1 -1
- package/src/components/common/AmountIndicator.tsx +0 -2
- package/src/components/common/EnhancedTable/EnhancedTable.tsx +0 -2
- package/src/components/e-commerce/customer/BackendCustomerProfileDisplay.tsx +261 -0
- package/src/components/e-commerce/customer/CustomerProfileDisplay.tsx +10 -2
- package/src/components/e-commerce/customer/FrontendCustomerProfileDisplay.tsx +256 -0
- package/src/components/e-commerce/opo/PaymentStatusIndicator.tsx +5 -5
- package/src/data/actions/e-commerce/iro/updateIroAction.ts +3 -0
- package/src/types/e-commerce/customer/types.ts +2 -2
|
@@ -4,4 +4,4 @@
|
|
|
4
4
|
* @copyright Jelle Paulus
|
|
5
5
|
* @license MIT
|
|
6
6
|
*/
|
|
7
|
-
import{__assign as e}from"../../../../node_modules/tslib/tslib.es6.js";import t from"react";import r from"@mui/material/Paper";import a from"@mui/material/Stack";import l from"@mui/material/Box";import n from"@mui/material/Typography";import m from"@mui/material/Button";import i from"@mui/material/Grid";import o from"@mui/material/Table";import c from"@mui/material/TableBody";import
|
|
7
|
+
import{__assign as e}from"../../../../node_modules/tslib/tslib.es6.js";import t from"react";import r from"@mui/material/Paper";import a from"@mui/material/Stack";import l from"@mui/material/Box";import n from"@mui/material/Typography";import m from"@mui/material/Button";import i from"@mui/material/Grid";import o from"@mui/material/Table";import c from"@mui/material/TableBody";import u from"@mui/material/TableCell";import s from"@mui/material/TableHead";import E from"@mui/material/TableRow";import d from"@mui/icons-material/Person";import p from"@mui/icons-material/Email";import f from"@mui/icons-material/Phone";import g from"../../common/Address.js";import v from"./BusinessCredentials.js";import{StyledLink as h}from"../../StyledLink.js";import{Alert as b}from"@mui/material";import{usePathname as y}from"next/navigation";function _(_){var x=_.data,w=x.first_name,A=x.last_name,B=x.email,D=x.phone,C=x.company_address,T=x.billing_address,j=x.delivery_address,N=x.business_credentials,S=x.editProfileUrl,P=void 0===S?"/user/profile/edit":S,k=x.completeEnough,R=void 0!==k&&k,L=x.orders,z=x.returns;if(!x)return t.createElement(a,{spacing:2},t.createElement(n,null,"Customer profile not available"));console.log("CustomerProfileDisplay",x);var O=y().includes("/user/");return t.createElement(i,{container:!0,sx:{width:"100%"},spacing:2},O&&t.createElement(i,{item:!0,xs:12},Boolean(R)?t.createElement(a,{direction:"row",justifyContent:"flex-end"},t.createElement(h,{href:P,target:"_self"},t.createElement(m,{variant:"contained"},"edit profile"))):t.createElement(b,{severity:"warning",action:t.createElement(h,{href:P,target:"_self"},t.createElement(m,{variant:"contained"},"complete profile"))},"After completion of your profile you can enjoy all the benefits of your services.")),t.createElement(i,{item:!0,xs:12},N?t.createElement(v,{data:N}):t.createElement(n,null,"Business credentials not available")),t.createElement(i,{item:!0,xs:12},t.createElement(a,{spacing:2,direction:"row"},t.createElement(d,null),t.createElement(l,null,t.createElement(n,{variant:"body1",component:"p"},w," ",A," ",!w&&!A&&"N/A"))),t.createElement(a,{spacing:2,direction:"row"},t.createElement(p,null),t.createElement(l,null,t.createElement(n,{variant:"body1",component:"p"},B," ",!B&&"N/A"))),t.createElement(a,{spacing:2,direction:"row"},t.createElement(f,null),t.createElement(l,null,t.createElement(n,{variant:"body1",component:"p"},D," ",!D&&"N/A")))),C?t.createElement(i,{item:!0,xs:12,md:4},t.createElement(n,{variant:"h6"},"Company Address"),t.createElement(g,{data:e({},C)})):t.createElement(i,{item:!0,xs:12,md:4},t.createElement(n,null,"Company address not available")),j?t.createElement(i,{item:!0,xs:12,md:4},t.createElement(n,{variant:"h6"},"Delivery Address"),t.createElement(g,{data:e({},j)})):t.createElement(i,{item:!0,xs:12,md:4},t.createElement(n,null,"Delivery address not available")),T?t.createElement(i,{item:!0,xs:12,md:4},t.createElement(n,{variant:"h6"},"Billing Address"),t.createElement(g,{data:e({},T)})):t.createElement(i,{item:!0,xs:12,md:4},t.createElement(n,null,"Billing address not available")),t.createElement(i,{item:!0,xs:12},t.createElement(n,{variant:"h6",gutterBottom:!0},"Orders"),t.createElement(r,null,L&&L.data&&L.data.length>0?t.createElement(o,null,t.createElement(s,null,t.createElement(E,null,t.createElement(u,null,"Order Number"),t.createElement(u,null,"Date"),t.createElement(u,null,"Status"),t.createElement(u,{align:"right"},"Total"),t.createElement(u,{align:"right"},"Actions"))),t.createElement(c,null,L.data.map((function(e,r){return t.createElement(E,{key:r},t.createElement(u,null,e.opo_number),t.createElement(u,null,new Date(e.order_date).toLocaleDateString()),t.createElement(u,null,e.status),t.createElement(u,{align:"right"},e.total_incl_vat," ",e.order_currency),t.createElement(u,{align:"right"},t.createElement(h,{href:"/orders/".concat(e.uuid),target:"_self"},t.createElement(m,{variant:"contained",size:"small"},"View"))))})))):t.createElement(l,{p:2},t.createElement(n,null,"You have no orders.")))),t.createElement(i,{item:!0,xs:12},t.createElement(n,{variant:"h6",gutterBottom:!0},"Returns"),t.createElement(r,null,z&&z.data&&z.data.length>0?t.createElement(o,null,t.createElement(s,null,t.createElement(E,null,t.createElement(u,null,"Return Number"),t.createElement(u,null,"RMA Number"),t.createElement(u,null,"Date"),t.createElement(u,null,"Status"),t.createElement(u,{align:"right"},"Actions"))),t.createElement(c,null,z.data.map((function(e,r){return t.createElement(E,{key:r},t.createElement(u,null,e.return_number),t.createElement(u,null,e.rma_number),t.createElement(u,null,new Date(e.return_date).toLocaleDateString()),t.createElement(u,null,e.status),t.createElement(u,{align:"right"},t.createElement(h,{href:"/returns/".concat(e.uuid),target:"_self"},t.createElement(m,{variant:"contained",size:"small"},"View"))))})))):t.createElement(l,{p:2},t.createElement(n,null,"You have no returns.")))))}export{_ as default};
|
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
"use client";
|
|
2
1
|
/*
|
|
3
2
|
* UMWD-Components
|
|
4
3
|
* @copyright Jelle Paulus
|
|
5
4
|
* @license MIT
|
|
6
5
|
*/
|
|
7
|
-
import r from"react";import o from"@mui/material/Chip";var t=[{status:"open",color:"warning"},{status:"pending",color:"warning"},{status:"authorized",color:"info"},{status:"paid",color:"success"},{status:"canceled",color:"error"},{status:"expired",color:"error"},{status:"failed",color:"error"}],e=function(e){var a,s=e.payment_status;
|
|
6
|
+
import r from"react";import o from"@mui/material/Chip";var t=[{status:"open",color:"warning"},{status:"pending",color:"warning"},{status:"authorized",color:"info"},{status:"paid",color:"success"},{status:"canceled",color:"error"},{status:"expired",color:"error"},{status:"failed",color:"error"}],e=function(e){var a,s=e.payment_status;e.provider_id;var n=s?s.charAt(0).toUpperCase()+s.slice(1):"Unknown";return r.createElement(o,{label:n,color:(null===(a=t.find((function(r){return r.status===s})))||void 0===a?void 0:a.color)||"default"})};export{e as PaymentStatusIndicator};
|
|
@@ -4,4 +4,4 @@
|
|
|
4
4
|
* @copyright Jelle Paulus
|
|
5
5
|
* @license MIT
|
|
6
6
|
*/
|
|
7
|
-
import{__awaiter as r,__generator as
|
|
7
|
+
import{__awaiter as r,__generator as e,__assign as s}from"../../../../../node_modules/tslib/tslib.es6.js";import{mutateData as t}from"../../../services/mutate-data.js";import{flattenAttributes as o}from"../../../../lib/utils.js";import{parseFormData as i}from"../../../../lib/parseFormData.js";function a(a,n){return r(this,void 0,void 0,(function(){var r,m,l,p;return e(this,(function(e){switch(e.label){case 0:return r=Object.fromEntries(n),m=i(n),console.log("parsedFormData",m),[4,t("PUT","/api/iros/".concat(r.id),m)];case 1:return(l=e.sent())?l.error?[2,s(s({},a),{strapiErrors:l.error,message:"Failed to Update Iro.",severity:"error"})]:(p=o(l),[2,s(s({},a),{message:"Iro Updated",severity:"success",data:p,strapiErrors:null})]):[2,s(s({},a),{strapiErrors:null,message:"Ops! Something went wrong. Please try again.",severity:"error"})]}}))}))}export{a as updateIroAction};
|