Skip to content

Commit

Permalink
Merge pull request #156 from Foxy/beta
Browse files Browse the repository at this point in the history
chore: release 1.26.0
  • Loading branch information
brettflorio authored Mar 22, 2024
2 parents e8b2864 + 1de54e8 commit 4794b66
Show file tree
Hide file tree
Showing 29 changed files with 546 additions and 351 deletions.
245 changes: 44 additions & 201 deletions custom-elements.json
Original file line number Diff line number Diff line change
Expand Up @@ -18682,39 +18682,15 @@
{
"name": "foxy-payment-card",
"path": "./src/elements/public/PaymentCard/index.ts",
"description": "Basic card displaying a payment.\n\nNote: payment gateway names need to be loaded separately. You can obtain\nthem from `fx:property_helpers` using your own Backend API proxy or just hardcode the values\nyou need. Once you have the gateway names, call `I18n.setGateways(names)`.",
"description": "Basic card displaying a payment resource (`fx:payment`).",
"attributes": [
{
"name": "mode",
"type": "string",
"default": "\"production\""
},
{
"name": "readonly",
"type": "boolean",
"default": "false"
"name": "hosted-payment-gateways-helper",
"description": "URL of the `fx:hosted_payment_gateways` property helper resource."
},
{
"name": "readonlycontrols",
"default": "\"False\""
},
{
"name": "disabled",
"type": "boolean",
"default": "false"
},
{
"name": "disabledcontrols",
"default": "\"False\""
},
{
"name": "hidden",
"type": "boolean",
"default": "false"
},
{
"name": "hiddencontrols",
"default": "\"False\""
"name": "payment-gateways-helper",
"description": "URL of the `fx:payment_gateways` property helper resource."
},
{
"name": "ns",
Expand Down Expand Up @@ -18757,60 +18733,14 @@
],
"properties": [
{
"name": "templates",
"type": "Templates",
"default": "{}"
},
{
"name": "mode",
"attribute": "mode",
"type": "string",
"default": "\"production\""
"name": "hostedPaymentGatewaysHelper",
"attribute": "hosted-payment-gateways-helper",
"description": "URL of the `fx:hosted_payment_gateways` property helper resource."
},
{
"name": "readonly",
"attribute": "readonly",
"type": "boolean",
"default": "false"
},
{
"name": "readonlyControls",
"attribute": "readonlycontrols",
"default": "\"False\""
},
{
"name": "disabled",
"attribute": "disabled",
"type": "boolean",
"default": "false"
},
{
"name": "disabledControls",
"attribute": "disabledcontrols",
"default": "\"False\""
},
{
"name": "hidden",
"attribute": "hidden",
"type": "boolean",
"default": "false"
},
{
"name": "hiddenControls",
"attribute": "hiddencontrols",
"default": "\"False\""
},
{
"name": "readonlySelector",
"type": "BooleanSelector"
},
{
"name": "disabledSelector",
"type": "BooleanSelector"
},
{
"name": "hiddenSelector",
"type": "BooleanSelector"
"name": "paymentGatewaysHelper",
"attribute": "payment-gateways-helper",
"description": "URL of the `fx:payment_gateways` property helper resource."
},
{
"name": "ns",
Expand All @@ -18823,6 +18753,10 @@
"type": "Translator",
"default": "\"(key, options) => {\\n const I18nElement = customElements.get('foxy-i18n') as typeof I18n | undefined;\\n\\n if (!I18nElement) return key;\\n\\n const keys = [\\n ...this.ns\\n .split(' ')\\n .reverse()\\n .map(v => v.trim())\\n .filter(v => v.length > 0)\\n .reverse()\\n .map((v, i, a) => `${v}:${[...a.slice(i + 1), key].join('.')}`),\\n `shared:${key}`,\\n ];\\n\\n return I18nElement.i18next.t(keys, { lng: this.lang, ...options }).toString();\\n }\""
},
{
"name": "isBodyReady",
"type": "boolean"
},
{
"name": "UpdateEvent",
"description": "Instances of this event are dispatched on an element whenever it changes its\nstate (e.g. when going from `busy` to `idle` or on `form` data change).\nThis event isn't cancelable, and it does not bubble.",
Expand Down Expand Up @@ -18910,38 +18844,6 @@
"name": "fetch",
"description": "Instance of `NucleonElement.API.FetchEvent`. Emitted before each API request."
}
],
"slots": [
{
"name": "title:before"
},
{
"name": "title:after"
},
{
"name": "subtitle:before"
},
{
"name": "subtitle:after"
},
{
"name": "card-info:before"
},
{
"name": "card-info:after"
},
{
"name": "fraud-risk:before"
},
{
"name": "fraud-risk:after"
},
{
"name": "processor-response:before"
},
{
"name": "processor-response:after"
}
]
},
{
Expand Down Expand Up @@ -21716,40 +21618,8 @@
{
"name": "foxy-shipment-card",
"path": "./src/elements/public/ShipmentCard/index.ts",
"description": "Basic card displaying a shipment.",
"description": "Basic card displaying a shipment (`fx:shipment`).",
"attributes": [
{
"name": "mode",
"type": "string",
"default": "\"production\""
},
{
"name": "readonly",
"type": "boolean",
"default": "false"
},
{
"name": "readonlycontrols",
"default": "\"False\""
},
{
"name": "disabled",
"type": "boolean",
"default": "false"
},
{
"name": "disabledcontrols",
"default": "\"False\""
},
{
"name": "hidden",
"type": "boolean",
"default": "false"
},
{
"name": "hiddencontrols",
"default": "\"False\""
},
{
"name": "ns",
"type": "string",
Expand Down Expand Up @@ -21790,61 +21660,6 @@
}
],
"properties": [
{
"name": "templates",
"default": "{}"
},
{
"name": "mode",
"attribute": "mode",
"type": "string",
"default": "\"production\""
},
{
"name": "readonly",
"attribute": "readonly",
"type": "boolean",
"default": "false"
},
{
"name": "readonlyControls",
"attribute": "readonlycontrols",
"default": "\"False\""
},
{
"name": "disabled",
"attribute": "disabled",
"type": "boolean",
"default": "false"
},
{
"name": "disabledControls",
"attribute": "disabledcontrols",
"default": "\"False\""
},
{
"name": "hidden",
"attribute": "hidden",
"type": "boolean",
"default": "false"
},
{
"name": "hiddenControls",
"attribute": "hiddencontrols",
"default": "\"False\""
},
{
"name": "readonlySelector",
"type": "BooleanSelector"
},
{
"name": "disabledSelector",
"type": "BooleanSelector"
},
{
"name": "hiddenSelector",
"type": "BooleanSelector"
},
{
"name": "ns",
"attribute": "ns",
Expand Down Expand Up @@ -26034,6 +25849,12 @@
{
"name": "google-analytics:after"
},
{
"name": "google-tag:before"
},
{
"name": "google-tag:after"
},
{
"name": "troubleshooting:before"
},
Expand Down Expand Up @@ -26930,6 +26751,14 @@
"path": "./src/elements/public/Transaction/index.ts",
"description": "Transaction summary page (`fx:transaction`).",
"attributes": [
{
"name": "hosted-payment-gateways-helper",
"description": "URL of the `fx:hosted_payment_gateways` property helper resource."
},
{
"name": "payment-gateways-helper",
"description": "URL of the `fx:payment_gateways` property helper resource."
},
{
"name": "ns",
"type": "string",
Expand Down Expand Up @@ -27007,6 +26836,16 @@
}
],
"properties": [
{
"name": "hostedPaymentGatewaysHelper",
"attribute": "hosted-payment-gateways-helper",
"description": "URL of the `fx:hosted_payment_gateways` property helper resource."
},
{
"name": "paymentGatewaysHelper",
"attribute": "payment-gateways-helper",
"description": "URL of the `fx:payment_gateways` property helper resource."
},
{
"name": "getSubscriptionPageHref"
},
Expand Down Expand Up @@ -27324,6 +27163,10 @@
"type": "Translator",
"default": "\"(key, options) => {\\n const I18nElement = customElements.get('foxy-i18n') as typeof I18n | undefined;\\n\\n if (!I18nElement) return key;\\n\\n const keys = [\\n ...this.ns\\n .split(' ')\\n .reverse()\\n .map(v => v.trim())\\n .filter(v => v.length > 0)\\n .reverse()\\n .map((v, i, a) => `${v}:${[...a.slice(i + 1), key].join('.')}`),\\n `shared:${key}`,\\n ];\\n\\n return I18nElement.i18next.t(keys, { lng: this.lang, ...options }).toString();\\n }\""
},
{
"name": "isBodyReady",
"type": "boolean"
},
{
"name": "UpdateEvent",
"description": "Instances of this event are dispatched on an element whenever it changes its\nstate (e.g. when going from `busy` to `idle` or on `form` data change).\nThis event isn't cancelable, and it does not bubble.",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -692,4 +692,50 @@ describe('AdminSubscriptionCard', () => {

expect(element.renderRoot).to.include.text('[email protected]');
});

it('renders customer name in line 3 from embedded fx:customer', async () => {
type Subscription = Resource<Rels.Subscription, { zoom: ['customer'] }>;

const router = createRouter();
const href = 'https://demo.api/hapi/subscriptions/0?zoom=customer';
const data = await getTestData<Subscription>(href, router);

const element = await fixture<Card>(html`
<foxy-admin-subscription-card
locale-codes="https://demo.api/hapi/property_helpers/7"
@fetch=${(evt: FetchEvent) => router.handleEvent(evt)}
>
</foxy-admin-subscription-card>
`);

data._embedded['fx:customer'].first_name = 'Test';
data._embedded['fx:customer'].last_name = 'User';
element.data = data;

await waitUntil(() => element.isBodyReady, '', { timeout: 5000 });
expect(element.renderRoot).to.include.text('Test User');
});

it('renders customer name in line 3 from remote fx:customer', async () => {
const router = createRouter();
const href = 'https://demo.api/hapi/subscriptions/0';
const data = await getTestData<Resource<Rels.Subscription>>(href, router);

const element = await fixture<Card>(html`
<foxy-admin-subscription-card
locale-codes="https://demo.api/hapi/property_helpers/7"
href=${href}
@fetch=${(evt: FetchEvent) => router.handleEvent(evt)}
>
</foxy-admin-subscription-card>
`);

await new Card.API(element).fetch(data._links['fx:customer'].href, {
method: 'PATCH',
body: JSON.stringify({ first_name: 'Test', last_name: 'User' }),
});

await waitUntil(() => element.isBodyReady, '', { timeout: 5000 });
expect(element.renderRoot).to.include.text('Test User');
});
});
Loading

0 comments on commit 4794b66

Please sign in to comment.