Skip to content

Commit

Permalink
updated order
Browse files Browse the repository at this point in the history
  • Loading branch information
KostiantynFandeliuk committed Dec 9, 2024
1 parent bcd78c2 commit be27593
Show file tree
Hide file tree
Showing 198 changed files with 1,859 additions and 790 deletions.
16 changes: 16 additions & 0 deletions build.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,22 @@
import { overrideGQLOperations } from '@dropins/build-tools/gql-extend.js';

overrideGQLOperations([
{
npm: '@dropins/storefront-order',
operations: [
`
fragment ADDRESS_FRAGMENT on OrderAddress {
city
company
country_code
fax
firstname
lastname
middlename
}
`,
],
},
// {
// npm: '@dropins/storefront-cart',
// operations: [],
Expand Down
4 changes: 1 addition & 3 deletions scripts/__dropins__/storefront-account/api.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
export declare const BASIC_CUSTOMER_INFO_FRAGMENT = "\n fragment BasicCustomerInfo on Customer {\n date_of_birth\n email\n firstname\n gender\n lastname\n middlename\n prefix\n suffix\n created_at\n }\n";
export declare const BASIC_CUSTOMER_INFO_FRAGMENT = "\n fragment BasicCustomerInfo on Customer {\n date_of_birth\n dob\n email\n firstname\n gender\n lastname\n middlename\n prefix\n suffix\n created_at\n }\n";
//# sourceMappingURL=CustomerFragment.graphql.d.ts.map
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
export declare const GET_CUSTOMER_ADDRESS = "\n query GET_CUSTOMER_ADDRESS {\n customer {\n addresses {\n firstname\n lastname\n middlename\n fax\n prefix\n suffix\n city\n company\n country_code\n region {\n region\n region_code\n region_id\n }\n custom_attributesV2 {\n ... on AttributeValue {\n code\n value\n }\n }\n telephone\n id\n vat_id\n postcode\n street\n default_shipping\n default_billing\n }\n }\n }\n";
export declare const GET_CUSTOMER_ADDRESS = "\n query GET_CUSTOMER_ADDRESS {\n customer {\n addresses {\n firstname\n lastname\n city\n company\n country_code\n region {\n region\n region_code\n region_id\n }\n custom_attributesV2 {\n ... on AttributeValue {\n code\n value\n }\n }\n telephone\n id\n vat_id\n postcode\n street\n default_shipping\n default_billing\n }\n }\n }\n";
//# sourceMappingURL=getCustomerAddress.graphql.d.ts.map
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
export declare const GET_STORE_CONFIG = "\n query GET_STORE_CONFIG {\n storeConfig {\n base_media_url\n autocomplete_on_storefront\n minimum_password_length\n required_character_classes_number\n }\n }\n";
export declare const GET_STORE_CONFIG = "\n query GET_STORE_CONFIG {\n storeConfig {\n autocomplete_on_storefront\n minimum_password_length\n required_character_classes_number\n }\n }\n";
//# sourceMappingURL=getStoreConfig.graphql.d.ts.map

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
/*! Copyright 2024 Adobe
All Rights Reserved. */
import{t as u,m as i,f as _,l as p}from"./removeCustomerAddress.js";const f=(e,t="en-US",a={})=>{const s={...{day:"2-digit",month:"2-digit",year:"numeric"},...a},r=new Date(e);return isNaN(r.getTime())?"Invalid Date":new Intl.DateTimeFormat(t,s).format(r)},g=e=>{var d,c;if(!((c=(d=e.data)==null?void 0:d.customer)!=null&&c.orders))return null;const{items:t,page_info:a,total_count:o,date_of_first_order:s}=e.data.customer.orders,{returns:r}=e.data.customer;return{items:t.map(n=>{const l={...n,returns:r==null?void 0:r.items.filter(m=>m.order.id===n.id),order_date:f(n.order_date),shipping_address:u(n.shipping_address),billing_address:u(n.billing_address)};return i(l,"camelCase",{})}),pageInfo:i(a,"camelCase",{}),totalCount:i(o,"camelCase",{}),dateOfFirstOrder:i(s,"camelCase",{})}},y=`
import{t as u,k as i,f as _,l as f,m as p}from"./removeCustomerAddress.js";const g=(r,a="en-US",s={})=>{const t={...{day:"2-digit",month:"2-digit",year:"numeric"},...s},e=new Date(r);return isNaN(e.getTime())?"Invalid Date":new Intl.DateTimeFormat(a,t).format(e)},y=r=>{var d,c;if(!((c=(d=r.data)==null?void 0:d.customer)!=null&&c.orders))return null;const{items:a,page_info:s,total_count:o,date_of_first_order:t}=r.data.customer.orders,{returns:e}=r.data.customer;return{items:a.map(n=>{const l={...n,returns:e==null?void 0:e.items.filter(m=>m.order.id===n.id),order_date:g(n.order_date),shipping_address:u(n.shipping_address),billing_address:u(n.billing_address)};return i(l,"camelCase",{})}),pageInfo:i(s,"camelCase",{}),totalCount:i(o,"camelCase",{}),dateOfFirstOrder:i(t,"camelCase",{})}},h=`
fragment AddressesList on OrderAddress {
city
company
Expand Down Expand Up @@ -121,6 +119,6 @@ fragment OrderSummary on OrderTotal {
}
}
}
${y}
${h}
${O}
`,h={sort_direction:"DESC",sort_field:"CREATED_AT"},E=async(e,t,a)=>{const o=t.includes("viewAll")?{}:{order_date:JSON.parse(t)};return await _(S,{method:"GET",cache:"no-cache",variables:{pageSize:e,currentPage:a,filter:o,sort:h}}).then(s=>g(s)).catch(p)};export{E as g};
`,E={sort_direction:"DESC",sort_field:"CREATED_AT"},C=async(r,a,s)=>{const o=a.includes("viewAll")?{}:{order_date:JSON.parse(a)};return await _(S,{method:"GET",cache:"no-cache",variables:{pageSize:r,currentPage:s,filter:o,sort:E}}).then(t=>{var e;return(e=t.errors)!=null&&e.length?f(t.errors):y(t)}).catch(p)};export{C as g};
12 changes: 0 additions & 12 deletions scripts/__dropins__/storefront-account/chunks/getStoreConfig.js

This file was deleted.

Loading

0 comments on commit be27593

Please sign in to comment.