@faststore/core 4.0.1-dev.1 → 4.1.0-dev.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/.turbo/turbo-generate.log +3 -3
- package/.turbo/turbo-test.log +22 -21
- package/@generated/gql.ts +3 -3
- package/@generated/graphql.ts +6 -2
- package/@generated/persisted-documents.json +1 -1
- package/@generated/schema.graphql +6 -0
- package/CHANGELOG.md +12 -0
- package/package.json +7 -7
- package/src/components/account/MyAccountUserDetails/MyAccountUserDetails.tsx +11 -5
- package/src/components/ui/LocalizationButton/LocalizationButton.tsx +5 -1
- package/src/pages/pvt/account/user-details.tsx +4 -0
- package/src/sdk/localization/useBindingSelector.ts +31 -1
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
|
|
2
|
-
> @faststore/core@4.0.1-dev.
|
|
2
|
+
> @faststore/core@4.0.1-dev.2 generate /home/runner/work/faststore/faststore/packages/core
|
|
3
3
|
> pnpm run gen-types && pnpm run cache-graphql
|
|
4
4
|
|
|
5
5
|
|
|
6
|
-
> @faststore/core@4.0.1-dev.
|
|
6
|
+
> @faststore/core@4.0.1-dev.2 gen-types /home/runner/work/faststore/faststore/packages/core
|
|
7
7
|
> node ../cli/bin/run generate-types .
|
|
8
8
|
|
|
9
9
|
[33m[STARTED][39m Parse Configuration
|
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
[32m[COMPLETED][39m Generate to /home/runner/work/faststore/faststore/packages/core/@generated/
|
|
20
20
|
[32m[COMPLETED][39m Generate outputs
|
|
21
21
|
|
|
22
|
-
> @faststore/core@4.0.1-dev.
|
|
22
|
+
> @faststore/core@4.0.1-dev.2 cache-graphql /home/runner/work/faststore/faststore/packages/core
|
|
23
23
|
> node ../cli/bin/run cache-graphql --config=./discovery.config.default.js --queries=./@generated/persisted-documents.json
|
|
24
24
|
|
|
25
25
|
[Info] - Config file location: /home/runner/work/faststore/faststore/packages/core/discovery.config.default.js
|
package/.turbo/turbo-test.log
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
|
|
2
|
-
> @faststore/core@4.0.1-dev.
|
|
2
|
+
> @faststore/core@4.0.1-dev.2 test /home/runner/work/faststore/faststore/packages/core
|
|
3
3
|
> vitest run
|
|
4
4
|
|
|
5
5
|
|
|
6
6
|
[1m[46m RUN [49m[22m [36mv4.0.7 [39m[90m/home/runner/work/faststore/faststore/packages/core[39m
|
|
7
7
|
|
|
8
|
-
[32m✓[39m [30m[43m node [49m[39m test/utils/match-url.test.ts [2m([22m[2m10 tests[22m[2m)[22m[32m
|
|
8
|
+
[32m✓[39m [30m[43m node [49m[39m test/utils/match-url.test.ts [2m([22m[2m10 tests[22m[2m)[22m[32m 31[2mms[22m[39m
|
|
9
9
|
[32m✓[39m [30m[43m node [49m[39m test/utils/localization/bindingPaths.test.ts [2m([22m[2m71 tests[22m[2m)[22m[32m 82[2mms[22m[39m
|
|
10
|
-
[32m✓[39m [30m[43m node [49m[39m test/sdk/localization/bindingSelector.test.ts [2m([22m[2m18 tests[22m[2m)[22m[32m
|
|
10
|
+
[32m✓[39m [30m[43m node [49m[39m test/sdk/localization/bindingSelector.test.ts [2m([22m[2m18 tests[22m[2m)[22m[32m 27[2mms[22m[39m
|
|
11
11
|
[90mstderr[2m | test/sdk/localization/store-url.browser.test.ts
|
|
12
12
|
[22m[39mError in optimistic validation: TypeError: Cannot read properties of undefined (reading 'read')
|
|
13
13
|
at validateCart [90m(/home/runner/work/faststore/faststore/packages/core/[39msrc/sdk/cart/index.ts:119:27[90m)[39m
|
|
@@ -23,25 +23,26 @@
|
|
|
23
23
|
at a (/home/runner/work/faststore/faststore/packages/sdk/dist/es/index.mjs:342:23)
|
|
24
24
|
[90m at processTicksAndRejections (node:internal/process/task_queues:103:5)[39m
|
|
25
25
|
|
|
26
|
-
[32m✓[39m [30m[
|
|
27
|
-
[32m✓[39m [30m[
|
|
28
|
-
[32m✓[39m [30m[43m node [49m[39m test/sdk/
|
|
29
|
-
[32m✓[39m [30m[43m node [49m[39m test/
|
|
30
|
-
[32m✓[39m [30m[43m node [49m[39m test/
|
|
31
|
-
[32m✓[39m [30m[43m node [49m[39m test/utils/clearCookies.test.ts [2m([22m[2m20 tests[22m[2m)[22m[32m
|
|
32
|
-
[32m✓[39m [30m[43m node [49m[39m test/server/cms/global.test.ts [2m([22m[2m3 tests[22m[2m)[22m[32m
|
|
33
|
-
[32m✓[39m [30m[43m node [49m[39m test/server/content/service.test.ts [2m([22m[2m5 tests[22m[2m)[22m[32m
|
|
34
|
-
[32m✓[39m [30m[43m node [49m[39m test/utils/getRequestHostname.test.ts [2m([22m[2m12 tests[22m[2m)[22m[32m
|
|
35
|
-
[32m✓[39m [30m[43m node [49m[39m test/sdk/localization/store-url.test.ts [2m([22m[2m1 test[22m[2m)[22m[32m
|
|
36
|
-
[32m✓[39m [30m[43m node [49m[39m test/utils/validateSessionRefreshToken.test.ts [2m([22m[2m6 tests[22m[2m)[22m[32m
|
|
37
|
-
[32m✓[39m [30m[43m node [49m[39m test/pages/api/preview.test.ts [2m([22m[2m2 tests[22m[2m)[22m[32m
|
|
38
|
-
[32m✓[39m [30m[43m node [49m[39m test/server/cms/index.test.ts [2m([22m[2m2 tests[22m[2m)[22m[32m
|
|
39
|
-
[32m✓[39m [30m[43m node [49m[39m test/server/index.test.ts [2m([22m[2m7 tests[22m[2m)[22m[33m
|
|
40
|
-
[33m[2m✓[22m[39m should return a valid merged GraphQL schema [33m
|
|
41
|
-
[33m[2m✓[22m[39m should
|
|
26
|
+
[32m✓[39m [30m[46m browser [49m[39m test/sdk/localization/store-url.browser.test.ts [2m([22m[2m3 tests[22m[2m)[22m[32m 20[2mms[22m[39m
|
|
27
|
+
[32m✓[39m [30m[43m node [49m[39m test/utils/cookieCacheBusting.test.ts [2m([22m[2m10 tests[22m[2m)[22m[32m 35[2mms[22m[39m
|
|
28
|
+
[32m✓[39m [30m[43m node [49m[39m test/sdk/localization/useBindingSelector.test.tsx [2m([22m[2m12 tests[22m[2m)[22m[32m 26[2mms[22m[39m
|
|
29
|
+
[32m✓[39m [30m[43m node [49m[39m test/sdk/search/useSearchHistory.test.ts [2m([22m[2m13 tests[22m[2m)[22m[32m 120[2mms[22m[39m
|
|
30
|
+
[32m✓[39m [30m[43m node [49m[39m test/utils/multipleTemplates.test.ts [2m([22m[2m8 tests[22m[2m)[22m[32m 13[2mms[22m[39m
|
|
31
|
+
[32m✓[39m [30m[43m node [49m[39m test/utils/clearCookies.test.ts [2m([22m[2m20 tests[22m[2m)[22m[32m 110[2mms[22m[39m
|
|
32
|
+
[32m✓[39m [30m[43m node [49m[39m test/server/cms/global.test.ts [2m([22m[2m3 tests[22m[2m)[22m[32m 14[2mms[22m[39m
|
|
33
|
+
[32m✓[39m [30m[43m node [49m[39m test/server/content/service.test.ts [2m([22m[2m5 tests[22m[2m)[22m[32m 13[2mms[22m[39m
|
|
34
|
+
[32m✓[39m [30m[43m node [49m[39m test/utils/getRequestHostname.test.ts [2m([22m[2m12 tests[22m[2m)[22m[32m 18[2mms[22m[39m
|
|
35
|
+
[32m✓[39m [30m[43m node [49m[39m test/sdk/localization/store-url.test.ts [2m([22m[2m1 test[22m[2m)[22m[32m 18[2mms[22m[39m
|
|
36
|
+
[32m✓[39m [30m[43m node [49m[39m test/utils/validateSessionRefreshToken.test.ts [2m([22m[2m6 tests[22m[2m)[22m[32m 12[2mms[22m[39m
|
|
37
|
+
[32m✓[39m [30m[43m node [49m[39m test/pages/api/preview.test.ts [2m([22m[2m2 tests[22m[2m)[22m[32m 29[2mms[22m[39m
|
|
38
|
+
[32m✓[39m [30m[43m node [49m[39m test/server/cms/index.test.ts [2m([22m[2m2 tests[22m[2m)[22m[32m 17[2mms[22m[39m
|
|
39
|
+
[32m✓[39m [30m[43m node [49m[39m test/server/index.test.ts [2m([22m[2m7 tests[22m[2m)[22m[33m 1380[2mms[22m[39m
|
|
40
|
+
[33m[2m✓[22m[39m should return a valid merged GraphQL schema [33m 351[2mms[22m[39m
|
|
41
|
+
[33m[2m✓[22m[39m should exist with its plugins [33m 521[2mms[22m[39m
|
|
42
|
+
[33m[2m✓[22m[39m should handle options and execute [33m 469[2mms[22m[39m
|
|
42
43
|
|
|
43
44
|
[2m Test Files [22m [1m[32m17 passed[39m[22m[90m (17)[39m
|
|
44
45
|
[2m Tests [22m [1m[32m203 passed[39m[22m[90m (203)[39m
|
|
45
|
-
[2m Start at [22m
|
|
46
|
-
[2m Duration [22m 13.
|
|
46
|
+
[2m Start at [22m 17:05:10
|
|
47
|
+
[2m Duration [22m 13.05s[2m (transform 5.17s, setup 0ms, collect 15.92s, tests 1.97s, environment 7.50s, prepare 664ms)[22m
|
|
47
48
|
|
package/@generated/gql.ts
CHANGED
|
@@ -36,7 +36,7 @@ type Documents = {
|
|
|
36
36
|
"\n query ServerListOrdersQuery ($page: Int,$perPage: Int, $status: [String], $dateInitial: String, $dateFinal: String, $text: String, $clientEmail: String, $pendingMyApproval: Boolean) {\n listUserOrders (page: $page, perPage: $perPage, status: $status, dateInitial: $dateInitial, dateFinal: $dateFinal, text: $text, clientEmail: $clientEmail, pendingMyApproval: $pendingMyApproval) {\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 type\n value\n }\n }\n paging {\n total\n pages\n currentPage\n perPage\n }\n }\n accountProfile {\n name\n }\n }\n": typeof types.ServerListOrdersQueryDocument,
|
|
37
37
|
"\n query ServerProfileQuery {\n accountProfile {\n name\n email\n id\n }\n }\n": typeof types.ServerProfileQueryDocument,
|
|
38
38
|
"\n query ServerSecurity {\n accountProfile {\n name\n }\n userDetails {\n email\n }\n }\n": typeof types.ServerSecurityDocument,
|
|
39
|
-
"\n query ServerUserDetailsQuery {\n accountProfile {\n name\n }\n userDetails {\n name\n email\n role\n orgUnit\n }\n }\n": typeof types.ServerUserDetailsQueryDocument,
|
|
39
|
+
"\n query ServerUserDetailsQuery {\n accountProfile {\n name\n }\n userDetails {\n username\n name\n email\n phone\n role\n orgUnit\n }\n }\n": typeof types.ServerUserDetailsQueryDocument,
|
|
40
40
|
"\n mutation CancelOrderMutation($data: IUserOrderCancel!) {\n cancelOrder(data: $data) {\n data\n }\n }\n": typeof types.CancelOrderMutationDocument,
|
|
41
41
|
"\n mutation ProcessOrderAuthorizationMutation($data: IProcessOrderAuthorization!) {\n processOrderAuthorization(data: $data) {\n isPendingForOtherAuthorizer\n ruleForAuthorization {\n orderAuthorizationId\n dimensionId\n rule {\n id\n name\n status\n doId\n authorizedEmails\n priority\n trigger {\n condition {\n conditionType\n description\n lessThan\n greatherThan\n expression\n }\n effect {\n description\n effectType\n funcPath\n }\n }\n timeout\n notification\n scoreInterval {\n accept\n deny\n }\n authorizationData {\n requireAllApprovals\n authorizers {\n id\n email\n type\n authorizationDate\n }\n }\n isUserAuthorized\n isUserNextAuthorizer\n }\n }\n }\n }\n": typeof types.ProcessOrderAuthorizationMutationDocument,
|
|
42
42
|
"\n query ValidateUser {\n validateUser {\n isValid\n }\n }\n": typeof types.ValidateUserDocument,
|
|
@@ -79,7 +79,7 @@ const documents: Documents = {
|
|
|
79
79
|
"\n query ServerListOrdersQuery ($page: Int,$perPage: Int, $status: [String], $dateInitial: String, $dateFinal: String, $text: String, $clientEmail: String, $pendingMyApproval: Boolean) {\n listUserOrders (page: $page, perPage: $perPage, status: $status, dateInitial: $dateInitial, dateFinal: $dateFinal, text: $text, clientEmail: $clientEmail, pendingMyApproval: $pendingMyApproval) {\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 type\n value\n }\n }\n paging {\n total\n pages\n currentPage\n perPage\n }\n }\n accountProfile {\n name\n }\n }\n": types.ServerListOrdersQueryDocument,
|
|
80
80
|
"\n query ServerProfileQuery {\n accountProfile {\n name\n email\n id\n }\n }\n": types.ServerProfileQueryDocument,
|
|
81
81
|
"\n query ServerSecurity {\n accountProfile {\n name\n }\n userDetails {\n email\n }\n }\n": types.ServerSecurityDocument,
|
|
82
|
-
"\n query ServerUserDetailsQuery {\n accountProfile {\n name\n }\n userDetails {\n name\n email\n role\n orgUnit\n }\n }\n": types.ServerUserDetailsQueryDocument,
|
|
82
|
+
"\n query ServerUserDetailsQuery {\n accountProfile {\n name\n }\n userDetails {\n username\n name\n email\n phone\n role\n orgUnit\n }\n }\n": types.ServerUserDetailsQueryDocument,
|
|
83
83
|
"\n mutation CancelOrderMutation($data: IUserOrderCancel!) {\n cancelOrder(data: $data) {\n data\n }\n }\n": types.CancelOrderMutationDocument,
|
|
84
84
|
"\n mutation ProcessOrderAuthorizationMutation($data: IProcessOrderAuthorization!) {\n processOrderAuthorization(data: $data) {\n isPendingForOtherAuthorizer\n ruleForAuthorization {\n orderAuthorizationId\n dimensionId\n rule {\n id\n name\n status\n doId\n authorizedEmails\n priority\n trigger {\n condition {\n conditionType\n description\n lessThan\n greatherThan\n expression\n }\n effect {\n description\n effectType\n funcPath\n }\n }\n timeout\n notification\n scoreInterval {\n accept\n deny\n }\n authorizationData {\n requireAllApprovals\n authorizers {\n id\n email\n type\n authorizationDate\n }\n }\n isUserAuthorized\n isUserNextAuthorizer\n }\n }\n }\n }\n": types.ProcessOrderAuthorizationMutationDocument,
|
|
85
85
|
"\n query ValidateUser {\n validateUser {\n isValid\n }\n }\n": types.ValidateUserDocument,
|
|
@@ -188,7 +188,7 @@ export function gql(source: "\n query ServerSecurity {\n accountProfile {\n
|
|
|
188
188
|
/**
|
|
189
189
|
* The gql function is used to parse GraphQL queries into a document that can be used by GraphQL clients.
|
|
190
190
|
*/
|
|
191
|
-
export function gql(source: "\n query ServerUserDetailsQuery {\n accountProfile {\n name\n }\n userDetails {\n name\n email\n role\n orgUnit\n }\n }\n"): typeof import('./graphql').ServerUserDetailsQueryDocument;
|
|
191
|
+
export function gql(source: "\n query ServerUserDetailsQuery {\n accountProfile {\n name\n }\n userDetails {\n username\n name\n email\n phone\n role\n orgUnit\n }\n }\n"): typeof import('./graphql').ServerUserDetailsQueryDocument;
|
|
192
192
|
/**
|
|
193
193
|
* The gql function is used to parse GraphQL queries into a document that can be used by GraphQL clients.
|
|
194
194
|
*/
|
package/@generated/graphql.ts
CHANGED
|
@@ -1658,8 +1658,12 @@ export type StoreUserDetails = {
|
|
|
1658
1658
|
name: Maybe<Scalars['String']['output']>;
|
|
1659
1659
|
/** User's organizational unit. */
|
|
1660
1660
|
orgUnit: Maybe<Scalars['String']['output']>;
|
|
1661
|
+
/** User's phone number. */
|
|
1662
|
+
phone: Maybe<Scalars['String']['output']>;
|
|
1661
1663
|
/** User's role. */
|
|
1662
1664
|
role: Maybe<Array<Maybe<Scalars['String']['output']>>>;
|
|
1665
|
+
/** User's username (login). May differ from email when Alternative Login is enabled. */
|
|
1666
|
+
username: Maybe<Scalars['String']['output']>;
|
|
1663
1667
|
};
|
|
1664
1668
|
|
|
1665
1669
|
export type UserOrder = {
|
|
@@ -2560,7 +2564,7 @@ export type ServerSecurityQuery = { accountProfile: { name: string | null }, use
|
|
|
2560
2564
|
export type ServerUserDetailsQueryQueryVariables = Exact<{ [key: string]: never; }>;
|
|
2561
2565
|
|
|
2562
2566
|
|
|
2563
|
-
export type ServerUserDetailsQueryQuery = { accountProfile: { name: string | null }, userDetails: { name: string | null, email: string | null, role: Array<string | null> | null, orgUnit: string | null } };
|
|
2567
|
+
export type ServerUserDetailsQueryQuery = { accountProfile: { name: string | null }, userDetails: { username: string | null, name: string | null, email: string | null, phone: string | null, role: Array<string | null> | null, orgUnit: string | null } };
|
|
2564
2568
|
|
|
2565
2569
|
export type CancelOrderMutationMutationVariables = Exact<{
|
|
2566
2570
|
data: IUserOrderCancel;
|
|
@@ -3247,7 +3251,7 @@ export const ServerOrderDetailsQueryDocument = {"__meta__":{"operationName":"Ser
|
|
|
3247
3251
|
export const ServerListOrdersQueryDocument = {"__meta__":{"operationName":"ServerListOrdersQuery","operationHash":"70d06de1da9c11f10ebde31b66fd74eccd456af5"}} as unknown as TypedDocumentString<ServerListOrdersQueryQuery, ServerListOrdersQueryQueryVariables>;
|
|
3248
3252
|
export const ServerProfileQueryDocument = {"__meta__":{"operationName":"ServerProfileQuery","operationHash":"672fe0f00b7b710b63fc6573c0a6b2ec54812b8f"}} as unknown as TypedDocumentString<ServerProfileQueryQuery, ServerProfileQueryQueryVariables>;
|
|
3249
3253
|
export const ServerSecurityDocument = {"__meta__":{"operationName":"ServerSecurity","operationHash":"0890ba3456c40a426893b80b698df7a84cfdd6a1"}} as unknown as TypedDocumentString<ServerSecurityQuery, ServerSecurityQueryVariables>;
|
|
3250
|
-
export const ServerUserDetailsQueryDocument = {"__meta__":{"operationName":"ServerUserDetailsQuery","operationHash":"
|
|
3254
|
+
export const ServerUserDetailsQueryDocument = {"__meta__":{"operationName":"ServerUserDetailsQuery","operationHash":"630ec1f47f2710ce3d7895e9131482641f30c837"}} as unknown as TypedDocumentString<ServerUserDetailsQueryQuery, ServerUserDetailsQueryQueryVariables>;
|
|
3251
3255
|
export const CancelOrderMutationDocument = {"__meta__":{"operationName":"CancelOrderMutation","operationHash":"e2b06da6840614d3c72768e56579b9d3b8e80802"}} as unknown as TypedDocumentString<CancelOrderMutationMutation, CancelOrderMutationMutationVariables>;
|
|
3252
3256
|
export const ProcessOrderAuthorizationMutationDocument = {"__meta__":{"operationName":"ProcessOrderAuthorizationMutation","operationHash":"8c25d37c8d6e7c20ab21bb8a4f4e6a2fe320ea8d"}} as unknown as TypedDocumentString<ProcessOrderAuthorizationMutationMutation, ProcessOrderAuthorizationMutationMutationVariables>;
|
|
3253
3257
|
export const ValidateUserDocument = {"__meta__":{"operationName":"ValidateUser","operationHash":"32f99c73c3de958b64d6bece1afe800469f54548"}} as unknown as TypedDocumentString<ValidateUserQuery, ValidateUserQueryVariables>;
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
"70d06de1da9c11f10ebde31b66fd74eccd456af5": "query ServerListOrdersQuery($clientEmail: String, $dateFinal: String, $dateInitial: String, $page: Int, $pendingMyApproval: Boolean, $perPage: Int, $status: [String], $text: String) { accountProfile { name } listUserOrders( page: $page perPage: $perPage status: $status dateInitial: $dateInitial dateFinal: $dateFinal text: $text clientEmail: $clientEmail pendingMyApproval: $pendingMyApproval ) { list { ShippingEstimatedDate clientName creationDate currencyCode customFields { type value } items { description ean id price productId quantity refId seller sellingPrice } orderId status statusDescription totalValue } paging { currentPage pages perPage total } } }",
|
|
7
7
|
"672fe0f00b7b710b63fc6573c0a6b2ec54812b8f": "query ServerProfileQuery { accountProfile { email id name } }",
|
|
8
8
|
"0890ba3456c40a426893b80b698df7a84cfdd6a1": "query ServerSecurity { accountProfile { name } userDetails { email } }",
|
|
9
|
-
"
|
|
9
|
+
"630ec1f47f2710ce3d7895e9131482641f30c837": "query ServerUserDetailsQuery { accountProfile { name } userDetails { email name orgUnit phone role username } }",
|
|
10
10
|
"e2b06da6840614d3c72768e56579b9d3b8e80802": "mutation CancelOrderMutation($data: IUserOrderCancel!) { cancelOrder(data: $data) { data } }",
|
|
11
11
|
"8c25d37c8d6e7c20ab21bb8a4f4e6a2fe320ea8d": "mutation ProcessOrderAuthorizationMutation($data: IProcessOrderAuthorization!) { processOrderAuthorization(data: $data) { isPendingForOtherAuthorizer ruleForAuthorization { dimensionId orderAuthorizationId rule { authorizationData { authorizers { authorizationDate email id type } requireAllApprovals } authorizedEmails doId id isUserAuthorized isUserNextAuthorizer name notification priority scoreInterval { accept deny } status timeout trigger { condition { conditionType description expression greatherThan lessThan } effect { description effectType funcPath } } } } } }",
|
|
12
12
|
"32f99c73c3de958b64d6bece1afe800469f54548": "query ValidateUser { validateUser { isValid } }",
|
|
@@ -1697,10 +1697,16 @@ type StoreSuggestions {
|
|
|
1697
1697
|
|
|
1698
1698
|
"""User details information."""
|
|
1699
1699
|
type StoreUserDetails {
|
|
1700
|
+
"""
|
|
1701
|
+
User's username (login). May differ from email when Alternative Login is enabled.
|
|
1702
|
+
"""
|
|
1703
|
+
username: String
|
|
1700
1704
|
"""User's name."""
|
|
1701
1705
|
name: String
|
|
1702
1706
|
"""User's email."""
|
|
1703
1707
|
email: String
|
|
1708
|
+
"""User's phone number."""
|
|
1709
|
+
phone: String
|
|
1704
1710
|
"""User's role."""
|
|
1705
1711
|
role: [String]
|
|
1706
1712
|
"""User's organizational unit."""
|
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,18 @@
|
|
|
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
|
+
# [4.1.0-dev.0](https://github.com/vtex/faststore/compare/v4.0.1-dev.2...v4.1.0-dev.0) (2026-05-11)
|
|
7
|
+
|
|
8
|
+
### Features
|
|
9
|
+
|
|
10
|
+
- user details adjusts - SFS-2950 ([#3306](https://github.com/vtex/faststore/issues/3306)) ([70b018d](https://github.com/vtex/faststore/commit/70b018d713b4ec0da698bfc377332b356d9fa9cd))
|
|
11
|
+
|
|
12
|
+
## [4.0.1-dev.2](https://github.com/vtex/faststore/compare/v4.0.1-dev.1...v4.0.1-dev.2) (2026-05-11)
|
|
13
|
+
|
|
14
|
+
### Bug Fixes
|
|
15
|
+
|
|
16
|
+
- localization selector stale and reset selection for unsaved changes ([#3301](https://github.com/vtex/faststore/issues/3301)) ([023e52e](https://github.com/vtex/faststore/commit/023e52ee3c8798cfc9f12ed98e99e8efacb1f1d5))
|
|
17
|
+
|
|
6
18
|
## [4.0.1-dev.1](https://github.com/vtex/faststore/compare/v4.0.1-dev.0...v4.0.1-dev.1) (2026-05-07)
|
|
7
19
|
|
|
8
20
|
### Bug Fixes
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@faststore/core",
|
|
3
|
-
"version": "4.0
|
|
3
|
+
"version": "4.1.0-dev.0",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -39,11 +39,11 @@
|
|
|
39
39
|
"@envelop/graphql-jit": "catalog:",
|
|
40
40
|
"@envelop/parser-cache": "catalog:",
|
|
41
41
|
"@envelop/validation-cache": "catalog:",
|
|
42
|
-
"@faststore/api": "4.0
|
|
43
|
-
"@faststore/diagnostics": "4.0
|
|
44
|
-
"@faststore/lighthouse": "4.0
|
|
45
|
-
"@faststore/sdk": "4.0
|
|
46
|
-
"@faststore/ui": "4.0
|
|
42
|
+
"@faststore/api": "4.1.0-dev.0",
|
|
43
|
+
"@faststore/diagnostics": "4.1.0-dev.0",
|
|
44
|
+
"@faststore/lighthouse": "4.1.0-dev.0",
|
|
45
|
+
"@faststore/sdk": "4.1.0-dev.0",
|
|
46
|
+
"@faststore/ui": "4.1.0-dev.0",
|
|
47
47
|
"@graphql-codegen/cli": "catalog:",
|
|
48
48
|
"@graphql-codegen/client-preset": "4.2.6",
|
|
49
49
|
"@graphql-codegen/typescript": "catalog:",
|
|
@@ -113,5 +113,5 @@
|
|
|
113
113
|
"react": "catalog:",
|
|
114
114
|
"react-dom": "catalog:"
|
|
115
115
|
},
|
|
116
|
-
"gitHead": "
|
|
116
|
+
"gitHead": "e356beb2c1bfd3b06bc2a383c01d5957d18c8f34"
|
|
117
117
|
}
|
|
@@ -5,15 +5,17 @@ import styles from './styles.module.scss'
|
|
|
5
5
|
|
|
6
6
|
type MyAccountUserDetailsProps = {
|
|
7
7
|
userDetails: {
|
|
8
|
+
username: string
|
|
8
9
|
name: string
|
|
9
10
|
email: string
|
|
11
|
+
phone: string
|
|
10
12
|
role: string[]
|
|
11
13
|
orgUnit: string
|
|
12
14
|
}
|
|
13
15
|
}
|
|
14
16
|
|
|
15
17
|
export default function MyAccountUserDetails({
|
|
16
|
-
userDetails: { name, email, role, orgUnit },
|
|
18
|
+
userDetails: { username, name, email, phone, role, orgUnit },
|
|
17
19
|
}: MyAccountUserDetailsProps) {
|
|
18
20
|
return (
|
|
19
21
|
<section className={styles.section}>
|
|
@@ -22,14 +24,18 @@ export default function MyAccountUserDetails({
|
|
|
22
24
|
<AccountTable
|
|
23
25
|
rows={[
|
|
24
26
|
{ heading: 'Name', data: name ? name : '–' },
|
|
27
|
+
{ heading: 'Username', data: username ? username : '–' },
|
|
28
|
+
{ heading: 'Phone number', data: phone ? phone : '–' },
|
|
25
29
|
{ heading: 'Email', data: email },
|
|
26
30
|
{
|
|
27
31
|
heading: 'Role',
|
|
28
|
-
data:
|
|
29
|
-
<span
|
|
30
|
-
|
|
32
|
+
data: (
|
|
33
|
+
<span data-fs-user-details-row-tags>
|
|
34
|
+
{role.map((r) => (
|
|
35
|
+
<Tag key={r}>{r}</Tag>
|
|
36
|
+
))}
|
|
31
37
|
</span>
|
|
32
|
-
)
|
|
38
|
+
),
|
|
33
39
|
},
|
|
34
40
|
{ heading: 'Organizational unit', data: orgUnit },
|
|
35
41
|
]}
|
|
@@ -49,6 +49,7 @@ const LocalizationButton = ({
|
|
|
49
49
|
setLocaleCode,
|
|
50
50
|
setCurrencyCode,
|
|
51
51
|
save,
|
|
52
|
+
reset,
|
|
52
53
|
isSaveEnabled,
|
|
53
54
|
error,
|
|
54
55
|
} = useBindingSelector()
|
|
@@ -97,7 +98,10 @@ const LocalizationButton = ({
|
|
|
97
98
|
{isSelectorOpen && (
|
|
98
99
|
<LocalizationSelector
|
|
99
100
|
isOpen={isSelectorOpen}
|
|
100
|
-
onClose={() =>
|
|
101
|
+
onClose={() => {
|
|
102
|
+
setIsSelectorOpen(false)
|
|
103
|
+
reset()
|
|
104
|
+
}}
|
|
101
105
|
triggerRef={buttonRef}
|
|
102
106
|
languages={languages}
|
|
103
107
|
currencies={currencies}
|
|
@@ -35,8 +35,10 @@ const COMPONENTS: Record<string, ComponentType<any>> = {
|
|
|
35
35
|
|
|
36
36
|
type UserDetailsPagePros = {
|
|
37
37
|
userDetails: {
|
|
38
|
+
username: string
|
|
38
39
|
name: string
|
|
39
40
|
email: string
|
|
41
|
+
phone: string
|
|
40
42
|
role: string[]
|
|
41
43
|
orgUnit: string
|
|
42
44
|
}
|
|
@@ -75,8 +77,10 @@ const query = gql(`
|
|
|
75
77
|
name
|
|
76
78
|
}
|
|
77
79
|
userDetails {
|
|
80
|
+
username
|
|
78
81
|
name
|
|
79
82
|
email
|
|
83
|
+
phone
|
|
80
84
|
role
|
|
81
85
|
orgUnit
|
|
82
86
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { useCallback, useMemo, useState } from 'react'
|
|
1
|
+
import { useCallback, useEffect, useMemo, useRef, useState } from 'react'
|
|
2
2
|
|
|
3
3
|
import storeConfig from '../../../discovery.config'
|
|
4
4
|
import { buildRedirectUrl } from '../../utils/localization/bindingPaths'
|
|
@@ -56,6 +56,8 @@ export interface UseBindingSelectorReturn {
|
|
|
56
56
|
setCurrencyCode: (code: string) => void
|
|
57
57
|
/** Action to save selections and redirect */
|
|
58
58
|
save: () => void
|
|
59
|
+
/** Discards unsaved changes and resets selections to current session values */
|
|
60
|
+
reset: () => void
|
|
59
61
|
}
|
|
60
62
|
|
|
61
63
|
/**
|
|
@@ -77,6 +79,23 @@ export function useBindingSelector(): UseBindingSelectorReturn {
|
|
|
77
79
|
)
|
|
78
80
|
const [error, setError] = useState<BindingSelectorError | null>(null)
|
|
79
81
|
|
|
82
|
+
const hasUserEditedSelection = useRef(false)
|
|
83
|
+
|
|
84
|
+
// Sync selections when session resolves after initial render (e.g. stale session
|
|
85
|
+
// from a previous locale when navigating between locale-prefixed paths).
|
|
86
|
+
// Skipped once the user has made an in-progress selection; call reset() on close to re-enable.
|
|
87
|
+
useEffect(() => {
|
|
88
|
+
if (!hasUserEditedSelection.current) {
|
|
89
|
+
setLocaleCode(currentLocale ?? null)
|
|
90
|
+
}
|
|
91
|
+
}, [currentLocale])
|
|
92
|
+
|
|
93
|
+
useEffect(() => {
|
|
94
|
+
if (!hasUserEditedSelection.current) {
|
|
95
|
+
setCurrencyCode(currentCurrency?.code ?? null)
|
|
96
|
+
}
|
|
97
|
+
}, [currentCurrency?.code])
|
|
98
|
+
|
|
80
99
|
// Build language options with disambiguation - returns Record<localeCode, languageName>
|
|
81
100
|
const languages = useMemo(
|
|
82
101
|
() => buildLanguageOptions(localizationConfig.locales),
|
|
@@ -98,6 +117,7 @@ export function useBindingSelector(): UseBindingSelectorReturn {
|
|
|
98
117
|
// Handle locale code change
|
|
99
118
|
const handleSetLocaleCode = useCallback(
|
|
100
119
|
(code: string) => {
|
|
120
|
+
hasUserEditedSelection.current = true
|
|
101
121
|
setLocaleCode(code)
|
|
102
122
|
setError(null)
|
|
103
123
|
|
|
@@ -126,6 +146,7 @@ export function useBindingSelector(): UseBindingSelectorReturn {
|
|
|
126
146
|
|
|
127
147
|
// Handle currency code change
|
|
128
148
|
const handleSetCurrencyCode = useCallback((code: string) => {
|
|
149
|
+
hasUserEditedSelection.current = true
|
|
129
150
|
setCurrencyCode(code)
|
|
130
151
|
setError(null)
|
|
131
152
|
}, [])
|
|
@@ -169,6 +190,14 @@ export function useBindingSelector(): UseBindingSelectorReturn {
|
|
|
169
190
|
|
|
170
191
|
const isSaveEnabled = Boolean(localeCode && currencyCode && !error)
|
|
171
192
|
|
|
193
|
+
// Discards unsaved changes and re-enables session syncing
|
|
194
|
+
const reset = useCallback(() => {
|
|
195
|
+
hasUserEditedSelection.current = false
|
|
196
|
+
setLocaleCode(currentLocale ?? null)
|
|
197
|
+
setCurrencyCode(currentCurrency?.code ?? null)
|
|
198
|
+
setError(null)
|
|
199
|
+
}, [currentLocale, currentCurrency?.code])
|
|
200
|
+
|
|
172
201
|
return {
|
|
173
202
|
languages,
|
|
174
203
|
currencies,
|
|
@@ -179,5 +208,6 @@ export function useBindingSelector(): UseBindingSelectorReturn {
|
|
|
179
208
|
setLocaleCode: handleSetLocaleCode,
|
|
180
209
|
setCurrencyCode: handleSetCurrencyCode,
|
|
181
210
|
save,
|
|
211
|
+
reset,
|
|
182
212
|
}
|
|
183
213
|
}
|