@faststore/core 3.47.0 → 3.48.0
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/.next/BUILD_ID +1 -1
- package/.next/build-manifest.json +39 -39
- package/.next/cache/.tsbuildinfo +1 -1
- package/.next/cache/config.json +3 -3
- package/.next/cache/webpack/client-production/0.pack +0 -0
- package/.next/cache/webpack/client-production/index.pack +0 -0
- package/.next/cache/webpack/server-production/0.pack +0 -0
- package/.next/cache/webpack/server-production/index.pack +0 -0
- package/.next/prerender-manifest.js +1 -1
- package/.next/prerender-manifest.json +1 -1
- package/.next/react-loadable-manifest.json +1 -1
- package/.next/routes-manifest.json +1 -1
- package/.next/server/chunks/4559.js +1 -1
- package/.next/server/chunks/5636.js +2 -2
- package/.next/server/middleware-build-manifest.js +1 -1
- package/.next/server/middleware-react-loadable-manifest.js +1 -1
- package/.next/server/pages/account/orders/[id].js +1 -1
- package/.next/server/pages/account/orders.js +1 -1
- package/.next/server/pages/api/graphql.js +2 -2
- package/.next/server/pages/en-US/404.html +2 -2
- package/.next/server/pages/en-US/500.html +2 -2
- package/.next/server/pages/en-US/account/403.html +2 -2
- package/.next/server/pages/en-US/account/404.html +2 -2
- package/.next/server/pages/en-US/checkout.html +2 -2
- package/.next/server/pages/en-US/login.html +2 -2
- package/.next/server/pages/en-US/s.html +2 -2
- package/.next/server/pages/en-US.html +2 -2
- package/.next/server/pages-manifest.json +1 -1
- package/.next/static/chunks/{1552.2705dd1ff3aee879.js → 1552.8751332da83cadc5.js} +1 -1
- package/.next/static/chunks/pages/account/orders/[id]-1b9f63221f8ac232.js +1 -0
- package/.next/static/chunks/pages/account/orders-6fe9b7be784abbbc.js +1 -0
- package/.next/static/chunks/{webpack-5eeb0e7a0a92b041.js → webpack-323ef2a537a2c00d.js} +1 -1
- package/.next/static/css/3aa693541804727c.css +1 -0
- package/.next/static/css/42dee7d8309ef26a.css +1 -0
- package/.next/static/iAS1zZeCjQJ2NXHxtNGNI/_buildManifest.js +1 -0
- package/.next/trace +129 -129
- package/.turbo/turbo-build.log +10 -10
- package/.turbo/turbo-test.log +5 -5
- package/@generated/gql.ts +2 -2
- package/@generated/graphql.ts +8 -1
- package/@generated/persisted-documents.json +1 -1
- package/@generated/schema.graphql +1 -0
- package/CHANGELOG.md +10 -0
- package/package.json +4 -4
- package/src/components/account/orders/MyAccountListOrders/MyAccountListOrdersTable/MyAccountListOrdersTable.tsx +127 -64
- package/src/components/account/orders/MyAccountListOrders/MyAccountListOrdersTable/styles.scss +27 -3
- package/src/components/account/orders/MyAccountListOrders/MyAccountSelectedTags/MyAccountSelectedTags.tsx +9 -13
- package/src/components/account/orders/MyAccountListOrders/MyAccountSelectedTags/styles.scss +15 -16
- package/src/components/account/orders/MyAccountOrderDetails/MyAccountDeliveryOptionAccordion/MyAccountDeliveryOptionAccordion.tsx +3 -3
- package/src/pages/account/orders/index.tsx +6 -0
- package/.next/static/chunks/pages/account/orders/[id]-987267efe897728e.js +0 -1
- package/.next/static/chunks/pages/account/orders-41bc5ef76c592a64.js +0 -1
- package/.next/static/css/25ded555cb9a704f.css +0 -1
- package/.next/static/css/9d1abf05f9ffaf8f.css +0 -1
- package/.next/static/qls88JfGKl9N9ILYbbCWR/_buildManifest.js +0 -1
- /package/.next/static/{qls88JfGKl9N9ILYbbCWR → iAS1zZeCjQJ2NXHxtNGNI}/_ssgManifest.js +0 -0
package/.turbo/turbo-build.log
CHANGED
|
@@ -1,23 +1,23 @@
|
|
|
1
1
|
|
|
2
|
-
> @faststore/core@3.
|
|
2
|
+
> @faststore/core@3.47.1 prebuild /home/runner/work/faststore/faststore/packages/core
|
|
3
3
|
> na run partytown && na run generate
|
|
4
4
|
|
|
5
5
|
|
|
6
|
-
> @faststore/core@3.
|
|
6
|
+
> @faststore/core@3.47.1 partytown /home/runner/work/faststore/faststore/packages/core
|
|
7
7
|
> partytown copylib ./public/~partytown
|
|
8
8
|
|
|
9
9
|
Partytown lib copied to: /home/runner/work/faststore/faststore/packages/core/public/~partytown
|
|
10
10
|
|
|
11
|
-
> @faststore/core@3.
|
|
11
|
+
> @faststore/core@3.47.1 generate /home/runner/work/faststore/faststore/packages/core
|
|
12
12
|
> na run generate:schema && na run generate:codegen && na run format:generated
|
|
13
13
|
|
|
14
14
|
|
|
15
|
-
> @faststore/core@3.
|
|
15
|
+
> @faststore/core@3.47.1 generate:schema /home/runner/work/faststore/faststore/packages/core
|
|
16
16
|
> tsx src/server/generator/generateGraphQLSchemaFile.ts
|
|
17
17
|
|
|
18
18
|
Schema GraphQL file generated successfully
|
|
19
19
|
|
|
20
|
-
> @faststore/core@3.
|
|
20
|
+
> @faststore/core@3.47.1 generate:codegen /home/runner/work/faststore/faststore/packages/core
|
|
21
21
|
> graphql-codegen
|
|
22
22
|
|
|
23
23
|
[STARTED] Parse Configuration
|
|
@@ -37,11 +37,11 @@ Running lifecycle hook "afterStart" scripts...
|
|
|
37
37
|
[CLI] Loading Documents
|
|
38
38
|
[CLI] Generating output
|
|
39
39
|
|
|
40
|
-
> @faststore/core@3.
|
|
40
|
+
> @faststore/core@3.47.1 format:generated /home/runner/work/faststore/faststore/packages/core
|
|
41
41
|
> prettier --write "@generated/**/*.{ts,js,tsx,jsx,json}" --loglevel error
|
|
42
42
|
|
|
43
43
|
|
|
44
|
-
> @faststore/core@3.
|
|
44
|
+
> @faststore/core@3.47.1 build /home/runner/work/faststore/faststore/packages/core
|
|
45
45
|
> next build
|
|
46
46
|
|
|
47
47
|
⚠ No build cache found. Please configure build caching for faster rebuilds. Read more: https://nextjs.org/docs/messages/no-cache
|
|
@@ -83,8 +83,8 @@ Route (pages) Size First Load JS
|
|
|
83
83
|
├ └ css/b7bba8fce075688b.css 4.2 kB
|
|
84
84
|
├ ● /account/404 2.02 kB 130 kB
|
|
85
85
|
├ └ css/5347dbc8b71de47d.css 4.25 kB
|
|
86
|
-
├ λ /account/orders 8.
|
|
87
|
-
├ └ css/
|
|
86
|
+
├ λ /account/orders 8.64 kB 137 kB
|
|
87
|
+
├ └ css/3aa693541804727c.css 11.8 kB
|
|
88
88
|
├ λ /account/orders/[id] 10.1 kB 138 kB
|
|
89
89
|
├ └ css/2557aa3eaecf6ef0.css 11.4 kB
|
|
90
90
|
├ λ /account/profile 1.26 kB 129 kB
|
|
@@ -101,7 +101,7 @@ Route (pages) Size First Load JS
|
|
|
101
101
|
├ chunks/framework-807b0f81cbc129f0.js 45.4 kB
|
|
102
102
|
├ chunks/main-5569625b3fdd6741.js 33.1 kB
|
|
103
103
|
├ chunks/pages/_app-e5a4d3ef47f1b5c3.js 16.3 kB
|
|
104
|
-
├ chunks/webpack-
|
|
104
|
+
├ chunks/webpack-323ef2a537a2c00d.js 3.7 kB
|
|
105
105
|
└ css/0a57ee6c7a57788c.css 3.49 kB
|
|
106
106
|
|
|
107
107
|
λ (Server) server-side renders at runtime (uses getInitialProps or getServerSideProps)
|
package/.turbo/turbo-test.log
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
|
|
2
|
-
> @faststore/core@3.
|
|
2
|
+
> @faststore/core@3.47.1 test /home/runner/work/faststore/faststore/packages/core
|
|
3
3
|
> jest
|
|
4
4
|
|
|
5
|
-
PASS test/server/cms/global.test.ts (24.
|
|
6
|
-
PASS test/utils/multipleTemplates.test.ts (
|
|
5
|
+
PASS test/server/cms/global.test.ts (24.997 s)
|
|
6
|
+
PASS test/utils/multipleTemplates.test.ts (25.16 s)
|
|
7
7
|
PASS test/server/cms/index.test.ts
|
|
8
|
-
PASS test/server/index.test.ts (29.
|
|
8
|
+
PASS test/server/index.test.ts (29.662 s)
|
|
9
9
|
|
|
10
10
|
Test Suites: 4 passed, 4 total
|
|
11
11
|
Tests: 22 passed, 22 total
|
|
12
12
|
Snapshots: 0 total
|
|
13
|
-
Time: 30.
|
|
13
|
+
Time: 30.995 s
|
|
14
14
|
Ran all test suites.
|
package/@generated/gql.ts
CHANGED
|
@@ -44,7 +44,7 @@ const documents = {
|
|
|
44
44
|
types.UserOrderItemsFragmentFragmentDoc,
|
|
45
45
|
'\n query ServerOrderDetailsQuery($orderId: String!) {\n userOrder(orderId: $orderId) {\n orderId\n status\n statusDescription\n allowCancellation\n storePreferencesData {\n currencyCode\n }\n clientProfileData {\n firstName\n lastName\n email\n phone\n corporateName\n isCorporate\n }\n customFields {\n type\n id\n fields {\n name\n value\n refId\n }\n }\n deliveryOptionsData {\n deliveryOptions {\n selectedSla\n deliveryChannel\n deliveryCompany\n deliveryWindow {\n startDateUtc\n endDateUtc\n price\n }\n shippingEstimate\n shippingEstimateDate\n friendlyShippingEstimate\n friendlyDeliveryOptionName\n seller\n address {\n addressType\n receiverName\n addressId\n versionId\n entityId\n postalCode\n city\n state\n country\n street\n number\n neighborhood\n complement\n reference\n geoCoordinates\n }\n pickupStoreInfo {\n additionalInfo\n address {\n addressType\n receiverName\n addressId\n versionId\n entityId\n postalCode\n city\n state\n country\n street\n number\n neighborhood\n complement\n reference\n geoCoordinates\n }\n dockId\n friendlyName\n isPickupStore\n }\n quantityOfDifferentItems\n total\n items {\n id\n name\n quantity\n price\n imageUrl\n tax\n total\n }\n }\n contact {\n email\n phone\n name\n }\n }\n paymentData {\n transactions {\n isActive\n payments {\n id\n paymentSystemName\n value\n installments\n referenceValue\n lastDigits\n url\n group\n tid\n connectorResponses {\n authId\n }\n bankIssuedInvoiceIdentificationNumber\n redemptionCode\n paymentOrigin\n }\n }\n }\n totals {\n id\n name\n value\n }\n }\n }\n':
|
|
46
46
|
types.ServerOrderDetailsQueryDocument,
|
|
47
|
-
'\n query ServerListOrdersQuery ($page: Int,$perPage: Int, $status: [String], $dateInitial: String, $dateFinal: String, $text: String, $clientEmail: String) {\n listUserOrders (page: $page, perPage: $perPage, status: $status, dateInitial: $dateInitial, dateFinal: $dateFinal, text: $text, clientEmail: $clientEmail) {\n list {\n orderId\n creationDate\n clientName\n items {\n seller\n quantity\n description\n ean\n refId\n id\n productId\n sellingPrice\n price\n }\n totalValue\n status\n statusDescription\n ShippingEstimatedDate\n currencyCode\n }\n paging {\n total\n pages\n currentPage\n perPage\n }\n }\n }\n':
|
|
47
|
+
'\n query ServerListOrdersQuery ($page: Int,$perPage: Int, $status: [String], $dateInitial: String, $dateFinal: String, $text: String, $clientEmail: String) {\n listUserOrders (page: $page, perPage: $perPage, status: $status, dateInitial: $dateInitial, dateFinal: $dateFinal, text: $text, clientEmail: $clientEmail) {\n list {\n orderId\n creationDate\n clientName\n items {\n seller\n quantity\n description\n ean\n refId\n id\n productId\n sellingPrice\n price\n }\n totalValue\n status\n statusDescription\n ShippingEstimatedDate\n currencyCode\n customFields {\n costCenter\n poNumber\n release\n desktop\n }\n }\n paging {\n total\n pages\n currentPage\n perPage\n }\n }\n }\n':
|
|
48
48
|
types.ServerListOrdersQueryDocument,
|
|
49
49
|
'\n mutation CancelOrderMutation($data: IUserOrderCancel!) {\n cancelOrder(data: $data) {\n data\n }\n }\n':
|
|
50
50
|
types.CancelOrderMutationDocument,
|
|
@@ -176,7 +176,7 @@ export function gql(
|
|
|
176
176
|
* The gql function is used to parse GraphQL queries into a document that can be used by GraphQL clients.
|
|
177
177
|
*/
|
|
178
178
|
export function gql(
|
|
179
|
-
source: '\n query ServerListOrdersQuery ($page: Int,$perPage: Int, $status: [String], $dateInitial: String, $dateFinal: String, $text: String, $clientEmail: String) {\n listUserOrders (page: $page, perPage: $perPage, status: $status, dateInitial: $dateInitial, dateFinal: $dateFinal, text: $text, clientEmail: $clientEmail) {\n list {\n orderId\n creationDate\n clientName\n items {\n seller\n quantity\n description\n ean\n refId\n id\n productId\n sellingPrice\n price\n }\n totalValue\n status\n statusDescription\n ShippingEstimatedDate\n currencyCode\n }\n paging {\n total\n pages\n currentPage\n perPage\n }\n }\n }\n'
|
|
179
|
+
source: '\n query ServerListOrdersQuery ($page: Int,$perPage: Int, $status: [String], $dateInitial: String, $dateFinal: String, $text: String, $clientEmail: String) {\n listUserOrders (page: $page, perPage: $perPage, status: $status, dateInitial: $dateInitial, dateFinal: $dateFinal, text: $text, clientEmail: $clientEmail) {\n list {\n orderId\n creationDate\n clientName\n items {\n seller\n quantity\n description\n ean\n refId\n id\n productId\n sellingPrice\n price\n }\n totalValue\n status\n statusDescription\n ShippingEstimatedDate\n currencyCode\n customFields {\n costCenter\n poNumber\n release\n desktop\n }\n }\n paging {\n total\n pages\n currentPage\n perPage\n }\n }\n }\n'
|
|
180
180
|
): typeof import('./graphql').ServerListOrdersQueryDocument
|
|
181
181
|
/**
|
|
182
182
|
* The gql function is used to parse GraphQL queries into a document that can be used by GraphQL clients.
|
package/@generated/graphql.ts
CHANGED
|
@@ -1559,6 +1559,7 @@ export type UserOrderFromList = {
|
|
|
1559
1559
|
clientName: Maybe<Scalars['String']['output']>
|
|
1560
1560
|
creationDate: Maybe<Scalars['String']['output']>
|
|
1561
1561
|
currencyCode: Maybe<Scalars['String']['output']>
|
|
1562
|
+
customFields: Maybe<UserOrderFromListCustomFields>
|
|
1562
1563
|
deliveryDates: Maybe<Array<Maybe<Scalars['String']['output']>>>
|
|
1563
1564
|
giftCardProviders: Maybe<Array<Maybe<Scalars['String']['output']>>>
|
|
1564
1565
|
hostname: Maybe<Scalars['String']['output']>
|
|
@@ -2418,6 +2419,12 @@ export type ServerListOrdersQueryQuery = {
|
|
|
2418
2419
|
sellingPrice: number | null
|
|
2419
2420
|
price: number | null
|
|
2420
2421
|
} | null> | null
|
|
2422
|
+
customFields: {
|
|
2423
|
+
costCenter: Array<string | null> | null
|
|
2424
|
+
poNumber: Array<string | null> | null
|
|
2425
|
+
release: Array<string | null> | null
|
|
2426
|
+
desktop: Array<string | null> | null
|
|
2427
|
+
} | null
|
|
2421
2428
|
} | null> | null
|
|
2422
2429
|
paging: {
|
|
2423
2430
|
total: number | null
|
|
@@ -3474,7 +3481,7 @@ export const ServerOrderDetailsQueryDocument = {
|
|
|
3474
3481
|
export const ServerListOrdersQueryDocument = {
|
|
3475
3482
|
__meta__: {
|
|
3476
3483
|
operationName: 'ServerListOrdersQuery',
|
|
3477
|
-
operationHash: '
|
|
3484
|
+
operationHash: '7fba0a7d767fceed07b268597d68e5577d952b43',
|
|
3478
3485
|
},
|
|
3479
3486
|
} as unknown as TypedDocumentString<
|
|
3480
3487
|
ServerListOrdersQueryQuery,
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"4b33c5c07f440dc7489e55619dc2211a13786e72": "fragment ServerCollectionPage on Query { collection(slug: $slug) { id } } query ServerCollectionPageQuery($slug: String!) { collection(slug: $slug) { breadcrumbList { itemListElement { item name position } } meta { selectedFacets { key value } } seo { description title } } ...ServerCollectionPage }",
|
|
3
3
|
"46103bee661405bde706d72126fdbf9b0a0c9e6e": "fragment CartProductItem on StoreProduct { additionalProperty { name propertyID value valueReference } brand { name } gtin image { alternateName url } isVariantOf { name productGroupID skuVariants { activeVariations availableVariations slugsMap } } name sku unitMultiplier } fragment ProductDetailsFragment_product on StoreProduct { additionalProperty { name propertyID value valueReference } brand { name } description gtin image { alternateName url } isVariantOf { name productGroupID skuVariants { activeVariations availableVariations slugsMap } } name offers { lowPrice lowPriceWithTaxes offers { availability listPrice listPriceWithTaxes price priceWithTaxes seller { identifier } } } id: productID sku unitMultiplier ...CartProductItem } fragment ServerProduct on Query { product(locator: $locator) { id: productID } } query ServerProductQuery($locator: [IStoreSelectedFacet!]!) { product(locator: $locator) { brand { name } breadcrumbList { itemListElement { item name position } } description gtin image { alternateName url } isVariantOf { productGroupID } name offers { highPrice lowPrice lowPriceWithTaxes offers { availability itemCondition price priceCurrency priceValidUntil seller { identifier } } priceCurrency } id: productID releaseDate seo { canonical description title } sku ...ProductDetailsFragment_product } ...ServerProduct }",
|
|
4
4
|
"8b9b9c7703b0b9af12f47cb86dd3d2e8eb40c8fd": "query ServerOrderDetailsQuery($orderId: String!) { userOrder(orderId: $orderId) { allowCancellation clientProfileData { corporateName email firstName isCorporate lastName phone } customFields { fields { name refId value } id type } deliveryOptionsData { contact { email name phone } deliveryOptions { address { addressId addressType city complement country entityId geoCoordinates neighborhood number postalCode receiverName reference state street versionId } deliveryChannel deliveryCompany deliveryWindow { endDateUtc price startDateUtc } friendlyDeliveryOptionName friendlyShippingEstimate items { id imageUrl name price quantity tax total } pickupStoreInfo { additionalInfo address { addressId addressType city complement country entityId geoCoordinates neighborhood number postalCode receiverName reference state street versionId } dockId friendlyName isPickupStore } quantityOfDifferentItems selectedSla seller shippingEstimate shippingEstimateDate total } } orderId paymentData { transactions { isActive payments { bankIssuedInvoiceIdentificationNumber connectorResponses { authId } group id installments lastDigits paymentOrigin paymentSystemName redemptionCode referenceValue tid url value } } } status statusDescription storePreferencesData { currencyCode } totals { id name value } } }",
|
|
5
|
-
"
|
|
5
|
+
"7fba0a7d767fceed07b268597d68e5577d952b43": "query ServerListOrdersQuery($clientEmail: String, $dateFinal: String, $dateInitial: String, $page: Int, $perPage: Int, $status: [String], $text: String) { listUserOrders( page: $page perPage: $perPage status: $status dateInitial: $dateInitial dateFinal: $dateFinal text: $text clientEmail: $clientEmail ) { list { ShippingEstimatedDate clientName creationDate currencyCode customFields { costCenter desktop poNumber release } items { description ean id price productId quantity refId seller sellingPrice } orderId status statusDescription totalValue } paging { currentPage pages perPage total } } }",
|
|
6
6
|
"e2b06da6840614d3c72768e56579b9d3b8e80802": "mutation CancelOrderMutation($data: IUserOrderCancel!) { cancelOrder(data: $data) { data } }",
|
|
7
7
|
"c2b3f8bff73ebf6ac79d758c66cabbc21ba9fcc0": "fragment CartItem on StoreOffer { itemOffered { ...CartProductItem } listPrice listPriceWithTaxes price priceWithTaxes quantity seller { identifier } } fragment CartMessage on StoreCartMessage { status text } fragment CartProductItem on StoreProduct { additionalProperty { name propertyID value valueReference } brand { name } gtin image { alternateName url } isVariantOf { name productGroupID skuVariants { activeVariations availableVariations slugsMap } } name sku unitMultiplier } mutation ValidateCartMutation($cart: IStoreCart!, $session: IStoreSession!) { validateCart(cart: $cart, session: $session) { messages { ...CartMessage } order { acceptedOffer { ...CartItem } orderNumber shouldSplitItem } } }",
|
|
8
8
|
"feb7005103a859e2bc8cf2360d568806fd88deba": "mutation SubscribeToNewsletter($data: IPersonNewsletter!) { subscribeToNewsletter(data: $data) { id } }",
|
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,16 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
# [3.48.0](https://github.com/vtex/faststore/compare/v3.47.2...v3.48.0) (2025-05-26)
|
|
7
|
+
|
|
8
|
+
### Features
|
|
9
|
+
|
|
10
|
+
- list orders custom fields + design improvements SFS-2513 SFS-2515 ([#2854](https://github.com/vtex/faststore/issues/2854)) ([20d5471](https://github.com/vtex/faststore/commit/20d547178f2e2a6ae1a7dde4d4e1b5dcbae5e4d6))
|
|
11
|
+
|
|
12
|
+
## [3.47.1](https://github.com/vtex/faststore/compare/v3.47.0...v3.47.1) (2025-05-22)
|
|
13
|
+
|
|
14
|
+
**Note:** Version bump only for package @faststore/core
|
|
15
|
+
|
|
6
16
|
# [3.47.0](https://github.com/vtex/faststore/compare/v3.46.0...v3.47.0) (2025-05-22)
|
|
7
17
|
|
|
8
18
|
### Features
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@faststore/core",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.48.0",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"repository": "vtex/faststore",
|
|
6
6
|
"browserslist": "supports es6-module and not dead",
|
|
@@ -44,11 +44,11 @@
|
|
|
44
44
|
"@envelop/graphql-jit": "^8.0.3",
|
|
45
45
|
"@envelop/parser-cache": "^6.0.2",
|
|
46
46
|
"@envelop/validation-cache": "^6.0.2",
|
|
47
|
-
"@faststore/api": "^3.
|
|
47
|
+
"@faststore/api": "^3.48.0",
|
|
48
48
|
"@faststore/graphql-utils": "^3.45.0",
|
|
49
49
|
"@faststore/lighthouse": "^3.45.0",
|
|
50
50
|
"@faststore/sdk": "^3.46.0",
|
|
51
|
-
"@faststore/ui": "^3.
|
|
51
|
+
"@faststore/ui": "^3.47.1",
|
|
52
52
|
"@graphql-codegen/cli": "5.0.2",
|
|
53
53
|
"@graphql-codegen/client-preset": "4.2.6",
|
|
54
54
|
"@graphql-codegen/typescript": "4.0.7",
|
|
@@ -105,5 +105,5 @@
|
|
|
105
105
|
"ts-jest": "29.1.1",
|
|
106
106
|
"typescript": "5.3.2"
|
|
107
107
|
},
|
|
108
|
-
"gitHead": "
|
|
108
|
+
"gitHead": "1e0cd51a61f29ceeaff71af91939bbfbc714347a"
|
|
109
109
|
}
|
|
@@ -1,12 +1,15 @@
|
|
|
1
1
|
import { Button, Icon } from '@faststore/ui'
|
|
2
2
|
import type { ServerListOrdersQueryQuery } from '@generated/graphql'
|
|
3
3
|
import { useRouter } from 'next/router'
|
|
4
|
+
import { useState } from 'react'
|
|
4
5
|
|
|
5
6
|
import MyAccountStatusBadge from 'src/components/account/components/MyAccountStatusBadge'
|
|
6
7
|
import { useFormatPrice } from 'src/components/account/utils/useFormatPrice'
|
|
7
8
|
import { useSession } from 'src/sdk/session'
|
|
8
9
|
import useScreenResize from 'src/sdk/ui/useScreenResize'
|
|
9
10
|
|
|
11
|
+
const MAX_COST_CENTERS = 5
|
|
12
|
+
|
|
10
13
|
function formatShippingDate(date: string, locale: string) {
|
|
11
14
|
return new Date(date).toLocaleDateString(locale, {
|
|
12
15
|
year: 'numeric',
|
|
@@ -105,6 +108,7 @@ export default function MyAccountListOrdersTable({
|
|
|
105
108
|
const { isDesktop } = useScreenResize()
|
|
106
109
|
const { locale } = useSession()
|
|
107
110
|
const formatPrice = useFormatPrice()
|
|
111
|
+
const [expandedRows, setExpandedRows] = useState<Record<string, boolean>>({})
|
|
108
112
|
|
|
109
113
|
const handleOrderDetail = ({ orderId }: { orderId: string }) => {
|
|
110
114
|
router.push({
|
|
@@ -112,6 +116,13 @@ export default function MyAccountListOrdersTable({
|
|
|
112
116
|
})
|
|
113
117
|
}
|
|
114
118
|
|
|
119
|
+
const handleToggleExpand = (orderId: string) => {
|
|
120
|
+
setExpandedRows((prev) => ({
|
|
121
|
+
...prev,
|
|
122
|
+
[orderId]: !prev[orderId],
|
|
123
|
+
}))
|
|
124
|
+
}
|
|
125
|
+
|
|
115
126
|
return (
|
|
116
127
|
<>
|
|
117
128
|
<table data-fs-list-orders-table>
|
|
@@ -120,14 +131,13 @@ export default function MyAccountListOrdersTable({
|
|
|
120
131
|
data-fs-list-orders-table-header-row
|
|
121
132
|
data-fs-list-orders-table-row
|
|
122
133
|
>
|
|
123
|
-
<th data-fs-list-orders-table-header-cell>Order</th>
|
|
124
134
|
{isDesktop && (
|
|
125
135
|
<>
|
|
136
|
+
<th data-fs-list-orders-table-header-cell>Order</th>
|
|
126
137
|
<th data-fs-list-orders-table-header-cell>Ordered by</th>
|
|
127
|
-
<th data-fs-list-orders-table-header-cell>Cost Center</th>
|
|
128
138
|
<th data-fs-list-orders-table-header-cell>Release</th>
|
|
129
139
|
<th data-fs-list-orders-table-header-cell>PO number</th>
|
|
130
|
-
<th data-fs-list-orders-table-header-cell>
|
|
140
|
+
<th data-fs-list-orders-table-header-cell>Cost Center</th>
|
|
131
141
|
</>
|
|
132
142
|
)}
|
|
133
143
|
<th data-fs-list-orders-table-header-cell>
|
|
@@ -136,70 +146,123 @@ export default function MyAccountListOrdersTable({
|
|
|
136
146
|
</tr>
|
|
137
147
|
</thead>
|
|
138
148
|
<tbody data-fs-list-orders-table-body>
|
|
139
|
-
{listOrders.list.map((item) =>
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
<
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
149
|
+
{listOrders.list.map((item) => {
|
|
150
|
+
const costCenters = item?.customFields?.costCenter || []
|
|
151
|
+
const isExpanded = expandedRows[item.orderId]
|
|
152
|
+
const shouldShowButton = costCenters.length > MAX_COST_CENTERS
|
|
153
|
+
const displayedCostCenters = isExpanded
|
|
154
|
+
? costCenters
|
|
155
|
+
: costCenters.slice(0, 5)
|
|
156
|
+
return (
|
|
157
|
+
// biome-ignore lint/a11y/useKeyWithClickEvents: <explanation>
|
|
158
|
+
<tr
|
|
159
|
+
data-fs-list-orders-table-body-row
|
|
160
|
+
data-fs-list-orders-table-row
|
|
161
|
+
key={item.orderId}
|
|
162
|
+
onClick={() => handleOrderDetail({ orderId: item.orderId })}
|
|
163
|
+
role="button"
|
|
164
|
+
>
|
|
165
|
+
<td data-fs-list-orders-table-cell>
|
|
166
|
+
<div data-fs-list-orders-table-product-info>
|
|
167
|
+
<p data-fs-list-orders-table-product-info-order-id>
|
|
168
|
+
{item.orderId || '-'}
|
|
169
|
+
</p>
|
|
170
|
+
<p data-fs-list-orders-table-product-info-order-date>
|
|
171
|
+
Placed on{' '}
|
|
172
|
+
{item.creationDate
|
|
173
|
+
? formatShippingDate(item.creationDate, locale)
|
|
174
|
+
: '-'}
|
|
175
|
+
</p>
|
|
176
|
+
{isDesktop && (
|
|
177
|
+
<p data-fs-list-orders-table-product-info-order-delivery>
|
|
178
|
+
Delivery by{' '}
|
|
179
|
+
{item.ShippingEstimatedDate
|
|
180
|
+
? formatShippingDate(
|
|
181
|
+
item.ShippingEstimatedDate,
|
|
182
|
+
locale
|
|
183
|
+
)
|
|
184
|
+
: '-'}
|
|
185
|
+
</p>
|
|
186
|
+
)}
|
|
164
187
|
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
</td>
|
|
171
|
-
<td data-fs-list-orders-table-cell>
|
|
172
|
-
<p>(Release)</p>
|
|
173
|
-
</td>
|
|
174
|
-
<td data-fs-list-orders-table-cell>
|
|
175
|
-
<p>(PO Number)</p>
|
|
176
|
-
</td>
|
|
177
|
-
<td data-fs-list-orders-table-cell>
|
|
178
|
-
{item.ShippingEstimatedDate
|
|
179
|
-
? formatShippingDate(item.ShippingEstimatedDate, locale)
|
|
180
|
-
: '-'}
|
|
181
|
-
</td>
|
|
182
|
-
</>
|
|
183
|
-
)}
|
|
188
|
+
<p data-fs-list-orders-table-product-info-order-total>
|
|
189
|
+
Total: {formatPrice(item.totalValue, item.currencyCode)}
|
|
190
|
+
</p>
|
|
191
|
+
</div>
|
|
192
|
+
</td>
|
|
184
193
|
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
194
|
+
{isDesktop && (
|
|
195
|
+
<>
|
|
196
|
+
<td data-fs-list-orders-table-cell>{item?.clientName}</td>
|
|
197
|
+
<td data-fs-list-orders-table-cell>
|
|
198
|
+
{item?.customFields?.release?.map((field) => (
|
|
199
|
+
<p key={field}>{field}</p>
|
|
200
|
+
))}
|
|
201
|
+
</td>
|
|
202
|
+
<td data-fs-list-orders-table-cell>
|
|
203
|
+
{item?.customFields?.poNumber?.map((field) => (
|
|
204
|
+
<p key={field}>{field}</p>
|
|
205
|
+
))}
|
|
206
|
+
</td>
|
|
207
|
+
<td data-fs-list-orders-table-cell>
|
|
208
|
+
{displayedCostCenters.map((field) => (
|
|
209
|
+
<p key={field}>{field}</p>
|
|
210
|
+
))}
|
|
211
|
+
{shouldShowButton && (
|
|
212
|
+
<Button
|
|
213
|
+
data-fs-list-orders-table-expand-button
|
|
214
|
+
size="small"
|
|
215
|
+
variant="primary"
|
|
216
|
+
inverse
|
|
217
|
+
iconPosition="right"
|
|
218
|
+
icon={
|
|
219
|
+
isExpanded ? (
|
|
220
|
+
<Icon
|
|
221
|
+
width={16}
|
|
222
|
+
height={16}
|
|
223
|
+
name="CaretUp"
|
|
224
|
+
aria-label="Collapse"
|
|
225
|
+
/>
|
|
226
|
+
) : (
|
|
227
|
+
<Icon
|
|
228
|
+
width={16}
|
|
229
|
+
height={16}
|
|
230
|
+
name="CaretDown"
|
|
231
|
+
aria-label="Expand"
|
|
232
|
+
/>
|
|
233
|
+
)
|
|
234
|
+
}
|
|
235
|
+
onClick={(e) => {
|
|
236
|
+
e.stopPropagation()
|
|
237
|
+
handleToggleExpand(item.orderId)
|
|
238
|
+
}}
|
|
239
|
+
>
|
|
240
|
+
{isExpanded ? 'View less' : 'View all'}
|
|
241
|
+
</Button>
|
|
242
|
+
)}
|
|
243
|
+
</td>
|
|
244
|
+
</>
|
|
199
245
|
)}
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
246
|
+
|
|
247
|
+
<td data-fs-list-orders-table-cell>
|
|
248
|
+
<MyAccountStatusBadge
|
|
249
|
+
status={item.status}
|
|
250
|
+
statusFallback={item.statusDescription}
|
|
251
|
+
/>
|
|
252
|
+
{!isDesktop && (
|
|
253
|
+
<p>
|
|
254
|
+
{item.ShippingEstimatedDate
|
|
255
|
+
? `Delivery by ${formatShippingDate(
|
|
256
|
+
item.ShippingEstimatedDate,
|
|
257
|
+
locale
|
|
258
|
+
)}`
|
|
259
|
+
: ''}
|
|
260
|
+
</p>
|
|
261
|
+
)}
|
|
262
|
+
</td>
|
|
263
|
+
</tr>
|
|
264
|
+
)
|
|
265
|
+
})}
|
|
203
266
|
</tbody>
|
|
204
267
|
</table>
|
|
205
268
|
{isDesktop && (
|
package/src/components/account/orders/MyAccountListOrders/MyAccountListOrdersTable/styles.scss
CHANGED
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
--fs-list-orders-table-product-info-font-weight : var(--fs-text-weight-semibold);
|
|
17
17
|
--fs-list-orders-table-product-info-margin-top : var(--fs-spacing-1);
|
|
18
18
|
--fs-list-orders-table-product-info-line-height : var(--fs-text-size-1);
|
|
19
|
-
--fs-list-orders-table-cell-padding : var(--fs-spacing-4) var(--fs-spacing-2);
|
|
19
|
+
--fs-list-orders-table-cell-padding : var(--fs-spacing-4) var(--fs-spacing-2) var(--fs-spacing-3);
|
|
20
20
|
--fs-list-orders-table-cell-padding-mobile : var(--fs-spacing-3) var(--fs-spacing-1);
|
|
21
21
|
--fs-list-orders-table-cell-color : var(--fs-color-neutral-6);
|
|
22
22
|
--fs-list-orders-table-row-border-bottom : var(--fs-border-width) solid var(--fs-color-neutral-3);
|
|
@@ -57,6 +57,7 @@
|
|
|
57
57
|
|
|
58
58
|
[data-fs-list-orders-table-header-cell]:last-child,[data-fs-list-orders-table-cell]:last-child {
|
|
59
59
|
width: var(--fs-list-orders-table-last-child-width);
|
|
60
|
+
text-align: end;
|
|
60
61
|
|
|
61
62
|
@include media("<notebook") {
|
|
62
63
|
display: flex;
|
|
@@ -68,7 +69,7 @@
|
|
|
68
69
|
}
|
|
69
70
|
}
|
|
70
71
|
|
|
71
|
-
[data-fs-list-orders-table-product-info-order-id], [data-fs-list-orders-table-product-info-order-date], [data-fs-list-orders-table-product-info-order-total] {
|
|
72
|
+
[data-fs-list-orders-table-product-info-order-id], [data-fs-list-orders-table-product-info-order-date], [data-fs-list-orders-table-product-info-order-delivery], [data-fs-list-orders-table-product-info-order-total] {
|
|
72
73
|
overflow: hidden;
|
|
73
74
|
text-overflow: ellipsis;
|
|
74
75
|
white-space: nowrap;
|
|
@@ -80,7 +81,7 @@
|
|
|
80
81
|
vertical-align: middle;
|
|
81
82
|
}
|
|
82
83
|
|
|
83
|
-
[data-fs-list-orders-table-product-info-order-date] {
|
|
84
|
+
[data-fs-list-orders-table-product-info-order-date], [data-fs-list-orders-table-product-info-order-total] {
|
|
84
85
|
margin-top: var(--fs-list-orders-table-product-info-margin-top);
|
|
85
86
|
line-height: var(--fs-list-orders-table-product-info-line-height);
|
|
86
87
|
}
|
|
@@ -88,6 +89,7 @@
|
|
|
88
89
|
[data-fs-list-orders-table-header-cell], [data-fs-list-orders-table-cell] {
|
|
89
90
|
padding: var(--fs-list-orders-table-cell-padding);
|
|
90
91
|
text-align: left;
|
|
92
|
+
vertical-align: top;
|
|
91
93
|
border: none;
|
|
92
94
|
|
|
93
95
|
@include media("<notebook") {
|
|
@@ -96,6 +98,7 @@
|
|
|
96
98
|
}
|
|
97
99
|
|
|
98
100
|
[data-fs-list-orders-table-cell]:not(:first-child):not(:last-child) {
|
|
101
|
+
padding-top: calc(var(--fs-spacing-4) + var(--fs-spacing-0));
|
|
99
102
|
color: var(--fs-list-orders-table-cell-color);
|
|
100
103
|
}
|
|
101
104
|
|
|
@@ -117,6 +120,27 @@
|
|
|
117
120
|
[data-fs-list-orders-table-body-row]:hover, [data-fs-list-orders-table-body-row]:focus {
|
|
118
121
|
background-color: var(--fs-list-orders-table-row-hover-bg);
|
|
119
122
|
}
|
|
123
|
+
|
|
124
|
+
[data-fs-list-orders-table-expand-button] {
|
|
125
|
+
--fs-list-orders-table-expand-width: 6.25rem; // 100px
|
|
126
|
+
--fs-list-orders-table-expand-margin-top: -0.75rem;
|
|
127
|
+
--fs-list-orders-table-expand-margin-left: -1.0625rem; // 17px to rem;
|
|
128
|
+
|
|
129
|
+
width: var(--fs-list-orders-table-expand-width);
|
|
130
|
+
margin-top: var(--fs-list-orders-table-expand-margin-top);
|
|
131
|
+
|
|
132
|
+
[data-fs-button-wrapper] {
|
|
133
|
+
width: max-content;
|
|
134
|
+
margin-left: var(--fs-list-orders-table-expand-margin-left);
|
|
135
|
+
font-size: var(--fs-text-size-tiny);
|
|
136
|
+
background-color: transparent;
|
|
137
|
+
transition: unset;
|
|
138
|
+
|
|
139
|
+
&:hover {
|
|
140
|
+
background-color: transparent;
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
}
|
|
120
144
|
}
|
|
121
145
|
|
|
122
146
|
[data-fs-list-orders-table-pagination] {
|
|
@@ -97,19 +97,15 @@ function MyAccountSelectedTags({
|
|
|
97
97
|
<>
|
|
98
98
|
{hasFilters && (
|
|
99
99
|
<div data-fs-list-orders-selected-tags>
|
|
100
|
-
<
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
>
|
|
110
|
-
Clear All
|
|
111
|
-
</Button>
|
|
112
|
-
</div>
|
|
100
|
+
<Tags filters={filters} onRemoveFilter={onRemoveFilter} />
|
|
101
|
+
<Button
|
|
102
|
+
variant="tertiary"
|
|
103
|
+
size="small"
|
|
104
|
+
data-fs-list-orders-selected-tags-clear-all-button
|
|
105
|
+
onClick={onClearAll}
|
|
106
|
+
>
|
|
107
|
+
Clear All
|
|
108
|
+
</Button>
|
|
113
109
|
</div>
|
|
114
110
|
)}
|
|
115
111
|
</>
|
|
@@ -20,22 +20,12 @@
|
|
|
20
20
|
|
|
21
21
|
--fs-list-orders-selected-tags-clear-all-min-width : 102px;
|
|
22
22
|
|
|
23
|
-
// --------------------------------------------------------
|
|
24
|
-
// Structural Styles
|
|
25
|
-
// --------------------------------------------------------
|
|
26
|
-
|
|
27
23
|
display: flex;
|
|
24
|
+
flex-wrap: wrap;
|
|
28
25
|
gap: var(--fs-list-orders-selected-tags-gap);
|
|
29
|
-
|
|
30
|
-
min-height: var(--fs-list-orders-selected-tags-min-height);
|
|
26
|
+
margin-top: var(--fs-list-orders-selected-tags-gap);
|
|
31
27
|
font-size: var(--fs-list-orders-selected-tags-text-size);
|
|
32
28
|
|
|
33
|
-
[data-fs-list-orders-selected-tags-pills] {
|
|
34
|
-
display: flex;
|
|
35
|
-
flex-wrap: wrap;
|
|
36
|
-
gap: var(--fs-list-orders-selected-tags-gap);
|
|
37
|
-
}
|
|
38
|
-
|
|
39
29
|
[data-fs-list-orders-selected-tag] {
|
|
40
30
|
display: flex;
|
|
41
31
|
align-items: center;
|
|
@@ -59,11 +49,20 @@
|
|
|
59
49
|
cursor: pointer;
|
|
60
50
|
}
|
|
61
51
|
|
|
62
|
-
[data-fs-list-orders-selected-tags-clear-all] {
|
|
63
|
-
min-width: var(--fs-list-orders-selected-tags-clear-all-min-width);
|
|
64
|
-
}
|
|
65
|
-
|
|
66
52
|
[data-fs-list-orders-selected-tags-clear-all-button] {
|
|
67
53
|
--fs-button-height: 1.5rem;
|
|
54
|
+
|
|
55
|
+
--fs-list-orders-selected-tags-clear-all-button-margin-left: -0.5rem;
|
|
56
|
+
|
|
57
|
+
[data-fs-button-wrapper] {
|
|
58
|
+
width: max-content;
|
|
59
|
+
margin-top: var(--fs-list-orders-selected-tags-clear-all-button-margin-left);
|
|
60
|
+
background-color: transparent;
|
|
61
|
+
transition: unset;
|
|
62
|
+
|
|
63
|
+
&:hover {
|
|
64
|
+
background-color: transparent;
|
|
65
|
+
}
|
|
66
|
+
}
|
|
68
67
|
}
|
|
69
68
|
}
|
|
@@ -75,9 +75,9 @@ function MyAccountDeliveryOptionAccordion({
|
|
|
75
75
|
image={item.imageUrl || ''}
|
|
76
76
|
quantity={item.quantity}
|
|
77
77
|
name={item.name}
|
|
78
|
-
field={
|
|
79
|
-
?.find((cf) => cf.id === item.id)
|
|
80
|
-
|
|
78
|
+
field={
|
|
79
|
+
customFields?.find((cf) => cf.id === item.id)?.fields?.[0]
|
|
80
|
+
}
|
|
81
81
|
price={formatPrice(item.price ?? 0, currencyCode)}
|
|
82
82
|
tax={formatPrice(item.tax ?? 0, currencyCode)}
|
|
83
83
|
total={formatPrice(item.total ?? 0, currencyCode)}
|