Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Auth / Order / Account - 1.0.0 #242

Merged
merged 7 commits into from
Dec 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion blocks/commerce-create-return/commerce-create-return.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,12 @@ import '../../scripts/initializers/order.js';

export default async function decorate(block) {
await orderRenderer.render(CreateReturn, {
routeReturnSuccess: (orderData) => (checkIsAuthenticated() ? `${CUSTOMER_ORDER_DETAILS_PATH}?orderRef=${orderData.number}` : `${ORDER_DETAILS_PATH}?orderRef=${orderData.token}`),
routeReturnSuccess: (orderData) => {
const orderRef = checkIsAuthenticated() ? orderData.number : orderData.token;
const encodedOrderRef = encodeURIComponent(orderRef);
const path = checkIsAuthenticated() ? CUSTOMER_ORDER_DETAILS_PATH : ORDER_DETAILS_PATH;

return `${path}?orderRef=${encodedOrderRef}`;
},
})(block);
}
2 changes: 1 addition & 1 deletion cypress/src/tests/e2eTests/verifyGuestUserCheckout.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ describe('Verify guest user can place order', () => {
cy.get('.dropin-header-container__title', {timeout: 3000})
.should('exist')
.and('be.visible')
.and('contain.text', 'cancellation requested');
.and('contain.text', 'Cancellation requested');

cy.get(fields.cancellationReasonsModal).should('not.exist');

Expand Down
20 changes: 12 additions & 8 deletions package-lock.json

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

6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,11 @@
"dependencies": {
"@adobe/magento-storefront-event-collector": "^1.8.0",
"@adobe/magento-storefront-events-sdk": "^1.8.0",
"@dropins/storefront-account": "0.1.0-alpha20",
"@dropins/storefront-auth": "0.0.1-alpha25",
"@dropins/storefront-account": "1.0.0-beta3",
"@dropins/storefront-auth": "1.0.0-beta2",
"@dropins/storefront-cart": "0.10.0",
"@dropins/storefront-checkout": "0.1.0-alpha61",
"@dropins/storefront-order": "0.1.0-alpha26",
"@dropins/storefront-order": "1.0.0-beta2",
"@dropins/storefront-pdp": "1.0.0-beta3",
"@dropins/tools": "^0.36.0"
}
Expand Down
4 changes: 3 additions & 1 deletion 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 CREATE_CUSTOMER_ADDRESS = "\n mutation CREATE_CUSTOMER_ADDRESS($input: CustomerAddressInput!) {\n createCustomerAddress(input:$input) {\n firstname\n }\n }\n";
export declare const CREATE_CUSTOMER_ADDRESS = "\n mutation CREATE_CUSTOMER_ADDRESS($input: CustomerAddressInput!) {\n createCustomerAddress(input: $input) {\n firstname\n }\n }\n";
//# sourceMappingURL=createCustomerAddress.graphql.d.ts.map
4 changes: 4 additions & 0 deletions scripts/__dropins__/storefront-account/api/fragments.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
export { BASIC_CUSTOMER_INFO_FRAGMENT } from './graphql/CustomerFragment.graphql';
export { ADDRESS_FRAGMENT } from './graphql/CustomerAddressFragment.graphql';
export { ORDER_SUMMARY_FRAGMENT } from './graphql/OrderSummaryFragment.graphql';
//# sourceMappingURL=fragments.d.ts.map

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
export declare const GET_ATTRIBUTES_FORM = "\n query GET_ATTRIBUTES_FORM($formCode: String!) {\n attributesForm(formCode: $formCode) {\n items {\n code\n default_value\n entity_type\n frontend_class\n frontend_input\n is_required\n is_unique\n label\n options {\n is_default\n label\n value\n }\n ... on CustomerAttributeMetadata {\n multiline_count\n sort_order\n validate_rules {\n name\n value\n }\n }\n }\n errors {\n type\n message\n }\n }\n }\n";
export declare const GET_ATTRIBUTES_FORM_SHORT = "\n query GET_ATTRIBUTES_FORM_SHORT {\n attributesForm(formCode: \"customer_register_address\") {\n items {\n frontend_input\n label\n code\n ... on CustomerAttributeMetadata {\n multiline_count\n sort_order\n }\n }\n }\n }\n";
export declare const GET_ATTRIBUTES_FORM_SHORT = "\n query GET_ATTRIBUTES_FORM_SHORT {\n attributesForm(formCode: \"customer_register_address\") {\n items {\n frontend_input\n label\n code\n ... on CustomerAttributeMetadata {\n multiline_count\n sort_order\n }\n }\n }\n }\n";
//# sourceMappingURL=getAttributesForm.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 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 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";
//# sourceMappingURL=getCustomerAddress.graphql.d.ts.map
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { OrderHistory } from '../../data/models';
import { OrderHistoryModel } from '../../data/models';

export declare const getOrderHistoryList: (pageSize: number, selectOrdersDate: string, currentPage: number) => Promise<OrderHistory | null>;
export declare const getOrderHistoryList: (pageSize: number, selectOrdersDate: string, currentPage: number) => Promise<OrderHistoryModel | null>;
//# sourceMappingURL=getOrderHistoryList.d.ts.map

This file was deleted.

This file was deleted.

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 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 base_media_url\n autocomplete_on_storefront\n minimum_password_length\n required_character_classes_number\n }\n }\n";
//# sourceMappingURL=getStoreConfig.graphql.d.ts.map
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
export declare const ADDRESS_FRAGMENT = "\n fragment ADDRESS_FRAGMENT on OrderAddress {\n city\n company\n country_code\n fax\n firstname\n lastname\n middlename\n postcode\n prefix\n region\n region_id\n street\n suffix\n telephone\n vat_id\n }\n";
//# sourceMappingURL=CustomerAddressFragment.graphql.d.ts.map
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
export declare const BASIC_CUSTOMER_INFO_FRAGMENT = "\n fragment BASIC_CUSTOMER_INFO_FRAGMENT 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";
//# sourceMappingURL=CustomerFragment.graphql.d.ts.map
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
export declare const ORDER_SUMMARY_FRAGMENT = "\n fragment ORDER_SUMMARY_FRAGMENT on OrderTotal {\n __typename\n grand_total {\n value\n currency\n }\n subtotal {\n currency\n value\n }\n taxes {\n amount {\n currency\n value\n }\n rate\n title\n }\n total_tax {\n currency\n value\n }\n total_shipping {\n currency\n value\n }\n discounts {\n amount {\n currency\n value\n }\n label\n }\n }\n";
//# sourceMappingURL=OrderSummaryFragment.graphql.d.ts.map
Original file line number Diff line number Diff line change
@@ -1,12 +1,18 @@
import { Initializer } from '@dropins/tools/types/elsie/src/lib';
import { Initializer, Model } from '@dropins/tools/types/elsie/src/lib';
import { Lang } from '@dropins/tools/types/elsie/src/i18n';
import { OrderHistoryModel } from '../../data/models';
import { CustomerDataModelShort } from '../../data/models/customer';

type ConfigProps = {
langDefinitions?: Lang;
authHeaderConfig?: {
header?: string;
tokenPrefix?: string;
};
models?: {
OrderHistoryModel?: Model<OrderHistoryModel>;
CustomerDataModelShort?: Model<CustomerDataModelShort>;
};
};
export declare const initialize: Initializer<ConfigProps>;
export declare const config: import('@dropins/tools/types/elsie/src/lib').Config<ConfigProps>;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
export declare const REMOVE_CUSTOMER_ADDRESS = "\n mutation REMOVE_CUSTOMER_ADDRESS($id: Int!) {\n deleteCustomerAddress(id:$id)\n }\n";
export declare const REMOVE_CUSTOMER_ADDRESS = "\n mutation REMOVE_CUSTOMER_ADDRESS($id: Int!) {\n deleteCustomerAddress(id: $id)\n }\n";
//# sourceMappingURL=removeCustomerAddress.graphql.d.ts.map
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
export declare const UPDATE_CUSTOMER_V2 = "\n mutation UPDATE_CUSTOMER_V2($input: CustomerUpdateInput!) {\n updateCustomerV2(input:$input) {\n customer {\n email\n }\n }\n }\n";
export declare const UPDATE_CUSTOMER_V2 = "\n mutation UPDATE_CUSTOMER_V2($input: CustomerUpdateInput!) {\n updateCustomerV2(input: $input) {\n customer {\n email\n }\n }\n }\n";
//# sourceMappingURL=updateCustomer.graphql.d.ts.map
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
export declare const UPDATE_CUSTOMER_ADDRESS = "\n mutation UPDATE_CUSTOMER_ADDRESS($id: Int!,\n $input: CustomerAddressInput) {\n updateCustomerAddress(id:$id, input:$input) {\n firstname\n }\n }\n";
export declare const UPDATE_CUSTOMER_ADDRESS = "\n mutation UPDATE_CUSTOMER_ADDRESS($id: Int!, $input: CustomerAddressInput) {\n updateCustomerAddress(id: $id, input: $input) {\n firstname\n }\n }\n";
//# sourceMappingURL=updateCustomerAddress.graphql.d.ts.map
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
export declare const UPDATE_CUSTOMER_EMAIL = "\n mutation UPDATE_CUSTOMER_EMAIL($email: String! $password: String!) {\n updateCustomerEmail(email:$email password:$password) {\n customer {\n email\n }\n }\n }\n";
export declare const UPDATE_CUSTOMER_EMAIL = "\n mutation UPDATE_CUSTOMER_EMAIL($email: String!, $password: String!) {\n updateCustomerEmail(email: $email, password: $password) {\n customer {\n email\n }\n }\n }\n";
//# sourceMappingURL=updateCustomerEmail.graphql.d.ts.map
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
export declare const CHANGE_CUSTOMER_PASSWORD = "\n mutation CHANGE_CUSTOMER_PASSWORD($currentPassword: String!, $newPassword: String!) {\n changeCustomerPassword(currentPassword: $currentPassword, newPassword: $newPassword) {\n email\n }\n }\n";
export declare const CHANGE_CUSTOMER_PASSWORD = "\n mutation CHANGE_CUSTOMER_PASSWORD(\n $currentPassword: String!\n $newPassword: String!\n ) {\n changeCustomerPassword(\n currentPassword: $currentPassword\n newPassword: $newPassword\n ) {\n email\n }\n }\n";
//# sourceMappingURL=updateCustomerPassword.graphql.d.ts.map

Large diffs are not rendered by default.

Loading
Loading