Skip to content

Commit

Permalink
Merge branch 'develop' into GA-Demo-Develop-2
Browse files Browse the repository at this point in the history
  • Loading branch information
ericeoeur authored Nov 11, 2024
2 parents 44c33db + ec6aea5 commit 6e8221f
Show file tree
Hide file tree
Showing 18 changed files with 70 additions and 23 deletions.
7 changes: 7 additions & 0 deletions blocks/commerce-order-returns/commerce-order-returns.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import { checkIsAuthenticated } from '../../scripts/configs.js';
import {
CUSTOMER_RETURN_DETAILS_PATH,
RETURN_DETAILS_PATH,
UPS_TRACKING_URL,
} from '../../scripts/constants.js';

// Initialize
Expand All @@ -18,6 +19,12 @@ export default async function decorate(block) {
: RETURN_DETAILS_PATH;

await orderRenderer.render(OrderReturns, {
routeTracking: ({ carrier, number }) => {
if (carrier?.toLowerCase() === 'ups') {
return `${UPS_TRACKING_URL}?tracknum=${number}`;
}
return '';
},
routeReturnDetails: ({ orderNumber, returnNumber, token }) => {
const { searchParams } = new URL(window.location.href);
const orderRefFromUrl = searchParams.get('orderRef');
Expand Down
7 changes: 7 additions & 0 deletions blocks/commerce-orders-list/commerce-orders-list.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import {
CUSTOMER_ORDER_DETAILS_PATH,
CUSTOMER_ORDERS_PATH,
CUSTOMER_RETURN_DETAILS_PATH,
UPS_TRACKING_URL,
} from '../../scripts/constants.js';

// Initialize
Expand All @@ -22,6 +23,12 @@ export default async function decorate(block) {
} else {
await accountRenderer.render(OrdersList, {
minifiedView: minifiedViewConfig === 'true',
routeTracking: ({ carrier, number }) => {
if (carrier === 'ups') {
return `${UPS_TRACKING_URL}?tracknum=${number}`;
}
return '';
},
routeOrdersList: () => CUSTOMER_ORDERS_PATH,
routeOrderDetails: (orderNumber) => `${CUSTOMER_ORDER_DETAILS_PATH}?orderRef=${orderNumber}`,
routeReturnDetails: ({ orderNumber, returnNumber }) => `${CUSTOMER_RETURN_DETAILS_PATH}?orderRef=${orderNumber}&returnRef=${returnNumber}`,
Expand Down
7 changes: 7 additions & 0 deletions blocks/commerce-returns-list/commerce-returns-list.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import {
CUSTOMER_RETURN_DETAILS_PATH,
CUSTOMER_ORDER_DETAILS_PATH,
CUSTOMER_RETURNS_PATH,
UPS_TRACKING_URL,
} from '../../scripts/constants.js';

// Initialize
Expand All @@ -24,6 +25,12 @@ export default async function decorate(block) {
} else {
await orderRenderer.render(ReturnsList, {
minifiedView: minifiedViewConfig === 'true',
routeTracking: ({ carrier, number }) => {
if (carrier?.toLowerCase() === 'ups') {
return `${UPS_TRACKING_URL}?tracknum=${number}`;
}
return '';
},
routeReturnDetails: ({ orderNumber, returnNumber }) => `${CUSTOMER_RETURN_DETAILS_PATH}?orderRef=${orderNumber}&returnRef=${returnNumber}`,
routeOrderDetails: ({ orderNumber }) => `${CUSTOMER_ORDER_DETAILS_PATH}?orderRef=${orderNumber}`,
routeReturnsList: () => CUSTOMER_RETURNS_PATH,
Expand Down
7 changes: 7 additions & 0 deletions blocks/commerce-shipping-status/commerce-shipping-status.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,19 @@
/* eslint-disable import/no-extraneous-dependencies */
import { render as orderRenderer } from '@dropins/storefront-order/render.js';
import { ShippingStatus } from '@dropins/storefront-order/containers/ShippingStatus.js';
import { UPS_TRACKING_URL } from '../../scripts/constants.js';

// Initialize
import '../../scripts/initializers/order.js';

export default async function decorate(block) {
await orderRenderer.render(ShippingStatus, {
routeTracking: ({ carrier, number }) => {
if (carrier?.toLowerCase() === 'ups') {
return `${UPS_TRACKING_URL}?tracknum=${number}`;
}
return '';
},
routeProductDetails: (data) => {
if (data?.orderItem) {
return `/products/${data?.orderItem?.productUrlKey}/${data?.orderItem?.product?.sku}`;
Expand Down
16 changes: 8 additions & 8 deletions package-lock.json

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

4 changes: 2 additions & 2 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-alpha17",
"@dropins/storefront-account": "0.1.0-alpha19",
"@dropins/storefront-auth": "0.0.1-alpha25",
"@dropins/storefront-cart": "0.9.0",
"@dropins/storefront-checkout": "0.1.0-alpha53",
"@dropins/storefront-order": "0.1.0-alpha18",
"@dropins/storefront-order": "0.1.0-alpha19",
"@dropins/storefront-pdp": "0.4.0",
"@dropins/tools": "^0.35.0"
}
Expand Down

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,7 @@ export declare const mockOrdersListResponse: {
status: string;
items: ({
status: string;
quantityOrdered: number;
product_name: string;
id: string;
product: {
Expand All @@ -167,6 +168,7 @@ export declare const mockOrdersListResponse: {
quantityInvoiced?: undefined;
} | {
status: string;
quantityOrdered: number;
quantityInvoiced: number;
product_name: string;
id: string;
Expand Down

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { useFormProps } from '../../types';

export declare const useForm: ({ fieldsConfig, onSubmit, onChange, setInputChange, formName, isWaitingForResponse, }: useFormProps) => {
isDataValid: boolean;
formData: Record<string, string | number>;
errors: Record<string, string>;
formRef: import('preact').RefObject<HTMLFormElement>;
Expand Down
Loading

0 comments on commit 6e8221f

Please sign in to comment.