@sonic-equipment/ui 1.1.1 → 1.1.3

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.
@@ -10,6 +10,7 @@ export interface FormProps {
10
10
  autoComplete?: boolean;
11
11
  children: ReactNode;
12
12
  className?: string;
13
+ 'data-test-selector'?: string;
13
14
  errorMessage?: string;
14
15
  footer?: ReactNode;
15
16
  header?: ReactNode;
@@ -17,4 +18,4 @@ export interface FormProps {
17
18
  title?: string;
18
19
  validationErrors?: ValidationErrors;
19
20
  }
20
- export declare function Form({ autoComplete, children, className, errorMessage, footer, header, onSubmit, title, validationErrors, }: FormProps): import("react/jsx-runtime").JSX.Element;
21
+ export declare function Form({ autoComplete, children, className, 'data-test-selector': dataTestSelector, errorMessage, footer, header, onSubmit, title, validationErrors, }: FormProps): import("react/jsx-runtime").JSX.Element;
@@ -7,7 +7,7 @@ import { Message } from '../../../message/message.js';
7
7
  import { scrollToTop } from '../../../shared/utils/scrolling.js';
8
8
  import styles from './form.module.css.js';
9
9
 
10
- function Form({ autoComplete = false, children, className, errorMessage, footer, header, onSubmit, title, validationErrors, }) {
10
+ function Form({ autoComplete = false, children, className, 'data-test-selector': dataTestSelector, errorMessage, footer, header, onSubmit, title, validationErrors, }) {
11
11
  const handleSubmit = (event) => {
12
12
  if (onSubmit) {
13
13
  event.preventDefault();
@@ -22,7 +22,7 @@ function Form({ autoComplete = false, children, className, errorMessage, footer,
22
22
  scrollToTop();
23
23
  }
24
24
  }, [errorMessage]);
25
- return (jsxs(Form$1, { "aria-label": title, autoComplete: autoComplete ? 'on' : 'off', className: clsx(styles['form'], className), onSubmit: handleSubmit, validationBehavior: "native", validationErrors: validationErrors, children: [header && jsx("header", { className: styles['form-header'], children: header }), errorMessage && (jsx("section", { className: styles['error-messages'], children: jsx(Message, { type: "danger", children: errorMessage }) })), children, footer && jsx("footer", { className: styles['form-footer'], children: footer })] }));
25
+ return (jsxs(Form$1, { "aria-label": title, autoComplete: autoComplete ? 'on' : 'off', className: clsx(styles['form'], className), "data-test-selector": dataTestSelector, onSubmit: handleSubmit, validationBehavior: "native", validationErrors: validationErrors, children: [header && jsx("header", { className: styles['form-header'], children: header }), errorMessage && (jsx("section", { className: styles['error-messages'], children: jsx(Message, { type: "danger", children: errorMessage }) })), children, footer && jsx("footer", { className: styles['form-footer'], children: footer })] }));
26
26
  }
27
27
 
28
28
  export { Form };
@@ -14,7 +14,7 @@ function ConnectedBillToAddressWidget({ billToId = 'current', } = {}) {
14
14
  const editAddressUrl = `${paths.ACCOUNT_EDIT_BILL_TO_ADDRESS}/${billToId}?returnUrl=${encodeURIComponent(href)}`;
15
15
  const { data: billToAddress, error, isLoading, } = useFetchBillToAddress({ billToId });
16
16
  return (jsx(AddressDataCard, { actions: [
17
- jsx(Button, { color: "secondary", href: editAddressUrl, size: "sm", variant: "outline", children: jsx(FormattedMessage, { id: "Edit" }) }, "edit"),
17
+ jsx(Button, { color: "secondary", "data-test-selector": "billing-address-edit-adress", href: editAddressUrl, size: "sm", variant: "outline", children: jsx(FormattedMessage, { id: "Edit" }) }, "edit"),
18
18
  ], data: {
19
19
  address1: billToAddress?.address1,
20
20
  address2: billToAddress?.address2,
@@ -18,8 +18,8 @@ function ConnectedShipToAddressWidget({ billToId = 'current', shipToId = 'curren
18
18
  shipToId,
19
19
  });
20
20
  return (jsx(AddressDataCard, { actions: [
21
- jsx(Button, { color: "secondary", href: editAddressUrl, size: "sm", variant: "outline", children: jsx(FormattedMessage, { id: "Edit" }) }, "edit"),
22
- jsx(Button, { color: "secondary", href: createAddressUrl, size: "sm", variant: "outline", children: jsx(FormattedMessage, { id: "Create" }) }, "create"),
21
+ jsx(Button, { color: "secondary", "data-test-selector": "shipping-address-edit-adress", href: editAddressUrl, size: "sm", variant: "outline", children: jsx(FormattedMessage, { id: "Edit" }) }, "edit"),
22
+ jsx(Button, { color: "secondary", "data-test-selector": "billing-address-create-adress", href: createAddressUrl, size: "sm", variant: "outline", children: jsx(FormattedMessage, { id: "Create" }) }, "create"),
23
23
  ], data: {
24
24
  address1: shipToAddress?.address1,
25
25
  address2: shipToAddress?.address2,
@@ -99,7 +99,11 @@ async function fetchProductListingPageData({ cultureCode, headers, ignoreCache,
99
99
  }
100
100
  async function fetchNavigationLinks({ cultureCode, headers, ignoreCache, }) {
101
101
  const { body } = await request({
102
- headers: { 'Current-Language-Id': cultureCode, ...headers },
102
+ headers: {
103
+ 'Cache-Control': 'no-cache',
104
+ 'Current-Language-Id': cultureCode,
105
+ ...headers,
106
+ },
103
107
  next: {
104
108
  revalidate: ignoreCache ? 0 : Infinity,
105
109
  tags: ignoreCache
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sonic-equipment/ui",
3
- "version": "1.1.1",
3
+ "version": "1.1.3",
4
4
  "type": "module",
5
5
  "license": "MIT",
6
6
  "engines": {