@futureordering/fo-web-plugin-types v3.4.1
Future Ordering frontend plugin types
TypeScript typings for frontend extensibility plugins for the Future Ordering frontend.
Installation
npm i @futureordering/fo-web-plugin-typesExamples
See https://github.com/Future-Ordering/frontend-plugin-boilerplate for usage example
Changelog
Upcoming major version
- File plugin-specs will be removed. For example when importing BlockComponentLocations, change import form
@futureordering/fo-web-plugin-types/plugin-specsto@futureordering/fo-web-plugin-types.
Version 3.4
Adds new block component location sidebar-basket-item which is displayed at each basket item. Component context-object for this location includes locationContext which has data about the current order item.
Version 3.2
Adds optional parameter to navigation method navigateToPage (ctx.location.navigateToPage):
expectedDiscount, the amount to subtract from a product's displayed total price in the product configurator
Version 3.1
Adds methods to menuContext:
isProductQuickAddable, whether product can be added directly without any configisProductConfigurable, whether product can be configured separately on product-config pagegetProductPrice, returns products total price
menuContext can be retrieved using ctx.menu.getMenu or (await ctx.order.getCurrentOrder()).menu
Version 3
Version 3 changes:
- Adds basic order support for working with orders, menus and products. Some of the new addons include:
- Create order (
ctx.order.createOrder) - Add item to basket (
orderContext.addItem, orderContext can for example be retrieved usingctx.order.getCurrentOrderandctx.order.createOrder) - Get order items (
(await orderContext.getOrderData()).orderItems) - Remove item from order (
orderContext.removeItem) - Set order class (
orderContext.setOrderClass) - Get menu (
ctx.menu.getMenu) - Get product (
menuContext.getProduct, menuContext can for example be retrieved usingctx.menu.getMenuor(await ctx.order.getCurrentOrder()).menu) - Iterate products (
menuContext.products) - Selecting config item (
menuContext.setItem)
- Create order (
- Starting order from plugin by navigating to select store and order type, and then back to plugin (
ctx.location.navigateToStartOrderAndBack) - Navigate to page (
ctx.location.navigateToPage, currently only supported to navigate to productConfig page) - Removes
ctx.location.navigateToPageComponentoverload - Changes
ctx.location.navigateargument menuType to orderClass
Migrating from version 2 to 3
ctx.location.navigateToPageComponent
Change
ctx.location.navigateToPageComponent('myPlugin', {}, { addReturnUrl: true });To
ctx.location.navigateToPageComponent({
pageName: 'myPlugin',
queryParams: {},
addReturnUrl: truer
})ctx.location.navigate
Change
ctx.location.navigate({
menuType: 'takeaway',
...
})To
ctx.location.navigate({
orderClass: 'takeaway',
...
})ctx.page.setButton
Available in page components. Removed because overriding the back button behavior goes against user expectations and the way the app works in general.
7 months ago
10 months ago
11 months ago
7 months ago
7 months ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago