Skip to content

Commit

Permalink
Add in store pickup targets's API definition
Browse files Browse the repository at this point in the history
  • Loading branch information
sirgalleto committed Apr 20, 2024
1 parent e9c1560 commit 41f54a8
Show file tree
Hide file tree
Showing 4 changed files with 40 additions and 0 deletions.
1 change: 1 addition & 0 deletions packages/ui-extensions/src/surfaces/admin/api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,4 @@ export type {ProductDetailsConfigurationApi} from './api/product-configuration/p
export type {ProductVariantDetailsConfigurationApi} from './api/product-configuration/product-variant-details-configuration';
export type {OrderRoutingRuleApi} from './api/order-routing-rule/order-routing-rule';
export type {ValidationSettingsApi} from './api/checkout-rules/validation-settings';
export type {InStorePickUpApi} from './api/in-store-pickup/in-store-pickup';
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import type {Metafield} from '../shared';

export interface Data {
metafields: Metafield[];
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import type {StandardApi} from '../standard/standard';
import type {ExtensionTarget as AnyExtensionTarget} from '../../extension-targets';

import {ApplyMetafieldsChange} from '../shared';
import {Data} from './data';

export interface InStorePickUpApi<ExtensionTarget extends AnyExtensionTarget>
extends StandardApi<ExtensionTarget> {
applyMetafieldsChange: ApplyMetafieldsChange;
data: Data;
}
23 changes: 23 additions & 0 deletions packages/ui-extensions/src/surfaces/admin/extension-targets.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import type {
ProductDetailsConfigurationApi,
ProductVariantDetailsConfigurationApi,
OrderRoutingRuleApi,
InStorePickUpApi,
ValidationSettingsApi,
} from './api';
import {AnyComponentBuilder} from '../../shared';
Expand Down Expand Up @@ -378,6 +379,28 @@ export interface ExtensionTargets {
AllComponents
>;

/**
* Renders In Store Pickup Configuration on in store pick up settings (general and per location).
*
* See the [list of available components](/docs/api/admin-extensions/components).
*/
'admin.settings.in-store-pickup.render': RenderExtension<
InStorePickUpApi<'admin.settings.in-store-pickup.render'>,
AllComponents
>;
'admin.settings.internal-in-store-pickup.render': RenderExtension<
InStorePickUpApi<'admin.settings.internal-in-store-pickup.render'>,
AllComponents
>;
'admin.settings.in-store-pickup-location.render': RenderExtension<
InStorePickUpApi<'admin.settings.in-store-pickup-location.render'>,
AllComponents
>;
'admin.settings.internal-in-store-pickup-location.render': RenderExtension<
InStorePickUpApi<'admin.settings.internal-in-store-pickup-location.render'>,
AllComponents
>;

/**
* Renders Validation Settings within a given validation's add and edit views.
*
Expand Down

0 comments on commit 41f54a8

Please sign in to comment.