3.0.0-preview.2 • Published 9 months ago
@futureordering/fo-web-plugin-types v3.0.0-preview.2
Future Ordering frontend plugin types
TypeScript typings for frontend extensibility plugins for the Future Ordering frontend.
Installation
npm i @futureordering/fo-web-plugin-types
Examples
See https://github.com/Future-Ordering/frontend-plugin-boilerplate for usage example
Version 3
Upcoming new 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.getCurrentOrder
andctx.order.createOrder
) - Get menu (
ctx.menu.getMenu
) - Get product (
menuContext.getProduct
, menuContext can for example be retrieved usingctx.menu.getMenu
or(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
) - Removes
ctx.location.navigateToPageComponent
overload - Changes
ctx.location.navigate
argument menuType to orderClass
Version 3 is in preview currently, it is installed with:
npm i @futureordering/fo-web-plugin-types@3.0.0-preview.2
Or latest preview version.
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',
...
})
3.0.0-preview.2
9 months ago
3.0.0-preview.1
9 months ago
2.5.0
10 months ago
2.4.0
1 year ago
2.2.0
1 year ago
2.0.0
1 year ago
2.0.0-preview.1
1 year ago
1.1.3
1 year ago
1.1.2
1 year ago
1.1.1
2 years ago
1.1.0
2 years ago