content
stringlengths
29
370k
## <small>2.2.3 (2024-05-02)</small> #### Fixes * **admin-ui** Fix creating customer on draft order ([64b9c60](https://github.com/vendure-ecommerce/vendure/commit/64b9c60)) * **cli** Fix api extension location detection ([a5fdd86](https://github.com/vendure-ecommerce/vendure/commit/a5fdd86)) * **cli** Fix maximum call stack error ([464e68b](https://github.com/vendure-ecommerce/vendure/commit/464e68b)), closes [#2819](https://github.com/vendure-ecommerce/vendure/issues/2819) * **cli** Fix relative import path for parent dirs ([9379d73](https://github.com/vendure-ecommerce/vendure/commit/9379d73)) * **cli** Fix translatable entity imports ([e6c9ba8](https://github.com/vendure-ecommerce/vendure/commit/e6c9ba8)) * **cli** Improve detection of migration file location ([359b236](https://github.com/vendure-ecommerce/vendure/commit/359b236)) * **cli** Improve plugin generation in monorepos ([40000a4](https://github.com/vendure-ecommerce/vendure/commit/40000a4)) * **cli** Improve support for multiple tsconfig files ([d871eb7](https://github.com/vendure-ecommerce/vendure/commit/d871eb7)) * **cli** Improve support for pnpm projects ([4eaf7ff](https://github.com/vendure-ecommerce/vendure/commit/4eaf7ff)) * **cli** Include plugin options in service constructor ([a77251e](https://github.com/vendure-ecommerce/vendure/commit/a77251e)) * **core** Improve message for custom field schema errors ([7ac4ac9](https://github.com/vendure-ecommerce/vendure/commit/7ac4ac9)) * **core** Make featuredAsset optional on collection duplicator (#2824) ([bb10b4c](https://github.com/vendure-ecommerce/vendure/commit/bb10b4c)), closes [#2824](https://github.com/vendure-ecommerce/vendure/issues/2824) ## <small>2.2.2 (2024-04-25)</small> This release contains no changes - it was published to fix a mistake in the publishing of the `@vendure/admin-ui@2.2.1` package. ## <small>2.2.1 (2024-04-25)</small> #### Fixes * **admin-ui** Fix code snippet for addNavMenuSection ([d1da9ae](https://github.com/vendure-ecommerce/vendure/commit/d1da9ae)), closes [#2807](https://github.com/vendure-ecommerce/vendure/issues/2807) * **admin-ui** Fix custom tabs in customer list ([482bca9](https://github.com/vendure-ecommerce/vendure/commit/482bca9)), closes [#2788](https://github.com/vendure-ecommerce/vendure/issues/2788) * **admin-ui** Fix default quantity when adding item to order ([277c17e](https://github.com/vendure-ecommerce/vendure/commit/277c17e)) * **admin-ui** Fix error preventing f key usage in code editor ([6e68226](https://github.com/vendure-ecommerce/vendure/commit/6e68226)), closes [#2771](https://github.com/vendure-ecommerce/vendure/issues/2771) * **admin-ui** Fix facet value selection with duplicated labels ([3a9c317](https://github.com/vendure-ecommerce/vendure/commit/3a9c317)) * **cli** Improve support for migrations in monorepo setups ([3fbf4e4](https://github.com/vendure-ecommerce/vendure/commit/3fbf4e4)) * **cli** Load .env files automatically for migrations ([777a5a5](https://github.com/vendure-ecommerce/vendure/commit/777a5a5)), closes [#2802](https://github.com/vendure-ecommerce/vendure/issues/2802) * **core** Add missing semver dependency ([91484a2](https://github.com/vendure-ecommerce/vendure/commit/91484a2)) * **core** Add surcharge taxLines to taxSummary (#2798) ([d0166a2](https://github.com/vendure-ecommerce/vendure/commit/d0166a2)), closes [#2798](https://github.com/vendure-ecommerce/vendure/issues/2798) * **core** Fix duplication of product without featured asset ([f5e866b](https://github.com/vendure-ecommerce/vendure/commit/f5e866b)), closes [#2803](https://github.com/vendure-ecommerce/vendure/issues/2803) * **core** Fix findOneInChannel with relations object ([b9eb7db](https://github.com/vendure-ecommerce/vendure/commit/b9eb7db)), closes [#2809](https://github.com/vendure-ecommerce/vendure/issues/2809) * **core** Fix importer asset channel handling (#2801) ([c7a28b7](https://github.com/vendure-ecommerce/vendure/commit/c7a28b7)), closes [#2801](https://github.com/vendure-ecommerce/vendure/issues/2801) * **core** Improved loading of eager-loaded custom field relations ([025a9c7](https://github.com/vendure-ecommerce/vendure/commit/025a9c7)), closes [#2775](https://github.com/vendure-ecommerce/vendure/issues/2775) [#2687](https://github.com/vendure-ecommerce/vendure/issues/2687) * **core** Publish OrderEvent when order is deleted ([55f68780](https://github.com/vendure-ecommerce/vendure/commit/55f68780)) * **core** Remove original entityTable from channels sql request (#2791) ([9c1cb16](https://github.com/vendure-ecommerce/vendure/commit/9c1cb16)), closes [#2791](https://github.com/vendure-ecommerce/vendure/issues/2791) * **core** Update relations on Stock Location update (#2805) ([47b1116](https://github.com/vendure-ecommerce/vendure/commit/47b1116)), closes [#2805](https://github.com/vendure-ecommerce/vendure/issues/2805) [#2804](https://github.com/vendure-ecommerce/vendure/issues/2804) ## 2.2.0 (2024-04-15) #### Fixes * **admin-ui** Add missing RTL compatibility to some admin-ui components (#2451) ([96eb96e](https://github.com/vendure-ecommerce/vendure/commit/96eb96e)), closes [#2451](https://github.com/vendure-ecommerce/vendure/issues/2451) * **admin-ui** Fix alerts service registration ([04dcaab](https://github.com/vendure-ecommerce/vendure/commit/04dcaab)) * **admin-ui** Fix alignment of order modification history item ([e4a172c](https://github.com/vendure-ecommerce/vendure/commit/e4a172c)) * **admin-ui** Fix dark mode layout ([893a913](https://github.com/vendure-ecommerce/vendure/commit/893a913)), closes [#2745](https://github.com/vendure-ecommerce/vendure/issues/2745) * **admin-ui** Fix display of alert on login screen ([7e66d85](https://github.com/vendure-ecommerce/vendure/commit/7e66d85)) * **admin-ui** Fix header for promotion list (#2782) ([e46b36d](https://github.com/vendure-ecommerce/vendure/commit/e46b36d)), closes [#2782](https://github.com/vendure-ecommerce/vendure/issues/2782) * **admin-ui** Fix saving entities with custom field relations ([80f1f95](https://github.com/vendure-ecommerce/vendure/commit/80f1f95)) * **admin-ui** Improve styling of form field wrapper ([5263c2d](https://github.com/vendure-ecommerce/vendure/commit/5263c2d)) * **admin-ui** Improved support for modifying OrderLine custom fields ([0750fb1](https://github.com/vendure-ecommerce/vendure/commit/0750fb1)), closes [#2641](https://github.com/vendure-ecommerce/vendure/issues/2641) * **cli** Improve type generation for interfaces & gql types ([f26a0bf](https://github.com/vendure-ecommerce/vendure/commit/f26a0bf)) * **cli** Removed channelId from generated findAll method ([5e3d831](https://github.com/vendure-ecommerce/vendure/commit/5e3d831)) * **cli** Various fixes to CLI add commands ([4ea7711](https://github.com/vendure-ecommerce/vendure/commit/4ea7711)) * **core** Add missing jobOptions to a strategy `jobQueueStrategy.add` function (#2770) ([f869a17](https://github.com/vendure-ecommerce/vendure/commit/f869a17)), closes [#2770](https://github.com/vendure-ecommerce/vendure/issues/2770) * **core** Add missing reverse side relations (#2781) ([bdf2329](https://github.com/vendure-ecommerce/vendure/commit/bdf2329)), closes [#2781](https://github.com/vendure-ecommerce/vendure/issues/2781) * **core** Correctly return custom field relation scalar fields ([1280cf3](https://github.com/vendure-ecommerce/vendure/commit/1280cf3)) * **core** Fix amount being sent to payment handler refund method ([b6a5691](https://github.com/vendure-ecommerce/vendure/commit/b6a5691)) * **core** Fix deleted product option groups can't be deleted again (#2706) ([16add4a](https://github.com/vendure-ecommerce/vendure/commit/16add4a)), closes [#2706](https://github.com/vendure-ecommerce/vendure/issues/2706) * **core** Fix edge case with cached tax zone ([e543e5e](https://github.com/vendure-ecommerce/vendure/commit/e543e5e)) * **core** Fix error in joining list query relations ([33db45d](https://github.com/vendure-ecommerce/vendure/commit/33db45d)) * **core** Fix floating promise & missed eventBus (#2779) ([603a36e](https://github.com/vendure-ecommerce/vendure/commit/603a36e)), closes [#2779](https://github.com/vendure-ecommerce/vendure/issues/2779) * **core** Fix hydration of product variant prices ([7adb115](https://github.com/vendure-ecommerce/vendure/commit/7adb115)) * **core** Fix self-referencing relations `Not unique table/alias` (#2740) ([357ba49](https://github.com/vendure-ecommerce/vendure/commit/357ba49)), closes [#2740](https://github.com/vendure-ecommerce/vendure/issues/2740) [#2738](https://github.com/vendure-ecommerce/vendure/issues/2738) * **core** Fix typing on ProductOptionGroupService.create() method ([8fe24da](https://github.com/vendure-ecommerce/vendure/commit/8fe24da)), closes [#2577](https://github.com/vendure-ecommerce/vendure/issues/2577) * **core** Fix undefined reference error in product variant resolver ([5afa6bc](https://github.com/vendure-ecommerce/vendure/commit/5afa6bc)) * **core** Persist custom field relations on TaxRate ([7eaa641](https://github.com/vendure-ecommerce/vendure/commit/7eaa641)) * **core** Remove empty customFields relations from getMissingRelations in entity-hydrator (#2765) ([1c44113](https://github.com/vendure-ecommerce/vendure/commit/1c44113)), closes [#2765](https://github.com/vendure-ecommerce/vendure/issues/2765) * **core** Revert change to SQLJobQueueStrategy update mechanism ([a1e7730](https://github.com/vendure-ecommerce/vendure/commit/a1e7730)) * **core** Wrap nextOrderStates in transaction ([ed9539d](https://github.com/vendure-ecommerce/vendure/commit/ed9539d)) * **email-plugin** Remove unwanted currency symbols in template (#2536) ([639fa0f](https://github.com/vendure-ecommerce/vendure/commit/639fa0f)), closes [#2536](https://github.com/vendure-ecommerce/vendure/issues/2536) * **ui-devkit** Add call to exit in sigint handler (#2558) ([bfd9281](https://github.com/vendure-ecommerce/vendure/commit/bfd9281)), closes [#2558](https://github.com/vendure-ecommerce/vendure/issues/2558) #### Perf * **cli** Lazy load commands to improve startup time ([ec2f497](https://github.com/vendure-ecommerce/vendure/commit/ec2f497)) * **core** Database access performance & edge case fixes (#2744) ([48b239b](https://github.com/vendure-ecommerce/vendure/commit/48b239b)), closes [#2744](https://github.com/vendure-ecommerce/vendure/issues/2744) * **core** Optimization for assignToChannels method (#2743) ([c69e4ac](https://github.com/vendure-ecommerce/vendure/commit/c69e4ac)), closes [#2743](https://github.com/vendure-ecommerce/vendure/issues/2743) * **core** Upgrade EntityHydrator performance to any hydrate call (#2742) ([77233cd](https://github.com/vendure-ecommerce/vendure/commit/77233cd)), closes [#2742](https://github.com/vendure-ecommerce/vendure/issues/2742) * **core** Upgrade sql requests for more performant memory usage with big datasets (#2741) ([65888cb](https://github.com/vendure-ecommerce/vendure/commit/65888cb)), closes [#2741](https://github.com/vendure-ecommerce/vendure/issues/2741) #### Features * **admin-ui** Add bulk facet value editing to product variant list ([5ad41bf](https://github.com/vendure-ecommerce/vendure/commit/5ad41bf)) * **admin-ui** Add React RichTextEditor component & hook (#2675) ([68e0fa5](https://github.com/vendure-ecommerce/vendure/commit/68e0fa5)), closes [#2675](https://github.com/vendure-ecommerce/vendure/issues/2675) * **admin-ui** Add React useLazyQuery hook (#2498) ([757635b](https://github.com/vendure-ecommerce/vendure/commit/757635b)), closes [#2498](https://github.com/vendure-ecommerce/vendure/issues/2498) * **admin-ui** Add support for custom action bar dropdown menus ([4d8bc74](https://github.com/vendure-ecommerce/vendure/commit/4d8bc74)), closes [#2678](https://github.com/vendure-ecommerce/vendure/issues/2678) * **admin-ui** Add support for Norwegian Bokmål (#2611) ([00d5315](https://github.com/vendure-ecommerce/vendure/commit/00d5315)), closes [#2611](https://github.com/vendure-ecommerce/vendure/issues/2611) * **admin-ui** Add support for permissions on custom fields ([94e0c42](https://github.com/vendure-ecommerce/vendure/commit/94e0c42)), closes [#2671](https://github.com/vendure-ecommerce/vendure/issues/2671) * **admin-ui** Allow configuration of available locales (#2550) ([dfddf0f](https://github.com/vendure-ecommerce/vendure/commit/dfddf0f)), closes [#2550](https://github.com/vendure-ecommerce/vendure/issues/2550) * **admin-ui** Allow customer to be reassigned to order ([a9a596e](https://github.com/vendure-ecommerce/vendure/commit/a9a596e)), closes [#2505](https://github.com/vendure-ecommerce/vendure/issues/2505) * **admin-ui** Allow order shipping method to be modified ([7f34329](https://github.com/vendure-ecommerce/vendure/commit/7f34329)), closes [#978](https://github.com/vendure-ecommerce/vendure/issues/978) * **admin-ui** Channel aware picker ([fd92b4c](https://github.com/vendure-ecommerce/vendure/commit/fd92b4c)) * **admin-ui** Enable multiple refunds on an order modification ([9b3aa65](https://github.com/vendure-ecommerce/vendure/commit/9b3aa65)), closes [#2393](https://github.com/vendure-ecommerce/vendure/issues/2393) * **admin-ui** Expose `entity$` observable on action bar context ([3f07179](https://github.com/vendure-ecommerce/vendure/commit/3f07179)) * **admin-ui** Expose `registerAlert` provider for custom UI alerts ([698ea0c](https://github.com/vendure-ecommerce/vendure/commit/698ea0c)), closes [#2503](https://github.com/vendure-ecommerce/vendure/issues/2503) * **admin-ui** Implement UI for entity duplication ([7aa0d16](https://github.com/vendure-ecommerce/vendure/commit/7aa0d16)), closes [#627](https://github.com/vendure-ecommerce/vendure/issues/627) * **admin-ui** Improve layout & styling of order payment cards ([4a8b91a](https://github.com/vendure-ecommerce/vendure/commit/4a8b91a)) * **admin-ui** Improve styling of order/customer history timeline ([aeebbdd](https://github.com/vendure-ecommerce/vendure/commit/aeebbdd)) * **admin-ui** Improved refund dialog ([ccbf9ec](https://github.com/vendure-ecommerce/vendure/commit/ccbf9ec)), closes [#2393](https://github.com/vendure-ecommerce/vendure/issues/2393) * **admin-ui** Product & variant lists can be filtered by name & sku ([74293cb](https://github.com/vendure-ecommerce/vendure/commit/74293cb)), closes [#2519](https://github.com/vendure-ecommerce/vendure/issues/2519) * **admin-ui** Support custom fields on custom entities ([74aeb86](https://github.com/vendure-ecommerce/vendure/commit/74aeb86)), closes [#1848](https://github.com/vendure-ecommerce/vendure/issues/1848) * **admin-ui** Update Angular to v17.2 ([6f6a7af](https://github.com/vendure-ecommerce/vendure/commit/6f6a7af)) * **admin-ui** Update Clarity UI library to v17 ([44cfd95](https://github.com/vendure-ecommerce/vendure/commit/44cfd95)) * **admin-ui** Updated order modification screen with improved UX ([ac4c762](https://github.com/vendure-ecommerce/vendure/commit/ac4c762)) * **asset-server-plugin** Add `q` query param for dynamic quality ([b96289b](https://github.com/vendure-ecommerce/vendure/commit/b96289b)) * **asset-server-plugin** Update Sharp to v0.33.2 ([f3d45a0](https://github.com/vendure-ecommerce/vendure/commit/f3d45a0)) * **cli** Add API extension command ([41675a4](https://github.com/vendure-ecommerce/vendure/commit/41675a4)) * **cli** Add codegen command ([de5544c](https://github.com/vendure-ecommerce/vendure/commit/de5544c)) * **cli** Add job queue command ([2193a77](https://github.com/vendure-ecommerce/vendure/commit/2193a77)) * **cli** Add service command ([e29accc](https://github.com/vendure-ecommerce/vendure/commit/e29accc)) * **cli** Allow chaining features onto a newly-created plugin ([5b32c59](https://github.com/vendure-ecommerce/vendure/commit/5b32c59)) * **cli** Allow new entity features to be selected ([74c69dd](https://github.com/vendure-ecommerce/vendure/commit/74c69dd)) * **cli** Allow new plugin dir to be specified ([4ae12e7](https://github.com/vendure-ecommerce/vendure/commit/4ae12e7)) * **cli** Implement "add entity" command ([ad87531](https://github.com/vendure-ecommerce/vendure/commit/ad87531)) * **cli** Implement "add" command for ui extensions ([795b013](https://github.com/vendure-ecommerce/vendure/commit/795b013)) * **cli** Implement migrations in CLI ([9860abd](https://github.com/vendure-ecommerce/vendure/commit/9860abd)) * **core** A support for custom fields on ProductVariantPrice (#2654) ([e7f0fe2](https://github.com/vendure-ecommerce/vendure/commit/e7f0fe2)), closes [#2654](https://github.com/vendure-ecommerce/vendure/issues/2654) * **core** Accept `maxAge` and `expires` options in cookie config ([c903388](https://github.com/vendure-ecommerce/vendure/commit/c903388)), closes [#2518](https://github.com/vendure-ecommerce/vendure/issues/2518) * **core** Add `amount` field to `RefundOrderInput` ([fe43b4a](https://github.com/vendure-ecommerce/vendure/commit/fe43b4a)), closes [#2393](https://github.com/vendure-ecommerce/vendure/issues/2393) * **core** Add `gracefulShutdownTimeout` to DefaultJobQueuePlugin ([cba06e0](https://github.com/vendure-ecommerce/vendure/commit/cba06e0)) * **core** Add `precision` property to MoneyStrategy ([c33ba63](https://github.com/vendure-ecommerce/vendure/commit/c33ba63)) * **core** Add cancellation handling to built-in jobs ([c8022be](https://github.com/vendure-ecommerce/vendure/commit/c8022be)), closes [#1127](https://github.com/vendure-ecommerce/vendure/issues/1127) [#2650](https://github.com/vendure-ecommerce/vendure/issues/2650) * **core** Add Missing inherit filters field in collection import (#2534) ([ef64db7](https://github.com/vendure-ecommerce/vendure/commit/ef64db7)), closes [#2534](https://github.com/vendure-ecommerce/vendure/issues/2534) [#2484](https://github.com/vendure-ecommerce/vendure/issues/2484) * **core** Add SKU filtering to `products` list in Admin API ([876d1ec](https://github.com/vendure-ecommerce/vendure/commit/876d1ec)), closes [#2519](https://github.com/vendure-ecommerce/vendure/issues/2519) * **core** Add support for permissions on custom fields ([1c9f8f9](https://github.com/vendure-ecommerce/vendure/commit/1c9f8f9)), closes [#2671](https://github.com/vendure-ecommerce/vendure/issues/2671) * **core** Allow order shipping method to be modified ([400d78a](https://github.com/vendure-ecommerce/vendure/commit/400d78a)), closes [#978](https://github.com/vendure-ecommerce/vendure/issues/978) * **core** Enable multiple refunds on an order modification ([cf91a9e](https://github.com/vendure-ecommerce/vendure/commit/cf91a9e)), closes [#2393](https://github.com/vendure-ecommerce/vendure/issues/2393) * **core** Enable setting different cookie name for Shop & Admin API (#2482) ([ae91650](https://github.com/vendure-ecommerce/vendure/commit/ae91650)), closes [#2482](https://github.com/vendure-ecommerce/vendure/issues/2482) * **core** Export order state machine ([138d9ff](https://github.com/vendure-ecommerce/vendure/commit/138d9ff)) * **core** Expose `enabled` field for Product in shop api (#2541) ([f6f2975](https://github.com/vendure-ecommerce/vendure/commit/f6f2975)), closes [#2541](https://github.com/vendure-ecommerce/vendure/issues/2541) * **core** Expose additional bootstrap options (#2568) ([3b6d6ab](https://github.com/vendure-ecommerce/vendure/commit/3b6d6ab)), closes [#2568](https://github.com/vendure-ecommerce/vendure/issues/2568) * **core** Expose entityCustomFields query ([01f9d44](https://github.com/vendure-ecommerce/vendure/commit/01f9d44)), closes [#1848](https://github.com/vendure-ecommerce/vendure/issues/1848) * **core** Implement `setOrderCustomer` mutation ([26e77d7](https://github.com/vendure-ecommerce/vendure/commit/26e77d7)), closes [#2505](https://github.com/vendure-ecommerce/vendure/issues/2505) * **core** Implement collection duplicator ([d457851](https://github.com/vendure-ecommerce/vendure/commit/d457851)), closes [#627](https://github.com/vendure-ecommerce/vendure/issues/627) * **core** Implement complex boolean list filtering for PaginatedLists ([c4bd484](https://github.com/vendure-ecommerce/vendure/commit/c4bd484)), closes [#2594](https://github.com/vendure-ecommerce/vendure/issues/2594) * **core** Implement facet duplicator ([8d20847](https://github.com/vendure-ecommerce/vendure/commit/8d20847)), closes [#627](https://github.com/vendure-ecommerce/vendure/issues/627) * **core** Implement internal support for entity duplication ([477fe93](https://github.com/vendure-ecommerce/vendure/commit/477fe93)), closes [#627](https://github.com/vendure-ecommerce/vendure/issues/627) * **core** Implement new blocking event handler API ([1c69499](https://github.com/vendure-ecommerce/vendure/commit/1c69499)), closes [#2735](https://github.com/vendure-ecommerce/vendure/issues/2735) * **core** Implement product duplicator ([6ac43d9](https://github.com/vendure-ecommerce/vendure/commit/6ac43d9)), closes [#627](https://github.com/vendure-ecommerce/vendure/issues/627) * **core** Implement promotion duplicator ([da58b0b](https://github.com/vendure-ecommerce/vendure/commit/da58b0b)), closes [#627](https://github.com/vendure-ecommerce/vendure/issues/627) * **core** Improve cancellation mechanism of DefaultJobQueuePlugin ([cba069b](https://github.com/vendure-ecommerce/vendure/commit/cba069b)), closes [#1127](https://github.com/vendure-ecommerce/vendure/issues/1127) [#2650](https://github.com/vendure-ecommerce/vendure/issues/2650) * **core** Introduce ErrorHandlerStrategy ([066e524](https://github.com/vendure-ecommerce/vendure/commit/066e524)) * **core** Introduce new `ProductVariantPriceEvent` ([aa4eeb8](https://github.com/vendure-ecommerce/vendure/commit/aa4eeb8)) * **core** Introduce new `ProductVariantPriceUpdateStrategy` ([9099f35](https://github.com/vendure-ecommerce/vendure/commit/9099f35)), closes [#2651](https://github.com/vendure-ecommerce/vendure/issues/2651) * **core** Pass ctx to job queue strategy add (#2759) ([3909251](https://github.com/vendure-ecommerce/vendure/commit/3909251)), closes [#2759](https://github.com/vendure-ecommerce/vendure/issues/2759) [#2758](https://github.com/vendure-ecommerce/vendure/issues/2758) * **core** Pass RequestContext to custom field validate function ([2314ff6](https://github.com/vendure-ecommerce/vendure/commit/2314ff6)), closes [#2408](https://github.com/vendure-ecommerce/vendure/issues/2408) * **core** Update NestJS to latest version (v10.3.3) ([573ae18](https://github.com/vendure-ecommerce/vendure/commit/573ae18)) * **core** Update TypeORM to v0.3.20 ([0afc94e](https://github.com/vendure-ecommerce/vendure/commit/0afc94e)) * **core** Update TypeScript version to v5.1.6 ([2f51929](https://github.com/vendure-ecommerce/vendure/commit/2f51929)) * **create** Ship Vendure CLI with new projects ([faf69a9](https://github.com/vendure-ecommerce/vendure/commit/faf69a9)) * **elasticsearch-plugin** Provide the ctx for custom mappings (#2547) ([c5d0ea2](https://github.com/vendure-ecommerce/vendure/commit/c5d0ea2)), closes [#2547](https://github.com/vendure-ecommerce/vendure/issues/2547) * **email-plugin** Multiple currency support in formatMoney helper (#2531) ([ccf17fb](https://github.com/vendure-ecommerce/vendure/commit/ccf17fb)), closes [#2531](https://github.com/vendure-ecommerce/vendure/issues/2531) * **email-plugin** Publish EmailSendEvent after send attempted ([e4175e7](https://github.com/vendure-ecommerce/vendure/commit/e4175e7)) * **job-queue-plugin** Implement cancellation mechanism ([d0e97ca](https://github.com/vendure-ecommerce/vendure/commit/d0e97ca)), closes [#1127](https://github.com/vendure-ecommerce/vendure/issues/1127) [#2650](https://github.com/vendure-ecommerce/vendure/issues/2650) * **job-queue-plugin** Improve pub/sub message handling (#2561) ([3645819](https://github.com/vendure-ecommerce/vendure/commit/3645819)), closes [#2561](https://github.com/vendure-ecommerce/vendure/issues/2561) * **payments-plugin** Accepted states ([124f169](https://github.com/vendure-ecommerce/vendure/commit/124f169)) * **payments-plugin** Admin ui dropdown button ([af80f26](https://github.com/vendure-ecommerce/vendure/commit/af80f26)) * **payments-plugin** Backend admin api implemented ([5390a4c](https://github.com/vendure-ecommerce/vendure/commit/5390a4c)) * **payments-plugin** Cleaner usage of type ([5a720bb](https://github.com/vendure-ecommerce/vendure/commit/5a720bb)) * **payments-plugin** Correct test naming ([07d9b4d](https://github.com/vendure-ecommerce/vendure/commit/07d9b4d)) * **payments-plugin** Docs ([f7dcc31](https://github.com/vendure-ecommerce/vendure/commit/f7dcc31)) * **payments-plugin** E2e test fixed ([1e65032](https://github.com/vendure-ecommerce/vendure/commit/1e65032)) * **payments-plugin** fixed e2e tests ([d842837](https://github.com/vendure-ecommerce/vendure/commit/d842837)) * **payments-plugin** Forgot to add files ([9e51be2](https://github.com/vendure-ecommerce/vendure/commit/9e51be2)) * **payments-plugin** Live testing of duplicate payments ([9c1df83](https://github.com/vendure-ecommerce/vendure/commit/9c1df83)) * **payments-plugin** Mollie locale preservation #2270 and type fixes ([9e58097](https://github.com/vendure-ecommerce/vendure/commit/9e58097)), closes [#2270](https://github.com/vendure-ecommerce/vendure/issues/2270) * **payments-plugin** Mollie: support extra parameters for listing methods (#2516) ([cb9846b](https://github.com/vendure-ecommerce/vendure/commit/cb9846b)), closes [#2516](https://github.com/vendure-ecommerce/vendure/issues/2516) [#2510](https://github.com/vendure-ecommerce/vendure/issues/2510) * **payments-plugin** more manual merge fixes ([ddea675](https://github.com/vendure-ecommerce/vendure/commit/ddea675)) * **payments-plugin** Plugin docs ([028dcf9](https://github.com/vendure-ecommerce/vendure/commit/028dcf9)) * **payments-plugin** Prevent duplicate Mollie payments (#2691) ([34b61cd](https://github.com/vendure-ecommerce/vendure/commit/34b61cd)), closes [#2691](https://github.com/vendure-ecommerce/vendure/issues/2691) * **payments-plugin** Readded describe for more readable gh diff ([d7a38ab](https://github.com/vendure-ecommerce/vendure/commit/d7a38ab)) * **payments-plugin** Removed copyfiles dependency ([fb519ed](https://github.com/vendure-ecommerce/vendure/commit/fb519ed)) * **payments-plugin** Removed ui for now ([3dfd0ba](https://github.com/vendure-ecommerce/vendure/commit/3dfd0ba)) * **payments-plugin** Reusing existing order if possible ([4642f9f](https://github.com/vendure-ecommerce/vendure/commit/4642f9f)) * **payments-plugin** Setup of preventing duplicate payments ([0cb2df8](https://github.com/vendure-ecommerce/vendure/commit/0cb2df8)) * **payments-plugin** Test case readability ([7009425](https://github.com/vendure-ecommerce/vendure/commit/7009425)) * **payments-plugin** Ui extension removal ([e8ae5f6](https://github.com/vendure-ecommerce/vendure/commit/e8ae5f6)) * **payments-plugin** Unstaged files ([1ef282a](https://github.com/vendure-ecommerce/vendure/commit/1ef282a)) * **payments-plugin** wip ([fb4cace](https://github.com/vendure-ecommerce/vendure/commit/fb4cace)) * **sentry-plugin** Use ErrorHandlerStrategy for better error coverage ([82ddf94](https://github.com/vendure-ecommerce/vendure/commit/82ddf94)) * **ui-devkit** Add `prefix` option to route config to allow overrides ([babe4f4](https://github.com/vendure-ecommerce/vendure/commit/babe4f4)), closes [#2705](https://github.com/vendure-ecommerce/vendure/issues/2705) ### BREAKING CHANGE * MolliePlugin - A new mollieOrderId has been added in order to prevent duplicate payments in Mollie. This will require a DB migration to add the custom field to your DB schema. ## <small>2.1.9 (2024-04-05)</small> #### Fixes * **admin-ui** Make channel detail defaultShippingZoneId required (#2719) ([7bae5d7](https://github.com/vendure-ecommerce/vendure/commit/7bae5d7)), closes [#2719](https://github.com/vendure-ecommerce/vendure/issues/2719) * **admin-ui** Require default currency and language for channels (#2722) ([7859a15](https://github.com/vendure-ecommerce/vendure/commit/7859a15)), closes [#2722](https://github.com/vendure-ecommerce/vendure/issues/2722) * **admin-ui** Swedish translation adjustments and corrections (#2752) ([3e08f7b](https://github.com/vendure-ecommerce/vendure/commit/3e08f7b)), closes [#2752](https://github.com/vendure-ecommerce/vendure/issues/2752) * **core** Fix custom field relation for ProductVariant when value is null (#2727) ([b4f8a55](https://github.com/vendure-ecommerce/vendure/commit/b4f8a55)), closes [#2727](https://github.com/vendure-ecommerce/vendure/issues/2727) [#2723](https://github.com/vendure-ecommerce/vendure/issues/2723) * **core** Fix missing shipping lines in partial order (#2766) ([d4ec842](https://github.com/vendure-ecommerce/vendure/commit/d4ec842)), closes [#2766](https://github.com/vendure-ecommerce/vendure/issues/2766) * **core** Fix stock constraint error for adjustOrderLine when using OrderLine custom fields (#2737) ([8a961b0](https://github.com/vendure-ecommerce/vendure/commit/8a961b0)), closes [#2737](https://github.com/vendure-ecommerce/vendure/issues/2737) * **elasticsearch-plugin** Fix aggregation buckets with taxes (#2749) ([c23993c](https://github.com/vendure-ecommerce/vendure/commit/c23993c)), closes [#2749](https://github.com/vendure-ecommerce/vendure/issues/2749) ## <small>2.1.8 (2024-03-05)</small> #### Fixes * **admin-ui** Add missing Swedish translation (#2672) ([cce90d6](https://github.com/vendure-ecommerce/vendure/commit/cce90d6)), closes [#2672](https://github.com/vendure-ecommerce/vendure/issues/2672) * **admin-ui** Add missing translation of breadcrumb tooltips (#2697) ([2a3a796](https://github.com/vendure-ecommerce/vendure/commit/2a3a796)), closes [#2697](https://github.com/vendure-ecommerce/vendure/issues/2697) * **admin-ui** Display calculated price when custom price strategy used ([09c66fe](https://github.com/vendure-ecommerce/vendure/commit/09c66fe)), closes [#2506](https://github.com/vendure-ecommerce/vendure/issues/2506) * **admin-ui** Export AssetsComponent as a Shared Component (#2695) ([cc85202](https://github.com/vendure-ecommerce/vendure/commit/cc85202)), closes [#2695](https://github.com/vendure-ecommerce/vendure/issues/2695) [#2637](https://github.com/vendure-ecommerce/vendure/issues/2637) * **common** Properly replace umlauts and Eszett for German lang (#2616) ([84ba64f](https://github.com/vendure-ecommerce/vendure/commit/84ba64f)), closes [#2616](https://github.com/vendure-ecommerce/vendure/issues/2616) * **core** Add missing Order.customer field resolver ([dad7f98](https://github.com/vendure-ecommerce/vendure/commit/dad7f98)), closes [#2715](https://github.com/vendure-ecommerce/vendure/issues/2715) * **core** Export OrderByCodeAccessStrategy and DefaultOrderByCodeAccessStrategy (#2692) ([6a4a7e5](https://github.com/vendure-ecommerce/vendure/commit/6a4a7e5)), closes [#2692](https://github.com/vendure-ecommerce/vendure/issues/2692) * **core** Fix custom field relation loading edge-case ([93ca4ca](https://github.com/vendure-ecommerce/vendure/commit/93ca4ca)), closes [#2708](https://github.com/vendure-ecommerce/vendure/issues/2708) * **core** Fix error when querying Roles without channels field ([b2cb011](https://github.com/vendure-ecommerce/vendure/commit/b2cb011)), closes [#2693](https://github.com/vendure-ecommerce/vendure/issues/2693) * **core** Fix querying order variant after removal from channel ([e28ba3d](https://github.com/vendure-ecommerce/vendure/commit/e28ba3d)), closes [#2716](https://github.com/vendure-ecommerce/vendure/issues/2716) * **core** Fix renaming of product with readonly custom field (#2684) ([2075d6d](https://github.com/vendure-ecommerce/vendure/commit/2075d6d)), closes [#2684](https://github.com/vendure-ecommerce/vendure/issues/2684) * **core** Fix stock constraint error when using OrderLine custom fields ([2f93eb7](https://github.com/vendure-ecommerce/vendure/commit/2f93eb7)), closes [#2702](https://github.com/vendure-ecommerce/vendure/issues/2702) * **core** Handle nullable relations in EntityHydrator (#2683) ([4e1f408](https://github.com/vendure-ecommerce/vendure/commit/4e1f408)), closes [#2683](https://github.com/vendure-ecommerce/vendure/issues/2683) [#2682](https://github.com/vendure-ecommerce/vendure/issues/2682) * **create** Update scaffolded service type safety for updated Enttity (#2712) ([2e3be51](https://github.com/vendure-ecommerce/vendure/commit/2e3be51)), closes [#2712](https://github.com/vendure-ecommerce/vendure/issues/2712) * **payments-plugin** Improve Mollie ignore order states (#2670) ([f02fc56](https://github.com/vendure-ecommerce/vendure/commit/f02fc56)), closes [#2670](https://github.com/vendure-ecommerce/vendure/issues/2670) ## <small>2.1.7 (2024-02-06)</small> #### Fixes * **admin-ui** Add missing Ukrainian translation (#2638) ([67c8c90](https://github.com/vendure-ecommerce/vendure/commit/67c8c90)), closes [#2638](https://github.com/vendure-ecommerce/vendure/issues/2638) * **admin-ui** Improve German translation (#2639) ([30f5e91](https://github.com/vendure-ecommerce/vendure/commit/30f5e91)), closes [#2639](https://github.com/vendure-ecommerce/vendure/issues/2639) * **admin-ui** Reset page to 1 on viewing collection contents from list ([daa4731](https://github.com/vendure-ecommerce/vendure/commit/daa4731)) * **core** Add product translation to product variant entity resolver (#2644) ([9289a1c](https://github.com/vendure-ecommerce/vendure/commit/9289a1c)), closes [#2644](https://github.com/vendure-ecommerce/vendure/issues/2644) * **core** Ensure deterministic sorting in case of duplicates in DefaultSearchPlugin search query (#2632) ([81b4607](https://github.com/vendure-ecommerce/vendure/commit/81b4607)), closes [#2632](https://github.com/vendure-ecommerce/vendure/issues/2632) * **core** Fix undefined reference error in product variant resolver ([4cceb70](https://github.com/vendure-ecommerce/vendure/commit/4cceb70)) * **core** Improve handling of active jobs on worker shutdown ([e1e0987](https://github.com/vendure-ecommerce/vendure/commit/e1e0987)) * **core** Improved resolution of Administrator.user ([c2a4685](https://github.com/vendure-ecommerce/vendure/commit/c2a4685)), closes [#1489](https://github.com/vendure-ecommerce/vendure/issues/1489) * **core** Update translations parent `updatedAt` column when updating translation (#2630) ([44fc828](https://github.com/vendure-ecommerce/vendure/commit/44fc828)), closes [#2630](https://github.com/vendure-ecommerce/vendure/issues/2630) * **elasticsearch-plugin** Optimize memory usage when indexing ([#2327](https://github.com/vendure-ecommerce/vendure/pull/2327)) * **payments-plugin** Don't handle mollie webhook for any state after PaymentSettled (#2657) ([754da02](https://github.com/vendure-ecommerce/vendure/commit/754da02)), closes [#2657](https://github.com/vendure-ecommerce/vendure/issues/2657) ## <small>2.1.6 (2024-01-16)</small> #### Fixes * **admin-ui** Fix auto-rename of variants when product is renamed ([65aced6](https://github.com/vendure-ecommerce/vendure/commit/65aced6)), closes [#2579](https://github.com/vendure-ecommerce/vendure/issues/2579) * **admin-ui** Fix bug in cancelling order lines ([913e6d8](https://github.com/vendure-ecommerce/vendure/commit/913e6d8)), closes [#2608](https://github.com/vendure-ecommerce/vendure/issues/2608) * **admin-ui** Fix long transactionId layout issue (#2595) ([7603ea4](https://github.com/vendure-ecommerce/vendure/commit/7603ea4)), closes [#2595](https://github.com/vendure-ecommerce/vendure/issues/2595) * **admin-ui** Fix route config for settings tabs ([4e7bbb1](https://github.com/vendure-ecommerce/vendure/commit/4e7bbb1)), closes [#2623](https://github.com/vendure-ecommerce/vendure/issues/2623) * **admin-ui** Improve collection breadcrumb styling (#2589) ([f5acf0f](https://github.com/vendure-ecommerce/vendure/commit/f5acf0f)), closes [#2589](https://github.com/vendure-ecommerce/vendure/issues/2589) * **admin-ui** Improve tabs hover style (#2584) ([fa7152c](https://github.com/vendure-ecommerce/vendure/commit/fa7152c)), closes [#2584](https://github.com/vendure-ecommerce/vendure/issues/2584) * **admin-ui** Login page dark mode color fix (#2582) ([c680486](https://github.com/vendure-ecommerce/vendure/commit/c680486)), closes [#2582](https://github.com/vendure-ecommerce/vendure/issues/2582) * **core** Admin can only read Roles at or below their permission level ([fc5d981](https://github.com/vendure-ecommerce/vendure/commit/fc5d981)), closes [#2492](https://github.com/vendure-ecommerce/vendure/issues/2492) * **core** Fix error when using HttpHealthCheckStrategy ([9ab2e4d](https://github.com/vendure-ecommerce/vendure/commit/9ab2e4d)), closes [#2617](https://github.com/vendure-ecommerce/vendure/issues/2617) * **core** Fix hydration error edge-case when removing order line ([6fca656](https://github.com/vendure-ecommerce/vendure/commit/6fca656)), closes [#2548](https://github.com/vendure-ecommerce/vendure/issues/2548) * **core** Fix permissions error on creation of superadmin ([3e4e31c](https://github.com/vendure-ecommerce/vendure/commit/3e4e31c)), closes [#2492](https://github.com/vendure-ecommerce/vendure/issues/2492) [#2478](https://github.com/vendure-ecommerce/vendure/issues/2478) * **core** Loosen typing of custom field relation inverseSide function ([a9696c9](https://github.com/vendure-ecommerce/vendure/commit/a9696c9)) * **core** Remove inapplicable shipping methods when updating an order ([f04b033](https://github.com/vendure-ecommerce/vendure/commit/f04b033)), closes [#2548](https://github.com/vendure-ecommerce/vendure/issues/2548) [#2540](https://github.com/vendure-ecommerce/vendure/issues/2540) * **create** Add a slash at the end of assetUrl to avoid being ignored (#2605) ([b99dfbc](https://github.com/vendure-ecommerce/vendure/commit/b99dfbc)), closes [#2605](https://github.com/vendure-ecommerce/vendure/issues/2605) ## <small>2.1.5 (2023-12-14)</small> #### Fixes * **admin-ui** Fix display of asset detail focal point buttons ([1b58aa7](https://github.com/vendure-ecommerce/vendure/commit/1b58aa7)) * **core** Export VendureEntityEvent abstract class from index (#2556) ([c46cf74](https://github.com/vendure-ecommerce/vendure/commit/c46cf74)), closes [#2556](https://github.com/vendure-ecommerce/vendure/issues/2556) * **core** Fix bug when instantiating entity from object with getter ([d09452e](https://github.com/vendure-ecommerce/vendure/commit/d09452e)), closes [#2574](https://github.com/vendure-ecommerce/vendure/issues/2574) * **core** Fix loading multiple customField relations (#2566) ([99e04d1](https://github.com/vendure-ecommerce/vendure/commit/99e04d1)), closes [#2566](https://github.com/vendure-ecommerce/vendure/issues/2566) [#2555](https://github.com/vendure-ecommerce/vendure/issues/2555) * **core** OrderLineEvent includes ID of deleted OrderLine ([ee04032](https://github.com/vendure-ecommerce/vendure/commit/ee04032)), closes [#2574](https://github.com/vendure-ecommerce/vendure/issues/2574) * **core** Remove redundant constraint when creating allocations ([52c0841](https://github.com/vendure-ecommerce/vendure/commit/52c0841)), closes [#2563](https://github.com/vendure-ecommerce/vendure/issues/2563) * **core** Send the correct amount to `refundOrder` (#2559) ([b5a265f](https://github.com/vendure-ecommerce/vendure/commit/b5a265f)), closes [#2559](https://github.com/vendure-ecommerce/vendure/issues/2559) * **elasticsearch-plugin** Fix type to allow the promise on custom mapping definition (#2562) ([8e9ee07](https://github.com/vendure-ecommerce/vendure/commit/8e9ee07)), closes [#2562](https://github.com/vendure-ecommerce/vendure/issues/2562) * **payments-plugin** Fix Mollie channel awareness (#2575) ([cc4826d](https://github.com/vendure-ecommerce/vendure/commit/cc4826d)), closes [#2575](https://github.com/vendure-ecommerce/vendure/issues/2575) * **payments-plugin** Mollie - ignore completed state to prevent unneccesary error throwing (#2569) ([ed80c68](https://github.com/vendure-ecommerce/vendure/commit/ed80c68)), closes [#2569](https://github.com/vendure-ecommerce/vendure/issues/2569) * **stellate-plugin** Add stellate plugin ([2254576](https://github.com/vendure-ecommerce/vendure/commit/2254576)) ## <small>2.1.4 (2023-11-24)</small> #### Fixes * **admin-ui** Fix admin ui code templates (#2545) ([a9e67fe](https://github.com/vendure-ecommerce/vendure/commit/a9e67fe)), closes [#2545](https://github.com/vendure-ecommerce/vendure/issues/2545) * **admin-ui** Fix card component colors in dark theme ([c077e15](https://github.com/vendure-ecommerce/vendure/commit/c077e15)) * **admin-ui** Fix code editor border color for dark mode ([9eb9d9d](https://github.com/vendure-ecommerce/vendure/commit/9eb9d9d)) * **admin-ui** Fix encoding of configurable arg values ([84764b1](https://github.com/vendure-ecommerce/vendure/commit/84764b1)), closes [#2539](https://github.com/vendure-ecommerce/vendure/issues/2539) * **admin-ui** Fix localized custom fields in Promotion & PaymentMethod ([d665ec6](https://github.com/vendure-ecommerce/vendure/commit/d665ec6)) * **admin-ui** Fix responsive layout of modal dialog for assets ([5176017](https://github.com/vendure-ecommerce/vendure/commit/5176017)), closes [#2537](https://github.com/vendure-ecommerce/vendure/issues/2537) * **admin-ui** Fix stack overflow when datetime picker inside a list ([f7b4f46](https://github.com/vendure-ecommerce/vendure/commit/f7b4f46)) * **core** Fix custom MoneyStrategy handling from plugins ([a09c2b2](https://github.com/vendure-ecommerce/vendure/commit/a09c2b2)), closes [#2527](https://github.com/vendure-ecommerce/vendure/issues/2527) * **core** Fix DefaultSearchPlugin for non-default languages (#2515) ([fb0ea13](https://github.com/vendure-ecommerce/vendure/commit/fb0ea13)), closes [#2515](https://github.com/vendure-ecommerce/vendure/issues/2515) [#2197](https://github.com/vendure-ecommerce/vendure/issues/2197) * **core** Fix entity hydration postgres edge-case ([9546d1b](https://github.com/vendure-ecommerce/vendure/commit/9546d1b)), closes [#2546](https://github.com/vendure-ecommerce/vendure/issues/2546) * **core** Fix i18n custom fields in Promotion & PaymentMethod ([3d6edb5](https://github.com/vendure-ecommerce/vendure/commit/3d6edb5)) * **core** Log error on misconfigured localized custom fields ([5775447](https://github.com/vendure-ecommerce/vendure/commit/5775447)) * **core** Relax validation of custom process states ([cf301eb](https://github.com/vendure-ecommerce/vendure/commit/cf301eb)) ## <small>2.1.3 (2023-11-17)</small> #### Security This patch addresses the following security advisory: https://github.com/vendure-ecommerce/vendure/security/advisories/GHSA-wm63-7627-ch33 #### Fixes * **admin-ui** Fix getting currencyCode in create product variant dialog (#2508) ([c4595e7](https://github.com/vendure-ecommerce/vendure/commit/c4595e7)), closes [#2508](https://github.com/vendure-ecommerce/vendure/issues/2508) * **admin-ui** Fix handling of Country custom fields ([3538bee](https://github.com/vendure-ecommerce/vendure/commit/3538bee)) * **admin-ui** Fix promotion list actionbar location id ([18a0b2c](https://github.com/vendure-ecommerce/vendure/commit/18a0b2c)) * **admin-ui** Prevent module constructor side effects from repeating ([a684b59](https://github.com/vendure-ecommerce/vendure/commit/a684b59)), closes [#2455](https://github.com/vendure-ecommerce/vendure/issues/2455) * **admin-ui** Update channel switcher after deleting channel ([32f592d](https://github.com/vendure-ecommerce/vendure/commit/32f592d)), closes [#2511](https://github.com/vendure-ecommerce/vendure/issues/2511) * **core** Add constraints to Channel currencyCode settings ([0ebf0fb](https://github.com/vendure-ecommerce/vendure/commit/0ebf0fb)), closes [#GHSA-wm63-7627-ch33](https://github.com/vendure-ecommerce/vendure/issues/GHSA-wm63-7627-ch33) * **core** Allow case-sensitive Administrator identifiers ([6527e23](https://github.com/vendure-ecommerce/vendure/commit/6527e23)), closes [#2485](https://github.com/vendure-ecommerce/vendure/issues/2485) * **core** Apply pricing adjustments against updated order (#2512) ([272be66](https://github.com/vendure-ecommerce/vendure/commit/272be66)), closes [#2512](https://github.com/vendure-ecommerce/vendure/issues/2512) * **core** Correctly handle changing Order currencyCode ([f544cf3](https://github.com/vendure-ecommerce/vendure/commit/f544cf3)), closes [#2469](https://github.com/vendure-ecommerce/vendure/issues/2469) [#GHSA-wm63-7627-ch33](https://github.com/vendure-ecommerce/vendure/issues/GHSA-wm63-7627-ch33) * **core** Fix default currencyCode change error in MySQL ([38e739a](https://github.com/vendure-ecommerce/vendure/commit/38e739a)) * **core** Fix validation of fulfillment state config ([cb13de4](https://github.com/vendure-ecommerce/vendure/commit/cb13de4)) * **core** Improved validation of state machine configs ([b44cc88](https://github.com/vendure-ecommerce/vendure/commit/b44cc88)), closes [#2521](https://github.com/vendure-ecommerce/vendure/issues/2521) * **core** Prevent duplicate variant price when updating currencyCode ([feecfae](https://github.com/vendure-ecommerce/vendure/commit/feecfae)), closes [#2391](https://github.com/vendure-ecommerce/vendure/issues/2391) * **core** Prevent use of unrecognized currency codes in RequestContext ([fee503f](https://github.com/vendure-ecommerce/vendure/commit/fee503f)), closes [#GHSA-wm63-7627-ch33](https://github.com/vendure-ecommerce/vendure/issues/GHSA-wm63-7627-ch33) * **core** Remove insecure fallback from default price selection strat ([6f34d06](https://github.com/vendure-ecommerce/vendure/commit/6f34d06)), closes [#GHSA-wm63-7627-ch33](https://github.com/vendure-ecommerce/vendure/issues/GHSA-wm63-7627-ch33) * **payments-plugin** Update Stripe peerDependency version ([6926638](https://github.com/vendure-ecommerce/vendure/commit/6926638)) * **testing** Allow NestJs to rethrow errors on e2e tests (#2514) ([1348ce0](https://github.com/vendure-ecommerce/vendure/commit/1348ce0)), closes [#2514](https://github.com/vendure-ecommerce/vendure/issues/2514) ## <small>2.1.2 (2023-11-03)</small> #### Fixes * **admin-ui** Add descriptive error when using getBreadcrumbs wrong ([b8c4a77](https://github.com/vendure-ecommerce/vendure/commit/b8c4a77)) * **admin-ui** Add horizontal scrollbar support to address select dialog ([60d991b](https://github.com/vendure-ecommerce/vendure/commit/60d991b)) * **admin-ui** Add some new ltr/rtl compatibility (#2466) ([e4d1545](https://github.com/vendure-ecommerce/vendure/commit/e4d1545)), closes [#2466](https://github.com/vendure-ecommerce/vendure/issues/2466) * **admin-ui** Fix layout of multiple addresses on custom detail page ([7a3e378](https://github.com/vendure-ecommerce/vendure/commit/7a3e378)) * **admin-ui** Fix styling of some dialogs with tabs ([f601acc](https://github.com/vendure-ecommerce/vendure/commit/f601acc)) * **admin-ui** Use generics in ReactDataTableComponentProps (#2500) ([730a103](https://github.com/vendure-ecommerce/vendure/commit/730a103)), closes [#2500](https://github.com/vendure-ecommerce/vendure/issues/2500) * **core** Assign assets when assigning Collection to channel ([a8481bf](https://github.com/vendure-ecommerce/vendure/commit/a8481bf)), closes [#2122](https://github.com/vendure-ecommerce/vendure/issues/2122) [#2478](https://github.com/vendure-ecommerce/vendure/issues/2478) * **core** Fix collection findBySlug issue (#2480) ([894ace7](https://github.com/vendure-ecommerce/vendure/commit/894ace7)), closes [#2480](https://github.com/vendure-ecommerce/vendure/issues/2480) [#2395](https://github.com/vendure-ecommerce/vendure/issues/2395) * **core** Fix configurable operation id decoding when using uuids (#2483) ([47f606c](https://github.com/vendure-ecommerce/vendure/commit/47f606c)), closes [#2483](https://github.com/vendure-ecommerce/vendure/issues/2483) * **payments-plugin** Expose `status` of Mollie payment methods (#2499) ([071aa9db](https://github.com/vendure-ecommerce/vendure/commit/071aa9db)) ## <small>2.1.1 (2023-10-18)</small> #### Fixes * **admin-ui** Add missing RTL compatibility to some admin-ui components (#2451) ([ec61b58](https://github.com/vendure-ecommerce/vendure/commit/ec61b58)), closes [#2451](https://github.com/vendure-ecommerce/vendure/issues/2451) * **admin-ui** Add unique location id for prod detail variants table ([ce2b251](https://github.com/vendure-ecommerce/vendure/commit/ce2b251)) * **admin-ui** Do not load pending search index updates if permissions are insufficient (#2460) ([08ad982](https://github.com/vendure-ecommerce/vendure/commit/08ad982)), closes [#2460](https://github.com/vendure-ecommerce/vendure/issues/2460) [#2456](https://github.com/vendure-ecommerce/vendure/issues/2456) * **admin-ui** Fix customer group select input ([02fe6ae](https://github.com/vendure-ecommerce/vendure/commit/02fe6ae)), closes [#2441](https://github.com/vendure-ecommerce/vendure/issues/2441) * **admin-ui** Fix initial render of code editor input marking dirty ([9dda349](https://github.com/vendure-ecommerce/vendure/commit/9dda349)) * **admin-ui** Fix setting facet values on new product ([9d88db2](https://github.com/vendure-ecommerce/vendure/commit/9d88db2)), closes [#2355](https://github.com/vendure-ecommerce/vendure/issues/2355) * **admin-ui** Improve Italian translations (#2445) ([3fd93c7](https://github.com/vendure-ecommerce/vendure/commit/3fd93c7)), closes [#2445](https://github.com/vendure-ecommerce/vendure/issues/2445) * **admin-ui** Improvements to Nepali translation (#2463) ([4035fda](https://github.com/vendure-ecommerce/vendure/commit/4035fda)), closes [#2463](https://github.com/vendure-ecommerce/vendure/issues/2463) * **admin-ui** Make ExtensionHostComponent work with new extension APIs ([b917e62](https://github.com/vendure-ecommerce/vendure/commit/b917e62)) * **admin-ui** Make utility margin/padding classes RTL-compatible ([74c6634](https://github.com/vendure-ecommerce/vendure/commit/74c6634)) * **common** Remove trademark symbols from normalized strings (#2447) ([9aac191](https://github.com/vendure-ecommerce/vendure/commit/9aac191)), closes [#2447](https://github.com/vendure-ecommerce/vendure/issues/2447) * **core** Fix custom field resolver for eager translatable relation (#2457) ([09dd7df](https://github.com/vendure-ecommerce/vendure/commit/09dd7df)), closes [#2453](https://github.com/vendure-ecommerce/vendure/issues/2453) * **core** Fix regression in ProductService.findOne not using relations ([92cad43](https://github.com/vendure-ecommerce/vendure/commit/92cad43)), closes [#2443](https://github.com/vendure-ecommerce/vendure/issues/2443) * **core** Normalize email address on updating Customer ([957d0ad](https://github.com/vendure-ecommerce/vendure/commit/957d0ad)), closes [#2449](https://github.com/vendure-ecommerce/vendure/issues/2449) * **payments-plugin** Fix Mollie klarna AutoCapture (#2446) ([8db459a](https://github.com/vendure-ecommerce/vendure/commit/8db459a)), closes [#2446](https://github.com/vendure-ecommerce/vendure/issues/2446) * **payments-plugin** Fix Stripe controller crashing server instance (#2454) ([b0ece21](https://github.com/vendure-ecommerce/vendure/commit/b0ece21)), closes [#2454](https://github.com/vendure-ecommerce/vendure/issues/2454) [#2450](https://github.com/vendure-ecommerce/vendure/issues/2450) * **payments-plugin** Idempotent 'paid' Mollie webhooks (#2462) ([2f7a8d5](https://github.com/vendure-ecommerce/vendure/commit/2f7a8d5)), closes [#2462](https://github.com/vendure-ecommerce/vendure/issues/2462) #### Features * **admin-ui** Add Croatian translation (#2442) ([b594c55](https://github.com/vendure-ecommerce/vendure/commit/b594c55)), closes [#2442](https://github.com/vendure-ecommerce/vendure/issues/2442) * **admin-ui** Add product slug in product multi selector dialog component (#2461) ([b7f3452](https://github.com/vendure-ecommerce/vendure/commit/b7f3452)), closes [#2461](https://github.com/vendure-ecommerce/vendure/issues/2461) ## 2.1.0 (2023-10-11) #### Fixes * **admin-ui** Correctly display job retries ([d3107fd](https://github.com/vendure-ecommerce/vendure/commit/d3107fd)), closes [#1467](https://github.com/vendure-ecommerce/vendure/issues/1467) * **admin-ui** Fix back/forward nav issues with data table filters ([58cb5a5](https://github.com/vendure-ecommerce/vendure/commit/58cb5a5)) * **admin-ui** Fix border colour of affixed input ([e2cb74b](https://github.com/vendure-ecommerce/vendure/commit/e2cb74b)) * **admin-ui** Fix component for new Angular extension route API ([6fe1bd0](https://github.com/vendure-ecommerce/vendure/commit/6fe1bd0)) * **admin-ui** Fix error when data table filters not defined ([2425a33](https://github.com/vendure-ecommerce/vendure/commit/2425a33)) * **admin-ui** Give all data table columns immutable ids ([73a78db](https://github.com/vendure-ecommerce/vendure/commit/73a78db)) * **admin-ui** Improve RTL styles ([056d205](https://github.com/vendure-ecommerce/vendure/commit/056d205)) * **admin-ui** Limit FacetValues in Facet list component ([b445955](https://github.com/vendure-ecommerce/vendure/commit/b445955)), closes [#1257](https://github.com/vendure-ecommerce/vendure/issues/1257) * **admin-ui** Reinstate serialized filter state in url ([a5bc0c1](https://github.com/vendure-ecommerce/vendure/commit/a5bc0c1)) * **admin-ui** Update active filter preset on back/forward navigation ([844876e](https://github.com/vendure-ecommerce/vendure/commit/844876e)) * **admin-ui** Use correct defaults for nullable custom fields (#2360) ([88430e5](https://github.com/vendure-ecommerce/vendure/commit/88430e5)), closes [#2360](https://github.com/vendure-ecommerce/vendure/issues/2360) * **core** Downgrade ForbiddenError from Error to Warn log level ([c186392](https://github.com/vendure-ecommerce/vendure/commit/c186392)), closes [#2383](https://github.com/vendure-ecommerce/vendure/issues/2383) * **core** Export EntityId and Money decorators ([4664dee](https://github.com/vendure-ecommerce/vendure/commit/4664dee)) * **core** Fix circular dependency issue in SQLiteSearchStrategy ([f2e2e32](https://github.com/vendure-ecommerce/vendure/commit/f2e2e32)) * **core** Fix resolution of facet valueList for postgres ([1d8fe47](https://github.com/vendure-ecommerce/vendure/commit/1d8fe47)) * **job-queue-plugin** Correct behaviour of job list query with BullMQ ([c148a92](https://github.com/vendure-ecommerce/vendure/commit/c148a92)), closes [#2120](https://github.com/vendure-ecommerce/vendure/issues/2120) [#1327](https://github.com/vendure-ecommerce/vendure/issues/1327) * **job-queue-plugin** Correct retry setting for BullMQ jobs ([972ba0e](https://github.com/vendure-ecommerce/vendure/commit/972ba0e)), closes [#1467](https://github.com/vendure-ecommerce/vendure/issues/1467) * **ui-devkit** Fix scaffold logic for custom providers ([2f2ddb5](https://github.com/vendure-ecommerce/vendure/commit/2f2ddb5)) #### Features * **admin-ui** Add data table filter presets functionality ([a656ef2](https://github.com/vendure-ecommerce/vendure/commit/a656ef2)) * **admin-ui** Add filter preset support to Collection list ([cbfb402](https://github.com/vendure-ecommerce/vendure/commit/cbfb402)) * **admin-ui** Add image carousel to asset preview dialog (#2370) ([cd7b2bf](https://github.com/vendure-ecommerce/vendure/commit/cd7b2bf)), closes [#2370](https://github.com/vendure-ecommerce/vendure/issues/2370) [#2129](https://github.com/vendure-ecommerce/vendure/issues/2129) * **admin-ui** Add initial React support for UI extensions ([1075dd7](https://github.com/vendure-ecommerce/vendure/commit/1075dd7)) * **admin-ui** Add more native React UI components ([04e03f8](https://github.com/vendure-ecommerce/vendure/commit/04e03f8)) * **admin-ui** Add Persian/Farsi i18n messages (#2418) ([1193863](https://github.com/vendure-ecommerce/vendure/commit/1193863)), closes [#2418](https://github.com/vendure-ecommerce/vendure/issues/2418) * **admin-ui** Add useRouteParams react hook ([b63fb7f](https://github.com/vendure-ecommerce/vendure/commit/b63fb7f)) * **admin-ui** Admin UI rtl with Arabic translation improvements (#2322) ([44ea12b](https://github.com/vendure-ecommerce/vendure/commit/44ea12b)), closes [#2322](https://github.com/vendure-ecommerce/vendure/issues/2322) * **admin-ui** Allow custom components in data table columns ([d3474dd](https://github.com/vendure-ecommerce/vendure/commit/d3474dd)), closes [#2347](https://github.com/vendure-ecommerce/vendure/issues/2347) [#2353](https://github.com/vendure-ecommerce/vendure/issues/2353) * **admin-ui** Allow custom React components in data table columns ([5cde775](https://github.com/vendure-ecommerce/vendure/commit/5cde775)), closes [#2347](https://github.com/vendure-ecommerce/vendure/issues/2347) [#2353](https://github.com/vendure-ecommerce/vendure/issues/2353) * **admin-ui** Display original quantity after order has been modified ([a36c6e0](https://github.com/vendure-ecommerce/vendure/commit/a36c6e0)) * **admin-ui** Enable Nepali translations ([342fafa](https://github.com/vendure-ecommerce/vendure/commit/342fafa)) * **admin-ui** Expose providers to nav menu routerLink function ([1bae40e](https://github.com/vendure-ecommerce/vendure/commit/1bae40e)) * **admin-ui** Implement custom components in Collection data table ([4ab7c1e](https://github.com/vendure-ecommerce/vendure/commit/4ab7c1e)) * **admin-ui** Implement custom components in order detail data table (#2420) ([e92e820](https://github.com/vendure-ecommerce/vendure/commit/e92e820)), closes [#2420](https://github.com/vendure-ecommerce/vendure/issues/2420) * **admin-ui** Implement drag-and-drop reorder of filter presets ([8e06705](https://github.com/vendure-ecommerce/vendure/commit/8e06705)) * **admin-ui** Implement filter preset renaming ([8b52e6f](https://github.com/vendure-ecommerce/vendure/commit/8b52e6f)) * **admin-ui** Implement job queue filtering by status ([baeb036](https://github.com/vendure-ecommerce/vendure/commit/baeb036)) * **admin-ui** Implement react Card component ([c588a1f](https://github.com/vendure-ecommerce/vendure/commit/c588a1f)) * **admin-ui** Implement relative date filtering ([d07a5f3](https://github.com/vendure-ecommerce/vendure/commit/d07a5f3)) * **admin-ui** Implement simplified API for UI route extensions ([b9ca367](https://github.com/vendure-ecommerce/vendure/commit/b9ca367)) * **admin-ui** Implement values pagination for Facet detail view ([4cf1826](https://github.com/vendure-ecommerce/vendure/commit/4cf1826)), closes [#1257](https://github.com/vendure-ecommerce/vendure/issues/1257) * **admin-ui** Improve dev mode extension point display ([4678930](https://github.com/vendure-ecommerce/vendure/commit/4678930)) * **admin-ui** Improve naming & layout of catalog & stock locations ([8452300](https://github.com/vendure-ecommerce/vendure/commit/8452300)) * **admin-ui** Improved control over ActionBar buttons ([065a2b4](https://github.com/vendure-ecommerce/vendure/commit/065a2b4)) * **admin-ui** Initial support for React UI extensions ([83d5756](https://github.com/vendure-ecommerce/vendure/commit/83d5756)) * **admin-ui** Style improvements to table and form input borders ([5287287](https://github.com/vendure-ecommerce/vendure/commit/5287287)) * **admin-ui** Support for React-based custom detail components ([55d9ffc](https://github.com/vendure-ecommerce/vendure/commit/55d9ffc)) * **admin-ui** Update to Angular v16.2 ([608d5d3](https://github.com/vendure-ecommerce/vendure/commit/608d5d3)) * **cli** Implement plugin scaffold command ([a6df4c1](https://github.com/vendure-ecommerce/vendure/commit/a6df4c1)) * **cli** Include custom CRUD permissions with plugin scaffold ([0c62b6f](https://github.com/vendure-ecommerce/vendure/commit/0c62b6f)) * **core** Add `Facet.valueList` resolver for paginated values ([09c7175](https://github.com/vendure-ecommerce/vendure/commit/09c7175)), closes [#1257](https://github.com/vendure-ecommerce/vendure/issues/1257) * **core** Add maximum coupon usage (#2331) ([bdd2720](https://github.com/vendure-ecommerce/vendure/commit/bdd2720)), closes [#2331](https://github.com/vendure-ecommerce/vendure/issues/2331) [#2330](https://github.com/vendure-ecommerce/vendure/issues/2330) * **core** Pass variant to ProductVariantPriceCalculationStrategy ([fee995c](https://github.com/vendure-ecommerce/vendure/commit/fee995c)), closes [#2398](https://github.com/vendure-ecommerce/vendure/issues/2398) * **core** Support bi-directional relations in customFields (#2365) ([0313ce5](https://github.com/vendure-ecommerce/vendure/commit/0313ce5)), closes [#2365](https://github.com/vendure-ecommerce/vendure/issues/2365) * **core** Update NestJS to v10, Apollo Server v4 ([b675fda](https://github.com/vendure-ecommerce/vendure/commit/b675fda)) * **create** Allow selection of package manager ([6561bb7](https://github.com/vendure-ecommerce/vendure/commit/6561bb7)) * **create** Better defaults for project scaffold ([fa683e7](https://github.com/vendure-ecommerce/vendure/commit/fa683e7)) * **email-plugin** Expose template vars to template loader (#2243) ([78ea016](https://github.com/vendure-ecommerce/vendure/commit/78ea016)), closes [#2243](https://github.com/vendure-ecommerce/vendure/issues/2243) [#2242](https://github.com/vendure-ecommerce/vendure/issues/2242) * **job-queue-plugin** Implement default cleanup of old BullMQ jobs ([6c1d7bb](https://github.com/vendure-ecommerce/vendure/commit/6c1d7bb)), closes [#1425](https://github.com/vendure-ecommerce/vendure/issues/1425) * **payments-plugin** Allow custom params to be passed to Stripe API ([1b29097](https://github.com/vendure-ecommerce/vendure/commit/1b29097)), closes [#2412](https://github.com/vendure-ecommerce/vendure/issues/2412) * **ui-devkit** Add experimental wrapper for shared ui providers ([daf6f8c](https://github.com/vendure-ecommerce/vendure/commit/daf6f8c)) ### BREAKING CHANGE * In the Admin UI, the "stock locations" list and detail views have been moved from the "catalog" module to the "settings" module. Also, the menu item & breadcrumb for "inventory" has been renamed to "products". This is an end-user breaking change rather than a code breaking change. Any UI extensions that link to a `/catalog/inventory/...` route will still work as there is a redirect in place to `/catalog/products/...`. * The update of Apollo Server to v4 includes some breaking changes if you have defined any custom ApolloServerPlugins. See the Apollo migration guide for full details: https://www.apollographql.com/docs/apollo-server/migration/ * The new Promotion.usageLimit field will require a non-destructive database migration to be performed. You should not need to do any manual migration work - it is a straightforward addition of a field to a table. * The ForbiddenError now defaults to a "warning" rather than "error" log level. Previously this was causing too much noise in logging services and the new level better reflects the severity of the error. * If after update you are running into the error `[GraphQL error]: Message: POST body missing, invalid Content-Type, or JSON object has no keys.`, this may be due to having the [body-parser](https://www.npmjs.com/package/body-parser) `json` middleware configured in your app. You should be able to safely remove this middleware in order to resolve the issue. ## <small>2.0.10 (2023-10-11)</small> #### Fixes * **core** Use correct Money type on ProductVariantPrice.price field ([446f61c](https://github.com/vendure-ecommerce/vendure/commit/446f61c)) * **payments-plugin** List missing available Mollie payment methods for orders api (#2435) ([23a0499](https://github.com/vendure-ecommerce/vendure/commit/23a0499)), closes [#2435](https://github.com/vendure-ecommerce/vendure/issues/2435) ## <small>2.0.9 (2023-09-29)</small> #### Fixes * **core** Fix discount calculation error edge-case ([7549aad](https://github.com/vendure-ecommerce/vendure/commit/7549aad)), closes [#2385](https://github.com/vendure-ecommerce/vendure/issues/2385) ## <small>2.0.8 (2023-09-27)</small> #### Fixes * **admin-ui** Fix creating nullable string fields ([7e2c17a](https://github.com/vendure-ecommerce/vendure/commit/7e2c17a)), closes [#2343](https://github.com/vendure-ecommerce/vendure/issues/2343) * **admin-ui** Fix link to Asset detail from asset picker ([4539de3](https://github.com/vendure-ecommerce/vendure/commit/4539de3)), closes [#2411](https://github.com/vendure-ecommerce/vendure/issues/2411) * **core** Implement Refund lines fields resolver ([6b4da6c](https://github.com/vendure-ecommerce/vendure/commit/6b4da6c)), closes [#2406](https://github.com/vendure-ecommerce/vendure/issues/2406) * **core** Prevent negative total from compounded promotions ([0740c87](https://github.com/vendure-ecommerce/vendure/commit/0740c87)), closes [#2385](https://github.com/vendure-ecommerce/vendure/issues/2385) * **payments-plugin** Fix stripe payment transaction handling (#2402) ([fd8a777](https://github.com/vendure-ecommerce/vendure/commit/fd8a777)), closes [#2402](https://github.com/vendure-ecommerce/vendure/issues/2402) * **admin-ui** Add image carousel to asset preview dialog (#2370) ([bd834d0](https://github.com/vendure-ecommerce/vendure/commit/bd834d0)), closes [#2370](https://github.com/vendure-ecommerce/vendure/issues/2370) [#2129](https://github.com/vendure-ecommerce/vendure/issues/2129) ## <small>2.0.7 (2023-09-08)</small> #### Fixes * **admin-ui** Add custom field support to Customer list ([298e90c](https://github.com/vendure-ecommerce/vendure/commit/298e90c)) * **admin-ui** Added and improved Italian translations (#2371) ([19292a8](https://github.com/vendure-ecommerce/vendure/commit/19292a8)), closes [#2371](https://github.com/vendure-ecommerce/vendure/issues/2371) * **admin-ui** Correct handling of ID filters in data tables ([52ddd96](https://github.com/vendure-ecommerce/vendure/commit/52ddd96)) * **admin-ui** Data table filters react to page navigation ([2471350](https://github.com/vendure-ecommerce/vendure/commit/2471350)) * **admin-ui** Fix alignment of facet value chip ([7eb43ef](https://github.com/vendure-ecommerce/vendure/commit/7eb43ef)) * **admin-ui** Fix channel switcher icon style ([6e70794](https://github.com/vendure-ecommerce/vendure/commit/6e70794)) * **admin-ui** Fix filter shortcut triggering from rich text component ([e6f95b3](https://github.com/vendure-ecommerce/vendure/commit/e6f95b3)), closes [#2384](https://github.com/vendure-ecommerce/vendure/issues/2384) * **admin-ui** Fix styling of custom field tabs ([ef3d2f9](https://github.com/vendure-ecommerce/vendure/commit/ef3d2f9)) * **admin-ui** Reinstate multi-deletion of Assets ([a203e50](https://github.com/vendure-ecommerce/vendure/commit/a203e50)), closes [#380](https://github.com/vendure-ecommerce/vendure/issues/380) * **admin-ui** Use appropriate default values for custom fields ([85a8866](https://github.com/vendure-ecommerce/vendure/commit/85a8866)), closes [#2362](https://github.com/vendure-ecommerce/vendure/issues/2362) * **admin-ui** Aligns items horizontally in the Chip component ([19d3e51](https://github.com/vendure-ecommerce/vendure/commit/19d3e51)) * **admin-ui** Add price field on variation dialog modal (#2378) ([5b99bae](https://github.com/vendure-ecommerce/vendure/commit/5b99bae)), closes [#2378](https://github.com/vendure-ecommerce/vendure/issues/2378) * **core** Fix channel association on promotion update (#2376) ([47e688d](https://github.com/vendure-ecommerce/vendure/commit/47e688d)), closes [#2376](https://github.com/vendure-ecommerce/vendure/issues/2376) ## <small>2.0.6 (2023-08-11)</small> #### Fixes * **admin-ui** Apply max dimensions to relation asset preview ([8169c4e](https://github.com/vendure-ecommerce/vendure/commit/8169c4e)), closes [#2320](https://github.com/vendure-ecommerce/vendure/issues/2320) * **admin-ui** Correctly display decimal tax rate in order summary ([1f507fa](https://github.com/vendure-ecommerce/vendure/commit/1f507fa)), closes [#2339](https://github.com/vendure-ecommerce/vendure/issues/2339) * **admin-ui** Correctly display widget titles in dropdown ([59a1d5d](https://github.com/vendure-ecommerce/vendure/commit/59a1d5d)), closes [#2334](https://github.com/vendure-ecommerce/vendure/issues/2334) * **admin-ui** Fix error when saving multiple new variant options ([e5ad0ee](https://github.com/vendure-ecommerce/vendure/commit/e5ad0ee)), closes [#2326](https://github.com/vendure-ecommerce/vendure/issues/2326) * **admin-ui** Fix header overlap on empty data tables ([ada153e](https://github.com/vendure-ecommerce/vendure/commit/ada153e)), closes [#2323](https://github.com/vendure-ecommerce/vendure/issues/2323) [#2325](https://github.com/vendure-ecommerce/vendure/issues/2325) * **admin-ui** Fix updating variant tax category ([ff29e9a](https://github.com/vendure-ecommerce/vendure/commit/ff29e9a)), closes [#2336](https://github.com/vendure-ecommerce/vendure/issues/2336) * **admin-ui** Fix width of affixed inputs ([75d51ed](https://github.com/vendure-ecommerce/vendure/commit/75d51ed)) * **admin-ui** Fulfillment button takes existing state into account ([ef357cd](https://github.com/vendure-ecommerce/vendure/commit/ef357cd)) * **admin-ui** Fulfillment dialog enforces max quantity ([571b157](https://github.com/vendure-ecommerce/vendure/commit/571b157)), closes [#2329](https://github.com/vendure-ecommerce/vendure/issues/2329) * **admin-ui** Prevent product creation without variants ([3364559](https://github.com/vendure-ecommerce/vendure/commit/3364559)), closes [#2337](https://github.com/vendure-ecommerce/vendure/issues/2337) * **core** Fix entity hydration of nested array entities ([55009a5](https://github.com/vendure-ecommerce/vendure/commit/55009a5)), closes [#2013](https://github.com/vendure-ecommerce/vendure/issues/2013) * **core** Fix logic relating to partial fulfillments ([6f48ee2](https://github.com/vendure-ecommerce/vendure/commit/6f48ee2)), closes [#2324](https://github.com/vendure-ecommerce/vendure/issues/2324) [#2191](https://github.com/vendure-ecommerce/vendure/issues/2191) * **core** Prevent fulfillments with too great a quantity ([579459a](https://github.com/vendure-ecommerce/vendure/commit/579459a)), closes [#2329](https://github.com/vendure-ecommerce/vendure/issues/2329) ## <small>2.0.5 (2023-07-27)</small> #### Fixes * **admin-ui** Add channelTokenKey to AdminUiConfig (#2307) ([5162d0c](https://github.com/vendure-ecommerce/vendure/commit/5162d0c)), closes [#2307](https://github.com/vendure-ecommerce/vendure/issues/2307) * **admin-ui** Add custom detail component locationId and action bar items to draft order detail (#2286) ([27c9ae7](https://github.com/vendure-ecommerce/vendure/commit/27c9ae7)), closes [#2286](https://github.com/vendure-ecommerce/vendure/issues/2286) * **admin-ui** Add missing Russian translation strings (#2309) ([9524add](https://github.com/vendure-ecommerce/vendure/commit/9524add)), closes [#2309](https://github.com/vendure-ecommerce/vendure/issues/2309) * **admin-ui** Add product variant name filter in product variant list (#2271) ([b17494d](https://github.com/vendure-ecommerce/vendure/commit/b17494d)), closes [#2271](https://github.com/vendure-ecommerce/vendure/issues/2271) * **admin-ui** Allow period in slug ([7c9d110](https://github.com/vendure-ecommerce/vendure/commit/7c9d110)), closes [#2304](https://github.com/vendure-ecommerce/vendure/issues/2304) * **admin-ui** Fix creation of zero tax rates ([5f898b4](https://github.com/vendure-ecommerce/vendure/commit/5f898b4)), closes [#2312](https://github.com/vendure-ecommerce/vendure/issues/2312) * **core** Do not publish CollectionModificationEvent if no changes ([75f6dec](https://github.com/vendure-ecommerce/vendure/commit/75f6dec)) * **core** Export missing search plugin types ([23af791](https://github.com/vendure-ecommerce/vendure/commit/23af791)) * **core** Fix createRefund amount on cancelled OrderLines ([2b49edf](https://github.com/vendure-ecommerce/vendure/commit/2b49edf)), closes [#2302](https://github.com/vendure-ecommerce/vendure/issues/2302) * **core** Fix incorrect allocation logic in default fulfillment process ([f6881bf](https://github.com/vendure-ecommerce/vendure/commit/f6881bf)), closes [#2306](https://github.com/vendure-ecommerce/vendure/issues/2306) * **core** Fix startup error with readonly Administrator custom fields ([cae55a6](https://github.com/vendure-ecommerce/vendure/commit/cae55a6)) * **core** Fix typo in option searchStrategy (#2305) ([8cd15e1](https://github.com/vendure-ecommerce/vendure/commit/8cd15e1)), closes [#2305](https://github.com/vendure-ecommerce/vendure/issues/2305) * **core** Improved CockroachDB compatibility for DefaultSearchPlugin ([b8d8dec](https://github.com/vendure-ecommerce/vendure/commit/b8d8dec)) * **core** Publish AccountRegistrationEvent when creating Customer via admin ([e0bd036](https://github.com/vendure-ecommerce/vendure/commit/e0bd036)) * **core** Use MoneyStrategy in Surcharges (#2294) ([efee8ec](https://github.com/vendure-ecommerce/vendure/commit/efee8ec)), closes [#2294](https://github.com/vendure-ecommerce/vendure/issues/2294) * **payments-plugin**: Only find payment methods in the current channel ([bbea69](https://github.com/vendure-ecommerce/vendure/commit/bbea69)), closes [#2308](https://github.com/vendure-ecommerce/vendure/issues/2308) #### Features Note: although we now have complete translations for Arabic & Hebrew, the right-to-left layout support is still in progress, so if you use these languages you will encounter layout issues. * **admin-ui** all Arabic tokens translated (100%) (#2287) ([83ecec9](https://github.com/vendure-ecommerce/vendure/commit/83ecec9)), closes [#2287](https://github.com/vendure-ecommerce/vendure/issues/2287) * **admin-ui** Hebrew support (#2313) ([2814142](https://github.com/vendure-ecommerce/vendure/commit/2814142)), closes [#2313](https://github.com/vendure-ecommerce/vendure/issues/2313) ## <small>2.0.4 (2023-07-13)</small> #### Fixes * **admin-ui** Allow target attribute on `<a>` tags in rich text editor ([8f72e1e](https://github.com/vendure-ecommerce/vendure/commit/8f72e1e)), closes [#2281](https://github.com/vendure-ecommerce/vendure/issues/2281) * **admin-ui** Display custom fields in StockLocation detail view ([d36ac84](https://github.com/vendure-ecommerce/vendure/commit/d36ac84)) * **admin-ui** Fix display of Address custom fields in customer detail view ([189e714](https://github.com/vendure-ecommerce/vendure/commit/189e714)), closes [#2272](https://github.com/vendure-ecommerce/vendure/issues/2272) * **admin-ui** Fix layout of select customer dropdown items ([3f8a1da](https://github.com/vendure-ecommerce/vendure/commit/3f8a1da)) * **admin-ui** Fix top left logo when using setBranding ([120a0bb](https://github.com/vendure-ecommerce/vendure/commit/120a0bb)), closes [#2225](https://github.com/vendure-ecommerce/vendure/issues/2225) * **admin-ui** Prevent list filter hotkey F firing from input elements ([c426f8d](https://github.com/vendure-ecommerce/vendure/commit/c426f8d)) * **asset-server-plugin** Better handling of malformed images ([593e0e2](https://github.com/vendure-ecommerce/vendure/commit/593e0e2)), closes [#2275](https://github.com/vendure-ecommerce/vendure/issues/2275) * **core** Add timeout logic to session cache handling ([a817a1a](https://github.com/vendure-ecommerce/vendure/commit/a817a1a)) * **core** Correctly update StockLocation custom fields ([1cb676a](https://github.com/vendure-ecommerce/vendure/commit/1cb676a)) * **core** Fix admin authentication when no native auth in shop API ([8fb9719](https://github.com/vendure-ecommerce/vendure/commit/8fb9719)), closes [#2282](https://github.com/vendure-ecommerce/vendure/issues/2282) * **core** Fix draft orders not getting correctly placed ([4d01ab5](https://github.com/vendure-ecommerce/vendure/commit/4d01ab5)), closes [#2105](https://github.com/vendure-ecommerce/vendure/issues/2105) * **core** Add currencyCode option to RequestContextService.create (#2277) ([2f336a7](https://github.com/vendure-ecommerce/vendure/commit/2f336a7)), closes [#2277](https://github.com/vendure-ecommerce/vendure/issues/2277) ## <small>2.0.3 (2023-07-04)</small> #### Fixes * **admin-ui-plugin** Enable metricsSummary query without serving UI app ([fba0739](https://github.com/vendure-ecommerce/vendure/commit/fba0739)), closes [#2261](https://github.com/vendure-ecommerce/vendure/issues/2261) * **admin-ui** 100% brazilian portuguese translation coverage (#2262) ([0d76b10](https://github.com/vendure-ecommerce/vendure/commit/0d76b10)), closes [#2262](https://github.com/vendure-ecommerce/vendure/issues/2262) * **admin-ui** 100% german translation coverage (#2248) ([60c9e86](https://github.com/vendure-ecommerce/vendure/commit/60c9e86)), closes [#2248](https://github.com/vendure-ecommerce/vendure/issues/2248) * **admin-ui** Add missing permission to metrics widget ([3353c6e](https://github.com/vendure-ecommerce/vendure/commit/3353c6e)) * **admin-ui** Add missing search index rebuild trigger ([92f35d0](https://github.com/vendure-ecommerce/vendure/commit/92f35d0)) * **admin-ui** Allow vertical resize of textarea ([86853ec](https://github.com/vendure-ecommerce/vendure/commit/86853ec)), closes [#2255](https://github.com/vendure-ecommerce/vendure/issues/2255) * **admin-ui** Correct location id for product-variant-detail action bar ([ebaff3a](https://github.com/vendure-ecommerce/vendure/commit/ebaff3a)) * **admin-ui** Correctly sort customer orders in detail view ([86a17af](https://github.com/vendure-ecommerce/vendure/commit/86a17af)) * **admin-ui** Fix description layout on shipping method detail page ([9b9119c](https://github.com/vendure-ecommerce/vendure/commit/9b9119c)) * **admin-ui** Fix low limit of facet value selector component ([1b13e7a](https://github.com/vendure-ecommerce/vendure/commit/1b13e7a)), closes [#2251](https://github.com/vendure-ecommerce/vendure/issues/2251) * **admin-ui** Fix position of main nav status badge ([8669ef4](https://github.com/vendure-ecommerce/vendure/commit/8669ef4)) * **admin-ui** Fix product multi select form input ([b5947ec](https://github.com/vendure-ecommerce/vendure/commit/b5947ec)), closes [#2249](https://github.com/vendure-ecommerce/vendure/issues/2249) * **admin-ui** Fix quantity label in order table (#2259) ([bb4c9e5](https://github.com/vendure-ecommerce/vendure/commit/bb4c9e5)), closes [#2259](https://github.com/vendure-ecommerce/vendure/issues/2259) * **admin-ui** Fix query filter option in order list component (#2258) ([7b56942](https://github.com/vendure-ecommerce/vendure/commit/7b56942)), closes [#2258](https://github.com/vendure-ecommerce/vendure/issues/2258) [#2257](https://github.com/vendure-ecommerce/vendure/issues/2257) * **admin-ui** Fix updating product variant asset ([b590bdd](https://github.com/vendure-ecommerce/vendure/commit/b590bdd)) * **admin-ui** Improve keyboard controls for data table filters ([00f0155](https://github.com/vendure-ecommerce/vendure/commit/00f0155)) * **admin-ui** Make dropdowns keyboard-accessible ([d9c6cdd](https://github.com/vendure-ecommerce/vendure/commit/d9c6cdd)) * **admin-ui** Set page to 1 when changing list filters ([f2f60c3](https://github.com/vendure-ecommerce/vendure/commit/f2f60c3)) * **admin-ui** Style improvements to chip & ng-select ([bcffd9c](https://github.com/vendure-ecommerce/vendure/commit/bcffd9c)) * **admin-ui** Styling improvements to custom field relation controls ([fb8aca6](https://github.com/vendure-ecommerce/vendure/commit/fb8aca6)) * **admin-ui** Update es translation (#2260) ([fbc4dff](https://github.com/vendure-ecommerce/vendure/commit/fbc4dff)), closes [#2260](https://github.com/vendure-ecommerce/vendure/issues/2260) * **admin-ui** Use SKU to filter product variant list ([52a09a4](https://github.com/vendure-ecommerce/vendure/commit/52a09a4)) * **admin-ui** Prevent XSS attack vector in rich text editor ([GHSA-gm68-572p-q28r](https://github.com/vendure-ecommerce/vendure/security/advisories/GHSA-gm68-572p-q28r)) * **core** Correctly set currencyCode when assigning variants to channel ([5e13b0e](https://github.com/vendure-ecommerce/vendure/commit/5e13b0e)), closes [#2228](https://github.com/vendure-ecommerce/vendure/issues/2228) * **core** Delete user sessions & token upon user-deletion (#2241) ([b989607](https://github.com/vendure-ecommerce/vendure/commit/b989607)), closes [#2241](https://github.com/vendure-ecommerce/vendure/issues/2241) * **core** Disable graphql playground according to apiOptions setting ([b9a0200](https://github.com/vendure-ecommerce/vendure/commit/b9a0200)), closes [#2246](https://github.com/vendure-ecommerce/vendure/issues/2246) * **core** Fix Asset.tags resolution in Shop API ([555666c](https://github.com/vendure-ecommerce/vendure/commit/555666c)), closes [#1754](https://github.com/vendure-ecommerce/vendure/issues/1754) * **core** Fix issue updating customer email address when no native auth ([79aab66](https://github.com/vendure-ecommerce/vendure/commit/79aab66)) * **core** Fix null reference error when hydrating entity ([5a2b2b7](https://github.com/vendure-ecommerce/vendure/commit/5a2b2b7)), closes [#2264](https://github.com/vendure-ecommerce/vendure/issues/2264) * **core** Update variants when changing channel defaultCurrencyCode ([2303328](https://github.com/vendure-ecommerce/vendure/commit/2303328)), closes [#2190](https://github.com/vendure-ecommerce/vendure/issues/2190) * **core** Use more secure default for cookie sameSite option ([4a10d67](https://github.com/vendure-ecommerce/vendure/commit/4a10d67)) * **email-plugin** Add warning when running devMode with transport ([7498901](https://github.com/vendure-ecommerce/vendure/commit/7498901)), closes [#2253](https://github.com/vendure-ecommerce/vendure/issues/2253) * **payments-plugin** Add compatibility metadata to payment plugins ([2dbfa2b](https://github.com/vendure-ecommerce/vendure/commit/2dbfa2b)) #### Perf * **core** Improve performance of Product.facetValues resolver (#2239) ([a0e891a](https://github.com/vendure-ecommerce/vendure/commit/a0e891a)), closes [#2239](https://github.com/vendure-ecommerce/vendure/issues/2239) #### Features * **admin-ui** Add product variant bulk actions (assign/delete channel, delete) (#2238) ([b25ddcd](https://github.com/vendure-ecommerce/vendure/commit/b25ddcd)), closes [#2238](https://github.com/vendure-ecommerce/vendure/issues/2238) ## <small>2.0.2 (2023-06-19)</small> #### Fixes * **admin-ui** Allow collections to be moved to root ([23b3f05](https://github.com/vendure-ecommerce/vendure/commit/23b3f05)), closes [#2236](https://github.com/vendure-ecommerce/vendure/issues/2236) * **admin-ui** Allow options to be passed to ChartComponent ([161b757](https://github.com/vendure-ecommerce/vendure/commit/161b757)) * **admin-ui** Fix channel creation when pricesIncludeTax is false ([36fe1a5](https://github.com/vendure-ecommerce/vendure/commit/36fe1a5)), closes [#2217](https://github.com/vendure-ecommerce/vendure/issues/2217) * **admin-ui** Fix mobile layout for asset list ([5f7ac8c](https://github.com/vendure-ecommerce/vendure/commit/5f7ac8c)), closes [#2206](https://github.com/vendure-ecommerce/vendure/issues/2206) * **admin-ui** Fix routerLink to the order overview (#2235) ([cb37b3e](https://github.com/vendure-ecommerce/vendure/commit/cb37b3e)), closes [#2235](https://github.com/vendure-ecommerce/vendure/issues/2235) * **admin-ui** Fix styling for very long breadcrumbs ([44c2c88](https://github.com/vendure-ecommerce/vendure/commit/44c2c88)) * **admin-ui** Update fr translation (#2232) ([e12770e](https://github.com/vendure-ecommerce/vendure/commit/e12770e)), closes [#2232](https://github.com/vendure-ecommerce/vendure/issues/2232) * **core** Channel cache can handle more than 1000 channels ([2218d42](https://github.com/vendure-ecommerce/vendure/commit/2218d42)), closes [#2233](https://github.com/vendure-ecommerce/vendure/issues/2233) ## <small>2.0.1 (2023-06-13)</small> #### Fixes * **admin-ui** Add missing primary button states ([93d2285](https://github.com/vendure-ecommerce/vendure/commit/93d2285)) * **admin-ui** Allow setting tab route config ([3fb170e](https://github.com/vendure-ecommerce/vendure/commit/3fb170e)) * **admin-ui** Fix customers breadcrumb link (#2218) ([edaa867](https://github.com/vendure-ecommerce/vendure/commit/edaa867)), closes [#2218](https://github.com/vendure-ecommerce/vendure/issues/2218) * **admin-ui** Fix pagination on options editor view ([dda5e67](https://github.com/vendure-ecommerce/vendure/commit/dda5e67)) * **admin-ui** Fix styling of address card component ([ea92bd1](https://github.com/vendure-ecommerce/vendure/commit/ea92bd1)) * **admin-ui** Fix tab label for product detail component ([cb81848](https://github.com/vendure-ecommerce/vendure/commit/cb81848)) * **admin-ui** Improve feedback on attempting to create variant ([e50b271](https://github.com/vendure-ecommerce/vendure/commit/e50b271)), closes [#2210](https://github.com/vendure-ecommerce/vendure/issues/2210) * **admin-ui** Improve readability of role permissions table ([95dabdc](https://github.com/vendure-ecommerce/vendure/commit/95dabdc)), closes [#2224](https://github.com/vendure-ecommerce/vendure/issues/2224) * **admin-ui** List newly-created customers ([6483aad](https://github.com/vendure-ecommerce/vendure/commit/6483aad)), closes [#2213](https://github.com/vendure-ecommerce/vendure/issues/2213) * **admin-ui** Preserve ui language settings after refresh ([dcae0d9](https://github.com/vendure-ecommerce/vendure/commit/dcae0d9)), closes [#2211](https://github.com/vendure-ecommerce/vendure/issues/2211) * **admin-ui** Prevent duplicate order state change on manual payment ([eadc479](https://github.com/vendure-ecommerce/vendure/commit/eadc479)), closes [#2204](https://github.com/vendure-ecommerce/vendure/issues/2204) * **admin-ui** Redirect to the right page on forbidden errors if an internal `loginUrl` is provided (#2175) ([c0630fb](https://github.com/vendure-ecommerce/vendure/commit/c0630fb)), closes [#2175](https://github.com/vendure-ecommerce/vendure/issues/2175) * **admin-ui** Small style fixes ([33eee17](https://github.com/vendure-ecommerce/vendure/commit/33eee17)) * **asset-server-plugin** Update Sharp to fix macOS 10.13+ support ([043c7ff](https://github.com/vendure-ecommerce/vendure/commit/043c7ff)) * **core** Add missing SellerEvent and correctly update relations ([4f421d3](https://github.com/vendure-ecommerce/vendure/commit/4f421d3)), closes [#2216](https://github.com/vendure-ecommerce/vendure/issues/2216) * **core** Correctly update Seller custom fields ([4a4691d](https://github.com/vendure-ecommerce/vendure/commit/4a4691d)) * **core** Expose the `topLevelOnly` collections option in Shop API ([ed28743](https://github.com/vendure-ecommerce/vendure/commit/ed28743)) * **core** Fix channel creation with defaultCurrencyCode field ([3aa72ab](https://github.com/vendure-ecommerce/vendure/commit/3aa72ab)), closes [#2217](https://github.com/vendure-ecommerce/vendure/issues/2217) * **core** Fix order state change from default payment process ([0e5129e](https://github.com/vendure-ecommerce/vendure/commit/0e5129e)), closes [#2204](https://github.com/vendure-ecommerce/vendure/issues/2204) * **job-queue-plugin** Fix graceful shutdown for BullMQJobQueueStrategy ([7c51eab](https://github.com/vendure-ecommerce/vendure/commit/7c51eab)), closes [#2222](https://github.com/vendure-ecommerce/vendure/issues/2222) ## <small>2.0.0 (2023-06-07)</small> #### Fixes * **asset-server-plugin** Change image format with no other transforms (#2104) ([6cf1608](https://github.com/vendure-ecommerce/vendure/commit/6cf1608)), closes [#2104](https://github.com/vendure-ecommerce/vendure/issues/2104) * **core** Correctly remove invalid promotion couponCodes from Order ([7a1c127](https://github.com/vendure-ecommerce/vendure/commit/7a1c127)) * **core** Fix concurrent order address update edge case ([f4ca9b2](https://github.com/vendure-ecommerce/vendure/commit/f4ca9b2)) * **core** Fix updating channel currencyCode ([7e01ecf](https://github.com/vendure-ecommerce/vendure/commit/7e01ecf)), closes [#2114](https://github.com/vendure-ecommerce/vendure/issues/2114) * **core** Translatable fields default to empty string if falsy ([e119154](https://github.com/vendure-ecommerce/vendure/commit/e119154)) * **core** Fix error messages containing colon char ([2cfc874](https://github.com/vendure-ecommerce/vendure/commit/2cfc874)), closes [#2153](https://github.com/vendure-ecommerce/vendure/issues/2153) * **core** Fix issues with Promotion & PaymentMethod null descriptions ([7b407de](https://github.com/vendure-ecommerce/vendure/commit/7b407de)) * **create** Use "create" version for all Vendure dependencies ([844b9ba](https://github.com/vendure-ecommerce/vendure/commit/844b9ba)) * **payments-plugin** Make peer dependencies optional ([98c764c](https://github.com/vendure-ecommerce/vendure/commit/98c764c)) * **testing** More graceful shutdown ([aa91bd0](https://github.com/vendure-ecommerce/vendure/commit/aa91bd0)) * **ui-devkit** Fix baseHref configuration ([c7836b2](https://github.com/vendure-ecommerce/vendure/commit/c7836b2)), closes [#1794](https://github.com/vendure-ecommerce/vendure/issues/1794) #### Features * **admin-ui** Rename vdr-product-selector ([9d9275c](https://github.com/vendure-ecommerce/vendure/commit/9d9275c)) * **admin-ui** Add filter inheritance control to Collection detail view ([7f1b01e](https://github.com/vendure-ecommerce/vendure/commit/7f1b01e)), closes [#1382](https://github.com/vendure-ecommerce/vendure/issues/1382) * **admin-ui** Update collection preview on filter inheritance toggle ([1a4aced](https://github.com/vendure-ecommerce/vendure/commit/1a4aced)) * **admin-ui** Add support for translatable PaymentMethods ([06efc50](https://github.com/vendure-ecommerce/vendure/commit/06efc50)), closes [#1184](https://github.com/vendure-ecommerce/vendure/issues/1184) * **admin-ui** Add support for translatable Promotions ([00bd433](https://github.com/vendure-ecommerce/vendure/commit/00bd433)), closes [#1990](https://github.com/vendure-ecommerce/vendure/issues/1990) * **admin-ui** New app layout with updated nav menu ([e6f8584](https://github.com/vendure-ecommerce/vendure/commit/e6f8584)), closes [#1645](https://github.com/vendure-ecommerce/vendure/issues/1645) * **admin-ui** Update to Angular v16.x ([0c503b4](https://github.com/vendure-ecommerce/vendure/commit/0c503b4)) * **admin-ui** Implement custom fields updating of ProductOptionGroup and ProductOption entities ([d2a0824](https://github.com/vendure-ecommerce/vendure/commit/d2a0824)) * **admin-ui-plugin** Add simple metrics support via new metricSummary query ([717d265](https://github.com/vendure-ecommerce/vendure/commit/717d265)). Thanks to @martijnvdbrug for providing the initial implementation, on which this is based! * **asset-server-plugin** Update to Sharp v0.31 * **asset-server-plugin** Update s3 asset storage strategy to use AWS sdk v3 (#2102) ([d628659](https://github.com/vendure-ecommerce/vendure/commit/d628659)), closes [#2102](https://github.com/vendure-ecommerce/vendure/issues/2102) * **core** Update all major dependencies to NestJS v8, Apollo Server v3, GraphQL v16 * **core** Update to TypeScript v4.9.5 ([99da585](https://github.com/vendure-ecommerce/vendure/commit/99da585)) * **core** Added a unique index to Order.code ([aa6025d](https://github.com/vendure-ecommerce/vendure/commit/aa6025d)) * **core** Collections can control inheritance of filters ([5d4206f](https://github.com/vendure-ecommerce/vendure/commit/5d4206f)), closes [#1382](https://github.com/vendure-ecommerce/vendure/issues/1382) * **core** Update codegen errors plugin to use object inputs ([6b9b2a4](https://github.com/vendure-ecommerce/vendure/commit/6b9b2a4)) * **core** Add currencyCode to variant price model ([24e558b](https://github.com/vendure-ecommerce/vendure/commit/24e558b)), closes [#1691](https://github.com/vendure-ecommerce/vendure/issues/1691) * **core** Add ProductVariantPriceSelectionStrategy ([efe23d1](https://github.com/vendure-ecommerce/vendure/commit/efe23d1)), closes [#1691](https://github.com/vendure-ecommerce/vendure/issues/1691) * **core** Implement Admin API operations for stock location, e2e tests ([7913b9a](https://github.com/vendure-ecommerce/vendure/commit/7913b9a)), closes [#1545](https://github.com/vendure-ecommerce/vendure/issues/1545) * **core** Implement data model & APIs for multi-location stock ([905c1df](https://github.com/vendure-ecommerce/vendure/commit/905c1df)), closes [#1545](https://github.com/vendure-ecommerce/vendure/issues/1545) * **core** Implement GuestCheckoutStrategy ([7e0f1d1](https://github.com/vendure-ecommerce/vendure/commit/7e0f1d1)), closes [#911](https://github.com/vendure-ecommerce/vendure/issues/911) [#762](https://github.com/vendure-ecommerce/vendure/issues/762) * **core** Implement localeText custom field type ([6a3c61f](https://github.com/vendure-ecommerce/vendure/commit/6a3c61f)), closes [#2000](https://github.com/vendure-ecommerce/vendure/issues/2000) * **core** Implement MoneyStrategy ([61ac041](https://github.com/vendure-ecommerce/vendure/commit/61ac041)), closes [#1835](https://github.com/vendure-ecommerce/vendure/issues/1835) * **core** Make PaymentMethod entity translatable ([2a4b3bc](https://github.com/vendure-ecommerce/vendure/commit/2a4b3bc)), closes [#1184](https://github.com/vendure-ecommerce/vendure/issues/1184) * **core** Make Promotion entity translatable, add description ([dada243](https://github.com/vendure-ecommerce/vendure/commit/dada243)), closes [#1990](https://github.com/vendure-ecommerce/vendure/issues/1990) * **core** Normalize email addresses for native auth ([ad7eab8](https://github.com/vendure-ecommerce/vendure/commit/ad7eab8)), closes [#1515](https://github.com/vendure-ecommerce/vendure/issues/1515) * **core** Collection preview handles filter inheritance ([3d2c0fb](https://github.com/vendure-ecommerce/vendure/commit/3d2c0fb)) * **core** Add support for PromotionAction side effects ([1a4a117](https://github.com/vendure-ecommerce/vendure/commit/1a4a117)), closes [#1798](https://github.com/vendure-ecommerce/vendure/issues/1798) * **core** Add filter method to EventBus (#1930) ([7eabaa7](https://github.com/vendure-ecommerce/vendure/commit/7eabaa7)), closes [#1930](https://github.com/vendure-ecommerce/vendure/issues/1930) * **core** Expose tags on Assets for shop api (#1754) ([d9316df](https://github.com/vendure-ecommerce/vendure/commit/d9316df)), closes [#1754](https://github.com/vendure-ecommerce/vendure/issues/1754) * **core** Create underlying APIs to support multivendor Orders ([3d9f7e8](https://github.com/vendure-ecommerce/vendure/commit/3d9f7e8)), closes [#1329](https://github.com/vendure-ecommerce/vendure/issues/1329) * **core** Extract hard-coded fulfillment state & process ([cdb2b75](https://github.com/vendure-ecommerce/vendure/commit/cdb2b75)) * **core** Extract hard-coded order state & process ([cff3b91](https://github.com/vendure-ecommerce/vendure/commit/cff3b91)) * **core** Extract hard-coded payment state & process ([4c5c946](https://github.com/vendure-ecommerce/vendure/commit/4c5c946)) * **core** Add `compatibility` check to VendurePlugin metadata ([d18d350](https://github.com/vendure-ecommerce/vendure/commit/d18d350)), closes [#1471](https://github.com/vendure-ecommerce/vendure/issues/1471) * **core** Add quantity arg to OrderItemPriceCalculationStrategy ([02a0864](https://github.com/vendure-ecommerce/vendure/commit/02a0864)), closes [#1920](https://github.com/vendure-ecommerce/vendure/issues/1920) * **core** Export VENDURE_VERSION constant ([b2a910a](https://github.com/vendure-ecommerce/vendure/commit/b2a910a)), closes [#1471](https://github.com/vendure-ecommerce/vendure/issues/1471) * **core** Implement Regions & support for Provinces ([7b8f5bf](https://github.com/vendure-ecommerce/vendure/commit/7b8f5bf)), closes [#76](https://github.com/vendure-ecommerce/vendure/issues/76) * **core** Allow specifying transaction isolation level (#2116) ([bf2b1f5](https://github.com/vendure-ecommerce/vendure/commit/bf2b1f5)), closes [#2116](https://github.com/vendure-ecommerce/vendure/issues/2116) * **core** Add `topLevelOnly` filter to collection list query ([66b8c75](https://github.com/vendure-ecommerce/vendure/commit/66b8c75)) * **core** Add bulk delete mutations ([2f5e096](https://github.com/vendure-ecommerce/vendure/commit/2f5e096)) * **core** Add facetValueId filter to products/variants list queries ([00b8268](https://github.com/vendure-ecommerce/vendure/commit/00b8268)) * **core** Allow variant options to be added & removed ([8cb9b27](https://github.com/vendure-ecommerce/vendure/commit/8cb9b27)) * **core** Channels mutation now returns PaginatedList ([d7a3447](https://github.com/vendure-ecommerce/vendure/commit/d7a3447)) * **core** ChannelService.findAll() returns PaginatedList ([53fa2a0](https://github.com/vendure-ecommerce/vendure/commit/53fa2a0)) * **core** Move global stock & language settings into Channel ([2748a6e](https://github.com/vendure-ecommerce/vendure/commit/2748a6e)) * **core** TaxCategories query now returns PaginatedList ([ddcd0fc](https://github.com/vendure-ecommerce/vendure/commit/ddcd0fc)) * **core** Zones query now returns PaginatedList ([afbb408](https://github.com/vendure-ecommerce/vendure/commit/afbb408)) * **email-plugin** Add support for dynamic templates & SMTP settings ([c6686cd](https://github.com/vendure-ecommerce/vendure/commit/c6686cd)), closes [#2043](https://github.com/vendure-ecommerce/vendure/issues/2043) [#2044](https://github.com/vendure-ecommerce/vendure/issues/2044) * **job-queue-plugin** Update bullmq & redis dependencies (#2020) ([eb0b73f](https://github.com/vendure-ecommerce/vendure/commit/eb0b73f)), closes [#2020](https://github.com/vendure-ecommerce/vendure/issues/2020) * **payments-plugin** Make Mollie plugin `redirecturl` dynamic (#2094) ([b452419](https://github.com/vendure-ecommerce/vendure/commit/b452419)), closes [#2094](https://github.com/vendure-ecommerce/vendure/issues/2094) [#2093](https://github.com/vendure-ecommerce/vendure/issues/2093) * **payments-plugin** Make Stripe plugin channel-aware (#2058) ([3b88702](https://github.com/vendure-ecommerce/vendure/commit/3b88702)), closes [#2058](https://github.com/vendure-ecommerce/vendure/issues/2058) * **testing** Turn productsCsvPath into an optional property for test server initialization (#2038) ([4c2b118](https://github.com/vendure-ecommerce/vendure/commit/4c2b118)), closes [#2038](https://github.com/vendure-ecommerce/vendure/issues/2038) * **ui-devkit** Add "exclude" option to UI extensions (#2009) ([dd6eee3](https://github.com/vendure-ecommerce/vendure/commit/dd6eee3)), closes [#2009](https://github.com/vendure-ecommerce/vendure/issues/2009) * **ui-devkit** Support module path mappings for UI extensions (#1994) ([6d57c86](https://github.com/vendure-ecommerce/vendure/commit/6d57c86)), closes [#1994](https://github.com/vendure-ecommerce/vendure/issues/1994) #### Performance * **core** Re-architect Order model for massive perf improvement on large orders, closes [#1981](https://github.com/vendure-ecommerce/vendure/issues/1981) * **core** Add indices to many-to-one relations ([01e369f](https://github.com/vendure-ecommerce/vendure/commit/01e369f)), closes [#1502](https://github.com/vendure-ecommerce/vendure/issues/1502) * **core** Add indexes to Product & Collection slugs ([937cf67](https://github.com/vendure-ecommerce/vendure/commit/937cf67)) #### BREAKING CHANGES When updating from v1.x, please see the [Migration Guide](https://docs.vendure.io/migrating-from-v1/). * The Admin UI app has been refreshed, including upgrading to Angular v16 as well as a host of style, layout & functional improvements. If you have ui extensions, they should still work but the layout will look somewhat broken. A full upgrade guide will be published with the final v2 release, but for now, wrapping all your custom pages in `<vdr-page-block>` (or `<div class="page-block">`) will improve things. * If you use any of the scoped method of the Admin UI `DataService`, you might find that some no longer exist. They are now deprecated and will eventually be removed. Use the `dataService.query()` and `dataService.mutation()` methods only, passing your own GraphQL documents. * ChannelService.findAll() will now return a PaginatedList<Channel> instead of a Channel[] * The `channels` mutation now returns a PaginatedList rather than a simple array of Channels. * The `taxCategories` mutation now returns a PaginatedList rather than a simple array of TaxCategory objects. * The `zones` query now returns a PaginatedList rather than a simple array of `Zone` objects. Likewise, the `ZoneService.findAll()` method also returns a paginated list. The old behaviour of `ZoneService.findAll()` (all Zones, cached for rapid access) can now be found under the new `ZoneService.getAllWithMembers()` method. * The Admin UI component `vdr-product-selector` has been renamed to `vdr-product-variant-selector` to more accurately represent what it does. If you are using `vdr-product-selector` if any ui extensions code, update it to use the new selector. * There's a breaking change you'll need to handle if you are using a `CustomOrderProcess`, `CustomFulfillmentProcess` or `CustomPaymentProcess`. Details in the migration guide. * The `Channel.currencyCode` field has been renamed to `defaultCurrencyCode`, and a new `currencyCode` field has been added to the `ProductVariantPrice` entity. * The introduction of the new MoneyStrategy includes a new GraphQL `Money` scalar, which replaces `Int` used in v1.x. In practice, this is still a `number` type and should not break any client applications. One point to note is that `Money` is based on the `Float` scalar and therefore can represent decimal values, allowing fractions of cents to be represented. * The minimum Redis recommended version is 6.2.0 * The Promotion entity is now translatable, which means existing promotions will need to be migrated to the new DB schema and care taken to preserve the name data. Also the GraphQL API for creating and updating Promotions, as well as the corresponding PromotionService methods have changed to take a `translations` array for setting the `name` and `description` in a given language. * A new `Region` entity has been introduced, which is a base class for `Country` and the new `Province` entity. The `Zone.members` property is now an array of `Region` rather than `Country`, since Zones may now be composed of both countries and provinces. If you have defined any custom fields on `Country`, you'll need to change it to `Region` in your custom fields config. * If you are using the s3 storage strategy of the AssetServerPlugin, it has been updated to use v3 of the AWS SDKs. This update introduces [an improved modular architecture to the AWS sdk](https://aws.amazon.com/blogs/developer/modular-packages-in-aws-sdk-for-javascript/), resulting in smaller bundle sizes. You need to install the `@aws-sdk/client-s3` & `@aws-sdk/lib-storage` packages, and can remove the `aws-sdk` package. * The Stripe plugin has been made channel aware. This means your api key and webhook secret are now stored in the database, per channel, instead of environment variables. Details are in the migration guide. ## <small>1.x</small> Changelogs for versions prior to v2.0.0 can be found in the [CHANGELOG_v1.md](./CHANGELOG_v1.md) file.
## 2.2.0-next.8 (2024-04-04) #### Fixes * **core** Fix deleted product option groups can't be deleted again (#2706) ([16add4a](https://github.com/vendure-ecommerce/vendure/commit/16add4a)), closes [#2706](https://github.com/vendure-ecommerce/vendure/issues/2706) * **core** Fix edge case with cached tax zone ([e543e5e](https://github.com/vendure-ecommerce/vendure/commit/e543e5e)) * **core** Fix error in joining list query relations ([33db45d](https://github.com/vendure-ecommerce/vendure/commit/33db45d)) * **core** Persist custom field relations on TaxRate ([7eaa641](https://github.com/vendure-ecommerce/vendure/commit/7eaa641)) * **core** Remove empty customFields relations from getMissingRelations in entity-hydrator (#2765) ([1c44113](https://github.com/vendure-ecommerce/vendure/commit/1c44113)), closes [#2765](https://github.com/vendure-ecommerce/vendure/issues/2765) * **core** Wrap nextOrderStates in transaction ([ed9539d](https://github.com/vendure-ecommerce/vendure/commit/ed9539d)) #### Features * **cli** Add API extension command ([41675a4](https://github.com/vendure-ecommerce/vendure/commit/41675a4)) * **cli** Add codegen command ([de5544c](https://github.com/vendure-ecommerce/vendure/commit/de5544c)) * **cli** Add job queue command ([2193a77](https://github.com/vendure-ecommerce/vendure/commit/2193a77)) * **cli** Add service command ([e29accc](https://github.com/vendure-ecommerce/vendure/commit/e29accc)) * **cli** Allow chaining features onto a newly-created plugin ([5b32c59](https://github.com/vendure-ecommerce/vendure/commit/5b32c59)) * **cli** Allow new entity features to be selected ([74c69dd](https://github.com/vendure-ecommerce/vendure/commit/74c69dd)) * **cli** Implement migrations in CLI ([9860abd](https://github.com/vendure-ecommerce/vendure/commit/9860abd)) * **core** Pass ctx to job queue strategy add (#2759) ([3909251](https://github.com/vendure-ecommerce/vendure/commit/3909251)), closes [#2759](https://github.com/vendure-ecommerce/vendure/issues/2759) [#2758](https://github.com/vendure-ecommerce/vendure/issues/2758) * **create** Ship Vendure CLI with new projects ([faf69a9](https://github.com/vendure-ecommerce/vendure/commit/faf69a9)) ## 2.2.0-next.7 (2024-03-20) #### Perf * **core** Database access performance & edge case fixes (#2744) ([48b239b](https://github.com/vendure-ecommerce/vendure/commit/48b239b)), closes [#2744](https://github.com/vendure-ecommerce/vendure/issues/2744) * **core** Optimization for assignToChannels method (#2743) ([c69e4ac](https://github.com/vendure-ecommerce/vendure/commit/c69e4ac)), closes [#2743](https://github.com/vendure-ecommerce/vendure/issues/2743) * **core** Upgrade EntityHydrator performance to any hydrate call (#2742) ([77233cd](https://github.com/vendure-ecommerce/vendure/commit/77233cd)), closes [#2742](https://github.com/vendure-ecommerce/vendure/issues/2742) * **core** Upgrade sql requests for more performant memory usage with big datasets (#2741) ([65888cb](https://github.com/vendure-ecommerce/vendure/commit/65888cb)), closes [#2741](https://github.com/vendure-ecommerce/vendure/issues/2741) #### Features * **admin-ui** Expose `registerAlert` provider for custom UI alerts ([698ea0c](https://github.com/vendure-ecommerce/vendure/commit/698ea0c)), closes [#2503](https://github.com/vendure-ecommerce/vendure/issues/2503) * **core** Implement new blocking event handler API ([1c69499](https://github.com/vendure-ecommerce/vendure/commit/1c69499)), closes [#2735](https://github.com/vendure-ecommerce/vendure/issues/2735) #### Fixes * **admin-ui** Fix dark mode layout ([893a913](https://github.com/vendure-ecommerce/vendure/commit/893a913)), closes [#2745](https://github.com/vendure-ecommerce/vendure/issues/2745) * **core** Fix self-referencing relations `Not unique table/alias` (#2740) ([357ba49](https://github.com/vendure-ecommerce/vendure/commit/357ba49)), closes [#2740](https://github.com/vendure-ecommerce/vendure/issues/2740) [#2738](https://github.com/vendure-ecommerce/vendure/issues/2738) ## 2.2.0-next.6 (2024-03-14) #### Fixes * **admin-ui** Fix alerts service registration ([04dcaab](https://github.com/vendure-ecommerce/vendure/commit/04dcaab)) * **core** Fix amount being sent to payment handler refund method ([b6a5691](https://github.com/vendure-ecommerce/vendure/commit/b6a5691)) #### Features * **admin-ui** Update Angular to v17.2 ([6f6a7af](https://github.com/vendure-ecommerce/vendure/commit/6f6a7af)) * **admin-ui** Update Clarity UI library to v17 ([44cfd95](https://github.com/vendure-ecommerce/vendure/commit/44cfd95)) * **asset-server-plugin** Add `q` query param for dynamic quality ([b96289b](https://github.com/vendure-ecommerce/vendure/commit/b96289b)) * **asset-server-plugin** Update Sharp to v0.33.2 ([f3d45a0](https://github.com/vendure-ecommerce/vendure/commit/f3d45a0)) * **core** Export order state machine ([138d9ff](https://github.com/vendure-ecommerce/vendure/commit/138d9ff)) * **core** Update NestJS to latest version (v10.3.3) ([573ae18](https://github.com/vendure-ecommerce/vendure/commit/573ae18)) * **core** Update TypeORM to v0.3.20 ([0afc94e](https://github.com/vendure-ecommerce/vendure/commit/0afc94e)) * **payments-plugin** Prevent duplicate Mollie payments (#2691) ([34b61cd](https://github.com/vendure-ecommerce/vendure/commit/34b61cd)), closes [#2691](https://github.com/vendure-ecommerce/vendure/issues/2691) * **ui-devkit** Add `prefix` option to route config to allow overrides ([babe4f4](https://github.com/vendure-ecommerce/vendure/commit/babe4f4)), closes [#2705](https://github.com/vendure-ecommerce/vendure/issues/2705) ### BREAKING CHANGE * MolliePlugin - A new mollieOrderId has been added in order to prevent duplicate payments in Mollie. This will require a DB migration to add the custom field to your DB schema. ## 2.2.0-next.5 (2024-02-26) #### Fixes * **core** Correctly return custom field relation scalar fields ([1280cf3](https://github.com/vendure-ecommerce/vendure/commit/1280cf3)) ## 2.2.0-next.4 (2024-02-26) #### Fixes * **admin-ui** Fix saving entities with custom field relations ([80f1f95](https://github.com/vendure-ecommerce/vendure/commit/80f1f95)) (this was a regression introduced in next.3) * **core** Fix typing on ProductOptionGroupService.create() method ([8fe24da](https://github.com/vendure-ecommerce/vendure/commit/8fe24da)), closes [#2577](https://github.com/vendure-ecommerce/vendure/issues/2577) #### Features * **admin-ui** Add React RichTextEditor component & hook (#2675) ([68e0fa5](https://github.com/vendure-ecommerce/vendure/commit/68e0fa5)), closes [#2675](https://github.com/vendure-ecommerce/vendure/issues/2675) * **admin-ui** Add support for custom action bar dropdown menus ([4d8bc74](https://github.com/vendure-ecommerce/vendure/commit/4d8bc74)), closes [#2678](https://github.com/vendure-ecommerce/vendure/issues/2678) * **admin-ui** Add support for permissions on custom fields ([94e0c42](https://github.com/vendure-ecommerce/vendure/commit/94e0c42)), closes [#2671](https://github.com/vendure-ecommerce/vendure/issues/2671) * **admin-ui** Channel aware picker ([fd92b4c](https://github.com/vendure-ecommerce/vendure/commit/fd92b4c)) * **admin-ui** Expose `entity$` observable on action bar context ([3f07179](https://github.com/vendure-ecommerce/vendure/commit/3f07179)) * **admin-ui** Implement UI for entity duplication ([7aa0d16](https://github.com/vendure-ecommerce/vendure/commit/7aa0d16)), closes [#627](https://github.com/vendure-ecommerce/vendure/issues/627) * **cli** Allow new plugin dir to be specified ([4ae12e7](https://github.com/vendure-ecommerce/vendure/commit/4ae12e7)) * **cli** Implement "add entity" command ([ad87531](https://github.com/vendure-ecommerce/vendure/commit/ad87531)) * **cli** Implement "add" command for ui extensions ([795b013](https://github.com/vendure-ecommerce/vendure/commit/795b013)) * **core** Add support for permissions on custom fields ([1c9f8f9](https://github.com/vendure-ecommerce/vendure/commit/1c9f8f9)), closes [#2671](https://github.com/vendure-ecommerce/vendure/issues/2671) * **core** Implement collection duplicator ([d457851](https://github.com/vendure-ecommerce/vendure/commit/d457851)), closes [#627](https://github.com/vendure-ecommerce/vendure/issues/627) * **core** Implement facet duplicator ([8d20847](https://github.com/vendure-ecommerce/vendure/commit/8d20847)), closes [#627](https://github.com/vendure-ecommerce/vendure/issues/627) * **core** Implement internal support for entity duplication ([477fe93](https://github.com/vendure-ecommerce/vendure/commit/477fe93)), closes [#627](https://github.com/vendure-ecommerce/vendure/issues/627) * **core** Implement product duplicator ([6ac43d9](https://github.com/vendure-ecommerce/vendure/commit/6ac43d9)), closes [#627](https://github.com/vendure-ecommerce/vendure/issues/627) * **core** Implement promotion duplicator ([da58b0b](https://github.com/vendure-ecommerce/vendure/commit/da58b0b)), closes [#627](https://github.com/vendure-ecommerce/vendure/issues/627) * **core** Update TypeScript version to v5.1.6 ([2f51929](https://github.com/vendure-ecommerce/vendure/commit/2f51929)) * **email-plugin** Publish EmailSendEvent after send attempted ([e4175e7](https://github.com/vendure-ecommerce/vendure/commit/e4175e7)) ## 2.2.0-next.3 (2024-02-14) #### Features * **admin-ui** Add bulk facet value editing to product variant list ([5ad41bf](https://github.com/vendure-ecommerce/vendure/commit/5ad41bf)) * **core** Introduce new `ProductVariantPriceEvent` ([aa4eeb8](https://github.com/vendure-ecommerce/vendure/commit/aa4eeb8)) * **core** Introduce new `ProductVariantPriceUpdateStrategy` ([9099f35](https://github.com/vendure-ecommerce/vendure/commit/9099f35)), closes [#2651](https://github.com/vendure-ecommerce/vendure/issues/2651) ## 2.2.0-next.2 (2024-02-07) #### Fixes * **admin-ui** Add missing RTL compatibility to some admin-ui components (#2451) ([96eb96e](https://github.com/vendure-ecommerce/vendure/commit/96eb96e)), closes [#2451](https://github.com/vendure-ecommerce/vendure/issues/2451) * **admin-ui** Fix alignment of order modification history item ([e4a172c](https://github.com/vendure-ecommerce/vendure/commit/e4a172c)) * **admin-ui** Improve styling of form field wrapper ([5263c2d](https://github.com/vendure-ecommerce/vendure/commit/5263c2d)) * **admin-ui** Improved support for modifying OrderLine custom fields ([0750fb1](https://github.com/vendure-ecommerce/vendure/commit/0750fb1)), closes [#2641](https://github.com/vendure-ecommerce/vendure/issues/2641) * **core** Fix undefined reference error in product variant resolver ([5afa6bc](https://github.com/vendure-ecommerce/vendure/commit/5afa6bc)) #### Features * **admin-ui** Allow customer to be reassigned to order ([a9a596e](https://github.com/vendure-ecommerce/vendure/commit/a9a596e)), closes [#2505](https://github.com/vendure-ecommerce/vendure/issues/2505) * **admin-ui** Allow order shipping method to be modified ([7f34329](https://github.com/vendure-ecommerce/vendure/commit/7f34329)), closes [#978](https://github.com/vendure-ecommerce/vendure/issues/978) * **admin-ui** Enable multiple refunds on an order modification ([9b3aa65](https://github.com/vendure-ecommerce/vendure/commit/9b3aa65)), closes [#2393](https://github.com/vendure-ecommerce/vendure/issues/2393) * **admin-ui** Improve layout & styling of order payment cards ([4a8b91a](https://github.com/vendure-ecommerce/vendure/commit/4a8b91a)) * **admin-ui** Improve styling of order/customer history timeline ([aeebbdd](https://github.com/vendure-ecommerce/vendure/commit/aeebbdd)) * **admin-ui** Improved refund dialog ([ccbf9ec](https://github.com/vendure-ecommerce/vendure/commit/ccbf9ec)), closes [#2393](https://github.com/vendure-ecommerce/vendure/issues/2393) * **admin-ui** Support custom fields on custom entities ([74aeb86](https://github.com/vendure-ecommerce/vendure/commit/74aeb86)), closes [#1848](https://github.com/vendure-ecommerce/vendure/issues/1848) * **admin-ui** Updated order modification screen with improved UX ([ac4c762](https://github.com/vendure-ecommerce/vendure/commit/ac4c762)) * **core** Add support for custom fields on ProductVariantPrice (#2654) ([e7f0fe2](https://github.com/vendure-ecommerce/vendure/commit/e7f0fe2)), closes [#2654](https://github.com/vendure-ecommerce/vendure/issues/2654) * **core** Add `amount` field to `RefundOrderInput` ([fe43b4a](https://github.com/vendure-ecommerce/vendure/commit/fe43b4a)), closes [#2393](https://github.com/vendure-ecommerce/vendure/issues/2393) * **core** Add `gracefulShutdownTimeout` to DefaultJobQueuePlugin ([cba06e0](https://github.com/vendure-ecommerce/vendure/commit/cba06e0)) * **core** Add cancellation handling to built-in jobs ([c8022be](https://github.com/vendure-ecommerce/vendure/commit/c8022be)), closes [#1127](https://github.com/vendure-ecommerce/vendure/issues/1127) [#2650](https://github.com/vendure-ecommerce/vendure/issues/2650) * **core** Allow order shipping method to be modified ([400d78a](https://github.com/vendure-ecommerce/vendure/commit/400d78a)), closes [#978](https://github.com/vendure-ecommerce/vendure/issues/978) * **core** Enable multiple refunds on an order modification ([cf91a9e](https://github.com/vendure-ecommerce/vendure/commit/cf91a9e)), closes [#2393](https://github.com/vendure-ecommerce/vendure/issues/2393) * **core** Expose entityCustomFields query ([01f9d44](https://github.com/vendure-ecommerce/vendure/commit/01f9d44)), closes [#1848](https://github.com/vendure-ecommerce/vendure/issues/1848) * **core** Implement `setOrderCustomer` mutation ([26e77d7](https://github.com/vendure-ecommerce/vendure/commit/26e77d7)), closes [#2505](https://github.com/vendure-ecommerce/vendure/issues/2505) * **core** Improve cancellation mechanism of DefaultJobQueuePlugin ([cba069b](https://github.com/vendure-ecommerce/vendure/commit/cba069b)), closes [#1127](https://github.com/vendure-ecommerce/vendure/issues/1127) [#2650](https://github.com/vendure-ecommerce/vendure/issues/2650) * **core** Introduce ErrorHandlerStrategy ([066e524](https://github.com/vendure-ecommerce/vendure/commit/066e524)) * **core** Pass RequestContext to custom field validate function ([2314ff6](https://github.com/vendure-ecommerce/vendure/commit/2314ff6)), closes [#2408](https://github.com/vendure-ecommerce/vendure/issues/2408) * **job-queue-plugin** Implement cancellation mechanism in BullMQJobQueuePlugin ([d0e97ca](https://github.com/vendure-ecommerce/vendure/commit/d0e97ca)), closes [#1127](https://github.com/vendure-ecommerce/vendure/issues/1127) [#2650](https://github.com/vendure-ecommerce/vendure/issues/2650) * **sentry-plugin** Use ErrorHandlerStrategy for better error coverage ([82ddf94](https://github.com/vendure-ecommerce/vendure/commit/82ddf94)) ## 2.2.0-next.1 (2024-01-16) #### Fixes - Includes all fixes from v2.1.6 #### Features * **admin-ui** Add support for Norwegian Bokmål (#2611) ([00d5315](https://github.com/vendure-ecommerce/vendure/commit/00d5315)), closes [#2611](https://github.com/vendure-ecommerce/vendure/issues/2611) * **admin-ui** Product & variant lists can be filtered by name & sku ([74293cb](https://github.com/vendure-ecommerce/vendure/commit/74293cb)), closes [#2519](https://github.com/vendure-ecommerce/vendure/issues/2519) * **core** Add `precision` property to MoneyStrategy ([c33ba63](https://github.com/vendure-ecommerce/vendure/commit/c33ba63)) * **core** Add SKU filtering to `products` list in Admin API ([876d1ec](https://github.com/vendure-ecommerce/vendure/commit/876d1ec)), closes [#2519](https://github.com/vendure-ecommerce/vendure/issues/2519) * **core** Expose `enabled` field for Product in shop api (#2541) ([f6f2975](https://github.com/vendure-ecommerce/vendure/commit/f6f2975)), closes [#2541](https://github.com/vendure-ecommerce/vendure/issues/2541) * **core** Expose additional bootstrap options (#2568) ([3b6d6ab](https://github.com/vendure-ecommerce/vendure/commit/3b6d6ab)), closes [#2568](https://github.com/vendure-ecommerce/vendure/issues/2568) * **core** Implement complex boolean list filtering for PaginatedLists ([c4bd484](https://github.com/vendure-ecommerce/vendure/commit/c4bd484)), closes [#2594](https://github.com/vendure-ecommerce/vendure/issues/2594) ## 2.2.0-next.0 (2023-12-14) #### Fixes * **email-plugin** Remove unwanted currency symbols in template (#2536) ([639fa0f](https://github.com/vendure-ecommerce/vendure/commit/639fa0f)), closes [#2536](https://github.com/vendure-ecommerce/vendure/issues/2536) * **ui-devkit** Add call to exit in sigint handler (#2558) ([bfd9281](https://github.com/vendure-ecommerce/vendure/commit/bfd9281)), closes [#2558](https://github.com/vendure-ecommerce/vendure/issues/2558) #### Features * **admin-ui** Add React useLazyQuery hook (#2498) ([757635b](https://github.com/vendure-ecommerce/vendure/commit/757635b)), closes [#2498](https://github.com/vendure-ecommerce/vendure/issues/2498) * **admin-ui** Allow configuration of available locales (#2550) ([dfddf0f](https://github.com/vendure-ecommerce/vendure/commit/dfddf0f)), closes [#2550](https://github.com/vendure-ecommerce/vendure/issues/2550) * **core** Accept `maxAge` and `expires` options in cookie config ([c903388](https://github.com/vendure-ecommerce/vendure/commit/c903388)), closes [#2518](https://github.com/vendure-ecommerce/vendure/issues/2518) * **core** Add Missing inherit filters field in collection import (#2534) ([ef64db7](https://github.com/vendure-ecommerce/vendure/commit/ef64db7)), closes [#2534](https://github.com/vendure-ecommerce/vendure/issues/2534) [#2484](https://github.com/vendure-ecommerce/vendure/issues/2484) * **core** Enable setting different cookie name for Shop & Admin API (#2482) ([ae91650](https://github.com/vendure-ecommerce/vendure/commit/ae91650)), closes [#2482](https://github.com/vendure-ecommerce/vendure/issues/2482) * **elasticsearch-plugin** Provide the ctx for custom mappings (#2547) ([c5d0ea2](https://github.com/vendure-ecommerce/vendure/commit/c5d0ea2)), closes [#2547](https://github.com/vendure-ecommerce/vendure/issues/2547) * **email-plugin** Multiple currency support in formatMoney helper (#2531) ([ccf17fb](https://github.com/vendure-ecommerce/vendure/commit/ccf17fb)), closes [#2531](https://github.com/vendure-ecommerce/vendure/issues/2531) * **job-queue-plugin** Improve pub/sub message handling (#2561) ([3645819](https://github.com/vendure-ecommerce/vendure/commit/3645819)), closes [#2561](https://github.com/vendure-ecommerce/vendure/issues/2561) * **payments-plugin** Mollie: support extra parameters for listing methods (#2516) ([cb9846b](https://github.com/vendure-ecommerce/vendure/commit/cb9846b)), closes [#2516](https://github.com/vendure-ecommerce/vendure/issues/2516) [#2510](https://github.com/vendure-ecommerce/vendure/issues/2510) ## 2.1.0-next.7 (2023-09-29) #### Features * **admin-ui** Add Persian/Farsi i18n messages (#2418) ([1193863](https://github.com/vendure-ecommerce/vendure/commit/1193863)), closes [#2418](https://github.com/vendure-ecommerce/vendure/issues/2418) #### Fixes * **core** Fix discount calculation error edge-case ([7549aad](https://github.com/vendure-ecommerce/vendure/commit/7549aad)), closes [#2385](https://github.com/vendure-ecommerce/vendure/issues/2385) ## 2.1.0-next.6 (2023-09-27) #### Features * **admin-ui** Add filter preset support to Collection list ([cbfb402](https://github.com/vendure-ecommerce/vendure/commit/cbfb402)) * **admin-ui** Display original quantity after order has been modified ([a36c6e0](https://github.com/vendure-ecommerce/vendure/commit/a36c6e0)) * **admin-ui** Implement job queue filtering by status ([baeb036](https://github.com/vendure-ecommerce/vendure/commit/baeb036)) * **admin-ui** Implement values pagination for Facet detail view ([4cf1826](https://github.com/vendure-ecommerce/vendure/commit/4cf1826)), closes [#1257](https://github.com/vendure-ecommerce/vendure/issues/1257) * **admin-ui** Improve naming & layout of catalog & stock locations ([8452300](https://github.com/vendure-ecommerce/vendure/commit/8452300)) * **core** Pass variant to ProductVariantPriceCalculationStrategy ([fee995c](https://github.com/vendure-ecommerce/vendure/commit/fee995c)), closes [#2398](https://github.com/vendure-ecommerce/vendure/issues/2398) * **create** Allow selection of package manager ([6561bb7](https://github.com/vendure-ecommerce/vendure/commit/6561bb7)) * **job-queue-plugin** Implement default cleanup of old BullMQ jobs ([6c1d7bb](https://github.com/vendure-ecommerce/vendure/commit/6c1d7bb)), closes [#1425](https://github.com/vendure-ecommerce/vendure/issues/1425) * **payments-plugin** Allow custom params to be passed to Stripe API ([1b29097](https://github.com/vendure-ecommerce/vendure/commit/1b29097)), closes [#2412](https://github.com/vendure-ecommerce/vendure/issues/2412) #### Fixes * **admin-ui** Correctly display job retries ([d3107fd](https://github.com/vendure-ecommerce/vendure/commit/d3107fd)), closes [#1467](https://github.com/vendure-ecommerce/vendure/issues/1467) * **job-queue-plugin** Correct behaviour of job list query with BullMQ ([c148a92](https://github.com/vendure-ecommerce/vendure/commit/c148a92)), closes [#2120](https://github.com/vendure-ecommerce/vendure/issues/2120) [#1327](https://github.com/vendure-ecommerce/vendure/issues/1327) * **job-queue-plugin** Correct retry setting for BullMQ jobs ([972ba0e](https://github.com/vendure-ecommerce/vendure/commit/972ba0e)), closes [#1467](https://github.com/vendure-ecommerce/vendure/issues/1467) ### BREAKING CHANGE * In the Admin UI, the "stock locations" list and detail views have been moved from the "catalog" module to the "settings" module. Also, the menu item & breadcrumb for "inventory" has been renamed to "products". This is an end-user breaking change rather than a code breaking change. Any UI extensions that link to a `/catalog/inventory/...` route will still work as there is a redirect in place to `/catalog/products/...`. ## 2.1.0-next.5 (2023-09-18) #### Features * **admin-ui** Add image carousel to asset preview dialog (#2370) ([bd834d0](https://github.com/vendure-ecommerce/vendure/commit/bd834d0)), closes [#2370](https://github.com/vendure-ecommerce/vendure/issues/2370) [#2129](https://github.com/vendure-ecommerce/vendure/issues/2129) * **admin-ui** Add more native React UI components ([04e03f8](https://github.com/vendure-ecommerce/vendure/commit/04e03f8)) * **admin-ui** Add useRouteParams react hook ([b63fb7f](https://github.com/vendure-ecommerce/vendure/commit/b63fb7f)) * **admin-ui** Expose providers to nav menu routerLink function ([1bae40e](https://github.com/vendure-ecommerce/vendure/commit/1bae40e)) * **admin-ui** Improved control over ActionBar buttons ([065a2b4](https://github.com/vendure-ecommerce/vendure/commit/065a2b4)) * **create** Better defaults for project scaffold ([fa683e7](https://github.com/vendure-ecommerce/vendure/commit/fa683e7)) * **cli** Introduce new `@vendure/cli` package which exposes a `vendure` binary. Currently supports `vendure new plugin` command. * **cli** Implement plugin scaffold command ([a6df4c1](https://github.com/vendure-ecommerce/vendure/commit/a6df4c1)) * **cli** Include custom CRUD permissions with plugin scaffold ([0c62b6f](https://github.com/vendure-ecommerce/vendure/commit/0c62b6f)) #### Fixes * **admin-ui** Fix component for new Angular extension route API ([6fe1bd0](https://github.com/vendure-ecommerce/vendure/commit/6fe1bd0)) * **admin-ui** Fix creating nullable string fields ([7e2c17a](https://github.com/vendure-ecommerce/vendure/commit/7e2c17a)), closes [#2343](https://github.com/vendure-ecommerce/vendure/issues/2343) * **core** Export EntityId and Money decorators ([4664dee](https://github.com/vendure-ecommerce/vendure/commit/4664dee)) ## 2.1.0-next.4 (2023-09-08) #### Fixes * **ui-devkit** Fix scaffold logic for custom providers ([2f2ddb5](https://github.com/vendure-ecommerce/vendure/commit/2f2ddb5)) ## 2.1.0-next.3 (2023-09-08) #### Fixes * **admin-ui** Add custom field support to Customer list ([97ba022](https://github.com/vendure-ecommerce/vendure/commit/97ba022)) * **admin-ui** Fix channel switcher icon style ([7f30361](https://github.com/vendure-ecommerce/vendure/commit/7f30361)) * **admin-ui** Fix error when data table filters not defined ([2425a33](https://github.com/vendure-ecommerce/vendure/commit/2425a33)) * **admin-ui** Fix styling of custom field tabs ([57f47df](https://github.com/vendure-ecommerce/vendure/commit/57f47df)) * **admin-ui** Give all data table columns immutable ids ([73a78db](https://github.com/vendure-ecommerce/vendure/commit/73a78db)) * **admin-ui** Use correct defaults for nullable custom fields (#2360) ([88430e5](https://github.com/vendure-ecommerce/vendure/commit/88430e5)), closes [#2360](https://github.com/vendure-ecommerce/vendure/issues/2360) * **core** Downgrade ForbiddenError from Error to Warn log level ([c186392](https://github.com/vendure-ecommerce/vendure/commit/c186392)), closes [#2383](https://github.com/vendure-ecommerce/vendure/issues/2383) * **core** Fix channel association on promotion update (#2376) ([e1ff2c7](https://github.com/vendure-ecommerce/vendure/commit/e1ff2c7)), closes [#2376](https://github.com/vendure-ecommerce/vendure/issues/2376) #### Features * **admin-ui** Add initial React support for UI extensions ([1075dd7](https://github.com/vendure-ecommerce/vendure/commit/1075dd7)) * **admin-ui** Allow custom components in data table columns ([d3474dd](https://github.com/vendure-ecommerce/vendure/commit/d3474dd)), closes [#2347](https://github.com/vendure-ecommerce/vendure/issues/2347) [#2353](https://github.com/vendure-ecommerce/vendure/issues/2353) * **admin-ui** Allow custom React components in data table columns ([5cde775](https://github.com/vendure-ecommerce/vendure/commit/5cde775)), closes [#2347](https://github.com/vendure-ecommerce/vendure/issues/2347) [#2353](https://github.com/vendure-ecommerce/vendure/issues/2353) * **admin-ui** Implement custom components in Collection data table ([4ab7c1e](https://github.com/vendure-ecommerce/vendure/commit/4ab7c1e)) * **admin-ui** Implement react Card component ([c588a1f](https://github.com/vendure-ecommerce/vendure/commit/c588a1f)) * **admin-ui** Implement simplified API for UI route extensions ([b9ca367](https://github.com/vendure-ecommerce/vendure/commit/b9ca367)) * **admin-ui** Improve dev mode extension point display ([4678930](https://github.com/vendure-ecommerce/vendure/commit/4678930)) * **admin-ui** Initial support for React UI extensions ([83d5756](https://github.com/vendure-ecommerce/vendure/commit/83d5756)) * **admin-ui** Style improvements to table and form input borders ([5287287](https://github.com/vendure-ecommerce/vendure/commit/5287287)) * **admin-ui** Support for React-based custom detail components ([55d9ffc](https://github.com/vendure-ecommerce/vendure/commit/55d9ffc)) * **core** Support bi-directional relations in customFields (#2365) ([0313ce5](https://github.com/vendure-ecommerce/vendure/commit/0313ce5)), closes [#2365](https://github.com/vendure-ecommerce/vendure/issues/2365) * **ui-devkit** Add experimental wrapper for shared ui providers ([daf6f8c](https://github.com/vendure-ecommerce/vendure/commit/daf6f8c)) ## 2.1.0-next.2 (2023-08-28) #### Fixes * **core** Fix resolution of facet valueList for postgres ([1d8fe47](https://github.com/vendure-ecommerce/vendure/commit/1d8fe47)) ## 2.1.0-next.1 (2023-08-28) #### Fixes * **admin-ui** Correct handling of ID filters in data tables ([0e05496](https://github.com/vendure-ecommerce/vendure/commit/0e05496)) * **admin-ui** Data table filters react to page navigation ([39832bd](https://github.com/vendure-ecommerce/vendure/commit/39832bd)) * **core** Fix circular dependency issue in SQLiteSearchStrategy ([f2e2e32](https://github.com/vendure-ecommerce/vendure/commit/f2e2e32)) #### Features * **admin-ui** Add data table filter presets functionality ([a656ef2](https://github.com/vendure-ecommerce/vendure/commit/a656ef2)) * **admin-ui** Implement drag-and-drop reorder of filter presets ([8e06705](https://github.com/vendure-ecommerce/vendure/commit/8e06705)) * **admin-ui** Implement filter preset renaming ([8b52e6f](https://github.com/vendure-ecommerce/vendure/commit/8b52e6f)) * **admin-ui** Implement relative date filtering ([d07a5f3](https://github.com/vendure-ecommerce/vendure/commit/d07a5f3)) * **admin-ui** Update to Angular v16.2 ([608d5d3](https://github.com/vendure-ecommerce/vendure/commit/608d5d3)) * **core** Update NestJS to v10, Apollo Server v4 ([b675fda](https://github.com/vendure-ecommerce/vendure/commit/b675fda)) ### BREAKING CHANGE * The update of Apollo Server to v4 includes some breaking changes if you have defined any custom ApolloServerPlugins. See the Apollo migration guide for full details: https://www.apollographql.com/docs/apollo-server/migration/ ## 2.1.0-next.0 (2023-08-11) Includes all changes from v2.0.6, plus: #### Features * **admin-ui** Admin UI rtl with Arabic translation improvements (#2322) ([44ea12b](https://github.com/vendure-ecommerce/vendure/commit/44ea12b)), closes [#2322](https://github.com/vendure-ecommerce/vendure/issues/2322) * **core** Add `Facet.valueList` resolver for paginated values ([09c7175](https://github.com/vendure-ecommerce/vendure/commit/09c7175)), closes [#1257](https://github.com/vendure-ecommerce/vendure/issues/1257) * **core** Add maximum coupon usage (#2331) ([bdd2720](https://github.com/vendure-ecommerce/vendure/commit/bdd2720)), closes [#2331](https://github.com/vendure-ecommerce/vendure/issues/2331) [#2330](https://github.com/vendure-ecommerce/vendure/issues/2330) * **email-plugin** Expose template vars to template loader (#2243) ([78ea016](https://github.com/vendure-ecommerce/vendure/commit/78ea016)), closes [#2243](https://github.com/vendure-ecommerce/vendure/issues/2243) [#2242](https://github.com/vendure-ecommerce/vendure/issues/2242) #### Fixes * **admin-ui** Improve RTL styles ([056d205](https://github.com/vendure-ecommerce/vendure/commit/056d205)) * **admin-ui** Limit FacetValues in Facet list component ([b445955](https://github.com/vendure-ecommerce/vendure/commit/b445955)), closes [#1257](https://github.com/vendure-ecommerce/vendure/issues/1257)
## <small>1.9.7 (2023-05-19)</small> #### Fixes * **create** Update community link to point to new Discord server #### Features * **payments-plugin** Add metadata field to StripePluginOptions (#2157) ([21baa0a](https://github.com/vendure-ecommerce/vendure/commit/21baa0a)), closes [#2157](https://github.com/vendure-ecommerce/vendure/issues/2157) [#1935](https://github.com/vendure-ecommerce/vendure/issues/1935) ## <small>1.9.6 (2023-04-28)</small> #### Fixes * **admin-ui** Add branding to welcome page (#2115) ([f0f8769](https://github.com/vendure-ecommerce/vendure/commit/f0f8769)), closes [#2115](https://github.com/vendure-ecommerce/vendure/issues/2115) [#2040](https://github.com/vendure-ecommerce/vendure/issues/2040) * **asset-server-plugin** Change image format with no other transforms (#2104) ([6cf1608](https://github.com/vendure-ecommerce/vendure/commit/6cf1608)), closes [#2104](https://github.com/vendure-ecommerce/vendure/issues/2104) * **core** Fix error messages containing colon char ([2cfc874](https://github.com/vendure-ecommerce/vendure/commit/2cfc874)), closes [#2153](https://github.com/vendure-ecommerce/vendure/issues/2153) #### Features * **admin-ui** Implement custom fields updating of ProductOptionGroup and ProductOption entities ([d2a0824](https://github.com/vendure-ecommerce/vendure/commit/d2a0824)) * **admin-ui** Search field added on administrators list on dashboard -> administrator. (#2130) ([0cc20f2](https://github.com/vendure-ecommerce/vendure/commit/0cc20f2)), closes [#2130](https://github.com/vendure-ecommerce/vendure/issues/2130) ## <small>1.9.5 (2023-03-24)</small> #### Fixes * **payments-plugin** Fix issue with handling of partial payments in Mollie. If you are using the MolliePlugin you should update as a priority. ([#2092](https://github.com/vendure-ecommerce/vendure/pull/2092)) ## <small>1.9.4 (2023-03-22)</small> #### Fixes * **admin-ui** Re-fetch asset list on channel change ([e909725](https://github.com/vendure-ecommerce/vendure/commit/e909725)) * **core** Correctly validate couponCode when adding guest customer ([a0458e2](https://github.com/vendure-ecommerce/vendure/commit/a0458e2)) * **core** Do not double-refund payments when refund total not covered ([64372da](https://github.com/vendure-ecommerce/vendure/commit/64372da)) * **core** Filter out deleted options groups (#2047) ([d93203c](https://github.com/vendure-ecommerce/vendure/commit/d93203c)), closes [#2047](https://github.com/vendure-ecommerce/vendure/issues/2047) * **core** Merge relations in customFields correctly (#2062) ([aeb06e3](https://github.com/vendure-ecommerce/vendure/commit/aeb06e3)), closes [#2062](https://github.com/vendure-ecommerce/vendure/issues/2062) * **core** Slugify product created with fast importer service (#2091) ([8e9f4d6](https://github.com/vendure-ecommerce/vendure/commit/8e9f4d6)), closes [#2091](https://github.com/vendure-ecommerce/vendure/issues/2091) * **payments-plugin** Handle multiple payments & verify stock for Mollie ([1aad00e](https://github.com/vendure-ecommerce/vendure/commit/1aad00e)), closes [#2026](https://github.com/vendure-ecommerce/vendure/issues/2026) [#2030](https://github.com/vendure-ecommerce/vendure/issues/2030) * **testing** Updated sql.js dependency (#2055) ([34ab54b](https://github.com/vendure-ecommerce/vendure/commit/34ab54b)), closes [#2055](https://github.com/vendure-ecommerce/vendure/issues/2055) ## <small>1.9.3 (2023-02-15)</small> #### Fixes * **admin-ui** Fix UI for long channel list tab on Administrator detail page (#2018) ([7fdd875](https://github.com/vendure-ecommerce/vendure/commit/7fdd875)), closes [#2018](https://github.com/vendure-ecommerce/vendure/issues/2018) * **admin-ui** Redirect to loginUrl if configured on Forbidden GraphQL error (#2012) ([53b78d2](https://github.com/vendure-ecommerce/vendure/commit/53b78d2)), closes [#2012](https://github.com/vendure-ecommerce/vendure/issues/2012) * **core** Fix auth of admin and customer users with the same email (#2016) ([3c76b2f](https://github.com/vendure-ecommerce/vendure/commit/3c76b2f)), closes [#2016](https://github.com/vendure-ecommerce/vendure/issues/2016) * **core** Fix deletion of product options (#2017) ([a3698b5](https://github.com/vendure-ecommerce/vendure/commit/a3698b5)), closes [#2017](https://github.com/vendure-ecommerce/vendure/issues/2017) * **payments-plugin** Improve handling of Braintree customerId errors ([4d9f49e](https://github.com/vendure-ecommerce/vendure/commit/4d9f49e)) #### Features * **asset-server-plugin** Add configurable Cache-Control header (#2005) ([316d04d](https://github.com/vendure-ecommerce/vendure/commit/316d04d)), closes [#2005](https://github.com/vendure-ecommerce/vendure/issues/2005) ## <small>1.9.2 (2023-01-18)</small> #### Fixes * **core** Fix collection delete for big collection (#1966) ([6541975](https://github.com/vendure-ecommerce/vendure/commit/6541975)), closes [#1966](https://github.com/vendure-ecommerce/vendure/issues/1966) [#1961](https://github.com/vendure-ecommerce/vendure/issues/1961) * **core** Fix deletion of guest Customers ([cbc500f](https://github.com/vendure-ecommerce/vendure/commit/cbc500f)), closes [#1960](https://github.com/vendure-ecommerce/vendure/issues/1960) * **core** Fix interop issues between native and external auth (#1968) ([82f6b61](https://github.com/vendure-ecommerce/vendure/commit/82f6b61)), closes [#1968](https://github.com/vendure-ecommerce/vendure/issues/1968) * **core** Validate OrderLine custom fields in ShopAPI mutations ([d272255](https://github.com/vendure-ecommerce/vendure/commit/d272255)), closes [#1953](https://github.com/vendure-ecommerce/vendure/issues/1953) * **create** Improve example dockerfile & docs ([86770d1](https://github.com/vendure-ecommerce/vendure/commit/86770d1)) * **email-plugin** Fix generation of test emails ([80da8e0](https://github.com/vendure-ecommerce/vendure/commit/80da8e0)), closes [#1931](https://github.com/vendure-ecommerce/vendure/issues/1931) * **payments-plugin** Calculate tax per order line instead of per unit for Mollie (#1958) ([16b17b6](https://github.com/vendure-ecommerce/vendure/commit/16b17b6)), closes [#1958](https://github.com/vendure-ecommerce/vendure/issues/1958) [#1939](https://github.com/vendure-ecommerce/vendure/issues/1939) ## <small>1.9.1 (2022-12-08)</small> #### Fixes * **admin-ui** Attribution via utm parameters for Unsplash production approval (#1917) ([d3c76d3](https://github.com/vendure-ecommerce/vendure/commit/d3c76d3)), closes [#1917](https://github.com/vendure-ecommerce/vendure/issues/1917) * **admin-ui** Fix bug in setting variant assets ([ed988d3](https://github.com/vendure-ecommerce/vendure/commit/ed988d3)) * **admin-ui** Update variant pagination controls when filtering ([0a4f330](https://github.com/vendure-ecommerce/vendure/commit/0a4f330)) * **core** Call lifecycle hooks on ChangedPriceHandlingStrategy ([75a695e](https://github.com/vendure-ecommerce/vendure/commit/75a695e)), closes [#1916](https://github.com/vendure-ecommerce/vendure/issues/1916) * **core** Correctly decode list query ID operators ([9f9b0e6](https://github.com/vendure-ecommerce/vendure/commit/9f9b0e6)), closes [#1922](https://github.com/vendure-ecommerce/vendure/issues/1922) * **core** Fix postgres error when filtering list with empty set ([10c05cf](https://github.com/vendure-ecommerce/vendure/commit/10c05cf)) * **core** ListQueryOptions type detects nullable fields on entity ([d6e5696](https://github.com/vendure-ecommerce/vendure/commit/d6e5696)), closes [#1834](https://github.com/vendure-ecommerce/vendure/issues/1834) * **core** Order calculator supports multiple shipping lines ([06e2be2](https://github.com/vendure-ecommerce/vendure/commit/06e2be2)), closes [#1897](https://github.com/vendure-ecommerce/vendure/issues/1897) * **core** Prevent out of stock variants from being purchased ([eb3964c](https://github.com/vendure-ecommerce/vendure/commit/eb3964c)), closes [#1738](https://github.com/vendure-ecommerce/vendure/issues/1738) ## 1.9.0 (2022-12-01) #### Fixes * **admin-ui** Add links according to Unsplash guidelines (#1911) ([e703304](https://github.com/vendure-ecommerce/vendure/commit/e703304)), closes [#1911](https://github.com/vendure-ecommerce/vendure/issues/1911) * **core** Fix creation of superadmin ([416e03a](https://github.com/vendure-ecommerce/vendure/commit/416e03a)) * **core** Importing custom boolean field works as intended (#1908) ([5114563](https://github.com/vendure-ecommerce/vendure/commit/5114563)), closes [#1908](https://github.com/vendure-ecommerce/vendure/issues/1908) #### Features * **admin-ui** Add default component for custom history entries ([cd8d5a2](https://github.com/vendure-ecommerce/vendure/commit/cd8d5a2)), closes [#1694](https://github.com/vendure-ecommerce/vendure/issues/1694) * **admin-ui** Allow custom components for Customer history timeline ([eeba323](https://github.com/vendure-ecommerce/vendure/commit/eeba323)), closes [#1694](https://github.com/vendure-ecommerce/vendure/issues/1694) [#432](https://github.com/vendure-ecommerce/vendure/issues/432) * **admin-ui** Allow custom components for Order history timeline ([fc7bcf1](https://github.com/vendure-ecommerce/vendure/commit/fc7bcf1)), closes [#1694](https://github.com/vendure-ecommerce/vendure/issues/1694) [#432](https://github.com/vendure-ecommerce/vendure/issues/432) * **admin-ui** Login UI refresh (#1862) ([72febce](https://github.com/vendure-ecommerce/vendure/commit/72febce)), closes [#1862](https://github.com/vendure-ecommerce/vendure/issues/1862) * **core** Add facetValues list query ([ddab719](https://github.com/vendure-ecommerce/vendure/commit/ddab719)), closes [#1404](https://github.com/vendure-ecommerce/vendure/issues/1404) * **core** Custom Order/Customer history entries can be defined ([d9e1770](https://github.com/vendure-ecommerce/vendure/commit/d9e1770)), closes [#1694](https://github.com/vendure-ecommerce/vendure/issues/1694) [#432](https://github.com/vendure-ecommerce/vendure/issues/432) * **core** Expose config for internal TaxRate cache ([454e905](https://github.com/vendure-ecommerce/vendure/commit/454e905)), closes [#1856](https://github.com/vendure-ecommerce/vendure/issues/1856) * **core** Implement ActiveOrderStrategy ([e62009f](https://github.com/vendure-ecommerce/vendure/commit/e62009f)), closes [#1858](https://github.com/vendure-ecommerce/vendure/issues/1858) * **core** Implement null filters on PaginatedList queries ([3906cbf](https://github.com/vendure-ecommerce/vendure/commit/3906cbf)), closes [#1490](https://github.com/vendure-ecommerce/vendure/issues/1490) * **elasticsearch-plugin** Independently access customMappings (#1909) ([6c1c83a](https://github.com/vendure-ecommerce/vendure/commit/6c1c83a)), closes [#1909](https://github.com/vendure-ecommerce/vendure/issues/1909) * **email-plugin** Add support for AWS SES transport (#1877) ([e516660](https://github.com/vendure-ecommerce/vendure/commit/e516660)), closes [#1877](https://github.com/vendure-ecommerce/vendure/issues/1877) * **payments-plugin** Use Mollie's Order API (#1884) ([56b8646](https://github.com/vendure-ecommerce/vendure/commit/56b8646)), closes [#1884](https://github.com/vendure-ecommerce/vendure/issues/1884) #### Perf * **admin-ui** Lazy-load facet values for selector component ([3350608](https://github.com/vendure-ecommerce/vendure/commit/3350608)), closes [#1404](https://github.com/vendure-ecommerce/vendure/issues/1404) ## <small>1.8.5 (2022-11-28)</small> #### Fixes * **admin-ui** Do not display form errors for pristine fields ([f15028a](https://github.com/vendure-ecommerce/vendure/commit/f15028a)), closes [#1901](https://github.com/vendure-ecommerce/vendure/issues/1901) * **core** Fix error when populating initial roles ([41cfaf8](https://github.com/vendure-ecommerce/vendure/commit/41cfaf8)), closes [#1905](https://github.com/vendure-ecommerce/vendure/issues/1905) * **core** Fix loading eager custom fields for `order` query ([93b8601](https://github.com/vendure-ecommerce/vendure/commit/93b8601)), closes [#1664](https://github.com/vendure-ecommerce/vendure/issues/1664) * **core** ListQueryBuilder handles empty in operator ([229afff](https://github.com/vendure-ecommerce/vendure/commit/229afff)) * **core** Make order of OrderLine from OrderService.findOne deterministic (#1904) ([2d06390](https://github.com/vendure-ecommerce/vendure/commit/2d06390)), closes [#1904](https://github.com/vendure-ecommerce/vendure/issues/1904) #### Perf * **core** Improve speed & memory usage when running collection filters ([464dcea](https://github.com/vendure-ecommerce/vendure/commit/464dcea)), closes [#1893](https://github.com/vendure-ecommerce/vendure/issues/1893) * **core** Use TypeORM relation query builder when filtering collection ([8aa7201](https://github.com/vendure-ecommerce/vendure/commit/8aa7201)), closes [#1893](https://github.com/vendure-ecommerce/vendure/issues/1893) ## <small>1.8.4 (2022-11-18)</small> #### Fixes * **admin-ui** Allow creation of Administrator without update permission ([8ea8e47](https://github.com/vendure-ecommerce/vendure/commit/8ea8e47)), closes [#1875](https://github.com/vendure-ecommerce/vendure/issues/1875) * **admin-ui** Fix edge case errors when facet value detail editing ([3e56f06](https://github.com/vendure-ecommerce/vendure/commit/3e56f06)) * **core** AuthGuard correctly handles subscriptions ([96d10b3](https://github.com/vendure-ecommerce/vendure/commit/96d10b3)) * **core** Fix creation of superadmin ([5fee35b](https://github.com/vendure-ecommerce/vendure/commit/5fee35b)) * **core** Fix injectable hooks on TaxLineCalculationStrategy (#1882) ([77163eb](https://github.com/vendure-ecommerce/vendure/commit/77163eb)), closes [#1882](https://github.com/vendure-ecommerce/vendure/issues/1882) [#1871](https://github.com/vendure-ecommerce/vendure/issues/1871) * **core** Fix permission escalation when creating Roles/Admins ([8f12142](https://github.com/vendure-ecommerce/vendure/commit/8f12142)), closes [#1874](https://github.com/vendure-ecommerce/vendure/issues/1874) * **payments-plugin** Return 200 on Stripe payment failed event (#1878) ([ec205ea](https://github.com/vendure-ecommerce/vendure/commit/ec205ea)), closes [#1878](https://github.com/vendure-ecommerce/vendure/issues/1878) * **ui-devkit** Update scaffolding to use correct eslib (#1886) ([30f79af](https://github.com/vendure-ecommerce/vendure/commit/30f79af)), closes [#1886](https://github.com/vendure-ecommerce/vendure/issues/1886) [#1859](https://github.com/vendure-ecommerce/vendure/issues/1859) #### Perf * **admin-ui** Load only first page of customer orders ([0c9b60e](https://github.com/vendure-ecommerce/vendure/commit/0c9b60e)), closes [#1769](https://github.com/vendure-ecommerce/vendure/issues/1769) * **core** Trim payload of Job type to omit verbose ctx data ([c25a1e3](https://github.com/vendure-ecommerce/vendure/commit/c25a1e3)), closes [#1376](https://github.com/vendure-ecommerce/vendure/issues/1376) ## <small>1.8.3 (2022-11-10)</small> #### Fixes * **admin-ui** Fix critical FacetValue deletion issue ([1e443e2](https://github.com/vendure-ecommerce/vendure/commit/1e443e2)) * **admin-ui** Sort orders on customer details page ([d67e1ff](https://github.com/vendure-ecommerce/vendure/commit/d67e1ff)), closes [#1827](https://github.com/vendure-ecommerce/vendure/issues/1827) * **asset-server-plugin** Better error message for s3 bucket errors ([adf58b4](https://github.com/vendure-ecommerce/vendure/commit/adf58b4)) * **asset-server-plugin** Update Sharp version to fix mac m1 issue ([b76515b](https://github.com/vendure-ecommerce/vendure/commit/b76515b)), closes [#1866](https://github.com/vendure-ecommerce/vendure/issues/1866) * **core** Add resolver for `Zone.members` field ([3b67e61](https://github.com/vendure-ecommerce/vendure/commit/3b67e61)) * **core** Allow ext. auth to find customer on any channel ([2445a89](https://github.com/vendure-ecommerce/vendure/commit/2445a89)), closes [#961](https://github.com/vendure-ecommerce/vendure/issues/961) * **core** Ensure deleted entities in events include ids ([265bb15](https://github.com/vendure-ecommerce/vendure/commit/265bb15)) * **core** Fix foreign key violation error when removing draft order line ([403ab2c](https://github.com/vendure-ecommerce/vendure/commit/403ab2c)), closes [#1855](https://github.com/vendure-ecommerce/vendure/issues/1855) * **core** Fix multiple refunds bug when modifying orders ([f18fedd](https://github.com/vendure-ecommerce/vendure/commit/f18fedd)), closes [#1753](https://github.com/vendure-ecommerce/vendure/issues/1753) * **core** Fix order incorrect refund amount when modifying Order ([b1486e8](https://github.com/vendure-ecommerce/vendure/commit/b1486e8)), closes [#1865](https://github.com/vendure-ecommerce/vendure/issues/1865) * **core** Improved feedback on FacetValue deletion confirmation ([03419cb](https://github.com/vendure-ecommerce/vendure/commit/03419cb)) * **core** Make order modification items deterministic ([14d0a22](https://github.com/vendure-ecommerce/vendure/commit/14d0a22)), closes [#1760](https://github.com/vendure-ecommerce/vendure/issues/1760) * **core** Publish event when deleting FacetValue ([0ece03b](https://github.com/vendure-ecommerce/vendure/commit/0ece03b)) ## <small>1.8.2 (2022-11-01)</small> #### Fixes * **admin-ui** Display descriptions for custom fields ([aaeb43d](https://github.com/vendure-ecommerce/vendure/commit/aaeb43d)) * **admin-ui** Fix getting custom fields in Zone dialog ([a919555](https://github.com/vendure-ecommerce/vendure/commit/a919555)) * **core** Fix edge case with nested eager custom field relations ([ca9848c](https://github.com/vendure-ecommerce/vendure/commit/ca9848c)), closes [#1664](https://github.com/vendure-ecommerce/vendure/issues/1664) * **core** Fix nested relations in ListQueryBuilder customPropertyMap ([839fa37](https://github.com/vendure-ecommerce/vendure/commit/839fa37)), closes [#1851](https://github.com/vendure-ecommerce/vendure/issues/1851) [#1774](https://github.com/vendure-ecommerce/vendure/issues/1774) ## <small>1.8.1 (2022-10-26)</small> This release corrects a publishing error with the `@vendure/admin-ui` packages. There are no code changes in this release. ## 1.8.0 (2022-10-26) #### Features * **admin-ui** Add basic table support to rich text editor ([09f8482](https://github.com/vendure-ecommerce/vendure/commit/09f8482)), closes [#1716](https://github.com/vendure-ecommerce/vendure/issues/1716) * **admin-ui** Add context menu for images in rich text editor ([5b09abd](https://github.com/vendure-ecommerce/vendure/commit/5b09abd)), closes [#1716](https://github.com/vendure-ecommerce/vendure/issues/1716) * **admin-ui** Add context menu for table operations ([7b68300](https://github.com/vendure-ecommerce/vendure/commit/7b68300)), closes [#1716](https://github.com/vendure-ecommerce/vendure/issues/1716) * **admin-ui** Add support for bulk collection actions ([220cf1c](https://github.com/vendure-ecommerce/vendure/commit/220cf1c)), closes [#853](https://github.com/vendure-ecommerce/vendure/issues/853) * **admin-ui** Add support for bulk facet channel assignment/removal ([647857c](https://github.com/vendure-ecommerce/vendure/commit/647857c)), closes [#853](https://github.com/vendure-ecommerce/vendure/issues/853) * **admin-ui** Add support for bulk facet deletion ([3c6cd9b](https://github.com/vendure-ecommerce/vendure/commit/3c6cd9b)), closes [#853](https://github.com/vendure-ecommerce/vendure/issues/853) * **admin-ui** Add support for bulk product channel assignment ([6ee74e4](https://github.com/vendure-ecommerce/vendure/commit/6ee74e4)), closes [#853](https://github.com/vendure-ecommerce/vendure/issues/853) * **admin-ui** Add support for bulk product deletion ([47fa230](https://github.com/vendure-ecommerce/vendure/commit/47fa230)), closes [#853](https://github.com/vendure-ecommerce/vendure/issues/853) * **admin-ui** Add support for bulk product facet editing ([0d1b592](https://github.com/vendure-ecommerce/vendure/commit/0d1b592)), closes [#853](https://github.com/vendure-ecommerce/vendure/issues/853) * **admin-ui** Add support for shift-select to DataTableComponent ([87f4062](https://github.com/vendure-ecommerce/vendure/commit/87f4062)), closes [#853](https://github.com/vendure-ecommerce/vendure/issues/853) * **admin-ui** Create supporting infrastructure for bulk actions API ([7b8d072](https://github.com/vendure-ecommerce/vendure/commit/7b8d072)) * **admin-ui** Display breadcrumbs in Collection detail view ([5ff4c47](https://github.com/vendure-ecommerce/vendure/commit/5ff4c47)) * **admin-ui** Draft Order creation UI ([d15cd34](https://github.com/vendure-ecommerce/vendure/commit/d15cd34)), closes [#1453](https://github.com/vendure-ecommerce/vendure/issues/1453) * **admin-ui** Enable overriding of default dashboard widget permissions ([c946b61](https://github.com/vendure-ecommerce/vendure/commit/c946b61)), closes [#1832](https://github.com/vendure-ecommerce/vendure/issues/1832) * **admin-ui** Exclude draft UI controls if Draft state not configured ([5ef9912](https://github.com/vendure-ecommerce/vendure/commit/5ef9912)), closes [#1453](https://github.com/vendure-ecommerce/vendure/issues/1453) * **admin-ui** Implement raw HTML editing support in rich text editor ([e9f7fcd](https://github.com/vendure-ecommerce/vendure/commit/e9f7fcd)), closes [#1716](https://github.com/vendure-ecommerce/vendure/issues/1716) * **admin-ui** Improve styling of rich text editor ([054aba4](https://github.com/vendure-ecommerce/vendure/commit/054aba4)) * **admin-ui** Support CustomDetailComponent on admin profile page ([8b7bf26](https://github.com/vendure-ecommerce/vendure/commit/8b7bf26)) * **admin-ui** Various styling fixes ([07acfbd](https://github.com/vendure-ecommerce/vendure/commit/07acfbd)) * **core** Add bulk collection delete mutation ([98b4c57](https://github.com/vendure-ecommerce/vendure/commit/98b4c57)), closes [#853](https://github.com/vendure-ecommerce/vendure/issues/853) * **core** Add bulk facet delete mutation ([4a1a2f5](https://github.com/vendure-ecommerce/vendure/commit/4a1a2f5)), closes [#853](https://github.com/vendure-ecommerce/vendure/issues/853) * **core** Add bulk product deletion mutations ([d5f5490](https://github.com/vendure-ecommerce/vendure/commit/d5f5490)), closes [#853](https://github.com/vendure-ecommerce/vendure/issues/853) * **core** Add bulk product update mutation ([fe007e2](https://github.com/vendure-ecommerce/vendure/commit/fe007e2)), closes [#853](https://github.com/vendure-ecommerce/vendure/issues/853) * **core** Add Facet/Collection Channel assignment mutations ([34840c9](https://github.com/vendure-ecommerce/vendure/commit/34840c9)) * **core** Add support for custom fields on draft orders ([43421c6](https://github.com/vendure-ecommerce/vendure/commit/43421c6)), closes [#1453](https://github.com/vendure-ecommerce/vendure/issues/1453) * **core** Add support for PromotionAction side effects ([81426fa](https://github.com/vendure-ecommerce/vendure/commit/81426fa)), closes [#1798](https://github.com/vendure-ecommerce/vendure/issues/1798) * **core** Export prorate function (#1783) ([d86fa29](https://github.com/vendure-ecommerce/vendure/commit/d86fa29)), closes [#1783](https://github.com/vendure-ecommerce/vendure/issues/1783) * **core** Implement APIs for draft order creation ([cb8ae03](https://github.com/vendure-ecommerce/vendure/commit/cb8ae03)), closes [#1453](https://github.com/vendure-ecommerce/vendure/issues/1453) * **core** Implement deletion of draft Orders ([dec00b1](https://github.com/vendure-ecommerce/vendure/commit/dec00b1)), closes [#1453](https://github.com/vendure-ecommerce/vendure/issues/1453) * **core** Pass order arg to OrderItemPriceCalculationStrategy and ChangedPriceHandlingStrategy (#1749) ([01d99d3](https://github.com/vendure-ecommerce/vendure/commit/01d99d3)), closes [#1749](https://github.com/vendure-ecommerce/vendure/issues/1749) * **core** Pass Promotion instance to condition & action functions ([e70bb66](https://github.com/vendure-ecommerce/vendure/commit/e70bb66)), closes [#1787](https://github.com/vendure-ecommerce/vendure/issues/1787) * **email-plugin** Allow to override email language (#1775) ([54c41ac](https://github.com/vendure-ecommerce/vendure/commit/54c41ac)), closes [#1775](https://github.com/vendure-ecommerce/vendure/issues/1775) * **email-plugin** EmailGenerator now implements InjectableStrategy ([f9aa5d7](https://github.com/vendure-ecommerce/vendure/commit/f9aa5d7)), closes [#1767](https://github.com/vendure-ecommerce/vendure/issues/1767) * **email-plugin** EmailSender now implements InjectableStrategy ([0c30be2](https://github.com/vendure-ecommerce/vendure/commit/0c30be2)), closes [#1767](https://github.com/vendure-ecommerce/vendure/issues/1767) * **email-plugin** Use full Nodemailer SMTPTransport options (#1781) ([86b12bc](https://github.com/vendure-ecommerce/vendure/commit/86b12bc)), closes [#1781](https://github.com/vendure-ecommerce/vendure/issues/1781) * **payments-plugin** Add `includeCustomerId` metadata key to Braintree ([a94fc22](https://github.com/vendure-ecommerce/vendure/commit/a94fc22)) * **payments-plugin** Add Mollie paymentmethod selection (#1825) ([a7c4e64](https://github.com/vendure-ecommerce/vendure/commit/a7c4e64)), closes [#1825](https://github.com/vendure-ecommerce/vendure/issues/1825) * **payments-plugin** Add support for opting-out of Braintree vault ([faeef6d](https://github.com/vendure-ecommerce/vendure/commit/faeef6d)), closes [#1651](https://github.com/vendure-ecommerce/vendure/issues/1651) * **testing** Enable e2e test logging using the `LOG` env var ([5f5d133](https://github.com/vendure-ecommerce/vendure/commit/5f5d133)) #### Fixes * **admin-ui** Adjust rich text context menu sensitivity ([86442cf](https://github.com/vendure-ecommerce/vendure/commit/86442cf)) * **admin-ui** Do not allow adding/re-ording readonly list inputs ([61b29ae](https://github.com/vendure-ecommerce/vendure/commit/61b29ae)) * **admin-ui** Fix issues with rich text editor in custom field ([f350ad8](https://github.com/vendure-ecommerce/vendure/commit/f350ad8)) * **admin-ui** Fix rich text editor when used in custom field list ([77fef28](https://github.com/vendure-ecommerce/vendure/commit/77fef28)) * **core** Correctly handle decimal percentages on promotion actions ([41d4652](https://github.com/vendure-ecommerce/vendure/commit/41d4652)), closes [#1773](https://github.com/vendure-ecommerce/vendure/issues/1773) * **core** Ensure FacetValues also get assigned to channel ([1a2639e](https://github.com/vendure-ecommerce/vendure/commit/1a2639e)) * **core** Fix nested customField relations "alias was not found" error ([3c48263](https://github.com/vendure-ecommerce/vendure/commit/3c48263)), closes [#1664](https://github.com/vendure-ecommerce/vendure/issues/1664) * **core** Order fixed discount considers channel pricesIncludeTax (#1841) ([4a50461](https://github.com/vendure-ecommerce/vendure/commit/4a50461)), closes [#1841](https://github.com/vendure-ecommerce/vendure/issues/1841) #### Perf * **elasticsearch-plugin** Reduce memory usage when deleting products (#1838) ([ce078dd](https://github.com/vendure-ecommerce/vendure/commit/ce078dd)), closes [#1838](https://github.com/vendure-ecommerce/vendure/issues/1838) * **elasticsearch-plugin** Reduce memory usage when indexing products (#1839) ([95c72c1](https://github.com/vendure-ecommerce/vendure/commit/95c72c1)), closes [#1839](https://github.com/vendure-ecommerce/vendure/issues/1839) ## <small>1.7.4 (2022-10-11)</small> #### Perf * **core** Improve performance when querying product by slug ([742ad36](https://github.com/vendure-ecommerce/vendure/commit/742ad36)) #### Fixes * **admin-ui** Fix fix of ShippingMethod update error ([2367ab0](https://github.com/vendure-ecommerce/vendure/commit/2367ab0)), closes [#1800](https://github.com/vendure-ecommerce/vendure/issues/1800) * **admin-ui** Fix variant editing when 2 options have same name ([56948c8](https://github.com/vendure-ecommerce/vendure/commit/56948c8)), closes [#1813](https://github.com/vendure-ecommerce/vendure/issues/1813) * **admin-ui** Wrap long promotion condition/action names ([3eba1c8](https://github.com/vendure-ecommerce/vendure/commit/3eba1c8)) * **common** Handle edge case in serializing null prototype objects ([02249fb](https://github.com/vendure-ecommerce/vendure/commit/02249fb)) * **core** Add translation for 'channel-not-found' error ([f7c053f](https://github.com/vendure-ecommerce/vendure/commit/f7c053f)) * **core** Do not allow negative total with orderFixedDiscount action ([a031956](https://github.com/vendure-ecommerce/vendure/commit/a031956)), closes [#1823](https://github.com/vendure-ecommerce/vendure/issues/1823) * **core** Export TranslatorService helper from core (#1826) ([50d5856](https://github.com/vendure-ecommerce/vendure/commit/50d5856)), closes [#1826](https://github.com/vendure-ecommerce/vendure/issues/1826) * **core** Fix default search handling of mysql binary operators ([c133cce](https://github.com/vendure-ecommerce/vendure/commit/c133cce)), closes [#1808](https://github.com/vendure-ecommerce/vendure/issues/1808) * **core** Fix race condition when updating order addresses in parallel ([d436ea9](https://github.com/vendure-ecommerce/vendure/commit/d436ea9)) * **core** Improved error handling for malformed collection filters ([cab520b](https://github.com/vendure-ecommerce/vendure/commit/cab520b)) * **core** Persist customField relations in PromotionService (#1822) ([40fdd80](https://github.com/vendure-ecommerce/vendure/commit/40fdd80)), closes [#1822](https://github.com/vendure-ecommerce/vendure/issues/1822) * **testing** Correctly apply beforeListen middleware on TestServer (#1802) ([c1db17e](https://github.com/vendure-ecommerce/vendure/commit/c1db17e)), closes [#1802](https://github.com/vendure-ecommerce/vendure/issues/1802) ## <small>1.7.3 (2022-09-24)</small> #### Fixes * **admin-ui** Fix ShippingMethod update error with falsy config values ([0484053](https://github.com/vendure-ecommerce/vendure/commit/0484053)), closes [#1800](https://github.com/vendure-ecommerce/vendure/issues/1800) * **core** 'productVariantId' in group statement is ambiguous (#1793) ([3c63364](https://github.com/vendure-ecommerce/vendure/commit/3c63364)), closes [#1793](https://github.com/vendure-ecommerce/vendure/issues/1793) * **core** Add null checks for relations in Order entity getters ([3f469bb](https://github.com/vendure-ecommerce/vendure/commit/3f469bb)) ## <small>1.7.2 (2022-09-19)</small> #### Fixes * **admin-ui** Correctly parse configurable args when not edited ([f753f76](https://github.com/vendure-ecommerce/vendure/commit/f753f76)), closes [#1786](https://github.com/vendure-ecommerce/vendure/issues/1786) * **admin-ui** Do not allow duplicate option names ([4c4ad29](https://github.com/vendure-ecommerce/vendure/commit/4c4ad29)), closes [#1747](https://github.com/vendure-ecommerce/vendure/issues/1747) * **admin-ui** Fix alignment of breadcrumbs ([3584ef9](https://github.com/vendure-ecommerce/vendure/commit/3584ef9)) * **admin-ui** Fix error when modifying Order with custom field relation ([eace1c1](https://github.com/vendure-ecommerce/vendure/commit/eace1c1)), closes [#1792](https://github.com/vendure-ecommerce/vendure/issues/1792) * **admin-ui** Fix error when using non-standard currencyCode ([4466b24](https://github.com/vendure-ecommerce/vendure/commit/4466b24)), closes [#1768](https://github.com/vendure-ecommerce/vendure/issues/1768) * **admin-ui** Fix refresh issues with customer group list view ([04b431c](https://github.com/vendure-ecommerce/vendure/commit/04b431c)) * **core** Add missing driver options in DefaultSearchPlugin ([12e2807](https://github.com/vendure-ecommerce/vendure/commit/12e2807)) * **core** Correctly escape search term for mysql strategy ([2fa7fcf](https://github.com/vendure-ecommerce/vendure/commit/2fa7fcf)), closes [#1789](https://github.com/vendure-ecommerce/vendure/issues/1789) * **core** Correctly escape search term for postgres strategy ([ec70228](https://github.com/vendure-ecommerce/vendure/commit/ec70228)), closes [#1789](https://github.com/vendure-ecommerce/vendure/issues/1789) * **core** Correctly populate shipping/billing address for new customer ([264b326](https://github.com/vendure-ecommerce/vendure/commit/264b326)) * **core** Handle edge-case of Collection.breadcrumbs having null values ([4a9ec5c](https://github.com/vendure-ecommerce/vendure/commit/4a9ec5c)) * **core** Include missing id field in ShippingLine type ([481d0de](https://github.com/vendure-ecommerce/vendure/commit/481d0de)), closes [#1792](https://github.com/vendure-ecommerce/vendure/issues/1792) * **core** Remove deleted Customers from any CustomerGroups ([9820d9e](https://github.com/vendure-ecommerce/vendure/commit/9820d9e)), closes [#1785](https://github.com/vendure-ecommerce/vendure/issues/1785) * **create** Fix default migration path of scaffold (#1759) ([e1c90cc](https://github.com/vendure-ecommerce/vendure/commit/e1c90cc)), closes [#1759](https://github.com/vendure-ecommerce/vendure/issues/1759) * **create** Make dotenv a dependency, not devDependency ([a641beb](https://github.com/vendure-ecommerce/vendure/commit/a641beb)) ## <small>1.7.1 (2022-08-29)</small> #### Fixes * **core** Fix DefaultSearchPlugin pagination/sort with non-default lang ([5f7bea4](https://github.com/vendure-ecommerce/vendure/commit/5f7bea4)), closes [#1752](https://github.com/vendure-ecommerce/vendure/issues/1752) [#1746](https://github.com/vendure-ecommerce/vendure/issues/1746) * **core** Fix delete order method when called with id (#1751) ([fc57b0d](https://github.com/vendure-ecommerce/vendure/commit/fc57b0d)), closes [#1751](https://github.com/vendure-ecommerce/vendure/issues/1751) * **core** Fix regression with custom field relations & product by slug ([e90b99a](https://github.com/vendure-ecommerce/vendure/commit/e90b99a)), closes [#1723](https://github.com/vendure-ecommerce/vendure/issues/1723) * **core** Password change checks pw validity (#1745) ([4b6ac3b](https://github.com/vendure-ecommerce/vendure/commit/4b6ac3b)), closes [#1745](https://github.com/vendure-ecommerce/vendure/issues/1745) * **core** Work-around for nested custom field relations issue ([651710a](https://github.com/vendure-ecommerce/vendure/commit/651710a)), closes [#1664](https://github.com/vendure-ecommerce/vendure/issues/1664) ## 1.7.0 (2022-08-26) #### Fixes * **admin-ui** Correctly convert out-of-order config args ([f1f7e71](https://github.com/vendure-ecommerce/vendure/commit/f1f7e71)), closes [#1682](https://github.com/vendure-ecommerce/vendure/issues/1682) * **admin-ui** Lib es2019 so ts understands array.flat (#1728) ([83e2056](https://github.com/vendure-ecommerce/vendure/commit/83e2056)), closes [#1728](https://github.com/vendure-ecommerce/vendure/issues/1728) * **core** Add check to fix transition from AddingItems with an empty order (#1736) ([c33e407](https://github.com/vendure-ecommerce/vendure/commit/c33e407)), closes [#1736](https://github.com/vendure-ecommerce/vendure/issues/1736) * **core** Add warning when OrderItems not joined ([e663547](https://github.com/vendure-ecommerce/vendure/commit/e663547)), closes [#1606](https://github.com/vendure-ecommerce/vendure/issues/1606) * **core** Allow removal of unused ProductOptionGroup ([860cce6](https://github.com/vendure-ecommerce/vendure/commit/860cce6)), closes [#1134](https://github.com/vendure-ecommerce/vendure/issues/1134) * **core** Correctly handle out-of-order config args ([43887f3](https://github.com/vendure-ecommerce/vendure/commit/43887f3)), closes [#1682](https://github.com/vendure-ecommerce/vendure/issues/1682) * **core** Export TagService from core ([a680ea3](https://github.com/vendure-ecommerce/vendure/commit/a680ea3)) * **core** Fix order calculation with over 1000 active Promotions ([7c63f31](https://github.com/vendure-ecommerce/vendure/commit/7c63f31)) * **core** Fix product option deletion logic ([1feec2e](https://github.com/vendure-ecommerce/vendure/commit/1feec2e)) * **core** Prevent negative order total with fixed discounts (#1721) ([22612e0](https://github.com/vendure-ecommerce/vendure/commit/22612e0)), closes [#1721](https://github.com/vendure-ecommerce/vendure/issues/1721) * **core** Reset active config after running migration functions ([4e65100](https://github.com/vendure-ecommerce/vendure/commit/4e65100)) * **core** Use correct sequence of language fallbacks (#1730) (#1737) ([897c21c](https://github.com/vendure-ecommerce/vendure/commit/897c21c)), closes [#1730](https://github.com/vendure-ecommerce/vendure/issues/1730) [#1737](https://github.com/vendure-ecommerce/vendure/issues/1737) * **create** Fix path for generated migrations ([f19c75c](https://github.com/vendure-ecommerce/vendure/commit/f19c75c)) #### Perf * **core** Optimize Order-related field resolvers ([03d2b2c](https://github.com/vendure-ecommerce/vendure/commit/03d2b2c)), closes [#1727](https://github.com/vendure-ecommerce/vendure/issues/1727) * **core** Optimize OrderDetail view ([987355c](https://github.com/vendure-ecommerce/vendure/commit/987355c)), closes [#1727](https://github.com/vendure-ecommerce/vendure/issues/1727) * **core** Optimize recursive collection queries that select variants ([3a76231](https://github.com/vendure-ecommerce/vendure/commit/3a76231)), closes [#1718](https://github.com/vendure-ecommerce/vendure/issues/1718) #### Features * **admin-ui** Add ability to remove option group from product ([6a62e47](https://github.com/vendure-ecommerce/vendure/commit/6a62e47)), closes [#1134](https://github.com/vendure-ecommerce/vendure/issues/1134) * **admin-ui** Auto-focus name input when creating new product option ([7ce0ed4](https://github.com/vendure-ecommerce/vendure/commit/7ce0ed4)) * **admin-ui** Implement deletion of ProductOptions via variant manager ([b43aa81](https://github.com/vendure-ecommerce/vendure/commit/b43aa81)), closes [#1134](https://github.com/vendure-ecommerce/vendure/issues/1134) * **admin-ui** Implement pagination & filtering for customer groups ([972123f](https://github.com/vendure-ecommerce/vendure/commit/972123f)), closes [#1360](https://github.com/vendure-ecommerce/vendure/issues/1360) * **admin-ui** Make new product option names editable ([600990f](https://github.com/vendure-ecommerce/vendure/commit/600990f)) * **admin-ui** Show total items in datatables (#1580) ([e8e349c](https://github.com/vendure-ecommerce/vendure/commit/e8e349c)), closes [#1580](https://github.com/vendure-ecommerce/vendure/issues/1580) * **admin-ui** Support filtering orders by transaction ID ([74eac8f](https://github.com/vendure-ecommerce/vendure/commit/74eac8f)), closes [#1520](https://github.com/vendure-ecommerce/vendure/issues/1520) * **admin-ui** Support tabbed custom fields in Order detail view ([013c126](https://github.com/vendure-ecommerce/vendure/commit/013c126)), closes [#1562](https://github.com/vendure-ecommerce/vendure/issues/1562) * **admin-ui** Use new cancelPayment mutation to cancel payments ([d35cf73](https://github.com/vendure-ecommerce/vendure/commit/d35cf73)), closes [#1637](https://github.com/vendure-ecommerce/vendure/issues/1637) * **asset-server-plugin** Add support for avif image format ([1c49143](https://github.com/vendure-ecommerce/vendure/commit/1c49143)), closes [#482](https://github.com/vendure-ecommerce/vendure/issues/482) * **asset-server-plugin** Allow custom AssetPreviewStrategy to be set ([add65e3](https://github.com/vendure-ecommerce/vendure/commit/add65e3)), closes [#1650](https://github.com/vendure-ecommerce/vendure/issues/1650) * **asset-server-plugin** Enable preview image format configuration ([f7c0800](https://github.com/vendure-ecommerce/vendure/commit/f7c0800)), closes [#1650](https://github.com/vendure-ecommerce/vendure/issues/1650) * **asset-server-plugin** Support for specifying format in query param ([5a0cbe6](https://github.com/vendure-ecommerce/vendure/commit/5a0cbe6)), closes [#482](https://github.com/vendure-ecommerce/vendure/issues/482) * **asset-server-plugin** Upgrade to Sharp v30 ([fe2f9e4](https://github.com/vendure-ecommerce/vendure/commit/fe2f9e4)) * **core** Add `deleteProductOption` mutation to Admin API ([d77de9b](https://github.com/vendure-ecommerce/vendure/commit/d77de9b)) * **core** Add support for custom GraphQL scalars ([099a36c](https://github.com/vendure-ecommerce/vendure/commit/099a36c)), closes [#1593](https://github.com/vendure-ecommerce/vendure/issues/1593) * **core** Check migration status in the `runMigrations()` util function ([ca72de5](https://github.com/vendure-ecommerce/vendure/commit/ca72de5)) * **core** Correct handling of product option groups ([70537fe](https://github.com/vendure-ecommerce/vendure/commit/70537fe)) * **core** Declare setDefaultContext in VendureLogger (#1672) ([5a93bf0](https://github.com/vendure-ecommerce/vendure/commit/5a93bf0)), closes [#1672](https://github.com/vendure-ecommerce/vendure/issues/1672) * **core** Deprecation of getRepository without context argument (#1603) ([9ec2fe5](https://github.com/vendure-ecommerce/vendure/commit/9ec2fe5)), closes [#1603](https://github.com/vendure-ecommerce/vendure/issues/1603) * **core** Enable defining custom states in a type-safe manner (#1678) ([4e2b4ad](https://github.com/vendure-ecommerce/vendure/commit/4e2b4ad)), closes [#1678](https://github.com/vendure-ecommerce/vendure/issues/1678) * **core** Extend API with additional Fulfillment info ([3f0115b](https://github.com/vendure-ecommerce/vendure/commit/3f0115b)), closes [#1727](https://github.com/vendure-ecommerce/vendure/issues/1727) * **core** Implement AssetImportStrategy, enable asset import from urls ([75653ae](https://github.com/vendure-ecommerce/vendure/commit/75653ae)) * **core** Implement cancelPayment in dummy payment handler ([177f905](https://github.com/vendure-ecommerce/vendure/commit/177f905)), closes [#1637](https://github.com/vendure-ecommerce/vendure/issues/1637) * **core** Implement payment cancellation ([1ce1ba7](https://github.com/vendure-ecommerce/vendure/commit/1ce1ba7)), closes [#1637](https://github.com/vendure-ecommerce/vendure/issues/1637) * **core** Make slug unique per channel instead of globally unique (#1729) ([ac1dcc7](https://github.com/vendure-ecommerce/vendure/commit/ac1dcc7)), closes [#1729](https://github.com/vendure-ecommerce/vendure/issues/1729) * **core** Support filtering orders by transactionId ([7806bc4](https://github.com/vendure-ecommerce/vendure/commit/7806bc4)), closes [#1520](https://github.com/vendure-ecommerce/vendure/issues/1520) * **core** Support save points (nested transactions) (#1579) ([9813d11](https://github.com/vendure-ecommerce/vendure/commit/9813d11)), closes [#1579](https://github.com/vendure-ecommerce/vendure/issues/1579) * **core** Use language fallback on DefaultSearchPlugin search (#1696) ([670b7e1](https://github.com/vendure-ecommerce/vendure/commit/670b7e1)), closes [#1696](https://github.com/vendure-ecommerce/vendure/issues/1696) * **create** Include migrations & general DX improvements ([2af85d0](https://github.com/vendure-ecommerce/vendure/commit/2af85d0)) * **create** Include sample Docker & compose files & docs ([864314f](https://github.com/vendure-ecommerce/vendure/commit/864314f)) * **create** Simplify create steps - remove JS option ([73b4671](https://github.com/vendure-ecommerce/vendure/commit/73b4671)) * **create** Support schema selection for Postgres ([217ee79](https://github.com/vendure-ecommerce/vendure/commit/217ee79)), closes [#1662](https://github.com/vendure-ecommerce/vendure/issues/1662) * **create** Use dotenv to handle env vars ([4fdc8aa](https://github.com/vendure-ecommerce/vendure/commit/4fdc8aa)) * **payments-plugin** Make BraintreePlugin metadata configurable ([99c80e8](https://github.com/vendure-ecommerce/vendure/commit/99c80e8)) * **ui-devkit** Support Clarity Sass variable overrides (#1684) ([46d1e2d](https://github.com/vendure-ecommerce/vendure/commit/46d1e2d)), closes [#1684](https://github.com/vendure-ecommerce/vendure/issues/1684) ### BREAKING CHANGE * (TypeORM): Due to an update of the TypeORM version, there is a **very remote** potential breaking change if you make use of TypeORM's soft-remove feature in combination with listeners/subscribers. Namely, update listeners and subscriber no longer triggered by soft-remove and recover (https://github.com/typeorm/typeorm/blob/master/CHANGELOG.md#0242-2022-02-16). This is not used in Vendure core and is a relatively obscure edge-case. ## <small>1.6.5 (2022-08-15)</small> #### Fixes * **admin-ui** Correctly display translatable custom field labels ([43b7766](https://github.com/vendure-ecommerce/vendure/commit/43b7766)) * **core** Fix find product by slug with relations (#1709) ([9aac2f5](https://github.com/vendure-ecommerce/vendure/commit/9aac2f5)), closes [#1709](https://github.com/vendure-ecommerce/vendure/issues/1709) * **core** Fix ListQueryBuilder language handling logic ([86ac107](https://github.com/vendure-ecommerce/vendure/commit/86ac107)), closes [#1631](https://github.com/vendure-ecommerce/vendure/issues/1631) [#1611](https://github.com/vendure-ecommerce/vendure/issues/1611) * **core** Fix orderLine customField equality ([214281e](https://github.com/vendure-ecommerce/vendure/commit/214281e)) * **core** Fix OrderLine relation customfields ([b3cb9f2](https://github.com/vendure-ecommerce/vendure/commit/b3cb9f2)) * **core** Reset activeConfig on app shutdown ([8b8e310](https://github.com/vendure-ecommerce/vendure/commit/8b8e310)) * **core** Take channels into account when validating coupon codes ([4ff8dff](https://github.com/vendure-ecommerce/vendure/commit/4ff8dff)), closes [#1692](https://github.com/vendure-ecommerce/vendure/issues/1692) ## <small>1.6.4 (2022-07-21)</small> #### Fixes * **admin-ui** Correctly handle falsy configArg default values ([1d8c30e](https://github.com/vendure-ecommerce/vendure/commit/1d8c30e)), closes [#1663](https://github.com/vendure-ecommerce/vendure/issues/1663) * **admin-ui** Display multiple shipping methods in order detail ([b45464e](https://github.com/vendure-ecommerce/vendure/commit/b45464e)), closes [#1665](https://github.com/vendure-ecommerce/vendure/issues/1665) * **admin-ui** Fix facet-value-form-input when used with custom fields ([0ae36a9](https://github.com/vendure-ecommerce/vendure/commit/0ae36a9)) * **admin-ui** Improved handling of failed cancellations ([2c79cf0](https://github.com/vendure-ecommerce/vendure/commit/2c79cf0)) * **core** Add missing `languageCode` field on ShippingMethod type ([4fab7cf](https://github.com/vendure-ecommerce/vendure/commit/4fab7cf)) * **core** Correctly resolve translatable custom field relations ([354932c](https://github.com/vendure-ecommerce/vendure/commit/354932c)) * **core** Fix issue with cancellation of fulfilled OrderItems ([13b0cf9](https://github.com/vendure-ecommerce/vendure/commit/13b0cf9)), closes [#1558](https://github.com/vendure-ecommerce/vendure/issues/1558) * **core** Fix order line custom field comparison logic ([dc3ea9c](https://github.com/vendure-ecommerce/vendure/commit/dc3ea9c)), closes [#1670](https://github.com/vendure-ecommerce/vendure/issues/1670) * **core** Fix regression when querying custom field relations ([b279d25](https://github.com/vendure-ecommerce/vendure/commit/b279d25)), closes [#1664](https://github.com/vendure-ecommerce/vendure/issues/1664) [#1636](https://github.com/vendure-ecommerce/vendure/issues/1636) [#1636](https://github.com/vendure-ecommerce/vendure/issues/1636) * **core** Handle user verification edge case ([1640ea7](https://github.com/vendure-ecommerce/vendure/commit/1640ea7)), closes [#1659](https://github.com/vendure-ecommerce/vendure/issues/1659) * **job-queue-plugin** Partially fix BullMQ shutdown error ([3835f8b](https://github.com/vendure-ecommerce/vendure/commit/3835f8b)) * **payments-plugin** Fix error on Braintree refund failure ([0b79eb5](https://github.com/vendure-ecommerce/vendure/commit/0b79eb5)) * **payments-plugin** Use idempotency key for Stripe API calls ([9b77d5c](https://github.com/vendure-ecommerce/vendure/commit/9b77d5c)) * **payments-plugin** Verify Stripe payment intent amount ([b72ae18](https://github.com/vendure-ecommerce/vendure/commit/b72ae18)) ## <small>1.6.3 (2022-07-05)</small> #### Fixes * **asset-server-plugin** Detect protocol for assetUrlPrefix when behind a proxy (#1641) ([a39c592](https://github.com/vendure-ecommerce/vendure/commit/a39c592)), closes [#1641](https://github.com/vendure-ecommerce/vendure/issues/1641) [#1640](https://github.com/vendure-ecommerce/vendure/issues/1640) * **core** Consistently apply coupon code checks on MySQL DBs ([bfaee82](https://github.com/vendure-ecommerce/vendure/commit/bfaee82)), closes [#1604](https://github.com/vendure-ecommerce/vendure/issues/1604) * **core** Correctly join custom field relations in findOneInChannel ([9834225](https://github.com/vendure-ecommerce/vendure/commit/9834225)), closes [#1636](https://github.com/vendure-ecommerce/vendure/issues/1636) * **core** Do no de-allocate OrderItems that were not allocated ([11b69c7](https://github.com/vendure-ecommerce/vendure/commit/11b69c7)), closes [#1557](https://github.com/vendure-ecommerce/vendure/issues/1557) * **core** Fix edge case for custom field comparison on MySQL ([f08f62c](https://github.com/vendure-ecommerce/vendure/commit/f08f62c)), closes [#1612](https://github.com/vendure-ecommerce/vendure/issues/1612) * **core** Fix error when calling assignToChannels on an Order ([5dbca2d](https://github.com/vendure-ecommerce/vendure/commit/5dbca2d)), closes [#1391](https://github.com/vendure-ecommerce/vendure/issues/1391) * **core** Fix OrderLine deduplication with customField default values ([9522f34](https://github.com/vendure-ecommerce/vendure/commit/9522f34)), closes [#1612](https://github.com/vendure-ecommerce/vendure/issues/1612) * **core** Introduced errorOnFail flag for job.updates() method (#1627) ([464924c](https://github.com/vendure-ecommerce/vendure/commit/464924c)), closes [#1627](https://github.com/vendure-ecommerce/vendure/issues/1627) [#1551](https://github.com/vendure-ecommerce/vendure/issues/1551) * **core** Re-evaluate shipping when all OrderLines removed ([19a554d](https://github.com/vendure-ecommerce/vendure/commit/19a554d)), closes [#1441](https://github.com/vendure-ecommerce/vendure/issues/1441) * **core** Resolve customField relations on related types ([3e81821](https://github.com/vendure-ecommerce/vendure/commit/3e81821)), closes [#1610](https://github.com/vendure-ecommerce/vendure/issues/1610) * **core** Use correct ctx when importing FacetValues ([fcaff4e](https://github.com/vendure-ecommerce/vendure/commit/fcaff4e)) * **core** Use RequestContext where available in all DB operations (#1639) ([a683ef5](https://github.com/vendure-ecommerce/vendure/commit/a683ef5)), closes [#1639](https://github.com/vendure-ecommerce/vendure/issues/1639) * **elasticsearch-plugin** Support hydration of custom field relations ([a75390e](https://github.com/vendure-ecommerce/vendure/commit/a75390e)), closes [#1638](https://github.com/vendure-ecommerce/vendure/issues/1638) * **email-plugin** Relax typings of `handlers` config option ([0dfa9d0](https://github.com/vendure-ecommerce/vendure/commit/0dfa9d0)) * **payments-plugin** Attach incoming req to `ctx` in Stripe webhook ([cb13e99](https://github.com/vendure-ecommerce/vendure/commit/cb13e99)), closes [#1643](https://github.com/vendure-ecommerce/vendure/issues/1643) * **payments-plugin** Stripe - send correct amount for JPY ([cd0a48f](https://github.com/vendure-ecommerce/vendure/commit/cd0a48f)), closes [#1630](https://github.com/vendure-ecommerce/vendure/issues/1630) ## <small>1.6.2 (2022-06-02)</small> #### Fixes * **admin-ui** Add missing "company" field to address components ([e218932](https://github.com/vendure-ecommerce/vendure/commit/e218932)), closes [#1591](https://github.com/vendure-ecommerce/vendure/issues/1591) * **admin-ui** Allow new option groups to be deleted in variant editor ([99ebf68](https://github.com/vendure-ecommerce/vendure/commit/99ebf68)), closes [#1577](https://github.com/vendure-ecommerce/vendure/issues/1577) * **admin-ui** Do not add empty option groups to a product ([a39bf70](https://github.com/vendure-ecommerce/vendure/commit/a39bf70)), closes [#1577](https://github.com/vendure-ecommerce/vendure/issues/1577) * **admin-ui** Fix NavMenuItem.onClick callback not being triggered (#1592) ([714d07c](https://github.com/vendure-ecommerce/vendure/commit/714d07c)), closes [#1592](https://github.com/vendure-ecommerce/vendure/issues/1592) * **core** Correct ordering of Collection.children ([476fb5e](https://github.com/vendure-ecommerce/vendure/commit/476fb5e)), closes [#1595](https://github.com/vendure-ecommerce/vendure/issues/1595) * **core** Fix `getMany()` method with ListQueryBuilder ([6be93b8](https://github.com/vendure-ecommerce/vendure/commit/6be93b8)), closes [#1586](https://github.com/vendure-ecommerce/vendure/issues/1586) * **core** Fix broken JSON encoding edge-case ([64765f3](https://github.com/vendure-ecommerce/vendure/commit/64765f3)), closes [#1596](https://github.com/vendure-ecommerce/vendure/issues/1596) * **core** Fix bug in importing Facets ([84ce87f](https://github.com/vendure-ecommerce/vendure/commit/84ce87f)) * **core** Fix float custom field handling ([e94730b](https://github.com/vendure-ecommerce/vendure/commit/e94730b)), closes [#1561](https://github.com/vendure-ecommerce/vendure/issues/1561) * **core** Fix sorting by localeString custom fields ([e096001](https://github.com/vendure-ecommerce/vendure/commit/e096001)), closes [#1581](https://github.com/vendure-ecommerce/vendure/issues/1581) * **core** Further fix on custom field float default ([b8fdbd8](https://github.com/vendure-ecommerce/vendure/commit/b8fdbd8)) * **core** Save relation custom fields on PaymentMethods ([711de06](https://github.com/vendure-ecommerce/vendure/commit/711de06)), closes [#1600](https://github.com/vendure-ecommerce/vendure/issues/1600) * **core** UserService.addNativeAuthenticationMethod persists userId ([ae1e24d](https://github.com/vendure-ecommerce/vendure/commit/ae1e24d)), closes [#1423](https://github.com/vendure-ecommerce/vendure/issues/1423) * **elasticsearch-plugin** Fix permissions for pendingSearchIndexUpdates query (#1585) ([88ec4a2](https://github.com/vendure-ecommerce/vendure/commit/88ec4a2)), closes [#1585](https://github.com/vendure-ecommerce/vendure/issues/1585) * **elasticsearch-plugin** Missing CustomMappingsResolver in Admin API (#1599) ([267c429](https://github.com/vendure-ecommerce/vendure/commit/267c429)), closes [#1599](https://github.com/vendure-ecommerce/vendure/issues/1599) #### Perf * **core** Fix perf regression from lookahead on certain fields ([9e65753](https://github.com/vendure-ecommerce/vendure/commit/9e65753)), closes [#1578](https://github.com/vendure-ecommerce/vendure/issues/1578) ## <small>1.6.1 (2022-05-19)</small> #### Fixes * **admin-ui** Fix dashboard widget change detection logic (#1573) ([48bd8bd](https://github.com/vendure-ecommerce/vendure/commit/48bd8bd)), closes [#1573](https://github.com/vendure-ecommerce/vendure/issues/1573) * **admin-ui** Fix issue saving null configurable args ([df92320](https://github.com/vendure-ecommerce/vendure/commit/df92320)), closes [#1546](https://github.com/vendure-ecommerce/vendure/issues/1546) * **core** Allow cancelling an Order that has deleted ProductVariants ([79c36b5](https://github.com/vendure-ecommerce/vendure/commit/79c36b5)), closes [#1567](https://github.com/vendure-ecommerce/vendure/issues/1567) * **core** Correctly use ProductVariant featuredAsset for OrderLine ([7a81110](https://github.com/vendure-ecommerce/vendure/commit/7a81110)), closes [#1570](https://github.com/vendure-ecommerce/vendure/issues/1570) * **core** Fix list query builder error when using entityPrefix ([0353a3f](https://github.com/vendure-ecommerce/vendure/commit/0353a3f)), closes [#1569](https://github.com/vendure-ecommerce/vendure/issues/1569) ## 1.6.0 (2022-05-18) #### Fixes * **admin-ui** Display total with tax in order list ([92661da](https://github.com/vendure-ecommerce/vendure/commit/92661da)) * **admin-ui** Fix form change detection in collection filters ([0938be0](https://github.com/vendure-ecommerce/vendure/commit/0938be0)) * **admin-ui** Improve display of many channels on Product detail ([87b8a53](https://github.com/vendure-ecommerce/vendure/commit/87b8a53)), closes [#1431](https://github.com/vendure-ecommerce/vendure/issues/1431) * **admin-ui** Prevent route change on collection contents list change ([5589628](https://github.com/vendure-ecommerce/vendure/commit/5589628)), closes [#1530](https://github.com/vendure-ecommerce/vendure/issues/1530) * **admin-ui** Styling improvements to image display ([7b308c1](https://github.com/vendure-ecommerce/vendure/commit/7b308c1)), closes [#1514](https://github.com/vendure-ecommerce/vendure/issues/1514) * **asset-server-plugin** Gracefully handle unsupported image previews ([91b69f0](https://github.com/vendure-ecommerce/vendure/commit/91b69f0)), closes [#1563](https://github.com/vendure-ecommerce/vendure/issues/1563) * **asset-server-plugin** Use EXIF data to correctly orient images ([aa9bd03](https://github.com/vendure-ecommerce/vendure/commit/aa9bd03)), closes [#1548](https://github.com/vendure-ecommerce/vendure/issues/1548) * **core** Fix error in configurable operation codec when arg not found ([9ba44f4](https://github.com/vendure-ecommerce/vendure/commit/9ba44f4)) * **core** Fix variants not being returned in some language configs ([6a4e0d4](https://github.com/vendure-ecommerce/vendure/commit/6a4e0d4)), closes [#1539](https://github.com/vendure-ecommerce/vendure/issues/1539) * **core** Improve error logging when search indexing fails ([bf75171](https://github.com/vendure-ecommerce/vendure/commit/bf75171)), closes [#1556](https://github.com/vendure-ecommerce/vendure/issues/1556) * **core** Job update doesn't emit if progress didn't change (#1550) ([2ce444f](https://github.com/vendure-ecommerce/vendure/commit/2ce444f)), closes [#1550](https://github.com/vendure-ecommerce/vendure/issues/1550) * **core** Make OrderLine.items eager-loaded from the DB ([8465d84](https://github.com/vendure-ecommerce/vendure/commit/8465d84)) * **core** Manage transactions outside of orderService.modifyOrder function. (#1533) ([e707274](https://github.com/vendure-ecommerce/vendure/commit/e707274)), closes [#1533](https://github.com/vendure-ecommerce/vendure/issues/1533) * **elasticsearch-plugin** Improve error log when search indexing fails ([7dcad6e](https://github.com/vendure-ecommerce/vendure/commit/7dcad6e)), closes [#1556](https://github.com/vendure-ecommerce/vendure/issues/1556) * **job-queue-plugin** Fix Redis health indicator error reporting ([48a30fb](https://github.com/vendure-ecommerce/vendure/commit/48a30fb)) * **ui-devkit** Wrap output path in quotes. (#1519) ([755d2e2](https://github.com/vendure-ecommerce/vendure/commit/755d2e2)), closes [#1519](https://github.com/vendure-ecommerce/vendure/issues/1519) #### Features * **admin-ui** Add live preview of Collection filter changes ([ba6c64a](https://github.com/vendure-ecommerce/vendure/commit/ba6c64a)), closes [#1530](https://github.com/vendure-ecommerce/vendure/issues/1530) * **admin-ui** Add sku to Collection contents table ([8c2263c](https://github.com/vendure-ecommerce/vendure/commit/8c2263c)) * **admin-ui** Display description tooltip for configurable args ([837e1f2](https://github.com/vendure-ecommerce/vendure/commit/837e1f2)) * **admin-ui** Implement combination mode toggle for Collection filters ([cb1e137](https://github.com/vendure-ecommerce/vendure/commit/cb1e137)) * **admin-ui** Implement content preview when creating collection ([1e4f072](https://github.com/vendure-ecommerce/vendure/commit/1e4f072)), closes [#1530](https://github.com/vendure-ecommerce/vendure/issues/1530) * **admin-ui** Implement FormInput for multi product/variant selection ([47c9b0e](https://github.com/vendure-ecommerce/vendure/commit/47c9b0e)) * **admin-ui** Improve styling of configurable arg inputs ([d20a1dc](https://github.com/vendure-ecommerce/vendure/commit/d20a1dc)) * **admin-ui** Persist Collection list expanded states to the url ([d67187e](https://github.com/vendure-ecommerce/vendure/commit/d67187e)), closes [#1532](https://github.com/vendure-ecommerce/vendure/issues/1532) * **admin-ui** Persist Collection list filter term to the url ([dcdd05b](https://github.com/vendure-ecommerce/vendure/commit/dcdd05b)), closes [#1532](https://github.com/vendure-ecommerce/vendure/issues/1532) * **admin-ui** Various styling improvements ([c76aba0](https://github.com/vendure-ecommerce/vendure/commit/c76aba0)) * **core** Add `metadataModifiers` for low-level DB entity config ([16e52f2](https://github.com/vendure-ecommerce/vendure/commit/16e52f2)), closes [#1506](https://github.com/vendure-ecommerce/vendure/issues/1506) [#1502](https://github.com/vendure-ecommerce/vendure/issues/1502) * **core** Add boolean combination support on default CollectionFilters ([8889ac2](https://github.com/vendure-ecommerce/vendure/commit/8889ac2)) * **core** Add new variantIdCollectionFilter default CollectionFilter ([449c584](https://github.com/vendure-ecommerce/vendure/commit/449c584)) * **core** Allow entity alias to be specified in ListQueryBuilder ([f221940](https://github.com/vendure-ecommerce/vendure/commit/f221940)) * **core** Create Relations decorator ([063b5fe](https://github.com/vendure-ecommerce/vendure/commit/063b5fe)), closes [#1506](https://github.com/vendure-ecommerce/vendure/issues/1506) * **core** Expose Importer.importProducts method ([bbe09aa](https://github.com/vendure-ecommerce/vendure/commit/bbe09aa)) * **core** Implement `previewCollectionVariants` query in Admin API ([1c3b38c](https://github.com/vendure-ecommerce/vendure/commit/1c3b38c)), closes [#1530](https://github.com/vendure-ecommerce/vendure/issues/1530) * **core** Implement unique constraint for custom fields ([07e1601](https://github.com/vendure-ecommerce/vendure/commit/07e1601)), closes [#1476](https://github.com/vendure-ecommerce/vendure/issues/1476) * **core** Make all health checks configurable ([f3d2d59](https://github.com/vendure-ecommerce/vendure/commit/f3d2d59)), closes [#1494](https://github.com/vendure-ecommerce/vendure/issues/1494) * **core** Make OrderService.applyPriceAdjustments() public ([826fd55](https://github.com/vendure-ecommerce/vendure/commit/826fd55)), closes [#1522](https://github.com/vendure-ecommerce/vendure/issues/1522) * **core** Make search strategy configurable via plugin options (#1504) ([b31694f](https://github.com/vendure-ecommerce/vendure/commit/b31694f)), closes [#1504](https://github.com/vendure-ecommerce/vendure/issues/1504) * **core** Pass payment method to handler and eligibility checker (#1564) ([4e63180](https://github.com/vendure-ecommerce/vendure/commit/4e63180)), closes [#1564](https://github.com/vendure-ecommerce/vendure/issues/1564) * **core** Pass shipping method to calculator and eligibility checker (#1509) ([826aa4a](https://github.com/vendure-ecommerce/vendure/commit/826aa4a)), closes [#1509](https://github.com/vendure-ecommerce/vendure/issues/1509) * **core** Use query relations data to optimize DB joins ([0421285](https://github.com/vendure-ecommerce/vendure/commit/0421285)), closes [#1506](https://github.com/vendure-ecommerce/vendure/issues/1506) [#1407](https://github.com/vendure-ecommerce/vendure/issues/1407) * **core** Use variant featuredAsset in OrderLine if available ([0c308e2](https://github.com/vendure-ecommerce/vendure/commit/0c308e2)), closes [#1488](https://github.com/vendure-ecommerce/vendure/issues/1488) * **core** Add `SearchEvent` & publish when search query is executed, closes [#1553](https://github.com/vendure-ecommerce/vendure/issues/1553) * **elasticsearch-plugin** Publish `SearchEvent` when search query is executed, closes [#1553](https://github.com/vendure-ecommerce/vendure/issues/1553) * **payments-plugin** Deprecate orderId when generating Braintree token ([8ba76f2](https://github.com/vendure-ecommerce/vendure/commit/8ba76f2)), closes [#1517](https://github.com/vendure-ecommerce/vendure/issues/1517) #### Perf * **core** Further optimizations to ListQueryBuilder ([d9577f8](https://github.com/vendure-ecommerce/vendure/commit/d9577f8)), closes [#1506](https://github.com/vendure-ecommerce/vendure/issues/1506) [#1503](https://github.com/vendure-ecommerce/vendure/issues/1503) * **core** Optimize ListQueryBuilder performance ([8d87f05](https://github.com/vendure-ecommerce/vendure/commit/8d87f05)), closes [#1503](https://github.com/vendure-ecommerce/vendure/issues/1503) [#1506](https://github.com/vendure-ecommerce/vendure/issues/1506) [1#L122](https://github.com/1/issues/L122) * **core** Optimize query to fetch all collection ids on changes ([a362fb4](https://github.com/vendure-ecommerce/vendure/commit/a362fb4)) ## <small>1.5.2 (2022-04-21)</small> #### Fixes * **admin-ui** Correctly size images when using alternate asset servers ([e175f52](https://github.com/vendure-ecommerce/vendure/commit/e175f52)), closes [#1514](https://github.com/vendure-ecommerce/vendure/issues/1514) * **admin-ui** Correctly split path when displaying asset source filename ([54519f0](https://github.com/vendure-ecommerce/vendure/commit/54519f0)) * **admin-ui** Fix disappearing sidenav menu ([2bb7f7c](https://github.com/vendure-ecommerce/vendure/commit/2bb7f7c)), closes [#1521](https://github.com/vendure-ecommerce/vendure/issues/1521) * **admin-ui** Fix issue with boolean configurable arg inputs ([a52c4c0](https://github.com/vendure-ecommerce/vendure/commit/a52c4c0)), closes [#1527](https://github.com/vendure-ecommerce/vendure/issues/1527) * **asset-server-plugin** Fix svg XSS vulnerability ([69a4486](https://github.com/vendure-ecommerce/vendure/commit/69a4486)) * **core** Copy context on transaction start. Do not allow to run queries after transaction aborts. (#1481) ([6050279](https://github.com/vendure-ecommerce/vendure/commit/6050279)), closes [#1481](https://github.com/vendure-ecommerce/vendure/issues/1481) * **core** Correctly handle slug validation of deleted translations ([61de857](https://github.com/vendure-ecommerce/vendure/commit/61de857)), closes [#1527](https://github.com/vendure-ecommerce/vendure/issues/1527) * **core** Correctly resolve prices of deleted ProductVariants in orders ([5061dd9](https://github.com/vendure-ecommerce/vendure/commit/5061dd9)), closes [#1508](https://github.com/vendure-ecommerce/vendure/issues/1508) ## <small>1.5.1 (2022-03-31)</small> #### Fixes * **admin-ui** Allow stockOnHand to match outOfStockThreshold ([f89bfbe](https://github.com/vendure-ecommerce/vendure/commit/f89bfbe)), closes [#1483](https://github.com/vendure-ecommerce/vendure/issues/1483) * **admin-ui** Fix error with FacetValue localeString custom field ([80ef31a](https://github.com/vendure-ecommerce/vendure/commit/80ef31a)), closes [#1442](https://github.com/vendure-ecommerce/vendure/issues/1442) * **core** Add missing OrderLine.order field resolver (#1478) ([c6cf4d4](https://github.com/vendure-ecommerce/vendure/commit/c6cf4d4)), closes [#1478](https://github.com/vendure-ecommerce/vendure/issues/1478) * **core** Allow stockOnHand adjustments to match outOfStockThreshold ([77239b2](https://github.com/vendure-ecommerce/vendure/commit/77239b2)), closes [#1483](https://github.com/vendure-ecommerce/vendure/issues/1483) * **core** Correctly save relation custom fields on CustomerGroup ([1634ed9](https://github.com/vendure-ecommerce/vendure/commit/1634ed9)), closes [#1493](https://github.com/vendure-ecommerce/vendure/issues/1493) * **core** Fix error when pro-rating order with 0 price variant ([44cc46d](https://github.com/vendure-ecommerce/vendure/commit/44cc46d)), closes [#1492](https://github.com/vendure-ecommerce/vendure/issues/1492) * **core** Fix importing products when 2 options have same name ([316f5e9](https://github.com/vendure-ecommerce/vendure/commit/316f5e9)), closes [#1445](https://github.com/vendure-ecommerce/vendure/issues/1445) * **core** Promotion usage limits account for cancelled orders ([ce34f14](https://github.com/vendure-ecommerce/vendure/commit/ce34f14)), closes [#1466](https://github.com/vendure-ecommerce/vendure/issues/1466) * **core** Truthy check for custom fields in importer ([a8c44d1](https://github.com/vendure-ecommerce/vendure/commit/a8c44d1)) * **core** Use subscribers passed in to the dbConnectionOptions ([ea63784](https://github.com/vendure-ecommerce/vendure/commit/ea63784)) * **payments-plugin** Fix state transitioning error case in Stripe webhook (#1485) ([280d2e3](https://github.com/vendure-ecommerce/vendure/commit/280d2e3)), closes [#1485](https://github.com/vendure-ecommerce/vendure/issues/1485) * **payments-plugin** Send 200 response from Stripe webhook (#1487) ([4d55949](https://github.com/vendure-ecommerce/vendure/commit/4d55949)), closes [#1487](https://github.com/vendure-ecommerce/vendure/issues/1487) ## 1.5.0 (2022-03-15) #### Fixes * **admin-ui** Fix circular dependency error ([ddc8941](https://github.com/vendure-ecommerce/vendure/commit/ddc8941)) * **core** Add OrderTestingService to core exports (#1469) ([a827055](https://github.com/vendure-ecommerce/vendure/commit/a827055)), closes [#1469](https://github.com/vendure-ecommerce/vendure/issues/1469) * **core** Correctly populate Collections in channel ([b42bf1e](https://github.com/vendure-ecommerce/vendure/commit/b42bf1e)) * **core** Export all Promotion conditions & actions ([56b30fa](https://github.com/vendure-ecommerce/vendure/commit/56b30fa)), closes [#1308](https://github.com/vendure-ecommerce/vendure/issues/1308) * **core** Fix FK error when merging orders with an existing session ([7cedf49](https://github.com/vendure-ecommerce/vendure/commit/7cedf49)), closes [#1454](https://github.com/vendure-ecommerce/vendure/issues/1454) * **core** Fix regression in accessing OrderLine.items when not defined ([3fcf5dc](https://github.com/vendure-ecommerce/vendure/commit/3fcf5dc)) * **core** Prevent error cause by order in outdated state ([2266293](https://github.com/vendure-ecommerce/vendure/commit/2266293)) * **core** Support usage of GQL interfaces on relational custom field (#1460) ([c608516](https://github.com/vendure-ecommerce/vendure/commit/c608516)), closes [#1460](https://github.com/vendure-ecommerce/vendure/issues/1460) * **core** Use sessionDuration when creating anonymous sessions ([2960a09](https://github.com/vendure-ecommerce/vendure/commit/2960a09)), closes [#1425](https://github.com/vendure-ecommerce/vendure/issues/1425) * **email-plugin** Add currency code in mock email confirmation (#1448) ([ef8b244](https://github.com/vendure-ecommerce/vendure/commit/ef8b244)), closes [#1448](https://github.com/vendure-ecommerce/vendure/issues/1448) * **email-plugin** Correctly resolve urls for OrderLine featured assets ([15f9b44](https://github.com/vendure-ecommerce/vendure/commit/15f9b44)) * **payments-plugin** Mollie payment intent + Stripe unauthorized settlement fix (#1437) ([37e5f58](https://github.com/vendure-ecommerce/vendure/commit/37e5f58)), closes [#1437](https://github.com/vendure-ecommerce/vendure/issues/1437) [#1432](https://github.com/vendure-ecommerce/vendure/issues/1432) [#1340](https://github.com/vendure-ecommerce/vendure/issues/1340) #### Features * **admin-ui-plugin** Make refund/cancellation reasons configurable ([1ab0119](https://github.com/vendure-ecommerce/vendure/commit/1ab0119)), closes [#893](https://github.com/vendure-ecommerce/vendure/issues/893) * **admin-ui** Add asset preview links to asset gallery & asset detail ([b09bc1f](https://github.com/vendure-ecommerce/vendure/commit/b09bc1f)), closes [#1305](https://github.com/vendure-ecommerce/vendure/issues/1305) * **admin-ui** Allow couponCodes to be set when modifying Order ([8083219](https://github.com/vendure-ecommerce/vendure/commit/8083219)), closes [#1308](https://github.com/vendure-ecommerce/vendure/issues/1308) * **admin-ui** Allow custom ng compiler args to be passed to admin ui compiler (#1386) ([d47df21](https://github.com/vendure-ecommerce/vendure/commit/d47df21)), closes [#1386](https://github.com/vendure-ecommerce/vendure/issues/1386) * **admin-ui** Enable filtering CustomerList by postalCode ([f3a2654](https://github.com/vendure-ecommerce/vendure/commit/f3a2654)), closes [#1389](https://github.com/vendure-ecommerce/vendure/issues/1389) * **admin-ui** Implement deletion of addresses from customer detail ([4a81f7c](https://github.com/vendure-ecommerce/vendure/commit/4a81f7c)) * **admin-ui** Implement generic custom field relation selector ([f3ea8a3](https://github.com/vendure-ecommerce/vendure/commit/f3ea8a3)) * **admin-ui** Improve cancel modal to allow full order cancellation ([3b90888](https://github.com/vendure-ecommerce/vendure/commit/3b90888)), closes [#1414](https://github.com/vendure-ecommerce/vendure/issues/1414) * **admin-ui** More flexible assets component (#1358) ([259e352](https://github.com/vendure-ecommerce/vendure/commit/259e352)), closes [#1358](https://github.com/vendure-ecommerce/vendure/issues/1358) [#1357](https://github.com/vendure-ecommerce/vendure/issues/1357) * **core** Add `inList` op to enable filtering on custom field lists ([94da850](https://github.com/vendure-ecommerce/vendure/commit/94da850)), closes [#1332](https://github.com/vendure-ecommerce/vendure/issues/1332) * **core** Add a job queue name prefix as a config option (#1359) ([921f8e0](https://github.com/vendure-ecommerce/vendure/commit/921f8e0)), closes [#1359](https://github.com/vendure-ecommerce/vendure/issues/1359) [#1350](https://github.com/vendure-ecommerce/vendure/issues/1350) * **core** Add option to CancelOrderInput to cancel of shipping ([9eebae3](https://github.com/vendure-ecommerce/vendure/commit/9eebae3)), closes [#1414](https://github.com/vendure-ecommerce/vendure/issues/1414) * **core** Add order event (#1306) ([c682c0e](https://github.com/vendure-ecommerce/vendure/commit/c682c0e)), closes [#1306](https://github.com/vendure-ecommerce/vendure/issues/1306) * **core** Add OrderLineEvent, to notify on changes to Order.lines ([16e099f](https://github.com/vendure-ecommerce/vendure/commit/16e099f)), closes [#1316](https://github.com/vendure-ecommerce/vendure/issues/1316) * **core** Add PasswordValidationStrategy to enable password policies ([dc4bc2d](https://github.com/vendure-ecommerce/vendure/commit/dc4bc2d)), closes [#863](https://github.com/vendure-ecommerce/vendure/issues/863) * **core** Allow channel to be specified in `populate()` function ([03b9fe1](https://github.com/vendure-ecommerce/vendure/commit/03b9fe1)), closes [#877](https://github.com/vendure-ecommerce/vendure/issues/877) * **core** Allow couponCodes to be set when modifying Order ([af3a705](https://github.com/vendure-ecommerce/vendure/commit/af3a705)), closes [#1308](https://github.com/vendure-ecommerce/vendure/issues/1308) * **core** Allow schema introspection to be disabled ([052d494](https://github.com/vendure-ecommerce/vendure/commit/052d494)), closes [#1353](https://github.com/vendure-ecommerce/vendure/issues/1353) * **core** Enable filtering customers by postalCode ([6692b95](https://github.com/vendure-ecommerce/vendure/commit/6692b95)), closes [#1389](https://github.com/vendure-ecommerce/vendure/issues/1389) * **core** Expose & document DataImportModule providers ([640f087](https://github.com/vendure-ecommerce/vendure/commit/640f087)), closes [#1336](https://github.com/vendure-ecommerce/vendure/issues/1336) * **core** Expose RequestContextService and add `create()` method ([335dfb5](https://github.com/vendure-ecommerce/vendure/commit/335dfb5)) * **core** Include Customer in CustomerAddressEvent ([67f60ac](https://github.com/vendure-ecommerce/vendure/commit/67f60ac)), closes [#1369](https://github.com/vendure-ecommerce/vendure/issues/1369) * **core** Loosen constraints on adding payment to Order ([7a42b01](https://github.com/vendure-ecommerce/vendure/commit/7a42b01)), closes [#963](https://github.com/vendure-ecommerce/vendure/issues/963) * **payments-plugin** Add Stripe integration (#1417) ([238be6b](https://github.com/vendure-ecommerce/vendure/commit/238be6b)), closes [#1417](https://github.com/vendure-ecommerce/vendure/issues/1417) * **ui-devkit** Allow yarn or npm to be specified to run ng compiler ([db66657](https://github.com/vendure-ecommerce/vendure/commit/db66657)) ## <small>1.4.7 (2022-02-22)</small> #### Fixes * **admin-ui** Allow non-SuperAdmins to perform CRUD on Channels ([791d47d](https://github.com/vendure-ecommerce/vendure/commit/791d47d)), closes [#1402](https://github.com/vendure-ecommerce/vendure/issues/1402) * **admin-ui** Correctly remove readonly custom field inputs ([75780ce](https://github.com/vendure-ecommerce/vendure/commit/75780ce)), closes [#1403](https://github.com/vendure-ecommerce/vendure/issues/1403) * **admin-ui** Fix issues with creating FacetValues with custom fields ([d4d4ee2](https://github.com/vendure-ecommerce/vendure/commit/d4d4ee2)), closes [#1434](https://github.com/vendure-ecommerce/vendure/issues/1434) * **admin-ui** Update to latest Angular v12, fix build error ([e54a2f2](https://github.com/vendure-ecommerce/vendure/commit/e54a2f2)), closes [#1408](https://github.com/vendure-ecommerce/vendure/issues/1408) * **core** Allow CRUD on Channels for non-SuperAdmins with permissions ([fd2f039](https://github.com/vendure-ecommerce/vendure/commit/fd2f039)), closes [#1402](https://github.com/vendure-ecommerce/vendure/issues/1402) * **core** Correctly display unitPrice of cancelled OrderLines ([e7c4373](https://github.com/vendure-ecommerce/vendure/commit/e7c4373)), closes [#1414](https://github.com/vendure-ecommerce/vendure/issues/1414) * **core** Fix entity relation paths typings in TS 4.5 ([c5e6c04](https://github.com/vendure-ecommerce/vendure/commit/c5e6c04)), closes [#1409](https://github.com/vendure-ecommerce/vendure/issues/1409) * **core** Fix error when using internal relation custom fields ([753470a](https://github.com/vendure-ecommerce/vendure/commit/753470a)), closes [#1416](https://github.com/vendure-ecommerce/vendure/issues/1416) * **core** Fix for job cancellation issue (#1420) ([2862dda](https://github.com/vendure-ecommerce/vendure/commit/2862dda)), closes [#1420](https://github.com/vendure-ecommerce/vendure/issues/1420) [#1127](https://github.com/vendure-ecommerce/vendure/issues/1127) * **core** Fix regression in accessing OrderLine.items when not defined ([32f2cd7](https://github.com/vendure-ecommerce/vendure/commit/32f2cd7)) * **core** Fix variant price/tax calculation when assigning to channel ([1a13e73](https://github.com/vendure-ecommerce/vendure/commit/1a13e73)), closes [#1421](https://github.com/vendure-ecommerce/vendure/issues/1421) * **core** Improve api context detection & error handling ([42d70f3](https://github.com/vendure-ecommerce/vendure/commit/42d70f3)), closes [#1426](https://github.com/vendure-ecommerce/vendure/issues/1426) * **core** Omit private facet values from Product.facetValues ([82e0b26](https://github.com/vendure-ecommerce/vendure/commit/82e0b26)), closes [#1435](https://github.com/vendure-ecommerce/vendure/issues/1435) * **payments-plugin** Fix logic for looking up Braintree payment method ([ad4ccf3](https://github.com/vendure-ecommerce/vendure/commit/ad4ccf3)) #### Perf * **common** Increase perf of `unique` helper by ~1000x ([910adf8](https://github.com/vendure-ecommerce/vendure/commit/910adf8)), closes [#1433](https://github.com/vendure-ecommerce/vendure/issues/1433) ## <small>1.4.6 (2022-02-04)</small> #### Fixes * **admin-ui** Do not display "undefined" in rich text editor ([e80b8c5](https://github.com/vendure-ecommerce/vendure/commit/e80b8c5)), closes [#1374](https://github.com/vendure-ecommerce/vendure/issues/1374) * **admin-ui** Fix error when toggling product list grouping ([1427399](https://github.com/vendure-ecommerce/vendure/commit/1427399)), closes [#1384](https://github.com/vendure-ecommerce/vendure/issues/1384) * **admin-ui** Fix hyphenation of long words (#1390) ([671a998](https://github.com/vendure-ecommerce/vendure/commit/671a998)), closes [#1390](https://github.com/vendure-ecommerce/vendure/issues/1390) * **admin-ui** Fix localeString error when creating Product ([e7013d0](https://github.com/vendure-ecommerce/vendure/commit/e7013d0)), closes [#1378](https://github.com/vendure-ecommerce/vendure/issues/1378) * **admin-ui** Fix long nav items (#1362) ([ffc48c6](https://github.com/vendure-ecommerce/vendure/commit/ffc48c6)), closes [#1362](https://github.com/vendure-ecommerce/vendure/issues/1362) [#1361](https://github.com/vendure-ecommerce/vendure/issues/1361) * **core** Add missing Fulfillment entity export ([cc1e4ed](https://github.com/vendure-ecommerce/vendure/commit/cc1e4ed)) * **core** Fix OrderAddress type AddressCustomFields error (#1394) ([b6dd5f4](https://github.com/vendure-ecommerce/vendure/commit/b6dd5f4)), closes [#1394](https://github.com/vendure-ecommerce/vendure/issues/1394) [#1377](https://github.com/vendure-ecommerce/vendure/issues/1377) * **core** Optimize DefaultSearchPlugin reindexing ([b9d2234](https://github.com/vendure-ecommerce/vendure/commit/b9d2234)), closes [#736](https://github.com/vendure-ecommerce/vendure/issues/736) * **core** Resolve OrderItem.fulfillment ([6a9efe9](https://github.com/vendure-ecommerce/vendure/commit/6a9efe9)), closes [#1381](https://github.com/vendure-ecommerce/vendure/issues/1381) * **elasticsearch-plugin** Fix high memory usage on reindex ([bce86f6](https://github.com/vendure-ecommerce/vendure/commit/bce86f6)), closes [#1120](https://github.com/vendure-ecommerce/vendure/issues/1120) ## <small>1.4.5 (2022-01-17)</small> #### Fixes * **admin-ui** Fix custom field select input ([2bbb972](https://github.com/vendure-ecommerce/vendure/commit/2bbb972)), closes [#1342](https://github.com/vendure-ecommerce/vendure/issues/1342) * **asset-server-plugin** Correctly handle non-latin filenames ([4cf8434](https://github.com/vendure-ecommerce/vendure/commit/4cf8434)), closes [#1343](https://github.com/vendure-ecommerce/vendure/issues/1343) * **core** Demote 404 errors to Verbose log level ([6b3c3fe](https://github.com/vendure-ecommerce/vendure/commit/6b3c3fe)), closes [#1335](https://github.com/vendure-ecommerce/vendure/issues/1335) * **core** Fix error with certain custom field config ([ba060b4](https://github.com/vendure-ecommerce/vendure/commit/ba060b4)), closes [#1337](https://github.com/vendure-ecommerce/vendure/issues/1337) * **core** Fix filtering by facet value uuid in DefaultSearchPlugin ([53babf6](https://github.com/vendure-ecommerce/vendure/commit/53babf6)), closes [#1341](https://github.com/vendure-ecommerce/vendure/issues/1341) * **core** Fix typings for EntityHydrator with nullable relations ([8f57547](https://github.com/vendure-ecommerce/vendure/commit/8f57547)) * **core** Prevent errors being logged by Nest's ExternalExceptionFilter ([cf4f246](https://github.com/vendure-ecommerce/vendure/commit/cf4f246)), closes [#1335](https://github.com/vendure-ecommerce/vendure/issues/1335) * **email-plugin** Fix population of shippingLines in order handler ([4cd7ecd](https://github.com/vendure-ecommerce/vendure/commit/4cd7ecd)), closes [#1354](https://github.com/vendure-ecommerce/vendure/issues/1354) ## <small>1.4.4 (2022-01-10)</small> #### Fixes * **admin-ui** Improve handling of locale combinations ([87f9f78](https://github.com/vendure-ecommerce/vendure/commit/87f9f78)) * **core** Correctly hydrate nested relations of empty array ([4a11666](https://github.com/vendure-ecommerce/vendure/commit/4a11666)), closes [#1324](https://github.com/vendure-ecommerce/vendure/issues/1324) * **core** Fix PromotionActions not passing state correctly (#1323) ([fc739c5](https://github.com/vendure-ecommerce/vendure/commit/fc739c5)), closes [#1323](https://github.com/vendure-ecommerce/vendure/issues/1323) [#1322](https://github.com/vendure-ecommerce/vendure/issues/1322) * **core** Return NotVerifiedError for resetPassword on unverified user ([8257d27](https://github.com/vendure-ecommerce/vendure/commit/8257d27)), closes [#1321](https://github.com/vendure-ecommerce/vendure/issues/1321) * **email-plugin** Fix sorting of emails in dev-mailbox ([57cc26e](https://github.com/vendure-ecommerce/vendure/commit/57cc26e)) ## <small>1.4.3 (2021-12-22)</small> #### Fixes * **admin-ui** Do not show cancelled orders in latest orders widget ([e842e6e](https://github.com/vendure-ecommerce/vendure/commit/e842e6e)) * **admin-ui** Fix broken Zone creation dialog ([2bc6f4d](https://github.com/vendure-ecommerce/vendure/commit/2bc6f4d)), closes [#1309](https://github.com/vendure-ecommerce/vendure/issues/1309) * **core** Prevent removal of sole SuperAdmin ([a1debff](https://github.com/vendure-ecommerce/vendure/commit/a1debff)), closes [#1307](https://github.com/vendure-ecommerce/vendure/issues/1307) * **core** Restore deleted superadmin entities ([498a5c6](https://github.com/vendure-ecommerce/vendure/commit/498a5c6)), closes [#1307](https://github.com/vendure-ecommerce/vendure/issues/1307) ## <small>1.4.2 (2021-12-20)</small> #### Fixes * **admin-ui** Allow CustomerGroup to be created ([2782df8](https://github.com/vendure-ecommerce/vendure/commit/2782df8)), closes [#1300](https://github.com/vendure-ecommerce/vendure/issues/1300) * **admin-ui** Correct the warning about the division in Sass (#1294) ([0e4e952](https://github.com/vendure-ecommerce/vendure/commit/0e4e952)), closes [#1294](https://github.com/vendure-ecommerce/vendure/issues/1294) [#1293](https://github.com/vendure-ecommerce/vendure/issues/1293) * **admin-ui** Fix cmd+u shortcut on macOS (#1291) ([0b74cc9](https://github.com/vendure-ecommerce/vendure/commit/0b74cc9)), closes [#1291](https://github.com/vendure-ecommerce/vendure/issues/1291) * **admin-ui** Fix null property access error for configurable args ([3f7d46d](https://github.com/vendure-ecommerce/vendure/commit/3f7d46d)), closes [#1296](https://github.com/vendure-ecommerce/vendure/issues/1296) * **admin-ui** Remove deprecated showCircularDependencies option ([a30d639](https://github.com/vendure-ecommerce/vendure/commit/a30d639)) * **core** Correctly record stock movement when modifying orders ([a983f24](https://github.com/vendure-ecommerce/vendure/commit/a983f24)), closes [#1210](https://github.com/vendure-ecommerce/vendure/issues/1210) * **core** EntityHydrator correctly handles custom field relations ([fd3e642](https://github.com/vendure-ecommerce/vendure/commit/fd3e642)), closes [#1284](https://github.com/vendure-ecommerce/vendure/issues/1284) * **core** Fix email verification for already-verified accounts (#1304) ([2f17b9a](https://github.com/vendure-ecommerce/vendure/commit/2f17b9a)), closes [#1304](https://github.com/vendure-ecommerce/vendure/issues/1304) [#1303](https://github.com/vendure-ecommerce/vendure/issues/1303) * **core** Handle search job buffer timeout errors, increase timeout ([8797456](https://github.com/vendure-ecommerce/vendure/commit/8797456)), closes [#1287](https://github.com/vendure-ecommerce/vendure/issues/1287) * **core** Handle substring search terms for postgres & mysql ([81e3672](https://github.com/vendure-ecommerce/vendure/commit/81e3672)), closes [#1277](https://github.com/vendure-ecommerce/vendure/issues/1277) ## <small>1.4.1 (2021-12-14)</small> #### Fixes * **core** Fix `Unknown type "ShippingMethodCustomFields"` error ([d810450](https://github.com/vendure-ecommerce/vendure/commit/d810450)) * **core** Fix FK error with adjustOrderLine when zero saleable stock ([28aeddb](https://github.com/vendure-ecommerce/vendure/commit/28aeddb)), closes [#1273](https://github.com/vendure-ecommerce/vendure/issues/1273) ## 1.4.0 (2021-12-13) #### Fixes * **admin-ui** Fix display of facet value custom fields ([f4a6dbd](https://github.com/vendure-ecommerce/vendure/commit/f4a6dbd)), closes [#1282](https://github.com/vendure-ecommerce/vendure/issues/1282) * **admin-ui** Fix error if no array of assets is provided (#1249) ([5af2b12](https://github.com/vendure-ecommerce/vendure/commit/5af2b12)), closes [#1249](https://github.com/vendure-ecommerce/vendure/issues/1249) * **admin-ui** Fix layout of Zone & CustomerGroup lists ([cd8b93d](https://github.com/vendure-ecommerce/vendure/commit/cd8b93d)) * **admin-ui** Fix rendering of custom field lists ([da9e2ce](https://github.com/vendure-ecommerce/vendure/commit/da9e2ce)) * **admin-ui** Fix tax rate permissions so product variants do not need access to customer groups (#1274) ([0a49fea](https://github.com/vendure-ecommerce/vendure/commit/0a49fea)), closes [#1274](https://github.com/vendure-ecommerce/vendure/issues/1274) * **admin-ui** General custom field tab always comes first ([873526d](https://github.com/vendure-ecommerce/vendure/commit/873526d)) * **core** Add Permission.ReadProduct to Allow decorator of TaxCategoryResolver.taxCategories (#1275) ([ff24fc0](https://github.com/vendure-ecommerce/vendure/commit/ff24fc0)), closes [#1275](https://github.com/vendure-ecommerce/vendure/issues/1275) * **core** Add Permission.ReadProduct to Allow decorator of TaxRateResolver.taxRates (#1258) ([5f5f767](https://github.com/vendure-ecommerce/vendure/commit/5f5f767)), closes [#1258](https://github.com/vendure-ecommerce/vendure/issues/1258) * **core** Clear shippingLines if no eligible ShippingMethods exist ([f9bc532](https://github.com/vendure-ecommerce/vendure/commit/f9bc532)), closes [#1195](https://github.com/vendure-ecommerce/vendure/issues/1195) * **core** Correctly validate custom field list types ([6f71bf2](https://github.com/vendure-ecommerce/vendure/commit/6f71bf2)), closes [#1241](https://github.com/vendure-ecommerce/vendure/issues/1241) * **core** Ensure all Orders have a ShippingMethod before payment ([9b9e547](https://github.com/vendure-ecommerce/vendure/commit/9b9e547)) * **core** Fix batch size error on postgres when reindexing (#1242) ([57be4c5](https://github.com/vendure-ecommerce/vendure/commit/57be4c5)), closes [#1242](https://github.com/vendure-ecommerce/vendure/issues/1242) * **core** Fix caching of zone members when switching language ([3c32fb2](https://github.com/vendure-ecommerce/vendure/commit/3c32fb2)) * **core** Fix EntityRelationPaths type for optional properties ([2d065f9](https://github.com/vendure-ecommerce/vendure/commit/2d065f9)) * **core** Fix permissions for `pendingSearchIndexUpdates` query ([152e64b](https://github.com/vendure-ecommerce/vendure/commit/152e64b)) * **core** Fix stream not being instance of ReadStream (#1238) ([5ee371d](https://github.com/vendure-ecommerce/vendure/commit/5ee371d)), closes [#1238](https://github.com/vendure-ecommerce/vendure/issues/1238) * **core** Gracefully handle errors in creating asset previews ([c3cfcb3](https://github.com/vendure-ecommerce/vendure/commit/c3cfcb3)), closes [#1246](https://github.com/vendure-ecommerce/vendure/issues/1246) * **core** Make facetValueCollectionFilter safe with uuids ([a3fef0f](https://github.com/vendure-ecommerce/vendure/commit/a3fef0f)) * **core** Make populator.populateCollections more robust to bad input ([8189c1b](https://github.com/vendure-ecommerce/vendure/commit/8189c1b)) * **core** Order collection.children by position ([f2def43](https://github.com/vendure-ecommerce/vendure/commit/f2def43)), closes [#1239](https://github.com/vendure-ecommerce/vendure/issues/1239) * **core** Re-allocate stock when cancelling a Fulfillment ([693fd83](https://github.com/vendure-ecommerce/vendure/commit/693fd83)), closes [#1250](https://github.com/vendure-ecommerce/vendure/issues/1250) #### Features * **admin-ui-plugin** Support for defaultLocale ([e7bd576](https://github.com/vendure-ecommerce/vendure/commit/e7bd576)), closes [#1196](https://github.com/vendure-ecommerce/vendure/issues/1196) * **admin-ui** Add filtering to FacetListComponent ([0ab212e](https://github.com/vendure-ecommerce/vendure/commit/0ab212e)) * **admin-ui** Add json editor field input component ([4297b87](https://github.com/vendure-ecommerce/vendure/commit/4297b87)) * **admin-ui** Add language switcher to Country & Zone list views ([7552fae](https://github.com/vendure-ecommerce/vendure/commit/7552fae)) * **admin-ui** Add rich text control form input ([0b09598](https://github.com/vendure-ecommerce/vendure/commit/0b09598)), closes [#415](https://github.com/vendure-ecommerce/vendure/issues/415) [#722](https://github.com/vendure-ecommerce/vendure/issues/722) * **admin-ui** Add support for tabbed custom fields ([b6cb16f](https://github.com/vendure-ecommerce/vendure/commit/b6cb16f)), closes [#724](https://github.com/vendure-ecommerce/vendure/issues/724) * **admin-ui** Allow custom components to embed in detail views ([e15c553](https://github.com/vendure-ecommerce/vendure/commit/e15c553)), closes [#415](https://github.com/vendure-ecommerce/vendure/issues/415) * **admin-ui** Allow manual payments to be added by Administrator ([0416869](https://github.com/vendure-ecommerce/vendure/commit/0416869)), closes [#753](https://github.com/vendure-ecommerce/vendure/issues/753) * **admin-ui** Display available UI extension points ([0963745](https://github.com/vendure-ecommerce/vendure/commit/0963745)), closes [#415](https://github.com/vendure-ecommerce/vendure/issues/415) * **admin-ui** Export all catalog components (#1248) ([e5feac4](https://github.com/vendure-ecommerce/vendure/commit/e5feac4)), closes [#1248](https://github.com/vendure-ecommerce/vendure/issues/1248) [#1245](https://github.com/vendure-ecommerce/vendure/issues/1245) * **admin-ui** Implement custom fields on newly-supported entities ([2da2ec9](https://github.com/vendure-ecommerce/vendure/commit/2da2ec9)), closes [#1185](https://github.com/vendure-ecommerce/vendure/issues/1185) * **admin-ui** Implement filtering in Collection list view ([aa74129](https://github.com/vendure-ecommerce/vendure/commit/aa74129)) * **admin-ui** Support for language regions (language + locale) ([b5cdbce](https://github.com/vendure-ecommerce/vendure/commit/b5cdbce)), closes [#1196](https://github.com/vendure-ecommerce/vendure/issues/1196) * **admin-ui** Use customField ui components specified in config ([f52459f](https://github.com/vendure-ecommerce/vendure/commit/f52459f)), closes [#415](https://github.com/vendure-ecommerce/vendure/issues/415) * **core** Add OrderPlacedEvent ([c1465dc](https://github.com/vendure-ecommerce/vendure/commit/c1465dc)), closes [#1219](https://github.com/vendure-ecommerce/vendure/issues/1219) * **core** Allow customField ui components to be specified in config ([e22e006](https://github.com/vendure-ecommerce/vendure/commit/e22e006)), closes [#415](https://github.com/vendure-ecommerce/vendure/issues/415) * **core** Allow manual payments to be added by Administrator ([107ca9a](https://github.com/vendure-ecommerce/vendure/commit/107ca9a)), closes [#753](https://github.com/vendure-ecommerce/vendure/issues/753) * **core** Allow PaginatedList queries to filter on ID fields ([fa3d5ed](https://github.com/vendure-ecommerce/vendure/commit/fa3d5ed)), closes [#1259](https://github.com/vendure-ecommerce/vendure/issues/1259) * **core** CustomField support on Country, CustomerGroup, PaymentMethod, Promotion, TaxCategory, ([fac803d](https://github.com/vendure-ecommerce/vendure/commit/fac803d)), closes [#1185](https://github.com/vendure-ecommerce/vendure/issues/1185) * **core** Expand the range of events published by the EventBus (#1222) ([edc9d69](https://github.com/vendure-ecommerce/vendure/commit/edc9d69)), closes [#1222](https://github.com/vendure-ecommerce/vendure/issues/1222) [#1219](https://github.com/vendure-ecommerce/vendure/issues/1219) [#1219](https://github.com/vendure-ecommerce/vendure/issues/1219) [#1219](https://github.com/vendure-ecommerce/vendure/issues/1219) [#1219](https://github.com/vendure-ecommerce/vendure/issues/1219) [#1219](https://github.com/vendure-ecommerce/vendure/issues/1219) [#1219](https://github.com/vendure-ecommerce/vendure/issues/1219) [#1219](https://github.com/vendure-ecommerce/vendure/issues/1219) * **core** Expose customfields on ShippingMethod- & PaymentMethodQuote ([52972db](https://github.com/vendure-ecommerce/vendure/commit/52972db)), closes [#1260](https://github.com/vendure-ecommerce/vendure/issues/1260) * **core** Support CSV import in multiple languages (#1199) ([4754954](https://github.com/vendure-ecommerce/vendure/commit/4754954)), closes [#1199](https://github.com/vendure-ecommerce/vendure/issues/1199) * **core** Upgrade TypeORM to v0.2.41 ([44f6fd5](https://github.com/vendure-ecommerce/vendure/commit/44f6fd5)) * **elasticsearch-plugin** Add custom sort parameter mapping (#1230) ([0d1f687](https://github.com/vendure-ecommerce/vendure/commit/0d1f687)), closes [#1230](https://github.com/vendure-ecommerce/vendure/issues/1230) [#1220](https://github.com/vendure-ecommerce/vendure/issues/1220) [#1220](https://github.com/vendure-ecommerce/vendure/issues/1220) * **elasticsearch-plugin** Add option to hide indexed fields in api (#1181) (#1212) ([9193dee](https://github.com/vendure-ecommerce/vendure/commit/9193dee)), closes [#1181](https://github.com/vendure-ecommerce/vendure/issues/1181) [#1212](https://github.com/vendure-ecommerce/vendure/issues/1212) * **payments-plugin** Add MolliePlugin - Mollie Payments integration * **payments-plugin** Add BraintreePlugin - Braintree Payments integration * **payments-plugin** Add support for Braintree vault to store cc data ([1d93db8](https://github.com/vendure-ecommerce/vendure/commit/1d93db8)) * **payments-plugin** Allow Braintree environment to be set ([55d67d9](https://github.com/vendure-ecommerce/vendure/commit/55d67d9)) * **ui-devkit** Expose route data in hosted UI extensions ([c3a21ff](https://github.com/vendure-ecommerce/vendure/commit/c3a21ff)), closes [#1281](https://github.com/vendure-ecommerce/vendure/issues/1281) ## <small>1.3.4 (2021-11-23)</small> #### Fixes * **core** Correctly deep-merge hydrated entities ([32d19e3](https://github.com/vendure-ecommerce/vendure/commit/32d19e3)), closes [#1229](https://github.com/vendure-ecommerce/vendure/issues/1229) * **core** Correctly set OrderItem prices on tax zone change ([731f8d9](https://github.com/vendure-ecommerce/vendure/commit/731f8d9)), closes [#1216](https://github.com/vendure-ecommerce/vendure/issues/1216) * **core** Do not list deleted ProductVariants in Collections ([5cd8e1a](https://github.com/vendure-ecommerce/vendure/commit/5cd8e1a)), closes [#1213](https://github.com/vendure-ecommerce/vendure/issues/1213) * **core** Fix argsArrayToHash, case where arg not present in this.args (#1224) ([454fdf5](https://github.com/vendure-ecommerce/vendure/commit/454fdf5)), closes [#1224](https://github.com/vendure-ecommerce/vendure/issues/1224) * **core** Fix edge case FK error when creating new Collections ([160f457](https://github.com/vendure-ecommerce/vendure/commit/160f457)), closes [#1215](https://github.com/vendure-ecommerce/vendure/issues/1215) * **core** Fix ONLY_FULL_GROUP_BY error when searching with MySQL ([94fa4db](https://github.com/vendure-ecommerce/vendure/commit/94fa4db)), closes [#1236](https://github.com/vendure-ecommerce/vendure/issues/1236) * **core** Fix ProductService.assignProductsToChannel to properly assign assets to channel (#1235) ([a3066b0](https://github.com/vendure-ecommerce/vendure/commit/a3066b0)), closes [#1235](https://github.com/vendure-ecommerce/vendure/issues/1235) * **testing** Fix "fail is not defined" error ([c474d93](https://github.com/vendure-ecommerce/vendure/commit/c474d93)) ## <small>1.3.3 (2021-11-09)</small> #### Fixes * **admin-ui** Correctly display primitive value job queue results ([d8c2195](https://github.com/vendure-ecommerce/vendure/commit/d8c2195)), closes [#881](https://github.com/vendure-ecommerce/vendure/issues/881) * **admin-ui** Fix display of channels in Role detail ([dee331a](https://github.com/vendure-ecommerce/vendure/commit/dee331a)), closes [#1211](https://github.com/vendure-ecommerce/vendure/issues/1211) * **core** Correctly cancel sales when cancelling Fulfillment ([00ac70d](https://github.com/vendure-ecommerce/vendure/commit/00ac70d)), closes [#1198](https://github.com/vendure-ecommerce/vendure/issues/1198) * **core** Export missing tax config types ([08951b3](https://github.com/vendure-ecommerce/vendure/commit/08951b3)) * **core** Fix error thrown when shipping address company is null ([303a216](https://github.com/vendure-ecommerce/vendure/commit/303a216)), closes [#744](https://github.com/vendure-ecommerce/vendure/issues/744) * **core** Make populator.populateCollections more robust to bad input ([15762e0](https://github.com/vendure-ecommerce/vendure/commit/15762e0)) ## <small>1.3.2 (2021-10-28)</small> #### Perf * **admin-ui** Improve performance of Collection list view ([4bf6dff](https://github.com/vendure-ecommerce/vendure/commit/4bf6dff)), closes [#1123](https://github.com/vendure-ecommerce/vendure/issues/1123) #### Fixes * **admin-ui-plugin** Correctly handle base href for custom routes ([752cc13](https://github.com/vendure-ecommerce/vendure/commit/752cc13)), closes [#1152](https://github.com/vendure-ecommerce/vendure/issues/1152) * **admin-ui** Add pt_PT translation to ui config ([c7a7bbd](https://github.com/vendure-ecommerce/vendure/commit/c7a7bbd)) * **admin-ui** Currency input handles currencies without minor units ([fd643b3](https://github.com/vendure-ecommerce/vendure/commit/fd643b3)), closes [#1146](https://github.com/vendure-ecommerce/vendure/issues/1146) * **core** Allow an Order in ArrangingAdditionalPayment to be cancelled ([3e1a3cf](https://github.com/vendure-ecommerce/vendure/commit/3e1a3cf)), closes [#1177](https://github.com/vendure-ecommerce/vendure/issues/1177) * **core** Export ShippingLine entity ([98927dd](https://github.com/vendure-ecommerce/vendure/commit/98927dd)) * **core** Fix error in validating custom fields with introspection fields in query ([f856491](https://github.com/vendure-ecommerce/vendure/commit/f856491)), closes [#1091](https://github.com/vendure-ecommerce/vendure/issues/1091) * **core** Fix order modification with refund on shipping ([95bff8f](https://github.com/vendure-ecommerce/vendure/commit/95bff8f)), closes [#1197](https://github.com/vendure-ecommerce/vendure/issues/1197) * **core** Fix polynomial regex vulnerability ([6675757](https://github.com/vendure-ecommerce/vendure/commit/6675757)) * **create** Update TypeScript to match current supported version ([3be6b88](https://github.com/vendure-ecommerce/vendure/commit/3be6b88)), closes [#1188](https://github.com/vendure-ecommerce/vendure/issues/1188) ## <small>1.3.1 (2021-10-19)</small> #### Fixes * **core** Allow middleware to inject TransactionalConnection ([28f713c](https://github.com/vendure-ecommerce/vendure/commit/28f713c)), closes [#1160](https://github.com/vendure-ecommerce/vendure/issues/1160) * **core** Fix EntityHydrator missing nested relations ([fbda3dd](https://github.com/vendure-ecommerce/vendure/commit/fbda3dd)), closes [#1161](https://github.com/vendure-ecommerce/vendure/issues/1161) * **core** Fix EntityHydrator when hydrating empty array relation ([70e0314](https://github.com/vendure-ecommerce/vendure/commit/70e0314)), closes [#1153](https://github.com/vendure-ecommerce/vendure/issues/1153) * **core** Fix EntityHydrator with entity getters ([7d0e894](https://github.com/vendure-ecommerce/vendure/commit/7d0e894)), closes [#1172](https://github.com/vendure-ecommerce/vendure/issues/1172) * **core** Fix shipping price when the promotion is not applicable anymore (#1150) ([eb1dcc4](https://github.com/vendure-ecommerce/vendure/commit/eb1dcc4)), closes [#1150](https://github.com/vendure-ecommerce/vendure/issues/1150) * **core** Improved error message when Order.lines not joined ([0a33e5c](https://github.com/vendure-ecommerce/vendure/commit/0a33e5c)) #### Perf * **core** Improve perf of DefaultSearchPlugin reindex job ([bfc72f2](https://github.com/vendure-ecommerce/vendure/commit/bfc72f2)) * **elasticsearch-plugin** Optimize indexing using RequestContextCache ([75da3b3](https://github.com/vendure-ecommerce/vendure/commit/75da3b3)) ## 1.3.0 (2021-10-13) #### Features * **admin-ui** Add admin-ui Portuguese (Portugal) translation (#1069) ([81d9836](https://github.com/vendure-ecommerce/vendure/commit/81d9836)), closes [#1069](https://github.com/vendure-ecommerce/vendure/issues/1069) * **admin-ui** Add empty option for nullable custom field selects ([894ca4a](https://github.com/vendure-ecommerce/vendure/commit/894ca4a)), closes [#1083](https://github.com/vendure-ecommerce/vendure/issues/1083) * **admin-ui** Display pending search index updates in product list ([6f4a89f](https://github.com/vendure-ecommerce/vendure/commit/6f4a89f)), closes [#1137](https://github.com/vendure-ecommerce/vendure/issues/1137) * **admin-ui** Display retry data in job list ([9c544bf](https://github.com/vendure-ecommerce/vendure/commit/9c544bf)) * **admin-ui** Improve facet filtering for product search input ([43f0adb](https://github.com/vendure-ecommerce/vendure/commit/43f0adb)), closes [#1078](https://github.com/vendure-ecommerce/vendure/issues/1078) * **admin-ui** Use server pagination of product variants ([552eafe](https://github.com/vendure-ecommerce/vendure/commit/552eafe)), closes [#1110](https://github.com/vendure-ecommerce/vendure/issues/1110) * **core** Add config for enabling/disabling worker health check ([f620566](https://github.com/vendure-ecommerce/vendure/commit/f620566)), closes [#1112](https://github.com/vendure-ecommerce/vendure/issues/1112) * **core** Add DB-based buffer storage support to DefaultJobQueuePlugin ([f26ad4b](https://github.com/vendure-ecommerce/vendure/commit/f26ad4b)), closes [#1137](https://github.com/vendure-ecommerce/vendure/issues/1137) * **core** Add Product.variantList field ([438ac46](https://github.com/vendure-ecommerce/vendure/commit/438ac46)), closes [#1110](https://github.com/vendure-ecommerce/vendure/issues/1110) * **core** Add support for stock status in DefaultSearchPlugin ([65add05](https://github.com/vendure-ecommerce/vendure/commit/65add05)), closes [#870](https://github.com/vendure-ecommerce/vendure/issues/870) * **core** Allow DefaultJobQueue retries to be configured per queue ([5017622](https://github.com/vendure-ecommerce/vendure/commit/5017622)), closes [#1111](https://github.com/vendure-ecommerce/vendure/issues/1111) * **core** Allow PaginatedList filters to use logical OR operator ([e371aa5](https://github.com/vendure-ecommerce/vendure/commit/e371aa5)), closes [#1149](https://github.com/vendure-ecommerce/vendure/issues/1149) * **core** Correctly index stock status based on saleable stock level ([4db9a37](https://github.com/vendure-ecommerce/vendure/commit/4db9a37)), closes [#870](https://github.com/vendure-ecommerce/vendure/issues/870) * **core** Create buffering logic for DefaultSearchPlugin ([6a47dcf](https://github.com/vendure-ecommerce/vendure/commit/6a47dcf)), closes [#1137](https://github.com/vendure-ecommerce/vendure/issues/1137) * **core** Create JobBuffer infrastructure ([d6aa20f](https://github.com/vendure-ecommerce/vendure/commit/d6aa20f)), closes [#1137](https://github.com/vendure-ecommerce/vendure/issues/1137) * **core** Export RequestContextCacheService from core ([92aa83f](https://github.com/vendure-ecommerce/vendure/commit/92aa83f)) * **core** Expose `nullable` property of CustomFieldConfig ([9ec6b90](https://github.com/vendure-ecommerce/vendure/commit/9ec6b90)), closes [#1083](https://github.com/vendure-ecommerce/vendure/issues/1083) * **core** Expose `withTransaction` method on TransactionalConnection ([861ef29](https://github.com/vendure-ecommerce/vendure/commit/861ef29)), closes [#1129](https://github.com/vendure-ecommerce/vendure/issues/1129) * **core** Expose pending search index updates operations in Admin API ([53a1943](https://github.com/vendure-ecommerce/vendure/commit/53a1943)), closes [#1137](https://github.com/vendure-ecommerce/vendure/issues/1137) * **core** Expose retry data on Job type in Admin API ([4b15ef4](https://github.com/vendure-ecommerce/vendure/commit/4b15ef4)) * **core** Implement EntityHydrator to simplify working with entities ([28e6a3a](https://github.com/vendure-ecommerce/vendure/commit/28e6a3a)), closes [#1103](https://github.com/vendure-ecommerce/vendure/issues/1103) * **core** Make entity cache ttl values configurable ([a05e7ab](https://github.com/vendure-ecommerce/vendure/commit/a05e7ab)), closes [#988](https://github.com/vendure-ecommerce/vendure/issues/988) * **core** Make event bus subscriptions transaction-safe ([f0fd662](https://github.com/vendure-ecommerce/vendure/commit/f0fd662)), closes [#1107](https://github.com/vendure-ecommerce/vendure/issues/1107) [#520](https://github.com/vendure-ecommerce/vendure/issues/520) * **core** Make extractSessionToken function available in core package ([f364e68](https://github.com/vendure-ecommerce/vendure/commit/f364e68)) * **core** Make password hashing strategy configurable ([e5abab0](https://github.com/vendure-ecommerce/vendure/commit/e5abab0)), closes [#1063](https://github.com/vendure-ecommerce/vendure/issues/1063) * **core** Remove all long-lived in-memory state, use short-TTL caching ([d428ffc](https://github.com/vendure-ecommerce/vendure/commit/d428ffc)) * **create** Improve config defaults ([e2f799c](https://github.com/vendure-ecommerce/vendure/commit/e2f799c)), closes [#1147](https://github.com/vendure-ecommerce/vendure/issues/1147) * **elasticsearch-plugin** Add inStock attribute and filter (#1130) ([53cfb8e](https://github.com/vendure-ecommerce/vendure/commit/53cfb8e)), closes [#1130](https://github.com/vendure-ecommerce/vendure/issues/1130) [#870](https://github.com/vendure-ecommerce/vendure/issues/870) * **elasticsearch-plugin** Allow custom mappings with type `ID` ([45c5b2d](https://github.com/vendure-ecommerce/vendure/commit/45c5b2d)) * **elasticsearch-plugin** Allow the SearchInput to be extended ([5981619](https://github.com/vendure-ecommerce/vendure/commit/5981619)) * **elasticsearch-plugin** Custom mappings can return lists & allow additional Product/variant relation hydration ([ee47095](https://github.com/vendure-ecommerce/vendure/commit/ee47095)), closes [#1054](https://github.com/vendure-ecommerce/vendure/issues/1054) [#1141](https://github.com/vendure-ecommerce/vendure/issues/1141) * **elasticsearch-plugin** Extend config with customScriptFields ([d300f8b](https://github.com/vendure-ecommerce/vendure/commit/d300f8b)), closes [#1143](https://github.com/vendure-ecommerce/vendure/issues/1143) * **elasticsearch-plugin** Index custom product mappings for products without variants ([a0b4534](https://github.com/vendure-ecommerce/vendure/commit/a0b4534)) * **elasticsearch-plugin** Index stock status based on saleable stock ([4efe258](https://github.com/vendure-ecommerce/vendure/commit/4efe258)), closes [#870](https://github.com/vendure-ecommerce/vendure/issues/870) * **elasticsearch-plugin** Support search index job batching ([f3fb298](https://github.com/vendure-ecommerce/vendure/commit/f3fb298)), closes [#1137](https://github.com/vendure-ecommerce/vendure/issues/1137) * **job-queue-plugin** Allow config of retries/backoff for BullMQ ([9fda858](https://github.com/vendure-ecommerce/vendure/commit/9fda858)), closes [#1111](https://github.com/vendure-ecommerce/vendure/issues/1111) * **job-queue-plugin** Implement Redis-based job buffering ([c7b91c3](https://github.com/vendure-ecommerce/vendure/commit/c7b91c3)) #### Fixes * **admin-ui** Improved Spanish translation of "facets" (#1122) ([b20d497](https://github.com/vendure-ecommerce/vendure/commit/b20d497)), closes [#1122](https://github.com/vendure-ecommerce/vendure/issues/1122) * **core** Correct cancellation logic with custom Order process ([b8448c1](https://github.com/vendure-ecommerce/vendure/commit/b8448c1)), closes [#1104](https://github.com/vendure-ecommerce/vendure/issues/1104) * **core** Correctly calculate job duration for pending/retrying jobs ([73fa278](https://github.com/vendure-ecommerce/vendure/commit/73fa278)) * **core** Fix error when resolving deleted Product from Order ([511f04d](https://github.com/vendure-ecommerce/vendure/commit/511f04d)), closes [#1125](https://github.com/vendure-ecommerce/vendure/issues/1125) * **core** Fix transaction-related issues with in-memory caching ([d35306f](https://github.com/vendure-ecommerce/vendure/commit/d35306f)) * **create** Correct escaping of quotes in templates ([9537245](https://github.com/vendure-ecommerce/vendure/commit/9537245)) * **job-queue-plugin** Close redis connection on destroy ([64ebdd1](https://github.com/vendure-ecommerce/vendure/commit/64ebdd1)) * **job-queue-plugin** Correctly filter BullMQ jobs by isSettled ([2f24a33](https://github.com/vendure-ecommerce/vendure/commit/2f24a33)) * **job-queue-plugin** More accurate determination of BullMQ job state ([3b3bb3b](https://github.com/vendure-ecommerce/vendure/commit/3b3bb3b)) #### Perf * **core** Simplify hot DB query for active order ([fa563f2](https://github.com/vendure-ecommerce/vendure/commit/fa563f2)) * **core** Use memoization when caching zone members ([54dfbf4](https://github.com/vendure-ecommerce/vendure/commit/54dfbf4)), closes [#988](https://github.com/vendure-ecommerce/vendure/issues/988) * **core** Use per-request caching for hot ProductVariant paths ([214b86b](https://github.com/vendure-ecommerce/vendure/commit/214b86b)), closes [#988](https://github.com/vendure-ecommerce/vendure/issues/988) * **core** Use request cache for hot-path tax rate calculation ([9e22e8b](https://github.com/vendure-ecommerce/vendure/commit/9e22e8b)) ## <small>1.2.3 (2021-09-29)</small> This release fixes an error in the publishing of the TypeScript definitions from v1.2.2. ## <small>1.2.2 (2021-09-28)</small> #### Perf * **core** Cache certain field resolvers to avoid duplicated DB calls ([13697c3](https://github.com/vendure-ecommerce/vendure/commit/13697c3)), closes [#1119](https://github.com/vendure-ecommerce/vendure/issues/1119) #### Fixes * **admin-ui** Do not cache active admin details between logins ([20b4b04](https://github.com/vendure-ecommerce/vendure/commit/20b4b04)), closes [#1099](https://github.com/vendure-ecommerce/vendure/issues/1099) * **admin-ui** Use correct order total on Customer detail page ([ddc2b0a](https://github.com/vendure-ecommerce/vendure/commit/ddc2b0a)) * **core** Fix wrong event type when a variant is created (#1102) ([cc45254](https://github.com/vendure-ecommerce/vendure/commit/cc45254)), closes [#1102](https://github.com/vendure-ecommerce/vendure/issues/1102) [#1095](https://github.com/vendure-ecommerce/vendure/issues/1095) * **core** Add missing logging & docs to DefaultJobQueuePlugin ([423f307](https://github.com/vendure-ecommerce/vendure/commit/423f307)) * **core** Fix collection update event generation (#1114) ([6e7e864](https://github.com/vendure-ecommerce/vendure/commit/6e7e864)), closes [#1114](https://github.com/vendure-ecommerce/vendure/issues/1114) [#1015](https://github.com/vendure-ecommerce/vendure/issues/1015) * **core** Fix updating customer email with no NativeAuth configured ([f6d3a52](https://github.com/vendure-ecommerce/vendure/commit/f6d3a52)), closes [#1092](https://github.com/vendure-ecommerce/vendure/issues/1092) * **core** Gracefully handle errors when populating initial data ([36c15b2](https://github.com/vendure-ecommerce/vendure/commit/36c15b2)) * **core** Return correct timestamp values for translated entities ([ded49c4](https://github.com/vendure-ecommerce/vendure/commit/ded49c4)), closes [#1101](https://github.com/vendure-ecommerce/vendure/issues/1101) * **core** Soft-delete variants when a product is soft-deleted ([ff1ae90](https://github.com/vendure-ecommerce/vendure/commit/ff1ae90)), closes [#1096](https://github.com/vendure-ecommerce/vendure/issues/1096) * **elasticsearch-plugin** Elasticsearch Cloud auth is not set during re-indexing (#1108) ([e40fc1c](https://github.com/vendure-ecommerce/vendure/commit/e40fc1c)), closes [#1108](https://github.com/vendure-ecommerce/vendure/issues/1108) [#1106](https://github.com/vendure-ecommerce/vendure/issues/1106) * **email-plugin** Correctly register failed email sending, add retry ([f50708a](https://github.com/vendure-ecommerce/vendure/commit/f50708a)) * **job-queue-plugin** Add missing logging & backoff settings ([6f7cc34](https://github.com/vendure-ecommerce/vendure/commit/6f7cc34)) * **job-queue-plugin** Fix redis connection to remote hosts ([9e36873](https://github.com/vendure-ecommerce/vendure/commit/9e36873)), closes [#1097](https://github.com/vendure-ecommerce/vendure/issues/1097) ## <small>1.2.1 (2021-09-15)</small> #### Fixes * **admin-ui** Add missing Spanish translation strings and fix a few typos (#1079) ([bd22dc5](https://github.com/vendure-ecommerce/vendure/commit/bd22dc5)), closes [#1079](https://github.com/vendure-ecommerce/vendure/issues/1079) * **admin-ui** Hide "assign to channel" button when creating Product ([ffeeaf6](https://github.com/vendure-ecommerce/vendure/commit/ffeeaf6)), closes [#1059](https://github.com/vendure-ecommerce/vendure/issues/1059) * **admin-ui** Keep product search bar in sync with url params ([58d5634](https://github.com/vendure-ecommerce/vendure/commit/58d5634)), closes [#1053](https://github.com/vendure-ecommerce/vendure/issues/1053) * **admin-ui** More consistent width of default custom field controls ([001207f](https://github.com/vendure-ecommerce/vendure/commit/001207f)), closes [#1077](https://github.com/vendure-ecommerce/vendure/issues/1077) * **core** Fix validation for nullable custom string fields with options ([9afa145](https://github.com/vendure-ecommerce/vendure/commit/9afa145)), closes [#1083](https://github.com/vendure-ecommerce/vendure/issues/1083) * **core** Improve log level of ForbiddenError to reduce log noise ([5be1dfe](https://github.com/vendure-ecommerce/vendure/commit/5be1dfe)), closes [#1080](https://github.com/vendure-ecommerce/vendure/issues/1080) * **core** Translate root Collection on first creation ([46659c7](https://github.com/vendure-ecommerce/vendure/commit/46659c7)), closes [#1068](https://github.com/vendure-ecommerce/vendure/issues/1068) * **core** Update login credentials when changing customer email address ([1ebc872](https://github.com/vendure-ecommerce/vendure/commit/1ebc872)), closes [#1071](https://github.com/vendure-ecommerce/vendure/issues/1071) * **create** Do not HTML escape strings used in the config file ([954c03a](https://github.com/vendure-ecommerce/vendure/commit/954c03a)), closes [#1070](https://github.com/vendure-ecommerce/vendure/issues/1070) ## 1.2.0 (2021-09-01) #### Features * **admin-ui** Add admin-ui Italian translation (#998) ([657a32b](https://github.com/vendure-ecommerce/vendure/commit/657a32b)), closes [#998](https://github.com/vendure-ecommerce/vendure/issues/998) * **admin-ui** Allow editing ProductOptionGroup names & options ([55d9784](https://github.com/vendure-ecommerce/vendure/commit/55d9784)), closes [#965](https://github.com/vendure-ecommerce/vendure/issues/965) * **admin-ui** Allow OrderAddress custom fields to be modified ([175e61a](https://github.com/vendure-ecommerce/vendure/commit/175e61a)), closes [#979](https://github.com/vendure-ecommerce/vendure/issues/979) * **admin-ui** Auto-select newly uploaded assets in AssetPickerDialog ([96cc8f9](https://github.com/vendure-ecommerce/vendure/commit/96cc8f9)) * **admin-ui** Support non-latin Product/Collection slugs ([fac735f](https://github.com/vendure-ecommerce/vendure/commit/fac735f)), closes [#1006](https://github.com/vendure-ecommerce/vendure/issues/1006) * **core** Add Russian and Ukrainian translation for server messages (#973) ([5b4a166](https://github.com/vendure-ecommerce/vendure/commit/5b4a166)), closes [#973](https://github.com/vendure-ecommerce/vendure/issues/973) * **core** Add Facet queries to Shop API (#1016) ([d6a049c](https://github.com/vendure-ecommerce/vendure/commit/d6a049c)), closes [#1016](https://github.com/vendure-ecommerce/vendure/issues/1016) [#1013](https://github.com/vendure-ecommerce/vendure/issues/1013) * **core** Allow cookie & bearer session tokens at the same time ([fc6b890](https://github.com/vendure-ecommerce/vendure/commit/fc6b890)), closes [#960](https://github.com/vendure-ecommerce/vendure/issues/960) * **core** Allow OrderAddress custom fields to be modified ([c622f1f](https://github.com/vendure-ecommerce/vendure/commit/c622f1f)), closes [#979](https://github.com/vendure-ecommerce/vendure/issues/979) * **core** Always pass current Order to TaxZoneStrategy calls ([7b76a7c](https://github.com/vendure-ecommerce/vendure/commit/7b76a7c)), closes [#1048](https://github.com/vendure-ecommerce/vendure/issues/1048) * **core** Export I18nModule as part of PluginCommonModule ([cd8f3d4](https://github.com/vendure-ecommerce/vendure/commit/cd8f3d4)), closes [#966](https://github.com/vendure-ecommerce/vendure/issues/966) * **core** Export ProcessContextModule from PluginCommonModule ([b787acb](https://github.com/vendure-ecommerce/vendure/commit/b787acb)) * **core** Implement health check server for worker ([fd374b3](https://github.com/vendure-ecommerce/vendure/commit/fd374b3)), closes [#994](https://github.com/vendure-ecommerce/vendure/issues/994) * **core** Implement internal health check for worker ([812b2cb](https://github.com/vendure-ecommerce/vendure/commit/812b2cb)), closes [#994](https://github.com/vendure-ecommerce/vendure/issues/994) * **elasticsearch-plugin** Add ability to customize index options and mappings ([92587e5](https://github.com/vendure-ecommerce/vendure/commit/92587e5)), closes [#995](https://github.com/vendure-ecommerce/vendure/issues/995) [#995](https://github.com/vendure-ecommerce/vendure/issues/995) [#995](https://github.com/vendure-ecommerce/vendure/issues/995) [#995](https://github.com/vendure-ecommerce/vendure/issues/995) * **job-queue-plugin** Create BullMQJobQueuePlugin ([ba9f5d0](https://github.com/vendure-ecommerce/vendure/commit/ba9f5d0)) * **job-queue-plugin** Set default concurrency ([0e971e7](https://github.com/vendure-ecommerce/vendure/commit/0e971e7)) #### Fixes * **admin-ui-plugin** Do not run server logic in worker context ([7c30f0e](https://github.com/vendure-ecommerce/vendure/commit/7c30f0e)) * **admin-ui** Fix fetch loop on job list view ([29c306a](https://github.com/vendure-ecommerce/vendure/commit/29c306a)), closes [#1049](https://github.com/vendure-ecommerce/vendure/issues/1049) * **asset-server-plugin** Do not run server logic in worker context ([c3a67b6](https://github.com/vendure-ecommerce/vendure/commit/c3a67b6)) * **core** Correctly persist ProductVariant customFields ([e59f52e](https://github.com/vendure-ecommerce/vendure/commit/e59f52e)), closes [#1056](https://github.com/vendure-ecommerce/vendure/issues/1056) * **core** Fix incorrect common import paths ([568e4b2](https://github.com/vendure-ecommerce/vendure/commit/568e4b2)) * **email-plugin** Do not run server logic in worker context ([f5b6ddc](https://github.com/vendure-ecommerce/vendure/commit/f5b6ddc)) ## <small>1.1.5 (2021-08-19)</small> #### Fixes * **admin-ui** Fix regression from v1.1.4 which broke Admin UI ([63ad437](https://github.com/vendure-ecommerce/vendure/commit/63ad437)), closes [#1045](https://github.com/vendure-ecommerce/vendure/issues/1045) * **core** Correct camel casing for custom orderable asset ids ([cd18431](https://github.com/vendure-ecommerce/vendure/commit/cd18431)), closes [#1035](https://github.com/vendure-ecommerce/vendure/issues/1035) ## <small>1.1.4 (2021-08-19)</small> #### Fixes * **admin-ui** Apply variant name auto-generation for new translations ([df3d3f4](https://github.com/vendure-ecommerce/vendure/commit/df3d3f4)), closes [#600](https://github.com/vendure-ecommerce/vendure/issues/600) * **admin-ui** Correctly display OrderLine custom field values ([496ce5e](https://github.com/vendure-ecommerce/vendure/commit/496ce5e)), closes [#1031](https://github.com/vendure-ecommerce/vendure/issues/1031) * **admin-ui** Correctly set content lang based on available langs ([d9531fd](https://github.com/vendure-ecommerce/vendure/commit/d9531fd)), closes [#1033](https://github.com/vendure-ecommerce/vendure/issues/1033) * **admin-ui** Fix Channel dropdown auto-select in Safari (#1040) ([aee8416](https://github.com/vendure-ecommerce/vendure/commit/aee8416)), closes [#1040](https://github.com/vendure-ecommerce/vendure/issues/1040) [#1036](https://github.com/vendure-ecommerce/vendure/issues/1036) * **admin-ui** Improve display of long Collection paths in dropdown ([4d7032b](https://github.com/vendure-ecommerce/vendure/commit/4d7032b)), closes [#1042](https://github.com/vendure-ecommerce/vendure/issues/1042) * **core** Allow custom host id when creating new entity with orderable assets (#1035) ([aeaf308](https://github.com/vendure-ecommerce/vendure/commit/aeaf308)), closes [#1035](https://github.com/vendure-ecommerce/vendure/issues/1035) [#1034](https://github.com/vendure-ecommerce/vendure/issues/1034) * **core** Fix custom field validation when updating ProductVariants ([372b4af](https://github.com/vendure-ecommerce/vendure/commit/372b4af)), closes [#1014](https://github.com/vendure-ecommerce/vendure/issues/1014) * **core** Fix incorrect quantity adjustment (#983) ([2441ce7](https://github.com/vendure-ecommerce/vendure/commit/2441ce7)), closes [#983](https://github.com/vendure-ecommerce/vendure/issues/983) [#931](https://github.com/vendure-ecommerce/vendure/issues/931) * **core** Fix publishing CustomerEvent without customer ID ([03cd5d7](https://github.com/vendure-ecommerce/vendure/commit/03cd5d7)) * **core** Fix stock movements when multiple OrderLines have same ProductVariant ([1b05f38](https://github.com/vendure-ecommerce/vendure/commit/1b05f38)), closes [#1028](https://github.com/vendure-ecommerce/vendure/issues/1028) * **core** Improve def of Translated<T> to allow customField typings ([3911059](https://github.com/vendure-ecommerce/vendure/commit/3911059)), closes [#1021](https://github.com/vendure-ecommerce/vendure/issues/1021) * **core** Loosen type def for ErrorResultUnion ([43ce722](https://github.com/vendure-ecommerce/vendure/commit/43ce722)) ## <small>1.1.3 (2021-07-29)</small> #### Fixes * **admin-ui** Fix case sensitivity in product variant filter ([02f9995](https://github.com/vendure-ecommerce/vendure/commit/02f9995)) * **core** Correct typings for VendureConfig.catalogOptions ([73e859b](https://github.com/vendure-ecommerce/vendure/commit/73e859b)) * **core** Fix update of ProductVariant with relation custom fields ([6e794c0](https://github.com/vendure-ecommerce/vendure/commit/6e794c0)), closes [#997](https://github.com/vendure-ecommerce/vendure/issues/997) * **core** Fix validation of relation custom fields ([fc3a9c5](https://github.com/vendure-ecommerce/vendure/commit/fc3a9c5)), closes [#1000](https://github.com/vendure-ecommerce/vendure/issues/1000) * **core** Import localeString custom fields from csv ([d25ea26](https://github.com/vendure-ecommerce/vendure/commit/d25ea26)), closes [#1001](https://github.com/vendure-ecommerce/vendure/issues/1001) ## <small>1.1.2 (2021-07-20)</small> #### Fixes * **admin-ui** Fix error when saving Product ([dbf6c00](https://github.com/vendure-ecommerce/vendure/commit/dbf6c00)) ## <small>1.1.1 (2021-07-19)</small> #### Fixes * **admin-ui** Correctly display currency names in all languages ([bf728d6](https://github.com/vendure-ecommerce/vendure/commit/bf728d6)), closes [#971](https://github.com/vendure-ecommerce/vendure/issues/971) * **admin-ui** Correctly refund shipping amount when refunding an order ([42ef9bf](https://github.com/vendure-ecommerce/vendure/commit/42ef9bf)), closes [#989](https://github.com/vendure-ecommerce/vendure/issues/989) * **admin-ui** Fix affix logic of CurrencyInputComponent ([bcb57b0](https://github.com/vendure-ecommerce/vendure/commit/bcb57b0)), closes [#971](https://github.com/vendure-ecommerce/vendure/issues/971) * **admin-ui** Fix broken image re-ordering drag-drop ([e052b25](https://github.com/vendure-ecommerce/vendure/commit/e052b25)), closes [#982](https://github.com/vendure-ecommerce/vendure/issues/982) * **admin-ui** Fix Russian & Ukrainian translations ([5061a43](https://github.com/vendure-ecommerce/vendure/commit/5061a43)) * **admin-ui** Fix saving relation custom fields on ProductVariants ([fb38c68](https://github.com/vendure-ecommerce/vendure/commit/fb38c68)) * **core** Correct handling of non-default languages in ListQueryBuilder ([837840e](https://github.com/vendure-ecommerce/vendure/commit/837840e)), closes [#980](https://github.com/vendure-ecommerce/vendure/issues/980) * **core** Correctly handle nested parent collection query in Shop API ([2445e48](https://github.com/vendure-ecommerce/vendure/commit/2445e48)), closes [#981](https://github.com/vendure-ecommerce/vendure/issues/981) * **core** Do not crash if asset filesize is over max size limit ([b289cc8](https://github.com/vendure-ecommerce/vendure/commit/b289cc8)), closes [#990](https://github.com/vendure-ecommerce/vendure/issues/990) * **core** Fix race condition in worker when populating DB schema ([7ae1e94](https://github.com/vendure-ecommerce/vendure/commit/7ae1e94)), closes [#205](https://github.com/vendure-ecommerce/vendure/issues/205) [#462](https://github.com/vendure-ecommerce/vendure/issues/462) * **core** Handle SqlJobQueueStrategy errors without crashing worker ([5d483f6](https://github.com/vendure-ecommerce/vendure/commit/5d483f6)) * **core** Handling of GlobalSettings edge-case bug ([8d23966](https://github.com/vendure-ecommerce/vendure/commit/8d23966)), closes [#987](https://github.com/vendure-ecommerce/vendure/issues/987) * **core** Update relation custom fields when updating Asset ([510025a](https://github.com/vendure-ecommerce/vendure/commit/510025a)), closes [#952](https://github.com/vendure-ecommerce/vendure/issues/952) * **ui-devkit** Fix baseHref setting when using npm ([511c2ed](https://github.com/vendure-ecommerce/vendure/commit/511c2ed)), closes [#916](https://github.com/vendure-ecommerce/vendure/issues/916) [#993](https://github.com/vendure-ecommerce/vendure/issues/993) ## 1.1.0 (2021-07-01) #### Fixes * **admin-ui** Correctly export relation selector components ([56ab5bd](https://github.com/vendure-ecommerce/vendure/commit/56ab5bd)), closes [#941](https://github.com/vendure-ecommerce/vendure/issues/941) * **asset-server-plugin** Update sharp to fix Linux install issues ([e9de674](https://github.com/vendure-ecommerce/vendure/commit/e9de674)), closes [#962](https://github.com/vendure-ecommerce/vendure/issues/962) * **core** Fix occasional failing variantNameCollectionFilter ([ac76e2c](https://github.com/vendure-ecommerce/vendure/commit/ac76e2c)) * **core** Improve fault tolerance of "apply-collection-filters" job ([be59bf9](https://github.com/vendure-ecommerce/vendure/commit/be59bf9)) * **core** Improve fault-tolerance of JobQueue ([cb5b100](https://github.com/vendure-ecommerce/vendure/commit/cb5b100)) * **core** Make verifyCustomerAccount channel-independent (#945) ([39b3937](https://github.com/vendure-ecommerce/vendure/commit/39b3937)), closes [#945](https://github.com/vendure-ecommerce/vendure/issues/945) #### Features * **admin-ui** Add ability to filter promotions by name or coupon code ([5795a84](https://github.com/vendure-ecommerce/vendure/commit/5795a84)) * **admin-ui** Add Ukrainian translation (#889) ([b0b1716](https://github.com/vendure-ecommerce/vendure/commit/b0b1716)), closes [#889](https://github.com/vendure-ecommerce/vendure/issues/889) * **admin-ui** Enable adding OptionGroups to existing products ([bd5e7c0](https://github.com/vendure-ecommerce/vendure/commit/bd5e7c0)), closes [#711](https://github.com/vendure-ecommerce/vendure/issues/711) * **admin-ui** Enable selection of content language from list views ([eb9cb4f](https://github.com/vendure-ecommerce/vendure/commit/eb9cb4f)), closes [#883](https://github.com/vendure-ecommerce/vendure/issues/883) * **admin-ui** Support "text" custom fields with textarea control ([2abd018](https://github.com/vendure-ecommerce/vendure/commit/2abd018)), closes [#885](https://github.com/vendure-ecommerce/vendure/issues/885) * **admin-ui** Support custom field controls in FulfillmentDetail ([a8a7eac](https://github.com/vendure-ecommerce/vendure/commit/a8a7eac)), closes [#887](https://github.com/vendure-ecommerce/vendure/issues/887) * **admin-ui** Support custom field controls in OrderTable ([02c2d4e](https://github.com/vendure-ecommerce/vendure/commit/02c2d4e)), closes [#887](https://github.com/vendure-ecommerce/vendure/issues/887) * **core** Access to orderByCode configurable by strategy ([2554822](https://github.com/vendure-ecommerce/vendure/commit/2554822)) * **core** Add "text" custom field type for storing data over 64k ([00c5c43](https://github.com/vendure-ecommerce/vendure/commit/00c5c43)), closes [#885](https://github.com/vendure-ecommerce/vendure/issues/885) * **core** Add retries to TransactionalConnection.getEntityOrThrow() ([1e3ba7b](https://github.com/vendure-ecommerce/vendure/commit/1e3ba7b)), closes [#937](https://github.com/vendure-ecommerce/vendure/issues/937) * **core** Allow middleware to execute before server.listen ([dd89204](https://github.com/vendure-ecommerce/vendure/commit/dd89204)) * **core** Allow Plugin entities to be defined with a function ([d130134](https://github.com/vendure-ecommerce/vendure/commit/d130134)), closes [#906](https://github.com/vendure-ecommerce/vendure/issues/906) * **core** Check availability of variants when adding to Order ([ea2b6b0](https://github.com/vendure-ecommerce/vendure/commit/ea2b6b0)), closes [#723](https://github.com/vendure-ecommerce/vendure/issues/723) * **core** Emit CustomerEvent on creation via Shop API ([680b8c2](https://github.com/vendure-ecommerce/vendure/commit/680b8c2)), closes [#949](https://github.com/vendure-ecommerce/vendure/issues/949) * **core** Enable importing of custom field list data ([5d85c07](https://github.com/vendure-ecommerce/vendure/commit/5d85c07)), closes [#577](https://github.com/vendure-ecommerce/vendure/issues/577) * **core** Export all helper classes from service layer ([d529db0](https://github.com/vendure-ecommerce/vendure/commit/d529db0)) * **core** Export PasswordCipher helper ([221051f](https://github.com/vendure-ecommerce/vendure/commit/221051f)) * **core** Improve typing of TransactionConnection.getEntityOrThrow ([eec8808](https://github.com/vendure-ecommerce/vendure/commit/eec8808)) * **core** Publish StockMovementEvent ([0a71723](https://github.com/vendure-ecommerce/vendure/commit/0a71723)), closes [#902](https://github.com/vendure-ecommerce/vendure/issues/902) * **core** Add `collections` field to SearchResponse, closes [#943](https://github.com/vendure-ecommerce/vendure/issues/943) * **elasticsearch-plugin** Add `collections` field to SearchResponse, closes [#943](https://github.com/vendure-ecommerce/vendure/issues/943) * **email-plugin** Add `.setOptionalAddressFields()` - cc, bcc, replyTo ([8e9b72f](https://github.com/vendure-ecommerce/vendure/commit/8e9b72f)), closes [#921](https://github.com/vendure-ecommerce/vendure/issues/921) * **email-plugin** Extend attachment support ([70a55fd](https://github.com/vendure-ecommerce/vendure/commit/70a55fd)), closes [#882](https://github.com/vendure-ecommerce/vendure/issues/882) ## <small>1.0.3 (2021-06-18)</small> #### Fixes * **admin-ui** Handle all ErrorResults when creating a Fulfillment ([75952dd](https://github.com/vendure-ecommerce/vendure/commit/75952dd)), closes [#929](https://github.com/vendure-ecommerce/vendure/issues/929) * **core** Correct handling of nested variantNameCollectionFilters ([14b40bb](https://github.com/vendure-ecommerce/vendure/commit/14b40bb)), closes [#927](https://github.com/vendure-ecommerce/vendure/issues/927) * **core** Do not return private collections in Shop API ([33f40f2](https://github.com/vendure-ecommerce/vendure/commit/33f40f2)), closes [#928](https://github.com/vendure-ecommerce/vendure/issues/928) * **core** Fix Admin/Customer user conflict with external auth ([69f46a3](https://github.com/vendure-ecommerce/vendure/commit/69f46a3)), closes [#926](https://github.com/vendure-ecommerce/vendure/issues/926) * **core** Remove "Placeholder" from Permission enum ([eabfe77](https://github.com/vendure-ecommerce/vendure/commit/eabfe77)) ## <small>1.0.2 (2021-06-10)</small> #### Fixes * **admin-ui** Allow Channel tokens to be updated from ChannelDetail ([cafa04e](https://github.com/vendure-ecommerce/vendure/commit/cafa04e)) * **core** Do not error when removing deleted variant from channel ([e3e8828](https://github.com/vendure-ecommerce/vendure/commit/e3e8828)) * **core** Fix worker error when using custom Logger ([cbe764a](https://github.com/vendure-ecommerce/vendure/commit/cbe764a)), closes [#912](https://github.com/vendure-ecommerce/vendure/issues/912) * **core** Update search index when removing translated variants ([fced1dc](https://github.com/vendure-ecommerce/vendure/commit/fced1dc)), closes [#896](https://github.com/vendure-ecommerce/vendure/issues/896) * **create** Remove tslib resolution from package.json ([863ffcb](https://github.com/vendure-ecommerce/vendure/commit/863ffcb)), closes [#925](https://github.com/vendure-ecommerce/vendure/issues/925) #### Perf * **core** Improve performance of apply-collection-filters job (#915) ([1e8c137](https://github.com/vendure-ecommerce/vendure/commit/1e8c137)), closes [#915](https://github.com/vendure-ecommerce/vendure/issues/915) ## <small>1.0.1 (2021-05-27)</small> #### Fixes * **admin-ui** Account for refunds when calculating outstanding payment ([fce00c4](https://github.com/vendure-ecommerce/vendure/commit/fce00c4)) * **admin-ui** Fixed unsupported plural for Simple Chinese translation (#888) ([d43602f](https://github.com/vendure-ecommerce/vendure/commit/d43602f)), closes [#888](https://github.com/vendure-ecommerce/vendure/issues/888) * **core** Correctly calculate refund amount when modifying order ([56d058d](https://github.com/vendure-ecommerce/vendure/commit/56d058d)), closes [#890](https://github.com/vendure-ecommerce/vendure/issues/890) * **core** Prevent FK error when migrating with better-sqlite3 driver ([8bfa03d](https://github.com/vendure-ecommerce/vendure/commit/8bfa03d)), closes [#880](https://github.com/vendure-ecommerce/vendure/issues/880) * **core** Publish PaymentStateTransitionEvent when settlePayment fails ([c01106c](https://github.com/vendure-ecommerce/vendure/commit/c01106c)), closes [#886](https://github.com/vendure-ecommerce/vendure/issues/886) * **core** Update NestJS & graphql-related deps to fix version conflict. This fix enables compatibility with npm v7.x ([8891c43](https://github.com/vendure-ecommerce/vendure/commit/8891c43)), closes [#532](https://github.com/vendure-ecommerce/vendure/issues/532) [blob/9267a79b974e397e87ad9ee408b65c46751e4565/CHANGELOG.md#v2230](https://github.com/blob/9267a79b974e397e87ad9ee408b65c46751e4565/CHANGELOG.md/issues/v2230) * **create** Remove redundant synchronize warning ([73841e4](https://github.com/vendure-ecommerce/vendure/commit/73841e4)) ## 1.0.0 (2021-05-19) Vendure v1.0 is here! 🎉 **Note** with this release, all deprecated APIs have been removed. If you were still using any, you'll have a very small amount of work to do in switching over to their replacements. Removed deprecated APIs: * TypeScript: `EventBus.sucscribe()`, use `EventBus.ofType()` instead. * TypeScript: `getEntityOrThrow()` helper. Use `TransactionalConnection.getEntityOrThrow()` instead. * TypeScript: `Injector.getConnection()`. Use `Injector.get(TransactionalConnection)` instead. * TypeScript: `PriceCalculationStrategy`. Use `OrderItemPriceCalculationStrategy` instead. * TypeScript: `TaxCalculationStrategy`. Use `ProductVariantPriceCalculationStrategy` instead. * TypeScript: `VendureConfig.authOptions.sessionSecret`. Use `VendureConfig.authOptions.cookieOptions.secret` instead. * TypeScript - AssetServerPlugin: The `region` option of the S3AssetStorageStrategy should be moved into the `nativeS3Configuration` object. * GraphQL: `SearchResult` type - `productPreview` & `productVariantPreview` fields. Use `productAsset.preview`, `productVariantAsset.preview` instead. * GraphQL: `Order.adjustments`. Use `Order.discounts` instead. * GraphQL: `OrderItem.unitPriceIncludesTax`. This is removed as redundant - `unitPrice` is always without tax. * GraphQL: `OrderLine.totalPrice`. Use `OrderLine.linePriceWithTax` instead. * GraphQL: `OrderLine.adjustments`. Use `OrderLine.discounts` instead. * GraphQL: `Product.priceIncludesTax`. This is removed as redundant - `price` is always without tax. #### Fixes * **admin-ui** Improve FR translations (#884) ([ad5bc2b](https://github.com/vendure-ecommerce/vendure/commit/ad5bc2b)), closes [#884](https://github.com/vendure-ecommerce/vendure/issues/884) * **admin-ui** Display refund metadata (#875) ([7bc7372](https://github.com/vendure-ecommerce/vendure/commit/7bc7372)), closes [#875](https://github.com/vendure-ecommerce/vendure/issues/875) * **admin-ui** Enable retrying of failed refunds ([4fc749d](https://github.com/vendure-ecommerce/vendure/commit/4fc749d)), closes [#873](https://github.com/vendure-ecommerce/vendure/issues/873) * **admin-ui** Fix configurable arg forms becoming unresponsive ([6039f0c](https://github.com/vendure-ecommerce/vendure/commit/6039f0c)) * **admin-ui** Update Chinese translations (#878) ([084dc31](https://github.com/vendure-ecommerce/vendure/commit/084dc31)), closes [#878](https://github.com/vendure-ecommerce/vendure/issues/878) * **core** Correct order totals in order modification preview ([1795f48](https://github.com/vendure-ecommerce/vendure/commit/1795f48)), closes [#872](https://github.com/vendure-ecommerce/vendure/issues/872) * **core** Fix bug in applying OrderItem promotions with postgres ([aaa8393](https://github.com/vendure-ecommerce/vendure/commit/aaa8393)) * **core** Fix multiple refunds on the same OrderLine ([7316d31](https://github.com/vendure-ecommerce/vendure/commit/7316d31)), closes [#868](https://github.com/vendure-ecommerce/vendure/issues/868) * **core** Fix refunds after failures & with multiple payments ([ed30874](https://github.com/vendure-ecommerce/vendure/commit/ed30874)), closes [#873](https://github.com/vendure-ecommerce/vendure/issues/873) * **core** Handle array circular refs when serializing RequestContext ([4abb912](https://github.com/vendure-ecommerce/vendure/commit/4abb912)), closes [#864](https://github.com/vendure-ecommerce/vendure/issues/864) * **core** Include tax setting when populating default shipping methods ([26ce6ff](https://github.com/vendure-ecommerce/vendure/commit/26ce6ff)) ## 1.0.0-rc.0 (2021-05-05) #### Fixes * **core** Fix transition to PaymentSettled with multiple payments ([c60fad7](https://github.com/vendure-ecommerce/vendure/commit/c60fad7)), closes [#847](https://github.com/vendure-ecommerce/vendure/issues/847) * **core** Handle different input types in validateRequiredFields() (#861) ([2ca6bfd](https://github.com/vendure-ecommerce/vendure/commit/2ca6bfd)), closes [#861](https://github.com/vendure-ecommerce/vendure/issues/861) [#855](https://github.com/vendure-ecommerce/vendure/issues/855) ## 1.0.0-beta.11 (2021-04-28) #### Fixes * **core** Allow plugins to define global Nestjs providers ([97edcb9](https://github.com/vendure-ecommerce/vendure/commit/97edcb9)), closes [#837](https://github.com/vendure-ecommerce/vendure/issues/837) * **core** Display informative message when saving a translatable fails ([ce6293d](https://github.com/vendure-ecommerce/vendure/commit/ce6293d)) * **core** Fix error on concurrent calls to new channel ([fad9006](https://github.com/vendure-ecommerce/vendure/commit/fad9006)), closes [#834](https://github.com/vendure-ecommerce/vendure/issues/834) * **core** Fix missing customField input for Assets ([772bd8d](https://github.com/vendure-ecommerce/vendure/commit/772bd8d)), closes [#844](https://github.com/vendure-ecommerce/vendure/issues/844) #### Features * **admin-ui** Support new permissions ([57566b0](https://github.com/vendure-ecommerce/vendure/commit/57566b0)), closes [#617](https://github.com/vendure-ecommerce/vendure/issues/617) * **core** Allow default Roles to be defined in InitialData ([d866325](https://github.com/vendure-ecommerce/vendure/commit/d866325)) * **core** Improved translations ([a8ca019](https://github.com/vendure-ecommerce/vendure/commit/a8ca019)), closes [#839](https://github.com/vendure-ecommerce/vendure/issues/839) * **core** More granular (entity-based) permissions ([4ed2ed5](https://github.com/vendure-ecommerce/vendure/commit/4ed2ed5)), closes [#617](https://github.com/vendure-ecommerce/vendure/issues/617) #### Perf * **elasticsearch-plugin** Improve indexing memory usage [#833](https://github.com/vendure-ecommerce/vendure/pull/833) ## 1.0.0-beta.10 (2021-04-22) #### Fixes * **admin-ui** Fix error when updating roles ([432c89c](https://github.com/vendure-ecommerce/vendure/commit/432c89c)), closes [#828](https://github.com/vendure-ecommerce/vendure/issues/828) * **admin-ui** Make dropdowns scrollable ([e887a2b](https://github.com/vendure-ecommerce/vendure/commit/e887a2b)), closes [#824](https://github.com/vendure-ecommerce/vendure/issues/824) * **core** Backoff strategy does not block next jobs ([709cdff](https://github.com/vendure-ecommerce/vendure/commit/709cdff)), closes [#832](https://github.com/vendure-ecommerce/vendure/issues/832) * **core** Fix crash on updating Facet code ([755ebc4](https://github.com/vendure-ecommerce/vendure/commit/755ebc4)), closes [#831](https://github.com/vendure-ecommerce/vendure/issues/831) * **core** Fix error when assigning deleted ProductVariant to channel ([b5d0e43](https://github.com/vendure-ecommerce/vendure/commit/b5d0e43)) * **elasticsearch-plugin** Fix bad import ([9c76767](https://github.com/vendure-ecommerce/vendure/commit/9c76767)) #### Features * **admin-ui** Add Russian translations (#829) ([650f38e](https://github.com/vendure-ecommerce/vendure/commit/650f38e)), closes [#829](https://github.com/vendure-ecommerce/vendure/issues/829) * **core** Added i18n messages for DE (#830) ([d62628b](https://github.com/vendure-ecommerce/vendure/commit/d62628b)), closes [#830](https://github.com/vendure-ecommerce/vendure/issues/830) * **core** JobQueueStrategy pollInterval accepts function ([c2701b9](https://github.com/vendure-ecommerce/vendure/commit/c2701b9)) ### 1.0.0-beta.9 (2021-04-13) #### Fixes * **admin-ui** Display guest orders in OrderList ([c1dcb19](https://github.com/vendure-ecommerce/vendure/commit/c1dcb19)) * **admin-ui-plugin** Bump version to make fix available ## 1.0.0-beta.8 (2021-04-13) #### Fixes * **admin-ui** Better display Fulfillment customFields in Order detail ([0e9f528](https://github.com/vendure-ecommerce/vendure/commit/0e9f528)), closes [#816](https://github.com/vendure-ecommerce/vendure/issues/816) * **core** Handle relation customFields when creating Fulfillments ([9559e34](https://github.com/vendure-ecommerce/vendure/commit/9559e34)), closes [#816](https://github.com/vendure-ecommerce/vendure/issues/816) * **core** Join eager relations on OrderService.findOne method ([5e181ea](https://github.com/vendure-ecommerce/vendure/commit/5e181ea)) * **core** Return all assets when querying product by slug ([acb3fb0](https://github.com/vendure-ecommerce/vendure/commit/acb3fb0)), closes [#820](https://github.com/vendure-ecommerce/vendure/issues/820) * **email-plugin** Added filename filter for json files (#821) ([317a63c](https://github.com/vendure-ecommerce/vendure/commit/317a63c)), closes [#821](https://github.com/vendure-ecommerce/vendure/issues/821) * **email-plugin** make @types/nodemailer a dependency to resolve #817 ([1c2b353](https://github.com/vendure-ecommerce/vendure/commit/1c2b353)), closes [#817](https://github.com/vendure-ecommerce/vendure/issues/817) [#817](https://github.com/vendure-ecommerce/vendure/issues/817) #### Features * **admin-ui** Display payment errors in OrderDetail view ([cf31cbf](https://github.com/vendure-ecommerce/vendure/commit/cf31cbf)) * **admin-ui** Filter Customer list by customer last name ([6df325b](https://github.com/vendure-ecommerce/vendure/commit/6df325b)), closes [#572](https://github.com/vendure-ecommerce/vendure/issues/572) * **admin-ui** Filter Order list by customer last name ([690dfa7](https://github.com/vendure-ecommerce/vendure/commit/690dfa7)), closes [#572](https://github.com/vendure-ecommerce/vendure/issues/572) * **admin-ui** Improve display of OrderLine customFields ([fde3ffc](https://github.com/vendure-ecommerce/vendure/commit/fde3ffc)) * **admin-ui** UI for deletion of PaymentMethods ([fa67076](https://github.com/vendure-ecommerce/vendure/commit/fa67076)) * **core** Add server translations via plugin application bootstrap ([13a4b68](https://github.com/vendure-ecommerce/vendure/commit/13a4b68)), closes [#810](https://github.com/vendure-ecommerce/vendure/issues/810) * **core** Allow ListQuery sort/filter inputs to be manually extended ([834ea2d](https://github.com/vendure-ecommerce/vendure/commit/834ea2d)), closes [#572](https://github.com/vendure-ecommerce/vendure/issues/572) * **core** Allow setting PaymentState on failure to settle Payment ([0241ade](https://github.com/vendure-ecommerce/vendure/commit/0241ade)), closes [#809](https://github.com/vendure-ecommerce/vendure/issues/809) * **core** Configurable backoff strategy for DefaultJobQueuePlugin ([be0a27d](https://github.com/vendure-ecommerce/vendure/commit/be0a27d)), closes [#813](https://github.com/vendure-ecommerce/vendure/issues/813) * **core** Implement deletion of PaymentMethods ([f97cd4f](https://github.com/vendure-ecommerce/vendure/commit/f97cd4f)) * **core** Implement sort/filter OrderList by customerLastName ([c29e6f2](https://github.com/vendure-ecommerce/vendure/commit/c29e6f2)), closes [#572](https://github.com/vendure-ecommerce/vendure/issues/572) * **elasticsearch-plugin** Add facetFilters input for search query ([23cc655](https://github.com/vendure-ecommerce/vendure/commit/23cc655)), closes [#726](https://github.com/vendure-ecommerce/vendure/issues/726) #### Perf * **core** Reduce memory usage of apply-collection-filters job ([76361d5](https://github.com/vendure-ecommerce/vendure/commit/76361d5)) ## 1.0.0-beta.7 (2021-04-05) #### Features * **admin-ui** AssetPickerDialog can take initial tags ([03c6706](https://github.com/vendure-ecommerce/vendure/commit/03c6706)) * **asset-server-plugin** Support Apple M1 (update Sharp to 0.28) ([1335080](https://github.com/vendure-ecommerce/vendure/commit/1335080)), closes [#803](https://github.com/vendure-ecommerce/vendure/issues/803) * **core** Add ability to get variants for a specific product in productVariants query ([1da0592](https://github.com/vendure-ecommerce/vendure/commit/1da0592)), closes [#786](https://github.com/vendure-ecommerce/vendure/issues/786) * **core** Add name and description fields to eligiblePaymentMethods query ([fd28208](https://github.com/vendure-ecommerce/vendure/commit/fd28208)), closes [#738](https://github.com/vendure-ecommerce/vendure/issues/738) #### Fixes * **admin-ui** Fix asset search component ([d65277e](https://github.com/vendure-ecommerce/vendure/commit/d65277e)) * **admin-ui** Fix errors caused by lists greater than 1000 items ([5844715](https://github.com/vendure-ecommerce/vendure/commit/5844715)), closes [#807](https://github.com/vendure-ecommerce/vendure/issues/807) * **admin-ui** Fix facet display in product search bar ([a05044d](https://github.com/vendure-ecommerce/vendure/commit/a05044d)) * **core** Fix product query by slug ([2ace0eb](https://github.com/vendure-ecommerce/vendure/commit/2ace0eb)), closes [#800](https://github.com/vendure-ecommerce/vendure/issues/800) ## 1.0.0-beta.6 (2021-04-01) #### Fixes * **core** Correct ordering of Collection breadcrumbs ([92952fb](https://github.com/vendure-ecommerce/vendure/commit/92952fb)) * **core** Correctly defer incomplete jobs on shutdown ([d3fa83a](https://github.com/vendure-ecommerce/vendure/commit/d3fa83a)) * **core** Correctly handle multiple external auth methods ([b397ba2](https://github.com/vendure-ecommerce/vendure/commit/b397ba2)), closes [#695](https://github.com/vendure-ecommerce/vendure/issues/695) * **core** Fix edge case in auth guard resolver detection ([b190300](https://github.com/vendure-ecommerce/vendure/commit/b190300)) * **core** Fix memory leak in default JobQueueStrategies ([e9e3c18](https://github.com/vendure-ecommerce/vendure/commit/e9e3c18)) * **core** Fix some issues with sorting/filtering calculated properties ([2d89554](https://github.com/vendure-ecommerce/vendure/commit/2d89554)) * **core** Fix sorting of Order calculated properties in Postgres ([e9b18fe](https://github.com/vendure-ecommerce/vendure/commit/e9b18fe)) * **core** Fix TypeScript TS2502 error in Translation<T> type ([a4243c4](https://github.com/vendure-ecommerce/vendure/commit/a4243c4)), closes [#787](https://github.com/vendure-ecommerce/vendure/issues/787) * **core** Prevent customer data leak via Shop API ([8ea544b](https://github.com/vendure-ecommerce/vendure/commit/8ea544b)), closes [#730](https://github.com/vendure-ecommerce/vendure/issues/730) * **core** Resolver permission changes work with REST routes ([b61b47d](https://github.com/vendure-ecommerce/vendure/commit/b61b47d)) #### Features * **core** AssetService can create assets from Readable streams ([9d80145](https://github.com/vendure-ecommerce/vendure/commit/9d80145)) * **core** Enable the use of Permissions of GraphQL field resolvers ([5c837b8](https://github.com/vendure-ecommerce/vendure/commit/5c837b8)), closes [#730](https://github.com/vendure-ecommerce/vendure/issues/730) * **core** Implement size limits for paginated list results ([92be4e0](https://github.com/vendure-ecommerce/vendure/commit/92be4e0)), closes [#751](https://github.com/vendure-ecommerce/vendure/issues/751) ## 1.0.0-beta.5 (2021-03-24) #### Fixes * **admin-ui** Fix buggy price input in ProductVariant list & table ([f2b53ca](https://github.com/vendure-ecommerce/vendure/commit/f2b53ca)), closes [#770](https://github.com/vendure-ecommerce/vendure/issues/770) * **admin-ui** Fix display of string results in JobQueue list ([10899f3](https://github.com/vendure-ecommerce/vendure/commit/10899f3)) * **admin-ui** Make assetPreview pipe handle null inputs ([2c19759](https://github.com/vendure-ecommerce/vendure/commit/2c19759)) * **core** Correctly compare falsy customField values in OrderLines ([265781c](https://github.com/vendure-ecommerce/vendure/commit/265781c)) * **core** Fix gql error when OrderLine has only private customFields ([4440fea](https://github.com/vendure-ecommerce/vendure/commit/4440fea)) * **core** Fix race condition in updating JobRecords ([b446c8f](https://github.com/vendure-ecommerce/vendure/commit/b446c8f)) * **core** Improve reliability of Job cancellation ([410b4c2](https://github.com/vendure-ecommerce/vendure/commit/410b4c2)) * **core** Make addPaymentToOrder channel aware ([6338212](https://github.com/vendure-ecommerce/vendure/commit/6338212)), closes [#773](https://github.com/vendure-ecommerce/vendure/issues/773) * **core** Save relation custom fields in addItemToOrder mutation ([10d43e8](https://github.com/vendure-ecommerce/vendure/commit/10d43e8)), closes [#760](https://github.com/vendure-ecommerce/vendure/issues/760) * **email-plugin** Fix broken images in order-confirmation mock emails ([82eefde](https://github.com/vendure-ecommerce/vendure/commit/82eefde)) #### Features * **admin-ui** Display Order discounts with & without tax ([ea5a9f2](https://github.com/vendure-ecommerce/vendure/commit/ea5a9f2)), closes [#749](https://github.com/vendure-ecommerce/vendure/issues/749) * **admin-ui** Improve German translations ([3497e81](https://github.com/vendure-ecommerce/vendure/commit/3497e81)) * **core** Add `code` field to ShippingMethodQuote ([847b4e2](https://github.com/vendure-ecommerce/vendure/commit/847b4e2)), closes [#780](https://github.com/vendure-ecommerce/vendure/issues/780) * **core** Add CustomerEvent and CustomerAddressEvent ([480de31](https://github.com/vendure-ecommerce/vendure/commit/480de31)) * **core** Enable population of relational custom fields from CSV ([38611fb](https://github.com/vendure-ecommerce/vendure/commit/38611fb)) * **core** Include with/without tax amounts on discounts ([2de6bf5](https://github.com/vendure-ecommerce/vendure/commit/2de6bf5)), closes [#749](https://github.com/vendure-ecommerce/vendure/issues/749) * **core** Make DefaultJobQueuePlugin configurable ([6373d9f](https://github.com/vendure-ecommerce/vendure/commit/6373d9f)) * **core** Make JobQueue jobs subscribable ([baba268](https://github.com/vendure-ecommerce/vendure/commit/baba268)), closes [#775](https://github.com/vendure-ecommerce/vendure/issues/775) * **core** Reinstate ProcessContext provider ([9e30505](https://github.com/vendure-ecommerce/vendure/commit/9e30505)), closes [#772](https://github.com/vendure-ecommerce/vendure/issues/772) * **email-plugin** Fix broken mock events ([9ae47f1](https://github.com/vendure-ecommerce/vendure/commit/9ae47f1)), closes [#771](https://github.com/vendure-ecommerce/vendure/issues/771) ### BREAKING CHANGE * A minor breaking change has been made to the GraphQL API: The `Order.discounts` and `OrderLine.discounts` fields now return `amount` and `amountWithTax`. Previously they only had `amount`, which was actually the tax-inclusive value. So if you want to show discount amounts with tax, use `amountWithTax` and otherwise use `amount`. ## 1.0.0-beta.4 (2021-03-18) #### Fixes * **asset-server-plugin** Make S3 credentials optional ([56bcbff](https://github.com/vendure-ecommerce/vendure/commit/56bcbff)), closes [#733](https://github.com/vendure-ecommerce/vendure/issues/733) * **core** Correctly handle refunds on Orders with multiple Payments ([f4ed0e7](https://github.com/vendure-ecommerce/vendure/commit/f4ed0e7)) * **core** Filter Promotions on Channel before applying to Order ([0cb29e5](https://github.com/vendure-ecommerce/vendure/commit/0cb29e5)) * **core** Hide private OrderLine customFields in addItemToOrder ([c2c7f1d](https://github.com/vendure-ecommerce/vendure/commit/c2c7f1d)) * **core** Payment amount accounts for existing Payments on Order ([e92d2ce](https://github.com/vendure-ecommerce/vendure/commit/e92d2ce)) * **core** Really correctly handle multiple payment refunds ([ba8d411](https://github.com/vendure-ecommerce/vendure/commit/ba8d411)) * **core** Resolve all LocaleString fields in GraphQL API ([3ddadc0](https://github.com/vendure-ecommerce/vendure/commit/3ddadc0)), closes [#763](https://github.com/vendure-ecommerce/vendure/issues/763) * **core** Resolve all ProductVariant price fields in GraphQL API ([2bd289a](https://github.com/vendure-ecommerce/vendure/commit/2bd289a)), closes [#763](https://github.com/vendure-ecommerce/vendure/issues/763) * **ui-devkit** Fix Angular compiler compatibility issue ([05b2b12](https://github.com/vendure-ecommerce/vendure/commit/05b2b12)), closes [#758](https://github.com/vendure-ecommerce/vendure/issues/758) #### Features * **asset-server-plugin** Allow assetUrlPrefix to be a function ([10eb014](https://github.com/vendure-ecommerce/vendure/commit/10eb014)), closes [#766](https://github.com/vendure-ecommerce/vendure/issues/766) * **core** Add Promotion Channel mutations to Admin API ([ff051ae](https://github.com/vendure-ecommerce/vendure/commit/ff051ae)) * **core** add promotion state and promotion action-condition dependency ([dd66138](https://github.com/vendure-ecommerce/vendure/commit/dd66138)) * **core** Allow to pass validationRules to shop and admin GraphQL API ([02a37ec](https://github.com/vendure-ecommerce/vendure/commit/02a37ec)) ## 1.0.0-beta.3 (2021-03-11) #### Fixes * **admin-ui-plugin** Fix proxy port when in dev mode ([28b096c](https://github.com/vendure-ecommerce/vendure/commit/28b096c)) * **core** Fix featuredAsset error when adding item to Order ([e635f25](https://github.com/vendure-ecommerce/vendure/commit/e635f25)), closes [#756](https://github.com/vendure-ecommerce/vendure/issues/756) * **core** Fix foreign key error on merging orders ([5e385df](https://github.com/vendure-ecommerce/vendure/commit/5e385df)), closes [#754](https://github.com/vendure-ecommerce/vendure/issues/754) * **core** Fix indexing of long descriptions in postgres ([9efd7db](https://github.com/vendure-ecommerce/vendure/commit/9efd7db)), closes [#745](https://github.com/vendure-ecommerce/vendure/issues/745) * **core** Prevent max integer error in job duration ([305727e](https://github.com/vendure-ecommerce/vendure/commit/305727e)), closes [#755](https://github.com/vendure-ecommerce/vendure/issues/755) ## 1.0.0-beta.2 (2021-03-09) #### Fixes * **core** Fix error in SqlJobQueueStrategy when using SQLite ([c775822](https://github.com/vendure-ecommerce/vendure/commit/c775822)) ## 1.0.0-beta.1 (2021-03-09) #### Fixes * **admin-ui** Improved control over Order payments ([475b72a](https://github.com/vendure-ecommerce/vendure/commit/475b72a)), closes [#688](https://github.com/vendure-ecommerce/vendure/issues/688) [#507](https://github.com/vendure-ecommerce/vendure/issues/507) * **admin-ui** Make order modification note not required ([432a51a](https://github.com/vendure-ecommerce/vendure/commit/432a51a)), closes [#688](https://github.com/vendure-ecommerce/vendure/issues/688) * **core** Allow loading of Order with deleted ShippingMethod ([7ba27f2](https://github.com/vendure-ecommerce/vendure/commit/7ba27f2)), closes [#716](https://github.com/vendure-ecommerce/vendure/issues/716) * **core** Allow unsetting PaymentMethod checkers ([48c0e96](https://github.com/vendure-ecommerce/vendure/commit/48c0e96)), closes [#469](https://github.com/vendure-ecommerce/vendure/issues/469) * **core** Apply Promotions when calculating modified order total ([c678a21](https://github.com/vendure-ecommerce/vendure/commit/c678a21)), closes [#688](https://github.com/vendure-ecommerce/vendure/issues/688) * **core** Correctly handle negative "skip"/"take" in list query options ([04a4c39](https://github.com/vendure-ecommerce/vendure/commit/04a4c39)) * **core** Do not return assets not in current channel ([5de1141](https://github.com/vendure-ecommerce/vendure/commit/5de1141)), closes [#717](https://github.com/vendure-ecommerce/vendure/issues/717) * **core** Fix "float" customField types ([b4dc912](https://github.com/vendure-ecommerce/vendure/commit/b4dc912)) * **core** Fix Asset uploads on Node v13+ ([049c75c](https://github.com/vendure-ecommerce/vendure/commit/049c75c)), closes [#396](https://github.com/vendure-ecommerce/vendure/issues/396) * **core** Fix broken Collection population ([29ff1f9](https://github.com/vendure-ecommerce/vendure/commit/29ff1f9)) * **core** Fix OrderMergeStrategy implementation ([3193080](https://github.com/vendure-ecommerce/vendure/commit/3193080)), closes [#669](https://github.com/vendure-ecommerce/vendure/issues/669) * **core** Fix transaction errors in job queue for better-sqlite3 ([0043ace](https://github.com/vendure-ecommerce/vendure/commit/0043ace)) * **core** Improve error message for missing price data ([634e14b](https://github.com/vendure-ecommerce/vendure/commit/634e14b)) * **core** Include shipping tax in Order.taxSummary ([cf5aa31](https://github.com/vendure-ecommerce/vendure/commit/cf5aa31)), closes [#729](https://github.com/vendure-ecommerce/vendure/issues/729) * **core** Invoke SessionCacheStrategy lifecycle hooks ([c3c5888](https://github.com/vendure-ecommerce/vendure/commit/c3c5888)) * **core** Make CustomFulfillmentProcess injectable ([8bce2b4](https://github.com/vendure-ecommerce/vendure/commit/8bce2b4)) * **core** Make CustomPaymentProcess injectable ([a0a9352](https://github.com/vendure-ecommerce/vendure/commit/a0a9352)) * **core** Make SqlJobQueueStrategy concurrency-safe ([5e5e55a](https://github.com/vendure-ecommerce/vendure/commit/5e5e55a)) * **core** Prevent plugin providers multiple instantiation ([98e463e](https://github.com/vendure-ecommerce/vendure/commit/98e463e)) * **core** Relax some restrictions on adding new payments to Order ([26c1b7a](https://github.com/vendure-ecommerce/vendure/commit/26c1b7a)), closes [#688](https://github.com/vendure-ecommerce/vendure/issues/688) * **core** RememberMe args not passed correctly for NativeAuthenticationStrategy ([532ea21](https://github.com/vendure-ecommerce/vendure/commit/532ea21)) * **core** Remove inapplicable order-level discounts ([2396cc3](https://github.com/vendure-ecommerce/vendure/commit/2396cc3)), closes [#710](https://github.com/vendure-ecommerce/vendure/issues/710) * **create** Fix broken bootstrap when populating data ([5dcf6e5](https://github.com/vendure-ecommerce/vendure/commit/5dcf6e5)) * **elasticsearch-plugin** Delete product/variant indexes for all channels ([80fabb0](https://github.com/vendure-ecommerce/vendure/commit/80fabb0)) * **email-plugin** Correctly initialize email processor ([819e480](https://github.com/vendure-ecommerce/vendure/commit/819e480)) #### Features * **admin-ui** Add support for "relation" custom field type ([63e97c7](https://github.com/vendure-ecommerce/vendure/commit/63e97c7)), closes [#308](https://github.com/vendure-ecommerce/vendure/issues/308) [#464](https://github.com/vendure-ecommerce/vendure/issues/464) * **admin-ui** Filter Asset list by tags ([c244c0a](https://github.com/vendure-ecommerce/vendure/commit/c244c0a)), closes [#316](https://github.com/vendure-ecommerce/vendure/issues/316) * **admin-ui** Implement creation of new PaymentMethods ([09a1a97](https://github.com/vendure-ecommerce/vendure/commit/09a1a97)), closes [#671](https://github.com/vendure-ecommerce/vendure/issues/671) * **admin-ui** Implement default TaxCategory support ([90ed7c4](https://github.com/vendure-ecommerce/vendure/commit/90ed7c4)), closes [#566](https://github.com/vendure-ecommerce/vendure/issues/566) * **admin-ui** Implement PaymentMethod checker/handler UI ([15fc707](https://github.com/vendure-ecommerce/vendure/commit/15fc707)), closes [#469](https://github.com/vendure-ecommerce/vendure/issues/469) * **admin-ui** Manage tags interface ([205391d](https://github.com/vendure-ecommerce/vendure/commit/205391d)), closes [#316](https://github.com/vendure-ecommerce/vendure/issues/316) * **admin-ui** Open Asset selection when clicking placeholder ([c39fa55](https://github.com/vendure-ecommerce/vendure/commit/c39fa55)) * **admin-ui** PaymentMethod & promotions list update on channel change ([c02518c](https://github.com/vendure-ecommerce/vendure/commit/c02518c)), closes [#587](https://github.com/vendure-ecommerce/vendure/issues/587) * **admin-ui** Support channel-aware Facets & FacetValues ([4ccc65e](https://github.com/vendure-ecommerce/vendure/commit/4ccc65e)), closes [#612](https://github.com/vendure-ecommerce/vendure/issues/612) * **admin-ui** Support custom fields on Administrator & Channel ([ecd1b17](https://github.com/vendure-ecommerce/vendure/commit/ecd1b17)), closes [#598](https://github.com/vendure-ecommerce/vendure/issues/598) * **admin-ui** Support for editing Asset custom fields ([f109436](https://github.com/vendure-ecommerce/vendure/commit/f109436)), closes [#684](https://github.com/vendure-ecommerce/vendure/issues/684) * **admin-ui** Tags can be assigned to Assets in detail view ([995d1b4](https://github.com/vendure-ecommerce/vendure/commit/995d1b4)), closes [#316](https://github.com/vendure-ecommerce/vendure/issues/316) * **asset-server-plugin** Add S3 upload options in configuration ([fa4d1c0](https://github.com/vendure-ecommerce/vendure/commit/fa4d1c0)) * **core** Add eligiblePaymentMethods query to Shop API ([e528c09](https://github.com/vendure-ecommerce/vendure/commit/e528c09)), closes [#469](https://github.com/vendure-ecommerce/vendure/issues/469) * **core** Add order line limit to Vendure configuration ([6755329](https://github.com/vendure-ecommerce/vendure/commit/6755329)) * **core** Add support for Asset tags ([71cf3b9](https://github.com/vendure-ecommerce/vendure/commit/71cf3b9)), closes [#316](https://github.com/vendure-ecommerce/vendure/issues/316) * **core** Add support for relation custom fields on Channel entity ([7b96b9f](https://github.com/vendure-ecommerce/vendure/commit/7b96b9f)), closes [#598](https://github.com/vendure-ecommerce/vendure/issues/598) * **core** Allow custom field validate fn to be async & injectable ([5e04a14](https://github.com/vendure-ecommerce/vendure/commit/5e04a14)) * **core** Allow NestJS middleware to be passed in apiOptions ([44d0b45](https://github.com/vendure-ecommerce/vendure/commit/44d0b45)) * **core** Base custom payment process ([83af699](https://github.com/vendure-ecommerce/vendure/commit/83af699)) * **core** Channel aware assets ([4ea74e2](https://github.com/vendure-ecommerce/vendure/commit/4ea74e2)), closes [#677](https://github.com/vendure-ecommerce/vendure/issues/677) * **core** Create APIs & resolver for Tag operations ([6630063](https://github.com/vendure-ecommerce/vendure/commit/6630063)), closes [#316](https://github.com/vendure-ecommerce/vendure/issues/316) * **core** De-couple PaymentMethod from PaymentMethodHandler ([ee9ba23](https://github.com/vendure-ecommerce/vendure/commit/ee9ba23)), closes [#671](https://github.com/vendure-ecommerce/vendure/issues/671) * **core** Export startJobQueue helper from boostrapWorker() ([d6e4af5](https://github.com/vendure-ecommerce/vendure/commit/d6e4af5)) * **core** Facet:value pairs can be used in InitialData collection def ([2dc7f15](https://github.com/vendure-ecommerce/vendure/commit/2dc7f15)) * **core** Implement "relation" custom field type ([3e1a900](https://github.com/vendure-ecommerce/vendure/commit/3e1a900)), closes [#308](https://github.com/vendure-ecommerce/vendure/issues/308) [#464](https://github.com/vendure-ecommerce/vendure/issues/464) * **core** Implement ChangedPriceHandlingStrategy ([3aae4fb](https://github.com/vendure-ecommerce/vendure/commit/3aae4fb)), closes [#664](https://github.com/vendure-ecommerce/vendure/issues/664) * **core** Implement eligibility checking for PaymentMethods ([690514a](https://github.com/vendure-ecommerce/vendure/commit/690514a)), closes [#469](https://github.com/vendure-ecommerce/vendure/issues/469) * **core** Implement isDefault on TaxCategory ([7eb21d1](https://github.com/vendure-ecommerce/vendure/commit/7eb21d1)), closes [#566](https://github.com/vendure-ecommerce/vendure/issues/566) * **core** Implement StockDisplayStrategy to display stockLevel in API ([2709922](https://github.com/vendure-ecommerce/vendure/commit/2709922)), closes [#442](https://github.com/vendure-ecommerce/vendure/issues/442) * **core** Import ServiceModule into AppModule to expose services ([117a0a7](https://github.com/vendure-ecommerce/vendure/commit/117a0a7)) * **core** Introduce OrderPlacedStrategy for better control of process ([b9b7767](https://github.com/vendure-ecommerce/vendure/commit/b9b7767)) * **core** Make Facets/FacetValues Channel-aware ([e8fcb99](https://github.com/vendure-ecommerce/vendure/commit/e8fcb99)), closes [#612](https://github.com/vendure-ecommerce/vendure/issues/612) * **core** Make PaymentMethod channel-aware ([1a3b04f](https://github.com/vendure-ecommerce/vendure/commit/1a3b04f)), closes [#587](https://github.com/vendure-ecommerce/vendure/issues/587) * **core** Make ProductOptionGroup / ProductOption soft-deletable ([0c997bf](https://github.com/vendure-ecommerce/vendure/commit/0c997bf)), closes [#291](https://github.com/vendure-ecommerce/vendure/issues/291) * **core** Support custom fields on Administrator entity ([260ccfc](https://github.com/vendure-ecommerce/vendure/commit/260ccfc)), closes [#598](https://github.com/vendure-ecommerce/vendure/issues/598) * **core** Support custom fields on Channel entity ([489faf5](https://github.com/vendure-ecommerce/vendure/commit/489faf5)), closes [#598](https://github.com/vendure-ecommerce/vendure/issues/598) * **core** Support custom Payment process ([d3b0f60](https://github.com/vendure-ecommerce/vendure/commit/d3b0f60)), closes [#359](https://github.com/vendure-ecommerce/vendure/issues/359) [#507](https://github.com/vendure-ecommerce/vendure/issues/507) * **core** Support for custom fields on Asset entity ([60b6171](https://github.com/vendure-ecommerce/vendure/commit/60b6171)), closes [#684](https://github.com/vendure-ecommerce/vendure/issues/684) #### Perf * **core** Correctly optimized OrderItem persistence ([5c879e7](https://github.com/vendure-ecommerce/vendure/commit/5c879e7)) * **core** Improve order quantity update performance ([3c20837](https://github.com/vendure-ecommerce/vendure/commit/3c20837)) * **core** Run job queues in the worker process ([f05210a](https://github.com/vendure-ecommerce/vendure/commit/f05210a)) ### BREAKING CHANGE * `Order.taxSummary` now includes shipping taxes * A database migration is required for the new Asset tags support. * New DB relation Asset to Channel, requiring a migration. The Admin API mutations `deleteAsset` and `deleteAssets` have changed their argument signature. * The Facet and FacetValue entities are now channel-aware. This change to the schema will require a DB migration. * The OrderItem entity has a new field, `initialListPrice`, used to better handle price changes to items in an active Order. This schema change will require a DB migration. * The PaymentMethod entity and type has changed. Previously, a PaymentMethod was coupled to the configured PaymentMethodHandlers 1-to-1. Now the PaymentMethodHandler is just a configurable _property_ of the PaymentMethod, much in the same way that a ShippingCalculator relates to a ShippingMethod. Any existing PaymentMethod entities will need to be migrated to the new structure. * The PaymentMethod entity is now channel-aware which will require a DB migration to migrate existing PaymentMethods * The ProductOptionGroup & ProductOption entities have a new `deletedAt` column which will require a DB migration. * The signature of the `OrderMergeStrategy.merge()` method has changed. If you have implemented a custom OrderMergeStrategy, you'll need to update it to return the expected type. * The TaxCategory entity now has an `isDefault` property, requiring a DB migration. ## <small>0.18.5 (2021-03-01)</small> #### Fixes * **admin-ui** Typing error on pt-Br i18n (#725) ([50aafb3](https://github.com/vendure-ecommerce/vendure/commit/50aafb3)), closes [#725](https://github.com/vendure-ecommerce/vendure/issues/725) * **core** Allow asset uploads with same major mime type ([070c5f2](https://github.com/vendure-ecommerce/vendure/commit/070c5f2)), closes [#727](https://github.com/vendure-ecommerce/vendure/issues/727) * **core** Fix list query sorting by non-default language with filters ([1e31828](https://github.com/vendure-ecommerce/vendure/commit/1e31828)) * **core** Prevent Facet code conflicts ([bce3b59](https://github.com/vendure-ecommerce/vendure/commit/bce3b59)), closes [#715](https://github.com/vendure-ecommerce/vendure/issues/715) #### Features * **email-plugin** Support custom EmailGenerators and EmailSenders ([3e20624](https://github.com/vendure-ecommerce/vendure/commit/3e20624)) ## <small>0.18.4 (2021-02-10)</small> #### Features * **core** Implement productVariants list query in Admin API ([6d830a0](https://github.com/vendure-ecommerce/vendure/commit/6d830a0)) * **core** Language fallback when querying Product/Collection by slug ([5967c8a](https://github.com/vendure-ecommerce/vendure/commit/5967c8a)), closes [#538](https://github.com/vendure-ecommerce/vendure/issues/538) #### Fixes * **admin-ui** Fix modification of order addresses ([cd9a812](https://github.com/vendure-ecommerce/vendure/commit/cd9a812)), closes [#688](https://github.com/vendure-ecommerce/vendure/issues/688) * **common** Correctly normalize strings with single quotes ([d12f369](https://github.com/vendure-ecommerce/vendure/commit/d12f369)), closes [#679](https://github.com/vendure-ecommerce/vendure/issues/679) * **core** Clean up Sessions when deleting a Channel ([7e7d4b8](https://github.com/vendure-ecommerce/vendure/commit/7e7d4b8)), closes [#686](https://github.com/vendure-ecommerce/vendure/issues/686) * **core** Correctly constrain inventory on addItemToOrder mutation ([8975247](https://github.com/vendure-ecommerce/vendure/commit/8975247)), closes [#691](https://github.com/vendure-ecommerce/vendure/issues/691) * **core** Do not modify billing address when shipping address changed ([7e9a709](https://github.com/vendure-ecommerce/vendure/commit/7e9a709)), closes [#688](https://github.com/vendure-ecommerce/vendure/issues/688) * **core** Fix bad column reference in querybuilder string ([61e9f83](https://github.com/vendure-ecommerce/vendure/commit/61e9f83)), closes [#687](https://github.com/vendure-ecommerce/vendure/issues/687) * **core** Fix sorting by price on productVariants list ([0102232](https://github.com/vendure-ecommerce/vendure/commit/0102232)), closes [#690](https://github.com/vendure-ecommerce/vendure/issues/690) * **core** Fix sorting by translatable fields in list queries ([d00bafb](https://github.com/vendure-ecommerce/vendure/commit/d00bafb)), closes [#689](https://github.com/vendure-ecommerce/vendure/issues/689) * **core** Loosen restriction on transitioning to PaymentAuthorized ([59d39d6](https://github.com/vendure-ecommerce/vendure/commit/59d39d6)) * **core** Products without variants are indexed by DefaultSearchPlugin ([2dab174](https://github.com/vendure-ecommerce/vendure/commit/2dab174)), closes [#609](https://github.com/vendure-ecommerce/vendure/issues/609) * **core** Reduce chance of index err in assigning variants to channels ([58e3f7b](https://github.com/vendure-ecommerce/vendure/commit/58e3f7b)) * **elasticsearch-plugin** Products without variants are indexed ([21b6aa3](https://github.com/vendure-ecommerce/vendure/commit/21b6aa3)), closes [#609](https://github.com/vendure-ecommerce/vendure/issues/609) ## <small>0.18.3 (2021-01-29)</small> #### Fixes * **admin-ui** Fix filtering products by term in Channel ([d880f8e](https://github.com/vendure-ecommerce/vendure/commit/d880f8e)) * **admin-ui** Fix role editor Channel value display ([c258975](https://github.com/vendure-ecommerce/vendure/commit/c258975)) * **admin-ui** Fix various issues with product variant management view ([d34f935](https://github.com/vendure-ecommerce/vendure/commit/d34f935)), closes [#602](https://github.com/vendure-ecommerce/vendure/issues/602) * **admin-ui** Translate missing Brazilian (PT-br) i18n json ([808d1fe](https://github.com/vendure-ecommerce/vendure/commit/808d1fe)) * **core** Do not allow updating products not in active channel ([4b2fac7](https://github.com/vendure-ecommerce/vendure/commit/4b2fac7)) * **core** Prevent multiple ProductVariantPrice creation ([c853033](https://github.com/vendure-ecommerce/vendure/commit/c853033)), closes [#652](https://github.com/vendure-ecommerce/vendure/issues/652) * **core** Re-calculate OrderItem price on all OrderLine changes ([0d8c485](https://github.com/vendure-ecommerce/vendure/commit/0d8c485)), closes [#660](https://github.com/vendure-ecommerce/vendure/issues/660) * **core** Update search index for all channels on updates ([85de520](https://github.com/vendure-ecommerce/vendure/commit/85de520)), closes [#629](https://github.com/vendure-ecommerce/vendure/issues/629) * **elasticsearch-plugin** Update search index for all channels on updates ([2be29c2](https://github.com/vendure-ecommerce/vendure/commit/2be29c2)), closes [#629](https://github.com/vendure-ecommerce/vendure/issues/629) #### Features * **admin-ui** Nav menu requirePermissions accepts predicate fn ([c74765d](https://github.com/vendure-ecommerce/vendure/commit/c74765d)), closes [#651](https://github.com/vendure-ecommerce/vendure/issues/651) * **admin-ui** Support "required" & "defaultValue" in ConfigArgs ([6e5e482](https://github.com/vendure-ecommerce/vendure/commit/6e5e482)), closes [#643](https://github.com/vendure-ecommerce/vendure/issues/643) * **core** Support "defaultValue" field in ConfigArgs ([92ae819](https://github.com/vendure-ecommerce/vendure/commit/92ae819)), closes [#643](https://github.com/vendure-ecommerce/vendure/issues/643) * **core** Support "required" field in ConfigArgs ([9940385](https://github.com/vendure-ecommerce/vendure/commit/9940385)), closes [#643](https://github.com/vendure-ecommerce/vendure/issues/643) * **elasticsearch-plugin** LanguageCode support in CustomMappings ([b114428](https://github.com/vendure-ecommerce/vendure/commit/b114428)) ## <small>0.18.2 (2021-01-15)</small> #### Fixes * **admin-ui** Fix translation of facet values ([a6f3083](https://github.com/vendure-ecommerce/vendure/commit/a6f3083)), closes [#636](https://github.com/vendure-ecommerce/vendure/issues/636) * **admin-ui** Order widget i18n fix ([68b8adb](https://github.com/vendure-ecommerce/vendure/commit/68b8adb)) * **admin-ui** Preserve asset changes between product list/table view ([c83e511](https://github.com/vendure-ecommerce/vendure/commit/c83e511)), closes [#632](https://github.com/vendure-ecommerce/vendure/issues/632) * **admin-ui** Preserve changes between product/variant tabs ([242787a](https://github.com/vendure-ecommerce/vendure/commit/242787a)), closes [#632](https://github.com/vendure-ecommerce/vendure/issues/632) * **admin-ui** Preserve variant price changes between list/table views ([43bd770](https://github.com/vendure-ecommerce/vendure/commit/43bd770)), closes [#632](https://github.com/vendure-ecommerce/vendure/issues/632) * **admin-ui** Update CS translations ([d18dab0](https://github.com/vendure-ecommerce/vendure/commit/d18dab0)) * **asset-server-plugin** Fix corrupt SVG previews ([3a16d87](https://github.com/vendure-ecommerce/vendure/commit/3a16d87)), closes [#456](https://github.com/vendure-ecommerce/vendure/issues/456) * **core** Add ReadOrder perm to fulfillment-related shipping queries ([72ed50c](https://github.com/vendure-ecommerce/vendure/commit/72ed50c)), closes [#644](https://github.com/vendure-ecommerce/vendure/issues/644) * **core** Allow list queries to filter/sort on calculated columns ([5325387](https://github.com/vendure-ecommerce/vendure/commit/5325387)), closes [#642](https://github.com/vendure-ecommerce/vendure/issues/642) * **core** Clear order discounts after removing coupon code ([e1cce8f](https://github.com/vendure-ecommerce/vendure/commit/e1cce8f)), closes [#649](https://github.com/vendure-ecommerce/vendure/issues/649) * **core** Correctly prorate order discounts over differing tax rates ([b128425](https://github.com/vendure-ecommerce/vendure/commit/b128425)), closes [#653](https://github.com/vendure-ecommerce/vendure/issues/653) * **core** Correctly return order quantities from list query ([a2e34ec](https://github.com/vendure-ecommerce/vendure/commit/a2e34ec)), closes [#603](https://github.com/vendure-ecommerce/vendure/issues/603) * **core** Do not error when querying fulfillment on empty order ([b0c0457](https://github.com/vendure-ecommerce/vendure/commit/b0c0457)), closes [#639](https://github.com/vendure-ecommerce/vendure/issues/639) * **core** Fix NaN error when prorating discount over zero-tax line ([51af5a0](https://github.com/vendure-ecommerce/vendure/commit/51af5a0)) * **core** Gracefully handle errors in JobQueue ([6d1b8c6](https://github.com/vendure-ecommerce/vendure/commit/6d1b8c6)), closes [#635](https://github.com/vendure-ecommerce/vendure/issues/635) #### Features * **admin-ui** Auto update ProductVariant name with Product name ([69cd0d0](https://github.com/vendure-ecommerce/vendure/commit/69cd0d0)), closes [#600](https://github.com/vendure-ecommerce/vendure/issues/600) * **admin-ui** Auto update ProductVariant name with ProductOption name ([0e98cb5](https://github.com/vendure-ecommerce/vendure/commit/0e98cb5)), closes [#600](https://github.com/vendure-ecommerce/vendure/issues/600) * **admin-ui** Currencies respect UI language setting ([5530782](https://github.com/vendure-ecommerce/vendure/commit/5530782)), closes [#568](https://github.com/vendure-ecommerce/vendure/issues/568) * **admin-ui** Dates respect UI language setting ([dd0e73a](https://github.com/vendure-ecommerce/vendure/commit/dd0e73a)), closes [#568](https://github.com/vendure-ecommerce/vendure/issues/568) * **admin-ui** Display channel filter when more than 10 Channels ([b1b363d](https://github.com/vendure-ecommerce/vendure/commit/b1b363d)), closes [#594](https://github.com/vendure-ecommerce/vendure/issues/594) * **email-plugin** Allow attachments to be set on emails ([0082067](https://github.com/vendure-ecommerce/vendure/commit/0082067)), closes [#481](https://github.com/vendure-ecommerce/vendure/issues/481) * **email-plugin** Do not re-send order confirmation after modifying ([ddb71df](https://github.com/vendure-ecommerce/vendure/commit/ddb71df)), closes [#650](https://github.com/vendure-ecommerce/vendure/issues/650) ## <small>0.18.1 (2021-01-08)</small> #### Fixes * **admin-ui** Refresh ShippingMethodList on channel change ([6811ca8](https://github.com/vendure-ecommerce/vendure/commit/6811ca8)), closes [#595](https://github.com/vendure-ecommerce/vendure/issues/595) * **admin-ui** Shipping method validators fix ([bbdd5be](https://github.com/vendure-ecommerce/vendure/commit/bbdd5be)) * **admin-ui** Translate to Spanish all languages available ([b56e45d](https://github.com/vendure-ecommerce/vendure/commit/b56e45d)) * **core** Always include customFields on OrderAddress type ([c5e3c6d](https://github.com/vendure-ecommerce/vendure/commit/c5e3c6d)), closes [#616](https://github.com/vendure-ecommerce/vendure/issues/616) * **core** Fix error when creating Product in sub-channel ([96c5103](https://github.com/vendure-ecommerce/vendure/commit/96c5103)), closes [#556](https://github.com/vendure-ecommerce/vendure/issues/556) [#613](https://github.com/vendure-ecommerce/vendure/issues/613) #### Features * **admin-ui** Add dark mode theme & switcher component ([76f80f6](https://github.com/vendure-ecommerce/vendure/commit/76f80f6)), closes [#391](https://github.com/vendure-ecommerce/vendure/issues/391) * **admin-ui** Add default branding values to vendure-ui-config ([50aeb2b](https://github.com/vendure-ecommerce/vendure/commit/50aeb2b)), closes [#391](https://github.com/vendure-ecommerce/vendure/issues/391) * **admin-ui** Add support for job cancellation ([c6004c1](https://github.com/vendure-ecommerce/vendure/commit/c6004c1)), closes [#614](https://github.com/vendure-ecommerce/vendure/issues/614) * **admin-ui** Allow "enabled" state to be set when creating products ([3e006ce](https://github.com/vendure-ecommerce/vendure/commit/3e006ce)), closes [#608](https://github.com/vendure-ecommerce/vendure/issues/608) * **admin-ui** Enable theming by use of css custom properties ([68107d2](https://github.com/vendure-ecommerce/vendure/commit/68107d2)), closes [#391](https://github.com/vendure-ecommerce/vendure/issues/391) * **core** Add `cancelJob` mutation ([2d099cf](https://github.com/vendure-ecommerce/vendure/commit/2d099cf)), closes [#614](https://github.com/vendure-ecommerce/vendure/issues/614) * **core** Allow "enabled" state to be set when creating products ([02eb9f7](https://github.com/vendure-ecommerce/vendure/commit/02eb9f7)), closes [#608](https://github.com/vendure-ecommerce/vendure/issues/608) * **ui-devkit** Allow custom global styles to be specified ([2081a15](https://github.com/vendure-ecommerce/vendure/commit/2081a15)), closes [#391](https://github.com/vendure-ecommerce/vendure/issues/391) * **ui-devkit** Allow extensions consisting of only static assets ([5ea3422](https://github.com/vendure-ecommerce/vendure/commit/5ea3422)), closes [#391](https://github.com/vendure-ecommerce/vendure/issues/391) [#309](https://github.com/vendure-ecommerce/vendure/issues/309) * **ui-devkit** Export helper function to set brand images ([6cde0d8](https://github.com/vendure-ecommerce/vendure/commit/6cde0d8)), closes [#391](https://github.com/vendure-ecommerce/vendure/issues/391) ## 0.18.0 (2020-12-31) #### Fixes * **admin-ui** Correctly handle order modification with no custom fields ([c0b699b](https://github.com/vendure-ecommerce/vendure/commit/c0b699b)) * **admin-ui** Correctly handle widget permissions ([e3d7855](https://github.com/vendure-ecommerce/vendure/commit/e3d7855)) * **admin-ui** Fix error when creating new Channel ([58db345](https://github.com/vendure-ecommerce/vendure/commit/58db345)) * **admin-ui** Fix memory leak with refetchOnChannelChange usage ([1bad22a](https://github.com/vendure-ecommerce/vendure/commit/1bad22a)) * **admin-ui** Fix variant price display issues ([f62f569](https://github.com/vendure-ecommerce/vendure/commit/f62f569)) * **core** Correct handling of discounts & taxes when prices include tax ([c04b1c7](https://github.com/vendure-ecommerce/vendure/commit/c04b1c7)), closes [#573](https://github.com/vendure-ecommerce/vendure/issues/573) * **core** Correctly handle addItemToOrder when 0 stock available ([187cf3d](https://github.com/vendure-ecommerce/vendure/commit/187cf3d)) * **core** Fix ChannelAware ProductVariant performance issues ([275cd62](https://github.com/vendure-ecommerce/vendure/commit/275cd62)) * **core** Fix default PromotionActions when Channel prices include tax ([efe640c](https://github.com/vendure-ecommerce/vendure/commit/efe640c)), closes [#573](https://github.com/vendure-ecommerce/vendure/issues/573) * **core** Fix error on updateCustomer mutation ([bb1878f](https://github.com/vendure-ecommerce/vendure/commit/bb1878f)), closes [#590](https://github.com/vendure-ecommerce/vendure/issues/590) * **core** Fix failing e2e tests ([36b6dab](https://github.com/vendure-ecommerce/vendure/commit/36b6dab)) * **core** Fix Postgres search with multiple terms ([5ece0d5](https://github.com/vendure-ecommerce/vendure/commit/5ece0d5)) * **core** Handle undefined reference in customerGroup condition ([0eaffc1](https://github.com/vendure-ecommerce/vendure/commit/0eaffc1)) * **core** Ignore deleted products when checking slug uniqueness ([844a12d](https://github.com/vendure-ecommerce/vendure/commit/844a12d)), closes [#558](https://github.com/vendure-ecommerce/vendure/issues/558) * **core** Return all ProductVariant.channels from default Channel ([799f306](https://github.com/vendure-ecommerce/vendure/commit/799f306)) #### Features * **admin-ui** Add support for dashboard widgets ([aa835e8](https://github.com/vendure-ecommerce/vendure/commit/aa835e8)), closes [#334](https://github.com/vendure-ecommerce/vendure/issues/334) * **admin-ui** Allow cancellation of OrderItems without refunding ([df55d2d](https://github.com/vendure-ecommerce/vendure/commit/df55d2d)), closes [#569](https://github.com/vendure-ecommerce/vendure/issues/569) * **admin-ui** Allow default dashboard widget widths to be set ([3e33bbc](https://github.com/vendure-ecommerce/vendure/commit/3e33bbc)), closes [#334](https://github.com/vendure-ecommerce/vendure/issues/334) * **admin-ui** Allow OrderLine customFields to be modified ([e89845e](https://github.com/vendure-ecommerce/vendure/commit/e89845e)), closes [#314](https://github.com/vendure-ecommerce/vendure/issues/314) * **admin-ui** Allow OrderLine customFields to be modified ([5a4811f](https://github.com/vendure-ecommerce/vendure/commit/5a4811f)), closes [#314](https://github.com/vendure-ecommerce/vendure/issues/314) * **admin-ui** Allow overriding built-in nav menu items ([9d862c6](https://github.com/vendure-ecommerce/vendure/commit/9d862c6)), closes [#562](https://github.com/vendure-ecommerce/vendure/issues/562) * **admin-ui** Allow setting FulfillmentHandler in ShippingDetail page ([8207c84](https://github.com/vendure-ecommerce/vendure/commit/8207c84)), closes [#529](https://github.com/vendure-ecommerce/vendure/issues/529) * **admin-ui** Correctly display cancelled Fulfillments ([7efe800](https://github.com/vendure-ecommerce/vendure/commit/7efe800)), closes [#565](https://github.com/vendure-ecommerce/vendure/issues/565) * **admin-ui** Display order tax summary, update to latest Order API ([9b8e7d4](https://github.com/vendure-ecommerce/vendure/commit/9b8e7d4)), closes [#573](https://github.com/vendure-ecommerce/vendure/issues/573) * **admin-ui** Display surcharges in OrderDetail ([bbcc6d8](https://github.com/vendure-ecommerce/vendure/commit/bbcc6d8)), closes [#583](https://github.com/vendure-ecommerce/vendure/issues/583) * **admin-ui** Display tax description in OrderDetail tax summary ([843bec2](https://github.com/vendure-ecommerce/vendure/commit/843bec2)) * **admin-ui** Enable manual order state transitions ([0868b4c](https://github.com/vendure-ecommerce/vendure/commit/0868b4c)) * **admin-ui** Fulfillment dialog accepts handler-defined arguments ([c787241](https://github.com/vendure-ecommerce/vendure/commit/c787241)), closes [#529](https://github.com/vendure-ecommerce/vendure/issues/529) * **admin-ui** Implement order modification flow ([d3e3a88](https://github.com/vendure-ecommerce/vendure/commit/d3e3a88)), closes [#314](https://github.com/vendure-ecommerce/vendure/issues/314) * **admin-ui** Implement reordering, resize, add, remove of widgets ([9a52bdf](https://github.com/vendure-ecommerce/vendure/commit/9a52bdf)), closes [#334](https://github.com/vendure-ecommerce/vendure/issues/334) * **admin-ui** Implement variant channel assignment controls ([83a33b5](https://github.com/vendure-ecommerce/vendure/commit/83a33b5)), closes [#519](https://github.com/vendure-ecommerce/vendure/issues/519) * **admin-ui** Persist dashboard layout to localStorage ([ace115d](https://github.com/vendure-ecommerce/vendure/commit/ace115d)) * **admin-ui** Persist dashboard layout to localStorage ([15cae77](https://github.com/vendure-ecommerce/vendure/commit/15cae77)), closes [#334](https://github.com/vendure-ecommerce/vendure/issues/334) * **core** Add Order history entry for modifications ([894f95b](https://github.com/vendure-ecommerce/vendure/commit/894f95b)), closes [#314](https://github.com/vendure-ecommerce/vendure/issues/314) * **core** Allow multiple Fulfillments per OrderItem ([3245e00](https://github.com/vendure-ecommerce/vendure/commit/3245e00)), closes [#565](https://github.com/vendure-ecommerce/vendure/issues/565) * **core** Allow Order/OrderLine customFields to be modified ([ce656c4](https://github.com/vendure-ecommerce/vendure/commit/ce656c4)), closes [#314](https://github.com/vendure-ecommerce/vendure/issues/314) * **core** ChannelAware ProductVariants ([4c1a2be](https://github.com/vendure-ecommerce/vendure/commit/4c1a2be)) * **core** Extend OrderLine type with more discount & tax info ([aa5513f](https://github.com/vendure-ecommerce/vendure/commit/aa5513f)), closes [#573](https://github.com/vendure-ecommerce/vendure/issues/573) * **core** Implement add/remove Surcharge methods in OrderService ([6cf6984](https://github.com/vendure-ecommerce/vendure/commit/6cf6984)), closes [#583](https://github.com/vendure-ecommerce/vendure/issues/583) * **core** Implement FulfillmentHandlers ([4e53d08](https://github.com/vendure-ecommerce/vendure/commit/4e53d08)), closes [#529](https://github.com/vendure-ecommerce/vendure/issues/529) * **core** Implement order modification ([9cd3e24](https://github.com/vendure-ecommerce/vendure/commit/9cd3e24)), closes [#314](https://github.com/vendure-ecommerce/vendure/issues/314) * **core** Implement Order surcharges ([b608e14](https://github.com/vendure-ecommerce/vendure/commit/b608e14)), closes [#583](https://github.com/vendure-ecommerce/vendure/issues/583) * **core** Implement Shipping promotion actions ([69b12e3](https://github.com/vendure-ecommerce/vendure/commit/69b12e3)), closes [#580](https://github.com/vendure-ecommerce/vendure/issues/580) * **core** Implement TaxLineCalculationStrategy ([95663b4](https://github.com/vendure-ecommerce/vendure/commit/95663b4)), closes [#307](https://github.com/vendure-ecommerce/vendure/issues/307) * **core** Improve naming of price calculation strategies ([ccbebc9](https://github.com/vendure-ecommerce/vendure/commit/ccbebc9)), closes [#307](https://github.com/vendure-ecommerce/vendure/issues/307) * **core** Improved handling of ShopAPI activeOrder mutations ([958af1a](https://github.com/vendure-ecommerce/vendure/commit/958af1a)), closes [#557](https://github.com/vendure-ecommerce/vendure/issues/557) * **core** Log unhandled errors ([4dbb974](https://github.com/vendure-ecommerce/vendure/commit/4dbb974)) * **core** Modify ShippingCalculator API to enable correct tax handling ([1ab1c81](https://github.com/vendure-ecommerce/vendure/commit/1ab1c81)), closes [#580](https://github.com/vendure-ecommerce/vendure/issues/580) [#573](https://github.com/vendure-ecommerce/vendure/issues/573) * **core** Pass `amount` argument into createPayment method ([0c85c76](https://github.com/vendure-ecommerce/vendure/commit/0c85c76)) * **core** Re-work handling of taxes, order-level discounts ([9e39af3](https://github.com/vendure-ecommerce/vendure/commit/9e39af3)), closes [#573](https://github.com/vendure-ecommerce/vendure/issues/573) [#573](https://github.com/vendure-ecommerce/vendure/issues/573) * **core** Rework Order shipping to support multiple shipping lines ([a711780](https://github.com/vendure-ecommerce/vendure/commit/a711780)), closes [#580](https://github.com/vendure-ecommerce/vendure/issues/580) * **core** Simplify TaxCalculationStrategy API ([9544dd4](https://github.com/vendure-ecommerce/vendure/commit/9544dd4)), closes [#307](https://github.com/vendure-ecommerce/vendure/issues/307) * **core** Split taxes from adjustments ([2c71a82](https://github.com/vendure-ecommerce/vendure/commit/2c71a82)), closes [#573](https://github.com/vendure-ecommerce/vendure/issues/573) * **ui-devkit** Make baseUrl configurable ([54700d2](https://github.com/vendure-ecommerce/vendure/commit/54700d2)), closes [#552](https://github.com/vendure-ecommerce/vendure/issues/552) ### BREAKING CHANGE * A change to the relation between OrderItems and Fulfillments means a database migration will be required to preserve fulfillment data of existing Orders. See the release blog post for details. * In order to support order modification, a couple of new default order states have been created - `Modifying` and `ArrangingAdditionalPayment`. Also a new DB entity, `OrderModification` has been created. * The `OrderLine.pendingAdjustments` field has been renamed to `adjustments`, tax adjustments are now stored in a new field, `taxLines`. This will require a DB migration to preserve data from existing Orders (see guide in release blog post) * The `PaymentMethodHandler.createPayment()` method now takes a new `amount` argument. Update any custom PaymentMethodHandlers to use account for this new parameter and use it instead of `order.total` when creating a new payment. ```ts // before createPayment: async (ctx, order, args, metadata) { const transactionAmount = order.total; // ... } // after createPayment: async (ctx, order, amount, args, metadata) { const transactionAmount = amount; // ... } ``` * The `TaxCalculationStrategy` has been renamed to `ProductVariantPriceCalculationStrategy` and moved in the VendureConfig from `taxOptions` to `catalogOptions` and its API has been simplified. The `PriceCalculationStrategy` has been renamed to `OrderItemPriceCalculationStrategy`. * The Fulfillment and ShippingMethod entities have new fields relating to FulfillmentHandlers. This will require a DB migration, though no custom data migration will be needed for this particular change. * The `addFulfillmentToOrder` mutation input has changed: the `method` & `trackingCode` fields have been replaced by a `handler` field which accepts a FulfillmentHandler code, and any expected arguments defined by that handler. * The ProductTranslation entity has had a constraint removed, requiring a schema migration. * The return object of the ShippingCalculator class has changed: ```ts // before return { price: 500, priceWithTax: 600, }; // after return { price: 500, taxRate: 20, priceIncludesTax: false, }; ``` This change will require you to update any custom ShippingCalculator implementations, and also to update any ShippingMethods by removing and re-selecting the ShippingCalculator. * The Shop API mutations `setOrderShippingAddress`, `setOrderBillingAddress` `setOrderCustomFields` now return a union type which includes a new `NoActiveOrderError`. Code which refers to these mutations will need to be updated to account for the union with the fragment spread syntax `...on Order {...}`. * The TaxCalculationStrategy return value has been simplified - it now only need return the `price` and `priceIncludesTax` properties. The `ProductVariant` entity has also been refactored to bring it into line with the corrected tax handling of the OrderItem entity. This will require a DB migration. See release blog post for details. * The way shipping charges on Orders are represented has been changed - an Order now contains multiple ShippingLine entities, each of which has a reference to a ShippingMethod. This will require a database migration with manual queries to preserve existing order data. See release blog post for details. * There have been some major changes to the way that Order taxes and discounts are handled. For a full discussion of the issues behind these changes see #573. These changes will require a DB migration as well as possible custom scripts to port existing Orders to the new format. See the release blog post for details. * The following GraphQL `Order` type properties have changed: * `subTotalBeforeTax` has been removed, `subTotal` now excludes tax, and `subTotalWithTax` has been added. * `totalBeforeTax` has been removed, `total` now excludes tax, and `totalWithTax` has been added. ## <small>0.17.3 (2020-12-14)</small> This release fixes an error in publishing the last release. No changes have been made. ## <small>0.17.2 (2020-12-11)</small> #### Features * **admin-ui** Add French translations ([891be89](https://github.com/vendure-ecommerce/vendure/commit/891be89)) * **core** Implement negated string filter operators ([75b5b7a](https://github.com/vendure-ecommerce/vendure/commit/75b5b7a)), closes [#571](https://github.com/vendure-ecommerce/vendure/issues/571) * **core** Include express request object in RequestContext ([c4352b2](https://github.com/vendure-ecommerce/vendure/commit/c4352b2)), closes [#581](https://github.com/vendure-ecommerce/vendure/issues/581) * **core** Log unhandled errors ([c9a0bcc](https://github.com/vendure-ecommerce/vendure/commit/c9a0bcc)) * **email-plugin** Improve error logging ([70cb932](https://github.com/vendure-ecommerce/vendure/commit/70cb932)), closes [#574](https://github.com/vendure-ecommerce/vendure/issues/574) * **testing** Create TestingLogger ([c4bed2d](https://github.com/vendure-ecommerce/vendure/commit/c4bed2d)) #### Fixes * **admin-ui** Fix error when creating new Channel ([b38e35d](https://github.com/vendure-ecommerce/vendure/commit/b38e35d)) ## <small>0.17.1 (2020-11-20)</small> #### Features * **admin-ui** Add "allocated" and "saleable" values to Variant form ([0df7c71](https://github.com/vendure-ecommerce/vendure/commit/0df7c71)), closes [#554](https://github.com/vendure-ecommerce/vendure/issues/554) * **admin-ui** Add profile page to edit current admin details ([e183041](https://github.com/vendure-ecommerce/vendure/commit/e183041)) * **admin-ui** Allow fulfillment when in PartiallyDelivered state ([b36ce38](https://github.com/vendure-ecommerce/vendure/commit/b36ce38)), closes [#565](https://github.com/vendure-ecommerce/vendure/issues/565) * **admin-ui** Improved login error message ([2b952aa](https://github.com/vendure-ecommerce/vendure/commit/2b952aa)) * **admin-ui** Persist custom order filter params in url ([8eb6246](https://github.com/vendure-ecommerce/vendure/commit/8eb6246)), closes [#561](https://github.com/vendure-ecommerce/vendure/issues/561) * **admin-ui** Store last used order list filters in localStorage ([7a9ba23](https://github.com/vendure-ecommerce/vendure/commit/7a9ba23)), closes [#561](https://github.com/vendure-ecommerce/vendure/issues/561) * **core** Add `activeAdministrator` query to Admin API ([70e14f2](https://github.com/vendure-ecommerce/vendure/commit/70e14f2)) * **core** Add `updateActiveAdministrator` mutation ([73ab736](https://github.com/vendure-ecommerce/vendure/commit/73ab736)) #### Fixes * **admin-ui** Add missing Czech translations for new translation tokens ([f2b541f](https://github.com/vendure-ecommerce/vendure/commit/f2b541f)) * **admin-ui** Refetch customer list on channel change ([078de40](https://github.com/vendure-ecommerce/vendure/commit/078de40)) ## 0.17.0 (2020-11-13) #### Fixes * **admin-ui** Add missing "authorized" state translation ([788ba87](https://github.com/vendure-ecommerce/vendure/commit/788ba87)) * **admin-ui** Add missing "state.error" token ([b40843a](https://github.com/vendure-ecommerce/vendure/commit/b40843a)) * **admin-ui** Fix payment states ([df32ba1](https://github.com/vendure-ecommerce/vendure/commit/df32ba1)) * **admin-ui** Fix permission handling in nav menu ([70037e5](https://github.com/vendure-ecommerce/vendure/commit/70037e5)) * **admin-ui** Use select control for string custom field with options ([5c59b67](https://github.com/vendure-ecommerce/vendure/commit/5c59b67)), closes [#546](https://github.com/vendure-ecommerce/vendure/issues/546) * **admin-ui** Use the ShippingMethod name in fulfillment dialog ([ca2ed58](https://github.com/vendure-ecommerce/vendure/commit/ca2ed58)) * **admin-ui** Use translated state labels in custom filter select ([5f6f9ff](https://github.com/vendure-ecommerce/vendure/commit/5f6f9ff)) * **core** Allow configurable stock allocation logic ([782c0f4](https://github.com/vendure-ecommerce/vendure/commit/782c0f4)), closes [#550](https://github.com/vendure-ecommerce/vendure/issues/550) * **core** Correctly cascade deletions in HistoryEntries ([6054b71](https://github.com/vendure-ecommerce/vendure/commit/6054b71)) * **core** Correctly encode IDs in nested fragments ([d2333fc](https://github.com/vendure-ecommerce/vendure/commit/d2333fc)) * **core** Correctly update cache in customerGroup promo condition ([8df4fec](https://github.com/vendure-ecommerce/vendure/commit/8df4fec)) * **core** Fix double-allocation of stock on 2-stage payments ([c43a343](https://github.com/vendure-ecommerce/vendure/commit/c43a343)), closes [#550](https://github.com/vendure-ecommerce/vendure/issues/550) * **core** Mitigate QueryRunnerAlreadyReleasedError in EventBus handlers ([739e56c](https://github.com/vendure-ecommerce/vendure/commit/739e56c)), closes [#520](https://github.com/vendure-ecommerce/vendure/issues/520) * **core** Validate all Role permissions on bootstrap ([60c8a0e](https://github.com/vendure-ecommerce/vendure/commit/60c8a0e)), closes [#450](https://github.com/vendure-ecommerce/vendure/issues/450) #### Features * **admin-ui** Account for stockOnHand when creating Fulfillments ([540d2c6](https://github.com/vendure-ecommerce/vendure/commit/540d2c6)), closes [#319](https://github.com/vendure-ecommerce/vendure/issues/319) * **admin-ui** Add filter presets to the OrderDetail view ([4f5a440](https://github.com/vendure-ecommerce/vendure/commit/4f5a440)), closes [#477](https://github.com/vendure-ecommerce/vendure/issues/477) * **admin-ui** Allow the setting of custom Permissions ([d525a32](https://github.com/vendure-ecommerce/vendure/commit/d525a32)), closes [#450](https://github.com/vendure-ecommerce/vendure/issues/450) * **admin-ui** Display Fulfillment custom fields ([838943e](https://github.com/vendure-ecommerce/vendure/commit/838943e)), closes [#525](https://github.com/vendure-ecommerce/vendure/issues/525) * **admin-ui** Implement UI controls for setting outOfStockThreshold ([335c345](https://github.com/vendure-ecommerce/vendure/commit/335c345)), closes [#319](https://github.com/vendure-ecommerce/vendure/issues/319) * **admin-ui** Support for ShippingMethod translations & custom fields ([e189bd4](https://github.com/vendure-ecommerce/vendure/commit/e189bd4)), closes [#530](https://github.com/vendure-ecommerce/vendure/issues/530) * **admin-ui** Support new API for ProductVariant.trackInventory ([b825df1](https://github.com/vendure-ecommerce/vendure/commit/b825df1)) * **core** Add `shouldRunCheck` function to ShippingEligibilityChecker ([3b7e7db](https://github.com/vendure-ecommerce/vendure/commit/3b7e7db)), closes [#536](https://github.com/vendure-ecommerce/vendure/issues/536) * **core** Add tax summary data to Order type ([a666fab](https://github.com/vendure-ecommerce/vendure/commit/a666fab)), closes [#467](https://github.com/vendure-ecommerce/vendure/issues/467) * **core** Allow custom Permissions to be defined ([1baeedf](https://github.com/vendure-ecommerce/vendure/commit/1baeedf)), closes [#450](https://github.com/vendure-ecommerce/vendure/issues/450) * **core** Emit event when assigning/removing Customer to/from group ([6676335](https://github.com/vendure-ecommerce/vendure/commit/6676335)) * **core** Enable inventory tracking by default in GlobalSettings ([31bb06a](https://github.com/vendure-ecommerce/vendure/commit/31bb06a)) * **core** Export custom entity field types ([21706b3](https://github.com/vendure-ecommerce/vendure/commit/21706b3)) * **core** Export HistoryService ([8688c35](https://github.com/vendure-ecommerce/vendure/commit/8688c35)) * **core** Export StockMovementService ([fe98c79](https://github.com/vendure-ecommerce/vendure/commit/fe98c79)), closes [#550](https://github.com/vendure-ecommerce/vendure/issues/550) * **core** Expose additional price & tax data on OrderLine ([c870684](https://github.com/vendure-ecommerce/vendure/commit/c870684)), closes [#467](https://github.com/vendure-ecommerce/vendure/issues/467) * **core** Expose assignable Permissions via ServerConfig type ([ab2f62c](https://github.com/vendure-ecommerce/vendure/commit/ab2f62c)), closes [#450](https://github.com/vendure-ecommerce/vendure/issues/450) * **core** Implement `in` string filter for PaginatedList queries ([7c7dcf2](https://github.com/vendure-ecommerce/vendure/commit/7c7dcf2)), closes [#543](https://github.com/vendure-ecommerce/vendure/issues/543) * **core** Implement `regex` string filter for PaginatedList queries ([0a33441](https://github.com/vendure-ecommerce/vendure/commit/0a33441)), closes [#543](https://github.com/vendure-ecommerce/vendure/issues/543) * **core** Implement constraints on adding & fulfilling OrderItems ([87d07f8](https://github.com/vendure-ecommerce/vendure/commit/87d07f8)), closes [#319](https://github.com/vendure-ecommerce/vendure/issues/319) * **core** Implement inheritance for ProductVariant.trackInventory ([f27f985](https://github.com/vendure-ecommerce/vendure/commit/f27f985)) * **core** Improve feedback & error handling in migration functions ([7a1773c](https://github.com/vendure-ecommerce/vendure/commit/7a1773c)) * **core** Make ShippingMethod translatable ([c7418d1](https://github.com/vendure-ecommerce/vendure/commit/c7418d1)), closes [#530](https://github.com/vendure-ecommerce/vendure/issues/530) * **core** New "Created" initial state for Fulfillments ([a53f27e](https://github.com/vendure-ecommerce/vendure/commit/a53f27e)), closes [#510](https://github.com/vendure-ecommerce/vendure/issues/510) * **core** New "Created" initial state for Orders ([7a774e3](https://github.com/vendure-ecommerce/vendure/commit/7a774e3)), closes [#510](https://github.com/vendure-ecommerce/vendure/issues/510) * **core** OrderItem.unitPrice now _always_ excludes tax ([6e2d490](https://github.com/vendure-ecommerce/vendure/commit/6e2d490)), closes [#467](https://github.com/vendure-ecommerce/vendure/issues/467) * **core** Pass RequestContext to AssetNamingStrategy functions ([48ae372](https://github.com/vendure-ecommerce/vendure/commit/48ae372)) * **core** Pass RequestContext to AssetPreviewStrategy functions ([05e6f9e](https://github.com/vendure-ecommerce/vendure/commit/05e6f9e)) * **core** Pass RequestContext to AuthenticationStrategy.onLogOut() ([a46ea5d](https://github.com/vendure-ecommerce/vendure/commit/a46ea5d)) * **core** Pass RequestContext to OrderMergeStrategy functions ([eae71f0](https://github.com/vendure-ecommerce/vendure/commit/eae71f0)) * **core** Pass RequestContext to PaymentMethodHandler functions ([9c2257d](https://github.com/vendure-ecommerce/vendure/commit/9c2257d)), closes [#488](https://github.com/vendure-ecommerce/vendure/issues/488) * **core** Pass RequestContext to PriceCalculationStrategy ([8a58325](https://github.com/vendure-ecommerce/vendure/commit/8a58325)), closes [#487](https://github.com/vendure-ecommerce/vendure/issues/487) * **core** Pass RequestContext to PromotionAction functions ([0a35a12](https://github.com/vendure-ecommerce/vendure/commit/0a35a12)) * **core** Pass RequestContext to ShippingCalculator functions ([6eee894](https://github.com/vendure-ecommerce/vendure/commit/6eee894)) * **core** Pass RequestContext to ShippingEligibilityChecker functions ([a5db022](https://github.com/vendure-ecommerce/vendure/commit/a5db022)) * **core** Pass RequestContext to TaxZoneStrategy functions ([a4d4311](https://github.com/vendure-ecommerce/vendure/commit/a4d4311)) * **core** Return ErrorResult when setting ineligible ShippingMethod ([0e09d51](https://github.com/vendure-ecommerce/vendure/commit/0e09d51)) * **core** Support custom fields on Fulfillment entity ([380f68e](https://github.com/vendure-ecommerce/vendure/commit/380f68e)), closes [#525](https://github.com/vendure-ecommerce/vendure/issues/525) * **core** Track stock allocations ([75e3f9c](https://github.com/vendure-ecommerce/vendure/commit/75e3f9c)), closes [#319](https://github.com/vendure-ecommerce/vendure/issues/319) #### Perf * **core** Optimize invocation of ShippingEligibilityCheckers ([11415e6](https://github.com/vendure-ecommerce/vendure/commit/11415e6)), closes [#536](https://github.com/vendure-ecommerce/vendure/issues/536) ### BREAKING CHANGE * Deletions of Orders or Customers now cascade to any associated HistoryEntries, thus preserving referential integrity. This involves a DB schema change which will necessitate a migration. * Fulfillments now start in the new "Created" state, and then _immediately_ transition to the "Pending" state. This allows e.g. event listeners to pick up newly-created Fulfillments. * Orders now start in the new "Created" state, and then _immediately_ transition to the "AddingItems" state. This allows e.g. event listeners to pick up newly-created Orders. * The `AuthenticationStrategy.onLogOut()` function signature has changed: the first argument is now the RequestContext of the current request. * The `OrderItem.unitPrice` is now _always_ given as the net (without tax) price of the related ProductVariant. Formerly, it was either the net or gross price, depending on the `pricesIncludeTax` setting of the Channel. If you have existing Orders where `unitPriceIncludesTax = true`, you will need to manually update the `unitPrice` value *before* running any other migrations for this release. The query will look like: `UPDATE order_item SET unitPrice = ROUND(unitPrice / ((taxRate + 100) / 100)) WHERE unitPriceIncludesTax = 1` * The `OrderLine.totalPrice` field has been deprecated and will be removed in a future release. Use the new `OrderLine.linePriceWithTax` field instead. * The `PaymentMethodHandler` function signatures have changed: `createPayment()`, `settlePayment()` & `createRefund()` now all get passed the RequestContext object as the first argument. * The `PriceCalculationStrategy.calculateUnitPrice()` function signature has changed: the first argument is now the RequestContext of the current request. * The `ProductVariant.trackInventory` field is now an Enum rather than a boolean, allowing explicit inheritance of the value set in GlobalSettings. This will require a DB migration with a custom query to transform the previous boolean values to the new enum (string) values of "TRUE", "FALSE" or "INHERIT". Check the release blog post for more details. * The `ShippingMethod` entity is now translatable. This change will require a DB migration to be performed, including custom queries to migrate any existing ShippingMethods to the new table structure (see release blog post for details). * The AssetNamingStrategy `generateSourceFileName()` & `generatePreviewFileName()` function signatures have changed: the first argument is now the RequestContext of the current request. * The AssetPreviewStrategy `generatePreviewImage()` function signature has changed: the first argument is now the RequestContext of the current request. * The internal handling of stock movements has been refined, which required changes to the DB schema. This will require a migration. * The OrderMergeStrategy `merge()` function signature has changed: the first argument is now the RequestContext of the current request. * The PromotionAction `execute()` function signature has changed: the first argument is now the RequestContext of the current request. * The ShippingCalculator `calculate()` function signature has changed: the first argument is now the RequestContext of the current request. * The ShippingEligibilityChecker `check()` function signature has changed: the first argument is now the RequestContext of the current request. * The TaxZoneStrategy `determineTaxZone()` function signature has changed: the first argument is now the RequestContext of the current request. ## <small>0.16.3 (2020-11-05)</small> #### Fixes * **admin-ui** Add missing I18n state tokens ([215a637](https://github.com/vendure-ecommerce/vendure/commit/215a637)) * **admin-ui** Fix Apollo cache warning for GlobalSettings.serverConfig ([8b135ad](https://github.com/vendure-ecommerce/vendure/commit/8b135ad)) * **admin-ui** Fix CustomerGroupList layout in Firefox ([c432a14](https://github.com/vendure-ecommerce/vendure/commit/c432a14)), closes [#531](https://github.com/vendure-ecommerce/vendure/issues/531) * **admin-ui** Fix overflow that made ui unusable on mobile ([f129e0c](https://github.com/vendure-ecommerce/vendure/commit/f129e0c)) * **admin-ui** Fix saving countries in other languages ([11a1004](https://github.com/vendure-ecommerce/vendure/commit/11a1004)), closes [#528](https://github.com/vendure-ecommerce/vendure/issues/528) * **core** Add retry logic in case of transaction deadlocks ([3b60bcb](https://github.com/vendure-ecommerce/vendure/commit/3b60bcb)), closes [#527](https://github.com/vendure-ecommerce/vendure/issues/527) #### Features * **core** Export FacetValueChecker promotion utility ([fc3890e](https://github.com/vendure-ecommerce/vendure/commit/fc3890e)) ## <small>0.16.2 (2020-10-22)</small> #### Fixes * **admin-ui** Auto-fill Product & Collection slugs in other languages ([9393d04](https://github.com/vendure-ecommerce/vendure/commit/9393d04)), closes [#522](https://github.com/vendure-ecommerce/vendure/issues/522) * **admin-ui** Correct display of args input in PaymentMethodDetail ([3f7627e](https://github.com/vendure-ecommerce/vendure/commit/3f7627e)), closes [#489](https://github.com/vendure-ecommerce/vendure/issues/489) * **admin-ui** Fix collection list "expand all" behaviour when toggling ([c77af2b](https://github.com/vendure-ecommerce/vendure/commit/c77af2b)), closes [#513](https://github.com/vendure-ecommerce/vendure/issues/513) * **admin-ui** Fix display of existing variants in ProductVariantEditor ([ca538b8](https://github.com/vendure-ecommerce/vendure/commit/ca538b8)), closes [#521](https://github.com/vendure-ecommerce/vendure/issues/521) * **admin-ui** Preserve expanded state on moving collections ([8d028cf](https://github.com/vendure-ecommerce/vendure/commit/8d028cf)), closes [#515](https://github.com/vendure-ecommerce/vendure/issues/515) * **core** Add missing events to export (fulfillment, logout) ([04a49bf](https://github.com/vendure-ecommerce/vendure/commit/04a49bf)) * **core** Correctly de-duplicate OrderLines with empty custom fields ([ef99c22](https://github.com/vendure-ecommerce/vendure/commit/ef99c22)), closes [#512](https://github.com/vendure-ecommerce/vendure/issues/512) * **email-plugin** Only call `loadData()` function after filters run ([e22db7e](https://github.com/vendure-ecommerce/vendure/commit/e22db7e)), closes [#518](https://github.com/vendure-ecommerce/vendure/issues/518) #### Features * **admin-ui** Add Czech translations ([89ee826](https://github.com/vendure-ecommerce/vendure/commit/89ee826)) * **admin-ui** Enable filtering by custom Order states in list view ([76d2d56](https://github.com/vendure-ecommerce/vendure/commit/76d2d56)) * **core** Add custom error result on AuthenticationStrategy ([d3ddb96](https://github.com/vendure-ecommerce/vendure/commit/d3ddb96)), closes [#499](https://github.com/vendure-ecommerce/vendure/issues/499) * **core** Add NotVerifiedError to AuthenticationResult ([ee39263](https://github.com/vendure-ecommerce/vendure/commit/ee39263)), closes [#500](https://github.com/vendure-ecommerce/vendure/issues/500) * **core** Add support for better-sqlite3 driver to DefaultSearchPlugin ([7a71fbe](https://github.com/vendure-ecommerce/vendure/commit/7a71fbe)), closes [#505](https://github.com/vendure-ecommerce/vendure/issues/505) * **create** Use better-sqlite3 driver for improved sqlite perf ([dfd4f36](https://github.com/vendure-ecommerce/vendure/commit/dfd4f36)), closes [#505](https://github.com/vendure-ecommerce/vendure/issues/505) ## <small>0.16.1 (2020-10-15)</small> #### Fixes * **admin-ui** Allow SortPipe to work with frozen arrays ([00e0af9](https://github.com/vendure-ecommerce/vendure/commit/00e0af9)) * **admin-ui** Correctly handle missing error codes ([aa80092](https://github.com/vendure-ecommerce/vendure/commit/aa80092)) * **admin-ui** Fix Apollo cache errors when switching Channels ([ca2c1b6](https://github.com/vendure-ecommerce/vendure/commit/ca2c1b6)), closes [#496](https://github.com/vendure-ecommerce/vendure/issues/496) * **admin-ui** Fix build-time Angular CLI warnings ([c52a258](https://github.com/vendure-ecommerce/vendure/commit/c52a258)) * **admin-ui** Fix DateFormInputComponent error ([5575778](https://github.com/vendure-ecommerce/vendure/commit/5575778)) * **admin-ui** Fix widths of product variant inputs ([feca114](https://github.com/vendure-ecommerce/vendure/commit/feca114)), closes [#503](https://github.com/vendure-ecommerce/vendure/issues/503) * **core** DefaultSearchPlugin correctly indexes language variants ([909479b](https://github.com/vendure-ecommerce/vendure/commit/909479b)), closes [#493](https://github.com/vendure-ecommerce/vendure/issues/493) * **core** Restore export of ZoneService ([9b8d278](https://github.com/vendure-ecommerce/vendure/commit/9b8d278)) * **core** Use correct permission for `updateAdministrator` mutation ([4b55288](https://github.com/vendure-ecommerce/vendure/commit/4b55288)) * **elasticsearch-plugin** Compatible with UUID primary keys strategy ([cdf3a39](https://github.com/vendure-ecommerce/vendure/commit/cdf3a39)), closes [#494](https://github.com/vendure-ecommerce/vendure/issues/494) * **elasticsearch-plugin** Correctly index language variants ([e37e5c9](https://github.com/vendure-ecommerce/vendure/commit/e37e5c9)), closes [#493](https://github.com/vendure-ecommerce/vendure/issues/493) ## 0.16.0 (2020-10-09) #### Fixes * **admin-ui-plugin** Fix default languages list ([be3bf29](https://github.com/vendure-ecommerce/vendure/commit/be3bf29)) * **admin-ui** Allow Fulfillments to be created based on state machine ([5b99f59](https://github.com/vendure-ecommerce/vendure/commit/5b99f59)), closes [#471](https://github.com/vendure-ecommerce/vendure/issues/471) * **admin-ui** Correctly handle missing shipping checker/calculator defs ([460963a](https://github.com/vendure-ecommerce/vendure/commit/460963a)) * **core** Add check on order PaymentSettled transition ([141d650](https://github.com/vendure-ecommerce/vendure/commit/141d650)) * **core** Correctly transition Order on Fulfillment transitions ([9b2c088](https://github.com/vendure-ecommerce/vendure/commit/9b2c088)) * **core** Fix error when using channelId with getEntityOrThrow method ([65c50d4](https://github.com/vendure-ecommerce/vendure/commit/65c50d4)) * **core** Fix NativeAuthenticationStrategy user lookup ([b275c20](https://github.com/vendure-ecommerce/vendure/commit/b275c20)), closes [#486](https://github.com/vendure-ecommerce/vendure/issues/486) #### Features * **admin-ui** Display error messages on failed Asset uploads ([5aebcd6](https://github.com/vendure-ecommerce/vendure/commit/5aebcd6)) * **admin-ui** Handle Fulfillments state from Order detail view ([7883a7a](https://github.com/vendure-ecommerce/vendure/commit/7883a7a)), closes [#426](https://github.com/vendure-ecommerce/vendure/issues/426) * **admin-ui** Make order history collapsible ([db37707](https://github.com/vendure-ecommerce/vendure/commit/db37707)) * **admin-ui** Update Apollo Client to v3 ([4e628a6](https://github.com/vendure-ecommerce/vendure/commit/4e628a6)) * **admin-ui** Update to Angular v10 & Clarity v4 ([57c4106](https://github.com/vendure-ecommerce/vendure/commit/57c4106)) * **core** Allow public & private Payment metadata ([3f72311](https://github.com/vendure-ecommerce/vendure/commit/3f72311)), closes [#476](https://github.com/vendure-ecommerce/vendure/issues/476) * **core** Create improved error-handling infrastructure ([0c0a7b2](https://github.com/vendure-ecommerce/vendure/commit/0c0a7b2)), closes [#437](https://github.com/vendure-ecommerce/vendure/issues/437) * **core** Create OrderCodeStrategy for more control over order codes ([30dc639](https://github.com/vendure-ecommerce/vendure/commit/30dc639)), closes [#452](https://github.com/vendure-ecommerce/vendure/issues/452) * **core** Create Transaction decorator ([4040089](https://github.com/vendure-ecommerce/vendure/commit/4040089)) * **core** Create unit-of-work infrastructure for transactions ([82b54e6](https://github.com/vendure-ecommerce/vendure/commit/82b54e6)), closes [#242](https://github.com/vendure-ecommerce/vendure/issues/242) * **core** Implement a state machine for Fulfillments ([70a7665](https://github.com/vendure-ecommerce/vendure/commit/70a7665)) * **core** Improved error handling for Admin API mutations ([af49054](https://github.com/vendure-ecommerce/vendure/commit/af49054)), closes [#437](https://github.com/vendure-ecommerce/vendure/issues/437) * **core** Improved error handling for ShopAPI order resolvers ([156c9e2](https://github.com/vendure-ecommerce/vendure/commit/156c9e2)), closes [#437](https://github.com/vendure-ecommerce/vendure/issues/437) * **core** Make Customers ChannelAware ([0f73473](https://github.com/vendure-ecommerce/vendure/commit/0f73473)) * **core** Run all mutations within transactions ([b40209e](https://github.com/vendure-ecommerce/vendure/commit/b40209e)), closes [#242](https://github.com/vendure-ecommerce/vendure/issues/242) * **core** Update GraphQL to v15 ([177a14f](https://github.com/vendure-ecommerce/vendure/commit/177a14f)) * **core** Update to TypeScript v4.0.3 ([e1ce807](https://github.com/vendure-ecommerce/vendure/commit/e1ce807)) * **core** Update TypeORM to 0.2.28 ([d280466](https://github.com/vendure-ecommerce/vendure/commit/d280466)) * **core** Use transaction to update Fulfillment state ([8232ddc](https://github.com/vendure-ecommerce/vendure/commit/8232ddc)) * **email-plugin** Provide an Injector instance to .loadData function ([e2665a7](https://github.com/vendure-ecommerce/vendure/commit/e2665a7)) * **testing** Create helpers for testing of ErrorResult union types ([6ef6045](https://github.com/vendure-ecommerce/vendure/commit/6ef6045)), closes [#437](https://github.com/vendure-ecommerce/vendure/issues/437) ### BREAKING CHANGE * All Vendure packages are now built on TypeScript v4.0.3. With new TypeScript versions come the possibility that its improved type-checking abilities will uncover new errors that it had not detected previously. * If you are using the `.loadData()` method of an EmailEventHandler, the callback signature has changed to provide an instance of the Injector class, rather than an `inject()` function. * The `orderOptions.generateOrderCode` config option has been replaced with `orderOptions.orderCodeStrategy`. This change allows order code generation to take advantage of the `InjectableStrategy` interface, i.e. to be able to inject Vendure services and other providers (e.g. the database connection). See the `OrderCodeStrategy` documentation for guidance on how to use the new API. * The `Payment.metadata` field is not private by default, meaning that it can only be read via the Admin API. Data required in the Shop API can be accessed by putting it in a field named `public`. Example: `Payment.metadata.public.redirectUrl` * The TypeORM `Connection` should no longer be directly used. Instead, inject the new `TransactionalConnection` class, which wraps the TypeORM connection and enables database transactions to be used in conjunction with the new `@Transaction` decorator. The `getEntityOrThrow()` and `findOneInChannel()` helper functions have been deprecated and replaced by methods with the same name (but slightly different signature) on the TransactionalConnection class. * The upgrade of the Admin UI to Angular v10 means that if you are using the `@vendure/ui-devkit` package to compile an extended version of the Admin UI, you need to have at least TypeScript v3.9.2 installed. ## <small>0.15.2 (2020-09-30)</small> #### Fixes * **admin-ui** Allow cancellation from custom Order states ([117264f](https://github.com/vendure-ecommerce/vendure/commit/117264f)), closes [#472](https://github.com/vendure-ecommerce/vendure/issues/472) * **admin-ui** Fix address dialog issues ([0d61f47](https://github.com/vendure-ecommerce/vendure/commit/0d61f47)), closes [#463](https://github.com/vendure-ecommerce/vendure/issues/463) * **admin-ui** Fix asset drag/drop support in safari ([55304c5](https://github.com/vendure-ecommerce/vendure/commit/55304c5)) * **core** Fix handling of JobRecord ids when using UUID strategy ([30e6e70](https://github.com/vendure-ecommerce/vendure/commit/30e6e70)), closes [#478](https://github.com/vendure-ecommerce/vendure/issues/478) * **email-plugin** Include shipping method in order receipt handler ([ea907a4](https://github.com/vendure-ecommerce/vendure/commit/ea907a4)), closes [#473](https://github.com/vendure-ecommerce/vendure/issues/473) #### Features * **core** Add `totalQuantity` field to Order type ([829ac96](https://github.com/vendure-ecommerce/vendure/commit/829ac96)), closes [#465](https://github.com/vendure-ecommerce/vendure/issues/465) * **elasticsearch-plugin** Allow full client options to be passed ([c686509](https://github.com/vendure-ecommerce/vendure/commit/c686509)), closes [#474](https://github.com/vendure-ecommerce/vendure/issues/474) ## <small>0.15.1 (2020-09-09)</small> #### Features * **admin-ui** Customer address editor opens in modal ([0a4d460](https://github.com/vendure-ecommerce/vendure/commit/0a4d460)) * **create** Make distinction between MySQL & MariaDB ([a31bbf8](https://github.com/vendure-ecommerce/vendure/commit/a31bbf8)) #### Fixes * **admin-ui** Allow removing last item from ProductSelectorFromInput ([21db8cf](https://github.com/vendure-ecommerce/vendure/commit/21db8cf)) * **admin-ui** Correctly update product list after deletion ([5587144](https://github.com/vendure-ecommerce/vendure/commit/5587144)), closes [#453](https://github.com/vendure-ecommerce/vendure/issues/453) * **admin-ui** Display custom fields in Address form ([f074f65](https://github.com/vendure-ecommerce/vendure/commit/f074f65)), closes [#455](https://github.com/vendure-ecommerce/vendure/issues/455) * **core** Add resolver for Product.facetValues ([163a32f](https://github.com/vendure-ecommerce/vendure/commit/163a32f)), closes [#449](https://github.com/vendure-ecommerce/vendure/issues/449) * **core** Add warning for list defaults in mysql ([d47becc](https://github.com/vendure-ecommerce/vendure/commit/d47becc)) * **core** Correctly parse fragments defined before operations ([44a9ab9](https://github.com/vendure-ecommerce/vendure/commit/44a9ab9)), closes [#459](https://github.com/vendure-ecommerce/vendure/issues/459) * **core** Fix only_full_group_by issues in MySQL search ([188cfaa](https://github.com/vendure-ecommerce/vendure/commit/188cfaa)) ## 0.15.0 (2020-08-27) #### Fixes * **admin-ui** Dynamically set yearRange of DatetimePickerComponent ([c66b10b](https://github.com/vendure-ecommerce/vendure/commit/c66b10b)), closes [#425](https://github.com/vendure-ecommerce/vendure/issues/425) * **admin-ui** Fix channel header when using bearer auth ([fa29805](https://github.com/vendure-ecommerce/vendure/commit/fa29805)) * **admin-ui** Fix filtering of product variant table ([121b6fc](https://github.com/vendure-ecommerce/vendure/commit/121b6fc)) * **admin-ui** Prevent clipping of product selector overlay ([7f9b6d7](https://github.com/vendure-ecommerce/vendure/commit/7f9b6d7)) * **admin-ui** Refetch orders list on channel change ([ffa5615](https://github.com/vendure-ecommerce/vendure/commit/ffa5615)) * **asset-server-plugin** Make nativeS3Configuration optional ([650977d](https://github.com/vendure-ecommerce/vendure/commit/650977d)) * **core** Correct shipping calculator typing ([9052845](https://github.com/vendure-ecommerce/vendure/commit/9052845)) * **core** Correct shipping calculator typing ([4a8e9ed](https://github.com/vendure-ecommerce/vendure/commit/4a8e9ed)) * **core** Correct typing of GraphQL ID type in generated code ([dc7b303](https://github.com/vendure-ecommerce/vendure/commit/dc7b303)), closes [#410](https://github.com/vendure-ecommerce/vendure/issues/410) * **core** Correctly calculate item price discount actions ([06bb780](https://github.com/vendure-ecommerce/vendure/commit/06bb780)) * **core** Correctly handle adjustOrderLine with quantity 0 ([7381d3d](https://github.com/vendure-ecommerce/vendure/commit/7381d3d)), closes [#435](https://github.com/vendure-ecommerce/vendure/issues/435) * **core** Ignore deleted variants when validating options ([9c242f8](https://github.com/vendure-ecommerce/vendure/commit/9c242f8)), closes [#412](https://github.com/vendure-ecommerce/vendure/issues/412) * **core** Make AssetOptions fields optional ([698011e](https://github.com/vendure-ecommerce/vendure/commit/698011e)) #### Features * **admin-ui** Add Brazilian Portuguese translations ([7673353](https://github.com/vendure-ecommerce/vendure/commit/7673353)) * **admin-ui** Add password form input ([6c909b3](https://github.com/vendure-ecommerce/vendure/commit/6c909b3)), closes [#445](https://github.com/vendure-ecommerce/vendure/issues/445) * **admin-ui** Add pt_BR to default translations ([5da5b4e](https://github.com/vendure-ecommerce/vendure/commit/5da5b4e)) * **admin-ui** Implement list types for ConfigurableOperationDef args ([4c7467b](https://github.com/vendure-ecommerce/vendure/commit/4c7467b)), closes [#414](https://github.com/vendure-ecommerce/vendure/issues/414) * **admin-ui** Implement list types for custom fields ([e72f0b3](https://github.com/vendure-ecommerce/vendure/commit/e72f0b3)), closes [#416](https://github.com/vendure-ecommerce/vendure/issues/416) * **admin-ui** Implement pagination & filtering of product variants ([e2b445b](https://github.com/vendure-ecommerce/vendure/commit/e2b445b)), closes [#411](https://github.com/vendure-ecommerce/vendure/issues/411) * **admin-ui** Implement product selector custom form input ([f687f49](https://github.com/vendure-ecommerce/vendure/commit/f687f49)), closes [#400](https://github.com/vendure-ecommerce/vendure/issues/400) * **admin-ui** Unify CustomFieldControl type with FormInputComponent ([9e22347](https://github.com/vendure-ecommerce/vendure/commit/9e22347)), closes [#415](https://github.com/vendure-ecommerce/vendure/issues/415) * **core** Add `productVariant` query to Admin API ([72b6ccd](https://github.com/vendure-ecommerce/vendure/commit/72b6ccd)) * **core** Add removeAllOrderLines mutation in Shop API ([841e352](https://github.com/vendure-ecommerce/vendure/commit/841e352)), closes [#430](https://github.com/vendure-ecommerce/vendure/issues/430) * **core** Add support for list types in ConfigurableOperationDefs ([6698195](https://github.com/vendure-ecommerce/vendure/commit/6698195)), closes [#414](https://github.com/vendure-ecommerce/vendure/issues/414) * **core** Implement "containsProducts" PromotionCondition ([688d304](https://github.com/vendure-ecommerce/vendure/commit/688d304)), closes [#400](https://github.com/vendure-ecommerce/vendure/issues/400) * **core** Implement customer group form input ([177866e](https://github.com/vendure-ecommerce/vendure/commit/177866e)), closes [#400](https://github.com/vendure-ecommerce/vendure/issues/400) * **core** Implement customer group promotion condition ([fd70448](https://github.com/vendure-ecommerce/vendure/commit/fd70448)), closes [#400](https://github.com/vendure-ecommerce/vendure/issues/400) * **core** Implement product discount promotion action ([7da0d46](https://github.com/vendure-ecommerce/vendure/commit/7da0d46)), closes [#400](https://github.com/vendure-ecommerce/vendure/issues/400) * **core** Implement search by collection slug ([a4cbdbb](https://github.com/vendure-ecommerce/vendure/commit/a4cbdbb)), closes [#405](https://github.com/vendure-ecommerce/vendure/issues/405) * **core** Improve type-safety of custom ui input config ([d0cc096](https://github.com/vendure-ecommerce/vendure/commit/d0cc096)), closes [#414](https://github.com/vendure-ecommerce/vendure/issues/414) * **core** Make Orders ChannelAware ([9bb5750](https://github.com/vendure-ecommerce/vendure/commit/9bb5750)), closes [#440](https://github.com/vendure-ecommerce/vendure/issues/440) * **core** Support list types for custom fields ([1fa3cf1](https://github.com/vendure-ecommerce/vendure/commit/1fa3cf1)), closes [#416](https://github.com/vendure-ecommerce/vendure/issues/416) * **elasticsearch-plugin** Implement search by collection slug ([cbfd499](https://github.com/vendure-ecommerce/vendure/commit/cbfd499)), closes [#405](https://github.com/vendure-ecommerce/vendure/issues/405) ### BREAKING CHANGE * If you use custom field controls in the Admin UI, you'll need to slightly modify the component class: the `customFieldConfig` property has been renamed to `config` and a required `readonly: boolean;` field should be added. This is part of an effort to unify the way custom input components work across different parts of the Admin UI. * Orders are now channel-aware which requires a non-destructive DB migration to apply the schema changes required for this relation. In addition, this migration is required to relate existing Orders to the default Channel: ```TypeScript // Assuming the ID of the default Channel is 1. If you are using a UUID strategy, // replace 1 with the ID of the default channel. await queryRunner.query( 'INSERT INTO `order_channels_channel` (orderId, channelId) SELECT id, 1 FROM `order`', undefined, ); ``` * The `'facetValueIds'` type has been removed from the `ConfigArgType` type, and replaced by `'ID'` and the `list` option. This change only affects you if you have created custom CollectionFilters of PromotionActions/Conditions using the `'facetValueIds'` type for an argument. * The `ID` type in `@vendure/common/lib/generated-types` & `@vendure/common/lib/generated-shop-types` is now correctly typed as `string | number`, whereas previously it was `string`. If you are using any generated types in your plugin code, this may lead to TypeScript compiler errors which will need to be corrected. ## <small>0.14.1 (2020-08-18)</small> #### Fixes * **admin-ui** Fix notification for customer verification email ([6c76ebe](https://github.com/vendure-ecommerce/vendure/commit/6c76ebe)), closes [#438](https://github.com/vendure-ecommerce/vendure/issues/438) * **admin-ui** Make emailAddress required in CustomerDetail form ([2a9ee2e](https://github.com/vendure-ecommerce/vendure/commit/2a9ee2e)), closes [#438](https://github.com/vendure-ecommerce/vendure/issues/438) * **admin-ui** Update facets cache after deletion ([f4eec6a](https://github.com/vendure-ecommerce/vendure/commit/f4eec6a)), closes [#424](https://github.com/vendure-ecommerce/vendure/issues/424) * **core** Correct shipping calculator typing ([18f5bcd](https://github.com/vendure-ecommerce/vendure/commit/18f5bcd)) * **core** Correctly handle aliases when transforming Asset urls ([18bbeee](https://github.com/vendure-ecommerce/vendure/commit/18bbeee)), closes [#417](https://github.com/vendure-ecommerce/vendure/issues/417) * **email-plugin** Add filter of emailVerificationHandler ([a68b18e](https://github.com/vendure-ecommerce/vendure/commit/a68b18e)), closes [#438](https://github.com/vendure-ecommerce/vendure/issues/438) #### Features * **admin-ui** Add Address custom fields to order detail ([c4ca2d0](https://github.com/vendure-ecommerce/vendure/commit/c4ca2d0)), closes [#409](https://github.com/vendure-ecommerce/vendure/issues/409) * **admin-ui** Restrict Asset input based on permitted file types ([dc668d9](https://github.com/vendure-ecommerce/vendure/commit/dc668d9)), closes [#421](https://github.com/vendure-ecommerce/vendure/issues/421) * **asset-server-plugin** Extended S3Config to accept aws-sdk configuration properties ([ce903ad](https://github.com/vendure-ecommerce/vendure/commit/ce903ad)) * **core** Add Address custom fields to OrderAddress ([6f35493](https://github.com/vendure-ecommerce/vendure/commit/6f35493)), closes [#409](https://github.com/vendure-ecommerce/vendure/issues/409) * **core** Custom field length configuration for localeString ([9fab7e8](https://github.com/vendure-ecommerce/vendure/commit/9fab7e8)) * **core** Expose all cookie options in VendureConfig ([ad089ea](https://github.com/vendure-ecommerce/vendure/commit/ad089ea)), closes [#436](https://github.com/vendure-ecommerce/vendure/issues/436) * **core** Expose permitted Asset types in ServerConfig type ([66abc7f](https://github.com/vendure-ecommerce/vendure/commit/66abc7f)), closes [#421](https://github.com/vendure-ecommerce/vendure/issues/421) * **core** Implement permitted mime types for Assets ([272b2db](https://github.com/vendure-ecommerce/vendure/commit/272b2db)), closes [#421](https://github.com/vendure-ecommerce/vendure/issues/421) * **core** Validate DB table structure on worker bootstrap ([c1ccaa1](https://github.com/vendure-ecommerce/vendure/commit/c1ccaa1)) * **core** Verbose query error logging (#433) ([8cf7483](https://github.com/vendure-ecommerce/vendure/commit/8cf7483)), closes [#433](https://github.com/vendure-ecommerce/vendure/issues/433) ## 0.14.0 (2020-07-20) #### Fixes * **admin-ui** Fix error when creating new Customer ([edc56f8](https://github.com/vendure-ecommerce/vendure/commit/edc56f8)) * **admin-ui** Fix ts error introduced by ShippingMethods custom fields ([8c38ad1](https://github.com/vendure-ecommerce/vendure/commit/8c38ad1)) * **admin-ui** Save custom fields in the Customer detail view ([3c45b16](https://github.com/vendure-ecommerce/vendure/commit/3c45b16)), closes [#387](https://github.com/vendure-ecommerce/vendure/issues/387) * **core** Correct handling of multiple session for same user ([2c42305](https://github.com/vendure-ecommerce/vendure/commit/2c42305)) * **core** Correctly call PaymentMethodHandler.onStateTransitionStart ([143e62f](https://github.com/vendure-ecommerce/vendure/commit/143e62f)) * **core** Define cascade behaviour for featured assets ([3f0c79b](https://github.com/vendure-ecommerce/vendure/commit/3f0c79b)) * **core** Fix bug where session user in cache would get removed ([ebec0f0](https://github.com/vendure-ecommerce/vendure/commit/ebec0f0)) * **core** Fix error when de-serializing a RequestContext without expiry ([a1e03fd](https://github.com/vendure-ecommerce/vendure/commit/a1e03fd)) * **core** Prevent countryCode exception when adding payment to order ([49c2ad4](https://github.com/vendure-ecommerce/vendure/commit/49c2ad4)) #### Features * **admin-ui-plugin** Support `loginUrl` option ([5a95476](https://github.com/vendure-ecommerce/vendure/commit/5a95476)) * **admin-ui** Add `loginUrl` option to support external login pages ([2745146](https://github.com/vendure-ecommerce/vendure/commit/2745146)), closes [#215](https://github.com/vendure-ecommerce/vendure/issues/215) * **admin-ui** Add ability to delete administrator from admin list ([e217ce0](https://github.com/vendure-ecommerce/vendure/commit/e217ce0)), closes [#384](https://github.com/vendure-ecommerce/vendure/issues/384) * **admin-ui** Display auth strategy in customer history ([bdfc43d](https://github.com/vendure-ecommerce/vendure/commit/bdfc43d)) * **admin-ui** Display customer last login time ([0f9dd1c](https://github.com/vendure-ecommerce/vendure/commit/0f9dd1c)) * **admin-ui** Enable updating of Order custom fields ([5bbd80b](https://github.com/vendure-ecommerce/vendure/commit/5bbd80b)), closes [#404](https://github.com/vendure-ecommerce/vendure/issues/404) * **admin-ui** Implement multiple asset deletion ([b2f3f08](https://github.com/vendure-ecommerce/vendure/commit/b2f3f08)), closes [#380](https://github.com/vendure-ecommerce/vendure/issues/380) * **admin-ui** Implement order process state chart view ([7283258](https://github.com/vendure-ecommerce/vendure/commit/7283258)) * **admin-ui** Improve multi-selection in Asset gallery component ([a4e132a](https://github.com/vendure-ecommerce/vendure/commit/a4e132a)), closes [#380](https://github.com/vendure-ecommerce/vendure/issues/380) * **admin-ui** Support custom state transitions from Order detail view ([1d2ba31](https://github.com/vendure-ecommerce/vendure/commit/1d2ba31)) * **core** Add `ProductOption.group` field & resolver ([f20e108](https://github.com/vendure-ecommerce/vendure/commit/f20e108)), closes [#378](https://github.com/vendure-ecommerce/vendure/issues/378) * **core** Add `ProductVariant.product` field & resolver ([0334848](https://github.com/vendure-ecommerce/vendure/commit/0334848)), closes [#378](https://github.com/vendure-ecommerce/vendure/issues/378) * **core** Add admin helpers to ExternalAuthenticationService ([3456ffb](https://github.com/vendure-ecommerce/vendure/commit/3456ffb)) * **core** Add custom fields to registerCustomerAccount mutation ([be1f200](https://github.com/vendure-ecommerce/vendure/commit/be1f200)), closes [#388](https://github.com/vendure-ecommerce/vendure/issues/388) * **core** Allow all CustomOrderProcess handlers to be async functions ([5d67d06](https://github.com/vendure-ecommerce/vendure/commit/5d67d06)) * **core** Enable custom fields on ShippingMethod entity (#406) ([fbc36ab](https://github.com/vendure-ecommerce/vendure/commit/fbc36ab)), closes [#406](https://github.com/vendure-ecommerce/vendure/issues/406) [#402](https://github.com/vendure-ecommerce/vendure/issues/402) * **core** Export ExternalAuthenticationService ([c3ed2cd](https://github.com/vendure-ecommerce/vendure/commit/c3ed2cd)) * **core** Expose `nextStates` on Order type in Admin API ([ece0bbe](https://github.com/vendure-ecommerce/vendure/commit/ece0bbe)) * **core** Expose order state machine config via `serverConfig` type ([0a77438](https://github.com/vendure-ecommerce/vendure/commit/0a77438)) * **core** Expose User.authenticationMethod in GraphQL APIs ([96f923a](https://github.com/vendure-ecommerce/vendure/commit/96f923a)) * **core** Implement `authenticate` mutation for Admin API ([357f878](https://github.com/vendure-ecommerce/vendure/commit/357f878)) * **core** Implement `deleteAdministrator` mutation ([dc82b2c](https://github.com/vendure-ecommerce/vendure/commit/dc82b2c)), closes [#384](https://github.com/vendure-ecommerce/vendure/issues/384) * **core** Implement `setOrderCustomFields` in Admin API ([ad89fc9](https://github.com/vendure-ecommerce/vendure/commit/ad89fc9)), closes [#404](https://github.com/vendure-ecommerce/vendure/issues/404) * **core** Implement `setOrderCustomFields` in Shop API ([3a12dc5](https://github.com/vendure-ecommerce/vendure/commit/3a12dc5)), closes [#404](https://github.com/vendure-ecommerce/vendure/issues/404) * **core** Implement `transitionOrderToState` in Admin API ([3196b52](https://github.com/vendure-ecommerce/vendure/commit/3196b52)) * **core** Implement configurable session caching ([09a432d](https://github.com/vendure-ecommerce/vendure/commit/09a432d)), closes [#394](https://github.com/vendure-ecommerce/vendure/issues/394) * **core** Implement deleteAssets mutation ([6f12014](https://github.com/vendure-ecommerce/vendure/commit/6f12014)), closes [#380](https://github.com/vendure-ecommerce/vendure/issues/380) * **core** Improve customization of order process ([0011ea9](https://github.com/vendure-ecommerce/vendure/commit/0011ea9)), closes [#401](https://github.com/vendure-ecommerce/vendure/issues/401) * **core** Include auth strategy name in AttemptedLoginEvent ([b83f1fe](https://github.com/vendure-ecommerce/vendure/commit/b83f1fe)) * **core** Log error variables as well as message ([de25bdb](https://github.com/vendure-ecommerce/vendure/commit/de25bdb)) * **core** More flexible customer registration flow ([92350e6](https://github.com/vendure-ecommerce/vendure/commit/92350e6)), closes [#392](https://github.com/vendure-ecommerce/vendure/issues/392) * **core** More flexible handling of shipping calculations ([d166c08](https://github.com/vendure-ecommerce/vendure/commit/d166c08)), closes [#397](https://github.com/vendure-ecommerce/vendure/issues/397) [#398](https://github.com/vendure-ecommerce/vendure/issues/398) * **core** Record lastLogin date on authenticate ([39c743b](https://github.com/vendure-ecommerce/vendure/commit/39c743b)) * **core** Record strategy used to register in Customer history ([5504044](https://github.com/vendure-ecommerce/vendure/commit/5504044)) * **core** Rework User/auth implementation to enable 3rd party auth ([f12b96f](https://github.com/vendure-ecommerce/vendure/commit/f12b96f)), closes [#215](https://github.com/vendure-ecommerce/vendure/issues/215) * **core** Store authenticationStrategy on an AuthenticatedSession ([e737c56](https://github.com/vendure-ecommerce/vendure/commit/e737c56)) * **email-plugin** Use new User model in email handlers ([16dd884](https://github.com/vendure-ecommerce/vendure/commit/16dd884)) ### BREAKING CHANGE * (email-plugin) The default email handlers have been updated to use the new User model, and as a result the email templates "email-verification", "email-address-change" and "password-reset" should be updated to remove the "user" object, so `{{ user.verificationToken }}` becomes `{{ verificationToken }}` and so on. * A new `AuthenticationMethod` entity has been added, with a one-to-many relation to the existing User entities. Several properties that were formerly part of the User entity have now moved to the `AuthenticationMethod` entity. Upgrading with therefore require a careful database migration to ensure that no data is lost. On release, a migration script will be provided for this. * Some ON DELETE behaviour was incorrectly defined in the database schema, and has how been fixed. This will require a non-destructive migration. * The `AttemptedLoginEvent.identifier` property is now optional, since it will only be sent when using the "native" authentication strategy. Code that listens for this event should now check that the `identifier` property is defined before attempting to use it. * The `RequestContext.session` object is no longer a `Session` entity. Instead it is a new type, `SerializedSession` which contains a subset of data pertaining to the current session. For example, if you have custom code which references `ctx.session.activeOrder` you will now get an error, since `activeOrder` does not exist on `SerializedSession`. Instead you would use `SerializedSession.activeOrderId` and then lookup the order in a separate query. The reason for this change is to enable efficient session caching. * The Administrator entity has a new `deletedAt` field, which will require a non-destructive database migration. * The way custom Order states are defined has changed. The `VendureConfig.orderOptions.process` property now accepts an **array** of objects implementing the `CustomerOrderProcess` interface. This interface is more-or-less the same as the old `OrderProcessOptions` object, but the use of an array now allows better composition, and since `CustomerOrderProcess` inherits from `InjectableStrategy`, this means providers can now be injected and used in the custom order process logic. ## <small>0.13.1 (2020-06-30)</small> #### Features * **admin-ui** Display billing address in Order detail view ([c8992a5](https://github.com/vendure-ecommerce/vendure/commit/c8992a5)), closes [#372](https://github.com/vendure-ecommerce/vendure/issues/372) * **core** Add setOrderBillingAddress mutation to Shop API ([83347b2](https://github.com/vendure-ecommerce/vendure/commit/83347b2)), closes [#372](https://github.com/vendure-ecommerce/vendure/issues/372) * **core** Allow phoneNumber in registerCustomerAccount mutation ([2c710b9](https://github.com/vendure-ecommerce/vendure/commit/2c710b9)), closes [#389](https://github.com/vendure-ecommerce/vendure/issues/389) #### Fixes * **admin-ui** Add custom field controls to ProductOption dialog ([4678360](https://github.com/vendure-ecommerce/vendure/commit/4678360)), closes [#382](https://github.com/vendure-ecommerce/vendure/issues/382) * **admin-ui** Correctly render channels in Role detail view ([cfb3c03](https://github.com/vendure-ecommerce/vendure/commit/cfb3c03)) * **admin-ui** Only check jobs if Admin has ReadSettings permission ([daca6b6](https://github.com/vendure-ecommerce/vendure/commit/daca6b6)), closes [#383](https://github.com/vendure-ecommerce/vendure/issues/383) * **core** Correctly resolve activeCustomer order lines ([56449b8](https://github.com/vendure-ecommerce/vendure/commit/56449b8)), closes [#374](https://github.com/vendure-ecommerce/vendure/issues/374) [#375](https://github.com/vendure-ecommerce/vendure/issues/375) * **core** Implement field resolvers for Facet & FacetValue ([7a4d046](https://github.com/vendure-ecommerce/vendure/commit/7a4d046)) ## 0.13.0 (2020-06-12) #### Fixes * **admin-ui-plugin** Correct handling of missing config file ([41f9085](https://github.com/vendure-ecommerce/vendure/commit/41f9085)) * **admin-ui** Fix duplicated "Adding Items" filter option in Order list ([2da3c16](https://github.com/vendure-ecommerce/vendure/commit/2da3c16)) * **admin-ui** Fix facet detail form losing input data ([2430f30](https://github.com/vendure-ecommerce/vendure/commit/2430f30)), closes [#353](https://github.com/vendure-ecommerce/vendure/issues/353) * **core** Attach Order to PaymentStateTransitionEvent on create ([1c57462](https://github.com/vendure-ecommerce/vendure/commit/1c57462)), closes [#371](https://github.com/vendure-ecommerce/vendure/issues/371) * **core** Correctly serialize job queue data payloads ([1a9ac07](https://github.com/vendure-ecommerce/vendure/commit/1a9ac07)) * **core** Fix collection.parent resolver in Postgres ([f3feb7c](https://github.com/vendure-ecommerce/vendure/commit/f3feb7c)), closes [#361](https://github.com/vendure-ecommerce/vendure/issues/361) * **core** Fix cookie auth for custom controller routes ([e36b9db](https://github.com/vendure-ecommerce/vendure/commit/e36b9db)), closes [#362](https://github.com/vendure-ecommerce/vendure/issues/362) * **core** Fix error when applying multiple promotions ([c807d32](https://github.com/vendure-ecommerce/vendure/commit/c807d32)) * **core** Fix findByIdsInChannel to take ids into account (#365) ([dd4bbc9](https://github.com/vendure-ecommerce/vendure/commit/dd4bbc9)), closes [#365](https://github.com/vendure-ecommerce/vendure/issues/365) * **core** Fix removal of order item promotions ([f385d69](https://github.com/vendure-ecommerce/vendure/commit/f385d69)) * **core** Fix typo in "transitions" config option name ([41b07eb](https://github.com/vendure-ecommerce/vendure/commit/41b07eb)) * **email-plugin** Do not HTML-escape "from" address ([699c796](https://github.com/vendure-ecommerce/vendure/commit/699c796)), closes [#363](https://github.com/vendure-ecommerce/vendure/issues/363) * **email-plugin** Fix dev mailbox when trailing slash omitted ([5372561](https://github.com/vendure-ecommerce/vendure/commit/5372561)), closes [#355](https://github.com/vendure-ecommerce/vendure/issues/355) #### Features * **admin-ui-plugin** Enable traditional & simplified Chinese trans ([43ef874](https://github.com/vendure-ecommerce/vendure/commit/43ef874)) * **admin-ui** Add 'groups' field to Customer type in Admin API ([9635677](https://github.com/vendure-ecommerce/vendure/commit/9635677)), closes [#330](https://github.com/vendure-ecommerce/vendure/issues/330) * **admin-ui** Add Collection slug to detail form ([700f4d6](https://github.com/vendure-ecommerce/vendure/commit/700f4d6)), closes [#335](https://github.com/vendure-ecommerce/vendure/issues/335) * **admin-ui** Add phoneNumber to customer detail form ([768c838](https://github.com/vendure-ecommerce/vendure/commit/768c838)), closes [#359](https://github.com/vendure-ecommerce/vendure/issues/359) * **admin-ui** Add Traditional Chinese for i18n-Message ([7160048](https://github.com/vendure-ecommerce/vendure/commit/7160048)) * **admin-ui** Allow groups admin from CustomerDetailComponent ([8dca9a3](https://github.com/vendure-ecommerce/vendure/commit/8dca9a3)), closes [#330](https://github.com/vendure-ecommerce/vendure/issues/330) * **admin-ui** Create CustomerGroup UI components & routes ([90b38a5](https://github.com/vendure-ecommerce/vendure/commit/90b38a5)), closes [#330](https://github.com/vendure-ecommerce/vendure/issues/330) * **admin-ui** Display customer history in detail view ([8eea7d6](https://github.com/vendure-ecommerce/vendure/commit/8eea7d6)), closes [#343](https://github.com/vendure-ecommerce/vendure/issues/343) * **admin-ui** Enable deletion of Customers from customer list ([d1b0b9e](https://github.com/vendure-ecommerce/vendure/commit/d1b0b9e)), closes [#360](https://github.com/vendure-ecommerce/vendure/issues/360) * **admin-ui** Implement UI for updating, deleting notes ([ef5eddf](https://github.com/vendure-ecommerce/vendure/commit/ef5eddf)), closes [#310](https://github.com/vendure-ecommerce/vendure/issues/310) * **core** Add "slug" field to Collection entity ([5b4d3db](https://github.com/vendure-ecommerce/vendure/commit/5b4d3db)), closes [#335](https://github.com/vendure-ecommerce/vendure/issues/335) * **core** Add "slug" field to CollectionBreadcrumb type ([97ffb1d](https://github.com/vendure-ecommerce/vendure/commit/97ffb1d)) * **core** Create customer history entries for groups ([4620730](https://github.com/vendure-ecommerce/vendure/commit/4620730)), closes [#343](https://github.com/vendure-ecommerce/vendure/issues/343) * **core** Enable Collection query by slug ([d5586bc](https://github.com/vendure-ecommerce/vendure/commit/d5586bc)), closes [#335](https://github.com/vendure-ecommerce/vendure/issues/335) * **core** Enable users to specify superadmin credentials ([0f0a1ad](https://github.com/vendure-ecommerce/vendure/commit/0f0a1ad)), closes [#279](https://github.com/vendure-ecommerce/vendure/issues/279) * **core** Implement Customer history tracking ([ccedf7c](https://github.com/vendure-ecommerce/vendure/commit/ccedf7c)), closes [#343](https://github.com/vendure-ecommerce/vendure/issues/343) * **core** Implement CustomerGroup queries & mutations ([13342c0](https://github.com/vendure-ecommerce/vendure/commit/13342c0)), closes [#330](https://github.com/vendure-ecommerce/vendure/issues/330) * **core** Implement editing & deletion of Order/Customer notes ([90bacf5](https://github.com/vendure-ecommerce/vendure/commit/90bacf5)), closes [#310](https://github.com/vendure-ecommerce/vendure/issues/310) * **core** Improved control over TypeORM query logging ([3168e54](https://github.com/vendure-ecommerce/vendure/commit/3168e54)), closes [#368](https://github.com/vendure-ecommerce/vendure/issues/368) * **core** Search by facetValueId allows operator argument ([2eca24e](https://github.com/vendure-ecommerce/vendure/commit/2eca24e)), closes [#357](https://github.com/vendure-ecommerce/vendure/issues/357) * **core** Update LanguageCode enum to support common regional variants ([8daee55](https://github.com/vendure-ecommerce/vendure/commit/8daee55)), closes [#356](https://github.com/vendure-ecommerce/vendure/issues/356) * **elasticsearch-plugin** Added mapQuery option ([a6de120](https://github.com/vendure-ecommerce/vendure/commit/a6de120)), closes [#364](https://github.com/vendure-ecommerce/vendure/issues/364) * **elasticsearch-plugin** Search by facetValueId allows operator arg ([f7f7e5c](https://github.com/vendure-ecommerce/vendure/commit/f7f7e5c)), closes [#357](https://github.com/vendure-ecommerce/vendure/issues/357) * **email-plugin** Enable logging for SMTP transport ([5ed6c24](https://github.com/vendure-ecommerce/vendure/commit/5ed6c24)), closes [#369](https://github.com/vendure-ecommerce/vendure/issues/369) ### BREAKING CHANGE * A DB migration will be required due to some additions to the schema related to Customer history entries. * A new "slug" field has been added to the CollectionTranslation entity, requiring a DB migration. Also, when creating a new Collection via the `createCollection` mutation, each translation must include a slug. ## <small>0.12.5 (2020-05-28)</small> #### Features * **admin-ui** Add German translations ([00bf630](https://github.com/vendure-ecommerce/vendure/commit/00bf630)) * **admin-ui** Focus facet selector when opening "add facets" dialog ([42c1a48](https://github.com/vendure-ecommerce/vendure/commit/42c1a48)) #### Fixes * **admin-ui** Fix error updating PaymentMethod config parameters ([b4061a5](https://github.com/vendure-ecommerce/vendure/commit/b4061a5)), closes [#345](https://github.com/vendure-ecommerce/vendure/issues/345) * **admin-ui** Update available facets when creating new values ([05864c6](https://github.com/vendure-ecommerce/vendure/commit/05864c6)), closes [#347](https://github.com/vendure-ecommerce/vendure/issues/347) * **asset-server-plugin** Fix mime type detection ([7613f74](https://github.com/vendure-ecommerce/vendure/commit/7613f74)), closes [#341](https://github.com/vendure-ecommerce/vendure/issues/341) ## <small>0.12.4 (2020-05-20)</small> Fixes broken publish of admin-ui-plugin ## <small>0.12.3 (2020-05-20)</small> #### Fixes * **core** Fix MySQL error in DefaultSearchPlugin ([9eb39a2](https://github.com/vendure-ecommerce/vendure/commit/9eb39a2)), closes [#331](https://github.com/vendure-ecommerce/vendure/issues/331) [#342](https://github.com/vendure-ecommerce/vendure/issues/342) * **core** Increase resilience of app close when worker in main thread ([3ce74ff](https://github.com/vendure-ecommerce/vendure/commit/3ce74ff)) #### Features * **admin-ui** Display visual feedback when uploading Assets ([ca6c30f](https://github.com/vendure-ecommerce/vendure/commit/ca6c30f)) * **core** Add static lifecycle hooks to run before bootstrap ([c92c21b](https://github.com/vendure-ecommerce/vendure/commit/c92c21b)) * **core** Implement configurable PriceCalculationStrategy ([3e2cc2b](https://github.com/vendure-ecommerce/vendure/commit/3e2cc2b)), closes [#237](https://github.com/vendure-ecommerce/vendure/issues/237) * **testing** Expose underlying NestApplication & NestMicroservice ([ebf78a2](https://github.com/vendure-ecommerce/vendure/commit/ebf78a2)) ## <small>0.12.2 (2020-05-13)</small> #### Fixes * **create** Add work-around for upstream tslib issue ([2f39379](https://github.com/vendure-ecommerce/vendure/commit/2f39379)) ## <small>0.12.1 (2020-05-12)</small> #### Fixes * **admin-ui-plugin** Fix default value for apiPort ([efde4d7](https://github.com/vendure-ecommerce/vendure/commit/efde4d7)) * **create** Fix use of deprecated port option ([96765b4](https://github.com/vendure-ecommerce/vendure/commit/96765b4)) ## 0.12.0 (2020-05-12) #### Perf * **core** Improved performance of validateVariantOptionIds (#337) ([7d19b9c](https://github.com/vendure-ecommerce/vendure/commit/7d19b9c)), closes [#337](https://github.com/vendure-ecommerce/vendure/issues/337) [#328](https://github.com/vendure-ecommerce/vendure/issues/328) #### Features * **admin-ui** Add Polish translations (#317) ([65a113b](https://github.com/vendure-ecommerce/vendure/commit/65a113b)), closes [#317](https://github.com/vendure-ecommerce/vendure/issues/317) * **admin-ui** Add system health status page ([b3411f2](https://github.com/vendure-ecommerce/vendure/commit/b3411f2)), closes [#289](https://github.com/vendure-ecommerce/vendure/issues/289) * **admin-ui** Allow status badges to be defined for NavMenuItems ([97e209c](https://github.com/vendure-ecommerce/vendure/commit/97e209c)) * **asset-server-plugin** Add health check ([05820f4](https://github.com/vendure-ecommerce/vendure/commit/05820f4)), closes [#289](https://github.com/vendure-ecommerce/vendure/issues/289) * **asset-server-plugin** Create S3AssetStorageStrategy ([3f89022](https://github.com/vendure-ecommerce/vendure/commit/3f89022)), closes [#191](https://github.com/vendure-ecommerce/vendure/issues/191) * **core** Add health check for DB & worker ([1b84ea7](https://github.com/vendure-ecommerce/vendure/commit/1b84ea7)), closes [#289](https://github.com/vendure-ecommerce/vendure/issues/289) * **core** Added playground and debug config for graphql apis ([1fb5fb4](https://github.com/vendure-ecommerce/vendure/commit/1fb5fb4)) * **core** Allow custom CollectionFilters in config ([87edc9b](https://github.com/vendure-ecommerce/vendure/commit/87edc9b)), closes [#325](https://github.com/vendure-ecommerce/vendure/issues/325) * **core** Group api options in VendureConfig ([6904743](https://github.com/vendure-ecommerce/vendure/commit/6904743)), closes [#327](https://github.com/vendure-ecommerce/vendure/issues/327) * **core** Implement injectable lifecycle hooks for configurable ops ([16db620](https://github.com/vendure-ecommerce/vendure/commit/16db620)), closes [#303](https://github.com/vendure-ecommerce/vendure/issues/303) * **core** Implement injectable lifecycle hooks for strategies ([451caf1](https://github.com/vendure-ecommerce/vendure/commit/451caf1)), closes [#303](https://github.com/vendure-ecommerce/vendure/issues/303) * **core** Prettier console greeting on server start ([fc30dfd](https://github.com/vendure-ecommerce/vendure/commit/fc30dfd)) * **elasticsearch-plugin** Add health check ([47a8cb9](https://github.com/vendure-ecommerce/vendure/commit/47a8cb9)), closes [#289](https://github.com/vendure-ecommerce/vendure/issues/289) #### Fixes * **admin-ui-plugin** Correctly fall back to 'auto' apiHost option ([b02d58a](https://github.com/vendure-ecommerce/vendure/commit/b02d58a)) * **core** Fix emailAddress conflict when creating Customers ([0d4e31a](https://github.com/vendure-ecommerce/vendure/commit/0d4e31a)), closes [#300](https://github.com/vendure-ecommerce/vendure/issues/300) ### BREAKING CHANGE * Options in the VendureConfig related to the API have been moved into a new location: `VendureConfig.apiOptions`. The affected options are `hostname`, `port`, `adminApiPath`, `shopApiPath`, `channelTokenKey`, `cors`, `middleware` and `apolloServerPlugins`. ```TypeScript // before const config: VendureConfig = { port: 3000, middleware: [/*...*/], // ... } // after const config: VendureConfig = { apiOptions: { port: 3000, middleware: [/*...*/], }, // ... } ``` This also applies to the `ConfigService`, in case you are using it in a custom plugin. * The `customer` and `user` tables have received some non-destructive modifications, requiring a DB migration. * The graphql-playground for the Shop and Admin APIs are now turned off by default, and the Apollo server debug option is also set to false by default (it was formerly true). You can manually configure these values using the VendureConfig.apiOptions object. ## <small>0.11.1 (2020-04-23)</small> #### Fixes * **admin-ui** Correctly display overlays inside modals ([ee9c8ca](https://github.com/vendure-ecommerce/vendure/commit/ee9c8ca)) * **admin-ui** Restore missing translation for "public" ([2f06d30](https://github.com/vendure-ecommerce/vendure/commit/2f06d30)) * **core** Correctly invalidate Zone cache on Country changes ([f4101b7](https://github.com/vendure-ecommerce/vendure/commit/f4101b7)) * **core** Fix swiss and congolese currency codes (#302) ([2fbf37a](https://github.com/vendure-ecommerce/vendure/commit/2fbf37a)), closes [#302](https://github.com/vendure-ecommerce/vendure/issues/302) * **core** Throw on no active taxZone when applying taxes to price ([451ae50](https://github.com/vendure-ecommerce/vendure/commit/451ae50)), closes [#321](https://github.com/vendure-ecommerce/vendure/issues/321) * **core** Use correct error type for email address conflict ([0ba66cb](https://github.com/vendure-ecommerce/vendure/commit/0ba66cb)), closes [#299](https://github.com/vendure-ecommerce/vendure/issues/299) * **ui-devkit** Correctly handle static asset file paths ([27b0adb](https://github.com/vendure-ecommerce/vendure/commit/27b0adb)), closes [#309](https://github.com/vendure-ecommerce/vendure/issues/309) * **ui-devkit** Fix generation of shared module file (#318) ([fd73472](https://github.com/vendure-ecommerce/vendure/commit/fd73472)), closes [#318](https://github.com/vendure-ecommerce/vendure/issues/318) #### Features * **admin-ui** Display warnings if Channel lacks default zones ([e80fcf8](https://github.com/vendure-ecommerce/vendure/commit/e80fcf8)), closes [#323](https://github.com/vendure-ecommerce/vendure/issues/323) * **admin-ui** Implement Zone list view, improved Zone/Country admin ([821f258](https://github.com/vendure-ecommerce/vendure/commit/821f258)), closes [#323](https://github.com/vendure-ecommerce/vendure/issues/323) * **asset-server-plugin** Implement asset binary deletion ([571ee55](https://github.com/vendure-ecommerce/vendure/commit/571ee55)), closes [#306](https://github.com/vendure-ecommerce/vendure/issues/306) * **core** Implement asset binary deletion ([b8fc937](https://github.com/vendure-ecommerce/vendure/commit/b8fc937)), closes [#306](https://github.com/vendure-ecommerce/vendure/issues/306) * **core** Warn when deleting a Zone used as a Channel default ([945c36d](https://github.com/vendure-ecommerce/vendure/commit/945c36d)) ## 0.11.0 (2020-04-13) #### Fixes * **admin-ui** Fix display of in-progress jobs ([5bed0e6](https://github.com/vendure-ecommerce/vendure/commit/5bed0e6)) * **admin-ui** Get entity default language from active Channel ([effe2c6](https://github.com/vendure-ecommerce/vendure/commit/effe2c6)), closes [#296](https://github.com/vendure-ecommerce/vendure/issues/296) * **admin-ui** Refresh Collection List on deletion ([4202398](https://github.com/vendure-ecommerce/vendure/commit/4202398)), closes [#295](https://github.com/vendure-ecommerce/vendure/issues/295) * **core** add missing translations for default channel not found (#301) ([07e1958](https://github.com/vendure-ecommerce/vendure/commit/07e1958)), closes [#301](https://github.com/vendure-ecommerce/vendure/issues/301) * **core** Correctly derive request language from active Channel ([aae4aa9](https://github.com/vendure-ecommerce/vendure/commit/aae4aa9)) * **core** Correctly reindex enabled state ([2231505](https://github.com/vendure-ecommerce/vendure/commit/2231505)), closes [#295](https://github.com/vendure-ecommerce/vendure/issues/295) * **core** Fix deletion of Collections ([44916b7](https://github.com/vendure-ecommerce/vendure/commit/44916b7)), closes [#297](https://github.com/vendure-ecommerce/vendure/issues/297) * **core** Fix generated import in CLI populate types ([4ea139f](https://github.com/vendure-ecommerce/vendure/commit/4ea139f)) * **core** Fix race condition when moving Collections ([987b611](https://github.com/vendure-ecommerce/vendure/commit/987b611)) * **core** Limit Channel defaultLanguage to one of availableLanguages ([b9f4dc0](https://github.com/vendure-ecommerce/vendure/commit/b9f4dc0)) * **core** Use configured defaultLanguageCode rather than hard-coded val ([d2942e6](https://github.com/vendure-ecommerce/vendure/commit/d2942e6)), closes [#296](https://github.com/vendure-ecommerce/vendure/issues/296) * **core** Validate availableLanguages when update GlobalSettings ([e304ae2](https://github.com/vendure-ecommerce/vendure/commit/e304ae2)) * **elasticsearch-plugin** Fix bad import paths ([99733fa](https://github.com/vendure-ecommerce/vendure/commit/99733fa)) * **email-plugin** Pass all email options when creating transport ([1c6b39f](https://github.com/vendure-ecommerce/vendure/commit/1c6b39f)) #### Features * **admin-ui** Display live list of queued jobs ([bbe5855](https://github.com/vendure-ecommerce/vendure/commit/bbe5855)) * **admin-ui** Enable setting default language for Channels ([0120202](https://github.com/vendure-ecommerce/vendure/commit/0120202)), closes [#296](https://github.com/vendure-ecommerce/vendure/issues/296) * **admin-ui** Implement Asset deletion UI ([4912a29](https://github.com/vendure-ecommerce/vendure/commit/4912a29)), closes [#285](https://github.com/vendure-ecommerce/vendure/issues/285) * **admin-ui** Update to Angular 9.1.0 ([084edd9](https://github.com/vendure-ecommerce/vendure/commit/084edd9)) * **asset-server-plugin** Update Sharp version to 0.25.2 ([13edc9c](https://github.com/vendure-ecommerce/vendure/commit/13edc9c)) * **core** Add DB-based persistence for JobQueue ([a61df93](https://github.com/vendure-ecommerce/vendure/commit/a61df93)), closes [#282](https://github.com/vendure-ecommerce/vendure/issues/282) * **core** Add jobQueues query ([46068b3](https://github.com/vendure-ecommerce/vendure/commit/46068b3)) * **core** Export ProcessContext service ([3177ac0](https://github.com/vendure-ecommerce/vendure/commit/3177ac0)) * **core** Extract SQL-based JobQueueStrategy in a bundled plugin ([a2069f6](https://github.com/vendure-ecommerce/vendure/commit/a2069f6)) * **core** Implement deleteAsset mutation ([efa12ba](https://github.com/vendure-ecommerce/vendure/commit/efa12ba)), closes [#285](https://github.com/vendure-ecommerce/vendure/issues/285) * **core** Implement removeSettledJobs mutation ([82af7f6](https://github.com/vendure-ecommerce/vendure/commit/82af7f6)) * **core** Log any errors when creating Asset preview images ([e1b8cb8](https://github.com/vendure-ecommerce/vendure/commit/e1b8cb8)) * **core** Redesign JobQueue to allow persistence, concurrency etc ([7acf532](https://github.com/vendure-ecommerce/vendure/commit/7acf532)), closes [#282](https://github.com/vendure-ecommerce/vendure/issues/282) * **core** Resume interrupted jobs in queue on restart ([9b66d33](https://github.com/vendure-ecommerce/vendure/commit/9b66d33)) * **core** Update to Nestjs v7 ([3d6657a](https://github.com/vendure-ecommerce/vendure/commit/3d6657a)) * **core** Update to TypeScript 3.8 ([e255674](https://github.com/vendure-ecommerce/vendure/commit/e255674)), closes [#286](https://github.com/vendure-ecommerce/vendure/issues/286) * **create** Add DefaultJobQueuePlugin to default config template ([38b375f](https://github.com/vendure-ecommerce/vendure/commit/38b375f)) * **elasticsearch-plugin** Update index on asset deletion ([c80662a](https://github.com/vendure-ecommerce/vendure/commit/c80662a)) * **elasticsearch-plugin** Update to use new job queue ([42b1d28](https://github.com/vendure-ecommerce/vendure/commit/42b1d28)) * **email-plugin** Generate and send emails on the worker ([0cc5f87](https://github.com/vendure-ecommerce/vendure/commit/0cc5f87)) * **testing** Add `bootstrap` method to TestServer ([dab9e21](https://github.com/vendure-ecommerce/vendure/commit/dab9e21)) #### Perf * **admin-ui-plugin** Use trackBy function to improve perf of datatable ([09ab4d7](https://github.com/vendure-ecommerce/vendure/commit/09ab4d7)) ### BREAKING CHANGE * (If using the DefaultJobQueuePlugin) A new JobRecord entity has been added, so a DB migration will be needed. * In order to accommodate Asset deletion, some non-destructive DB modifications have been made which will require a migration. * Nestjs has been updated to v7. If you make use of any of the Nest internals in your plugins, this may cause some breaking changes. Please see the [Nest migration guide](https://docs.nestjs.com/migration-guide) for details. This release also includes updates to many dependencies which in turn have dropped support for Node.js v8. Therefore **Vendure now supports Node.js v10** or higher. * The CollectionAsset entity had a cascade delete defined, which will require a DB migration. * The JobQueueService has been completely re-designed. In the event that you are using this service in your Plugins, please see the [API documentation](https://www.vendure.io/docs/developer-guide/job-queue) on how to use it now. ## <small>0.10.2 (2020-04-02)</small> #### Fixes * **admin-ui-plugin** Add Chinese to the default available languages ([46ff932](https://github.com/vendure-ecommerce/vendure/commit/46ff932)) * **admin-ui** Fix prosemirror error when changing product detail tabs ([8a7cf9a](https://github.com/vendure-ecommerce/vendure/commit/8a7cf9a)) * **admin-ui** Make rich text editor editable when creating products etc ([d268276](https://github.com/vendure-ecommerce/vendure/commit/d268276)) * **asset-server-plugin** Fix build to export non-image file icon ([63166a2](https://github.com/vendure-ecommerce/vendure/commit/63166a2)) #### Features * **admin-ui** Better error reporting for invalid translation files ([a64f7ac](https://github.com/vendure-ecommerce/vendure/commit/a64f7ac)), closes [#292](https://github.com/vendure-ecommerce/vendure/issues/292) * **create** Check server port is free before install ([202f68d](https://github.com/vendure-ecommerce/vendure/commit/202f68d)) * **create** Pin TypeScript version ([a2fba13](https://github.com/vendure-ecommerce/vendure/commit/a2fba13)), closes [#268](https://github.com/vendure-ecommerce/vendure/issues/268) ## <small>0.10.1 (2020-03-24)</small> #### Features * **admin-ui-plugin** Allow ui languages to be set in the AdminUiPlugin ([db3bce3](https://github.com/vendure-ecommerce/vendure/commit/db3bce3)), closes [#264](https://github.com/vendure-ecommerce/vendure/issues/264) * **admin-ui** Added Chinese i18n messages (#280) ([749ee3d](https://github.com/vendure-ecommerce/vendure/commit/749ee3d)), closes [#280](https://github.com/vendure-ecommerce/vendure/issues/280) * **admin-ui** Enable ui language config & selection ([aa4452e](https://github.com/vendure-ecommerce/vendure/commit/aa4452e)), closes [#264](https://github.com/vendure-ecommerce/vendure/issues/264) * **core** Export some missing symbols from Core ([f16bd7b](https://github.com/vendure-ecommerce/vendure/commit/f16bd7b)) * **testing** Expose raw http fetch method in SimpleGraphQLClient ([d715d30](https://github.com/vendure-ecommerce/vendure/commit/d715d30)) * **ui-devkit** Allow custom i18n files to compiled into the Admin UI ([df88d58](https://github.com/vendure-ecommerce/vendure/commit/df88d58)), closes [#264](https://github.com/vendure-ecommerce/vendure/issues/264) * **ui-devkit** Allow stand-alone translation extensions ([7a70642](https://github.com/vendure-ecommerce/vendure/commit/7a70642)), closes [#264](https://github.com/vendure-ecommerce/vendure/issues/264) #### Fixes * **core** Correctly handle error responses for REST controllers ([72be58d](https://github.com/vendure-ecommerce/vendure/commit/72be58d)), closes [#187](https://github.com/vendure-ecommerce/vendure/issues/187) * **core** Fix DefaultAssetNamingStrategy with files without extensions ([dee3258](https://github.com/vendure-ecommerce/vendure/commit/dee3258)), closes [#271](https://github.com/vendure-ecommerce/vendure/issues/271) [#272](https://github.com/vendure-ecommerce/vendure/issues/272) * **core** Fix error when using non-TCP transport in workerOptions ([b37ea05](https://github.com/vendure-ecommerce/vendure/commit/b37ea05)), closes [#270](https://github.com/vendure-ecommerce/vendure/issues/270) * **core** Prevent data leakage of guest Customer data ([ea51000](https://github.com/vendure-ecommerce/vendure/commit/ea51000)), closes [#98](https://github.com/vendure-ecommerce/vendure/issues/98) * **elasticsearch-plugin** Do not expose private facets in search result ([60bb5b9](https://github.com/vendure-ecommerce/vendure/commit/60bb5b9)) ## 0.10.0 (2020-03-17) #### Features * **admin-ui** Export helper for hosting external ui extensions ([3d08460](https://github.com/vendure-ecommerce/vendure/commit/3d08460)) * **admin-ui** Export minified theme css for ui extensions dev ([99073c9](https://github.com/vendure-ecommerce/vendure/commit/99073c9)) * **admin-ui** Improved ui extension development API & architecture ([fe72c41](https://github.com/vendure-ecommerce/vendure/commit/fe72c41)) * **admin-ui** Simplify API for adding menu items, custom controls ([2b9e4c4](https://github.com/vendure-ecommerce/vendure/commit/2b9e4c4)) * **admin-ui** Update Angular to v9 ([bc35c25](https://github.com/vendure-ecommerce/vendure/commit/bc35c25)) * **admin-ui** Update Clarity to v3.rc ([f8b94b2](https://github.com/vendure-ecommerce/vendure/commit/f8b94b2)) * **admin-ui** Use ProseMirror as rich text editor ([e309111](https://github.com/vendure-ecommerce/vendure/commit/e309111)) * **ui-devkit** Allow static assets to be renamed ([08e23d0](https://github.com/vendure-ecommerce/vendure/commit/08e23d0)) * **ui-devkit** Run detect and run ngcc on first compilation ([b5a57a8](https://github.com/vendure-ecommerce/vendure/commit/b5a57a8)) #### Fixes * **admin-ui** Enable full template type checks and fix issues ([db36111](https://github.com/vendure-ecommerce/vendure/commit/db36111)) * **admin-ui** Prevent removal of FacetValue on ProductDetail form enter ([1db6c3d](https://github.com/vendure-ecommerce/vendure/commit/1db6c3d)), closes [#267](https://github.com/vendure-ecommerce/vendure/issues/267) * **core** Correctly resolve deprecated asset fields in search query ([e9a517b](https://github.com/vendure-ecommerce/vendure/commit/e9a517b)) * **core** Correctly update search index on ProductVariant deletion ([401c236](https://github.com/vendure-ecommerce/vendure/commit/401c236)), closes [#266](https://github.com/vendure-ecommerce/vendure/issues/266) * **elasticsearch-plugin** Correctly update index on variant deletion ([8b91a59](https://github.com/vendure-ecommerce/vendure/commit/8b91a59)), closes [#266](https://github.com/vendure-ecommerce/vendure/issues/266) ### BREAKING CHANGE * This release introduces a re-architected solution for handling extensions to the Admin UI. *If you do not use the ui extensions feature, you will not need to change anything*. For those already using ui extensions, these are the changes: * The `@vendure/admin-ui-plugin` now contains only the default admin ui app. * To create extensions, you will need to install `@vendure/ui-devkit`, which exposes a `compileUiExtensions()` function. * Here is an example of how the config differs: ```ts // before AdminUiPlugin.init({ port: 3002, extensions: [ ReviewsPlugin.uiExtensions, RewardsPlugin.uiExtensions, ], watch: true, }), ``` ```ts // after import { compileUiExtensions } from '@vendure/ui-devkit/compiler'; // ... AdminUiPlugin.init({ port: 3002, app: compileUiExtensions({ // The source files of the admin ui, extended with your extensions, // will be output and compiled from this location outputPath: path.join(__dirname, '../admin-ui'), extensions: [ ReviewsPlugin.uiExtensions, RewardsPlugin.uiExtensions, ], watch: true, }), }), ``` * For lazy-loaded extension modules, you must now specify a `route` property. This allows us to lazy-load each extension individually, whereas previously _all_ extensions were bundled into a single lazy-loaded chunk. ```diff export class ReviewsPlugin { static uiExtensions: AdminUiExtension = { extensionPath: path.join(__dirname, 'ui'), id: 'reviews-plugin', ngModules: [{ type: 'lazy', + route: 'product-reviews', ngModuleFileName: 'reviews-ui-lazy.module.ts', ngModuleName: 'ReviewsUiLazyModule', }], }; } // in the route config of the lazy-loaded module { - path: 'product-reviews', + path: '', + pathMatch: 'full', component: AllProductReviewsListComponent, }, ``` * The `CustomFieldControl` interface changed slightly: ```diff import { - CustomFieldConfig, + CustomFieldConfigType, CustomFieldControl, } from '@vendure/admin-ui/core'; @Component({ // ... }) export class ReviewCountComponent implements CustomFieldControl { - customFieldConfig: CustomFieldConfig; + customFieldConfig: CustomFieldConfigType; formControl: FormControl; // ... } ``` * **NOTE:** if you run into errors with Angular dependencies in the wrong place (e.g. nested inside the `node_modules` of another dependency), try running `yarn upgrade --check-files`, or failing that, remove the node_modules directory, delete the lockfile, and re-install. ## 0.9.0 (2020-02-19) #### Fixes * **asset-server-plugin** Correctly handle non-integer image dimensions ([e28c2b3](https://github.com/vendure-ecommerce/vendure/commit/e28c2b3)) * **core** Do not merge orders from another Customer ([de3715f](https://github.com/vendure-ecommerce/vendure/commit/de3715f)), closes [#263](https://github.com/vendure-ecommerce/vendure/issues/263) * **testing** Correctly log from the main process ([bdd419f](https://github.com/vendure-ecommerce/vendure/commit/bdd419f)) #### Features * **admin-ui** Asset names can be updated ([fcb4f3d](https://github.com/vendure-ecommerce/vendure/commit/fcb4f3d)) * **admin-ui** Export BaseEntityResolver ([db68d86](https://github.com/vendure-ecommerce/vendure/commit/db68d86)) * **admin-ui** Implement editing of Asset focal point ([11b6b33](https://github.com/vendure-ecommerce/vendure/commit/11b6b33)), closes [#93](https://github.com/vendure-ecommerce/vendure/issues/93) * **admin-ui** Thumbnails make use of focal point data ([667b885](https://github.com/vendure-ecommerce/vendure/commit/667b885)), closes [#93](https://github.com/vendure-ecommerce/vendure/issues/93) * **asset-server-plugin** Add ability to disable caching per-request ([22cc878](https://github.com/vendure-ecommerce/vendure/commit/22cc878)) * **asset-server-plugin** Implement focal point-aware cropping ([5fef77d](https://github.com/vendure-ecommerce/vendure/commit/5fef77d)), closes [#93](https://github.com/vendure-ecommerce/vendure/issues/93) * **asset-server-plugin** Make AssetNamingStrategy configurable ([09dc445](https://github.com/vendure-ecommerce/vendure/commit/09dc445)), closes [#258](https://github.com/vendure-ecommerce/vendure/issues/258) * **asset-server-plugin** Make the AssetStorageStrategy configurable ([a13a504](https://github.com/vendure-ecommerce/vendure/commit/a13a504)), closes [#258](https://github.com/vendure-ecommerce/vendure/issues/258) * **core** Add `focalPoint` field to Asset entity ([1666e22](https://github.com/vendure-ecommerce/vendure/commit/1666e22)), closes [#93](https://github.com/vendure-ecommerce/vendure/issues/93) * **core** Add asset focal point data to SearchResult type ([f717fb3](https://github.com/vendure-ecommerce/vendure/commit/f717fb3)), closes [#93](https://github.com/vendure-ecommerce/vendure/issues/93) * **core** Publish AssetEvent when Asset created/modified ([3a352c5](https://github.com/vendure-ecommerce/vendure/commit/3a352c5)) * **elasticsearch-plugin** Store asset focal point data ([9027beb](https://github.com/vendure-ecommerce/vendure/commit/9027beb)), closes [#93](https://github.com/vendure-ecommerce/vendure/issues/93) #### Perf * **asset-server-plugin** Implement hashed directory naming for assets ([30c27c5](https://github.com/vendure-ecommerce/vendure/commit/30c27c5)), closes [#258](https://github.com/vendure-ecommerce/vendure/issues/258) * **testing** Disable synchronization for sqljs e2e tests ([4ad7752](https://github.com/vendure-ecommerce/vendure/commit/4ad7752)) ### BREAKING CHANGE * A new field, `focalPoint` has been added to the `Asset` entity which will require a database migration to add. * The `LocalAssetStorageStrategy` class has been removed from `@vendure/core` and now lives in the `@vendure/asset-server-plugin` package. * The `search` query's `SearchResult` type has had two properties deprecated: `productPreview` and `productVariantPreview`. They are replaced by `productAsset.preview` and `productVariantAsset.preview respectively`. The deprecated properties still work but will be removed from a future release. * The AssetServerPlugin has a new default naming strategy - instead of dumping all assets & previews into a single directory, it will now split sources & previews into subdirectories and in each of them will use hashed directories to ensure that the total number of files in a single directory does not grow too large (as this can have a negative performance impact). If you wish to keep the current behavior, then you must manually set the `namingStrategy: new DefaultAssetNamingStrategy()` in the `AssetServerPlugin.init()` method. ## <small>0.8.2 (2020-02-12)</small> #### Features * **admin-ui** Can delete TaxCategory via list view ([6f6e0a1](https://github.com/vendure-ecommerce/vendure/commit/6f6e0a1)), closes [#262](https://github.com/vendure-ecommerce/vendure/issues/262) * **admin-ui** Can delete TaxRate via list view ([ee02aa2](https://github.com/vendure-ecommerce/vendure/commit/ee02aa2)), closes [#262](https://github.com/vendure-ecommerce/vendure/issues/262) * **core** Implement deletion of TaxCategory ([b263b8b](https://github.com/vendure-ecommerce/vendure/commit/b263b8b)), closes [#262](https://github.com/vendure-ecommerce/vendure/issues/262) * **core** Implement deletion of TaxRate ([8c2db90](https://github.com/vendure-ecommerce/vendure/commit/8c2db90)), closes [#262](https://github.com/vendure-ecommerce/vendure/issues/262) #### Fixes * **email-plugin** Correctly filter when using loadData in handler ([66bc98c](https://github.com/vendure-ecommerce/vendure/commit/66bc98c)), closes [#257](https://github.com/vendure-ecommerce/vendure/issues/257) * **email-plugin** Fix Handlebars "cannot resolve property" error ([2984a90](https://github.com/vendure-ecommerce/vendure/commit/2984a90)), closes [#259](https://github.com/vendure-ecommerce/vendure/issues/259) ## <small>0.8.1 (2020-02-05)</small> #### Fixes * **admin-ui** Do not reset Promotion actions & conditions on update ([2b3fc72](https://github.com/vendure-ecommerce/vendure/commit/2b3fc72)), closes [#256](https://github.com/vendure-ecommerce/vendure/issues/256) * **core** Prevent Customers from logging in to admin API ([09eb30c](https://github.com/vendure-ecommerce/vendure/commit/09eb30c)), closes [#77](https://github.com/vendure-ecommerce/vendure/issues/77) #### Features * **core** Allow a custom function for generating order codes ([7d36de9](https://github.com/vendure-ecommerce/vendure/commit/7d36de9)), closes [#252](https://github.com/vendure-ecommerce/vendure/issues/252) ## 0.8.0 (2020-01-30) #### Fixes * **admin-ui** Better error message when user lacks permissions ([1f7c230](https://github.com/vendure-ecommerce/vendure/commit/1f7c230)), closes [#246](https://github.com/vendure-ecommerce/vendure/issues/246) * **admin-ui** Correct types for OrderDetail ([2169366](https://github.com/vendure-ecommerce/vendure/commit/2169366)), closes [#232](https://github.com/vendure-ecommerce/vendure/issues/232) * **admin-ui** Fix TS error with latest apollo-client typings ([465f81e](https://github.com/vendure-ecommerce/vendure/commit/465f81e)), closes [#243](https://github.com/vendure-ecommerce/vendure/issues/243) * **admin-ui** Set default `requiresPermission` for ActionBar items ([292e6d4](https://github.com/vendure-ecommerce/vendure/commit/292e6d4)) * **core** Correctly resolve Customer.User property ([c11c8a0](https://github.com/vendure-ecommerce/vendure/commit/c11c8a0)) * **core** Fix "contains" list filter operator for postgres ([c3898a6](https://github.com/vendure-ecommerce/vendure/commit/c3898a6)) * **core** Fix date handling for ListQueryBuilder ([6a6397b](https://github.com/vendure-ecommerce/vendure/commit/6a6397b)), closes [#251](https://github.com/vendure-ecommerce/vendure/issues/251) * **core** Fix inconsistencies in behaviour between DB drivers ([71b8f4c](https://github.com/vendure-ecommerce/vendure/commit/71b8f4c)) * **core** Fix inconsistencies in DefaultSearchPlugin search strategies ([50fbae6](https://github.com/vendure-ecommerce/vendure/commit/50fbae6)) * **core** Fix worker becoming unresponsive after errors ([0f905b0](https://github.com/vendure-ecommerce/vendure/commit/0f905b0)), closes [#250](https://github.com/vendure-ecommerce/vendure/issues/250) * **core** Publish state transition events after persisting entities ([005a553](https://github.com/vendure-ecommerce/vendure/commit/005a553)), closes [#245](https://github.com/vendure-ecommerce/vendure/issues/245) * **core** Remove null defaults from entity fields ([98bff33](https://github.com/vendure-ecommerce/vendure/commit/98bff33)), closes [#244](https://github.com/vendure-ecommerce/vendure/issues/244) * **core** Validate non-nullable custom fields ([f5dd95e](https://github.com/vendure-ecommerce/vendure/commit/f5dd95e)) * **elasticsearch-plugin** Fix inconsistencies in behaviour between DBs ([35d0008](https://github.com/vendure-ecommerce/vendure/commit/35d0008)) #### Features * **admin-ui** Expose services to ActionBarItem onClick function ([e44d372](https://github.com/vendure-ecommerce/vendure/commit/e44d372)), closes [#247](https://github.com/vendure-ecommerce/vendure/issues/247) * **core** Set default DB timezone to UTC ([8bf2c7a](https://github.com/vendure-ecommerce/vendure/commit/8bf2c7a)) * **core** Store TaxRate value as decimal type ([1aea1b5](https://github.com/vendure-ecommerce/vendure/commit/1aea1b5)), closes [#234](https://github.com/vendure-ecommerce/vendure/issues/234) * **core** Use decimal type for OrderItem.taxRate ([92650ec](https://github.com/vendure-ecommerce/vendure/commit/92650ec)), closes [#234](https://github.com/vendure-ecommerce/vendure/issues/234) * **testing** Add support for e2e tests backed by MySQL/MariaDB ([dbc591f](https://github.com/vendure-ecommerce/vendure/commit/dbc591f)), closes [#207](https://github.com/vendure-ecommerce/vendure/issues/207) * **testing** Add support for e2e tests backed by Postgres ([50bdbd8](https://github.com/vendure-ecommerce/vendure/commit/50bdbd8)), closes [#207](https://github.com/vendure-ecommerce/vendure/issues/207) * **testing** Modularize DB support for e2e tests ([f8060b5](https://github.com/vendure-ecommerce/vendure/commit/f8060b5)), closes [#207](https://github.com/vendure-ecommerce/vendure/issues/207) ### BREAKING CHANGE * The `@vendure/testing` package now requires you to explicitly register initializers for the databases you with to test against. This change enables e2e tests to be run against any database supported by TypeORM. The `dataDir` option has been removed from the call to the `TestServer.init()` method, as it is specific to the SqljsInitializer: before: ```TypeScript import { createTestEnvironment, testConfig } from '@vendure/testing'; describe('my e2e test suite', () => { const { server, adminClient } = createTestEnvironment(testConfig); beforeAll(() => { await server.init({ dataDir: path.join(__dirname, '__data__'), initialData, productsCsvPath: path.join(__dirname, 'fixtures/e2e-products-minimal.csv'), customerCount: 1, }); }); //... }); ``` after: ```TypeScript import { createTestEnvironment, registerInitializer, SqljsInitializer, testConfig } from '@vendure/testing'; registerInitializer('sqljs', new SqljsInitializer(path.join(__dirname, '__data__'))); describe('my e2e test suite', () => { const { server, adminClient } = createTestEnvironment(testConfig); beforeAll(() => { await server.init({ initialData, productsCsvPath: path.join(__dirname, 'fixtures/e2e-products-minimal.csv'), customerCount: 1, }); }); //... }); ``` * The `OrderItem.taxRate` column type in the database has been changed from `int` to `decimal`. You will need to perform a migration to update this column and depending on your database type, you may need to manually edit the migration script in order to preserve the old values. * The `TaxRate.value` column type in the database has been changed from `int` to `decimal`. You will need to perform a migration to update this column and depending on your database type, you may need to manually edit the migration script in order to preserve the old values. * The default `dbConnectionOptions.timezone` setting is now set to `'Z'` (UTC). If you have not explicitly set the timezone in your project, then up until now it would have defaulted to `'local'`. To preserve this behavior you can override this new default by setting `dbConnectionOptions.timezone: 'local'` in your VendureConfig. * This relates to Admin UI extensions. The `onClick` function signature of any custom ActionBarItems has changed - the second parameter used to be the `ActivatedRoute` - it is now an object containing `ActivatedRoute` plus an instance of `DataService` and `NotificationService`. ## 0.7.0 (2019-12-18) #### Features * **admin-ui** Display CustomFields for OrderLines in order detail view ([c33f1f6](https://github.com/vendure-ecommerce/vendure/commit/c33f1f6)), closes [#227](https://github.com/vendure-ecommerce/vendure/issues/227) * **ui-devkit** Allow ui extensions to be launched in a new window ([71eb6a5](https://github.com/vendure-ecommerce/vendure/commit/71eb6a5)) #### Fixes * **admin-ui** Correct mis-spelled "secondary" type in ModalService ([9600c42](https://github.com/vendure-ecommerce/vendure/commit/9600c42)) * **admin-ui** Correctly handle multiple additional NavMenu items ([6e27c37](https://github.com/vendure-ecommerce/vendure/commit/6e27c37)) * **core** Update TypeORM version to fix Postgres 12 compatibility ([895ebdf](https://github.com/vendure-ecommerce/vendure/commit/895ebdf)), closes [#177](https://github.com/vendure-ecommerce/vendure/issues/177) #### Perf * **core** Add `reload: false` to .save() operations ([3c33f33](https://github.com/vendure-ecommerce/vendure/commit/3c33f33)) * **core** Implement caching of GraphqlValueTransformer type trees ([ffe47b1](https://github.com/vendure-ecommerce/vendure/commit/ffe47b1)), closes [#226](https://github.com/vendure-ecommerce/vendure/issues/226) * **core** Optimize OrderCalculator logic to improve performance ([71f3eab](https://github.com/vendure-ecommerce/vendure/commit/71f3eab)), closes [#226](https://github.com/vendure-ecommerce/vendure/issues/226) * **core** Optimize some SQL queries in hot code paths for Orders ([691f579](https://github.com/vendure-ecommerce/vendure/commit/691f579)), closes [#226](https://github.com/vendure-ecommerce/vendure/issues/226) * **core** Remove the @RelationId() decorator from OrderItem ([6bda232](https://github.com/vendure-ecommerce/vendure/commit/6bda232)), closes [#226](https://github.com/vendure-ecommerce/vendure/issues/226) ### BREAKING CHANGE * The `Order` entity now has a new column, `taxZoneId`. This is used to more efficiently track changes to the active tax zone, and therefore reduce the number of tax calculations to be performed on an Order. This change will require a migration which should be routine. ## <small>0.6.5 (2019-12-11)</small> #### Fixes * **admin-ui** Add polling to watch mode to alleviate race condition ([1b95a81](https://github.com/vendure-ecommerce/vendure/commit/1b95a81)) * **admin-ui** Allow new FacetValues to be added ([337762e](https://github.com/vendure-ecommerce/vendure/commit/337762e)), closes [#222](https://github.com/vendure-ecommerce/vendure/issues/222) * **admin-ui** Assign NavMenuSection default permission if not specified ([b476dcb](https://github.com/vendure-ecommerce/vendure/commit/b476dcb)) * **admin-ui** Correctly initialize Facet detail view ([d68fcb7](https://github.com/vendure-ecommerce/vendure/commit/d68fcb7)) * **admin-ui** Fix CustomerDetail display of custom fields ([02757ea](https://github.com/vendure-ecommerce/vendure/commit/02757ea)) * **core** Fix error when patching custom fields ([a3afc1b](https://github.com/vendure-ecommerce/vendure/commit/a3afc1b)) #### Features * **admin-ui** Export Dialog interface ([6b31f28](https://github.com/vendure-ecommerce/vendure/commit/6b31f28)) * **admin-ui** Initial implementation of extension host architecture ([85815c1](https://github.com/vendure-ecommerce/vendure/commit/85815c1)), closes [#225](https://github.com/vendure-ecommerce/vendure/issues/225) * **ui-devkit** Add `notify()` function ([085c7cf](https://github.com/vendure-ecommerce/vendure/commit/085c7cf)) * **ui-devkit** Create ui-devkit package for developing UI extensions ([20cd34d](https://github.com/vendure-ecommerce/vendure/commit/20cd34d)), closes [#225](https://github.com/vendure-ecommerce/vendure/issues/225) ## <small>0.6.4 (2019-12-04)</small> #### Fixes * **admin-ui** Correct bad imports ([3cd74ab](https://github.com/vendure-ecommerce/vendure/commit/3cd74ab)) * **admin-ui** Make Channel zones required in ChannelDetailComponent ([ba27360](https://github.com/vendure-ecommerce/vendure/commit/ba27360)), closes [#218](https://github.com/vendure-ecommerce/vendure/issues/218) * **admin-ui** Order detail - fix broken app when no featuredAsset (#219) ([e0bfa4d](https://github.com/vendure-ecommerce/vendure/commit/e0bfa4d)), closes [#219](https://github.com/vendure-ecommerce/vendure/issues/219) * **core** Enforce Channels created with a default tax/shipping Zone ([f57fb51](https://github.com/vendure-ecommerce/vendure/commit/f57fb51)), closes [#218](https://github.com/vendure-ecommerce/vendure/issues/218) * **core** Use "double precision" as column type for float custom fields ([8f2d034](https://github.com/vendure-ecommerce/vendure/commit/8f2d034)), closes [#217](https://github.com/vendure-ecommerce/vendure/issues/217) * **email-plugin** Fix incorrect relative imports ([561c793](https://github.com/vendure-ecommerce/vendure/commit/561c793)) #### Features * **admin-ui** Make readonly custom fields readonly in the UI ([cf1d7f1](https://github.com/vendure-ecommerce/vendure/commit/cf1d7f1)), closes [#216](https://github.com/vendure-ecommerce/vendure/issues/216) * **core** Export OrderCalculator helper service ([6340045](https://github.com/vendure-ecommerce/vendure/commit/6340045)) * **core** Implement internal and readonly CustomField properties ([c2ae44f](https://github.com/vendure-ecommerce/vendure/commit/c2ae44f)), closes [#216](https://github.com/vendure-ecommerce/vendure/issues/216) ## <small>0.6.3 (2019-11-26)</small> *Note: only the `@vendure/email-plugin` package was updated in this release, as v0.6.2 included a critical bug which prevented installation via `@vendure/create`* #### Fixes * **email-plugin** Fix TypeScript compiler error on defaultEmailHandlers ([d794e5f](https://github.com/vendure-ecommerce/vendure/commit/d794e5f)) ## <small>0.6.2 (2019-11-26)</small> #### Features * **core** Allow custom ApolloServerPlugins to be specified ([dc45c87](https://github.com/vendure-ecommerce/vendure/commit/dc45c87)), closes [#210](https://github.com/vendure-ecommerce/vendure/issues/210) * **create** Include a .gitignore file ([6b6b3e3](https://github.com/vendure-ecommerce/vendure/commit/6b6b3e3)) * **email-plugin** Allow async data loading in EmailEventHandlers ([155d429](https://github.com/vendure-ecommerce/vendure/commit/155d429)), closes [#184](https://github.com/vendure-ecommerce/vendure/issues/184) #### Fixes * **core** Ensure plugins instantiated only once per process ([7198b85](https://github.com/vendure-ecommerce/vendure/commit/7198b85)), closes [#213](https://github.com/vendure-ecommerce/vendure/issues/213) * **core** Export LoginEvent & RefundStateTransitionEvent ([90e161b](https://github.com/vendure-ecommerce/vendure/commit/90e161b)) * **core** Use correct config & output path when generating migrations ([637c863](https://github.com/vendure-ecommerce/vendure/commit/637c863)) * **core** Use correct config for runMigrations & revertLastMigration ([c9acd68](https://github.com/vendure-ecommerce/vendure/commit/c9acd68)) ## <small>0.6.1 (2019-11-18)</small> #### Fixes * **asset-server-plugin** Update sharp dependency for node 13 compat ([186b47e](https://github.com/vendure-ecommerce/vendure/commit/186b47e)), closes [#204](https://github.com/vendure-ecommerce/vendure/issues/204) * **core** Fix product search with postgres ([dadef4c](https://github.com/vendure-ecommerce/vendure/commit/dadef4c)), closes [#206](https://github.com/vendure-ecommerce/vendure/issues/206) ## 0.6.0 (2019-11-14) #### Fixes * **admin-ui** Correctly display HttpErrorResponse messages ([8cc6885](https://github.com/vendure-ecommerce/vendure/commit/8cc6885)) * **admin-ui** Correctly specify channels when creating a Role ([34a6a3e](https://github.com/vendure-ecommerce/vendure/commit/34a6a3e)) * **admin-ui** Update permissions-based display when permissions change ([aec08be](https://github.com/vendure-ecommerce/vendure/commit/aec08be)) * **core** Add resolver for Role.channels ([5a2ddc5](https://github.com/vendure-ecommerce/vendure/commit/5a2ddc5)) #### Features * **admin-ui** Add channel switcher ([0396e88](https://github.com/vendure-ecommerce/vendure/commit/0396e88)), closes [#12](https://github.com/vendure-ecommerce/vendure/issues/12) * **admin-ui** Display color-coded label for Channels ([571c379](https://github.com/vendure-ecommerce/vendure/commit/571c379)) * **admin-ui** Display permissions by Channel in Admin detail view ([586f2d7](https://github.com/vendure-ecommerce/vendure/commit/586f2d7)) * **admin-ui** Enable assigning Products to Channels ([59b9c91](https://github.com/vendure-ecommerce/vendure/commit/59b9c91)), closes [#12](https://github.com/vendure-ecommerce/vendure/issues/12) * **admin-ui** Enable deletion of Channels ([b295e52](https://github.com/vendure-ecommerce/vendure/commit/b295e52)), closes [#12](https://github.com/vendure-ecommerce/vendure/issues/12) * **admin-ui** Enable deletion of Roles ([2a674a3](https://github.com/vendure-ecommerce/vendure/commit/2a674a3)) * **admin-ui** Enable removal of Product from Channel ([27eea68](https://github.com/vendure-ecommerce/vendure/commit/27eea68)), closes [#12](https://github.com/vendure-ecommerce/vendure/issues/12) * **admin-ui** Enable setting Role channel on update ([8379a82](https://github.com/vendure-ecommerce/vendure/commit/8379a82)), closes [#12](https://github.com/vendure-ecommerce/vendure/issues/12) * **admin-ui** Truncate display of role permissions if too long ([98d971f](https://github.com/vendure-ecommerce/vendure/commit/98d971f)) * **core** Add channel handling to DefaultSearchPlugin ([280a38b](https://github.com/vendure-ecommerce/vendure/commit/280a38b)) * **core** Allow Roles to be created in other channels ([df5f006](https://github.com/vendure-ecommerce/vendure/commit/df5f006)), closes [#12](https://github.com/vendure-ecommerce/vendure/issues/12) * **core** Allow Roles to have Channels specified on update ([b3dd6c1](https://github.com/vendure-ecommerce/vendure/commit/b3dd6c1)) * **core** Assign superadmin Role to newly created Channels ([6fc421a](https://github.com/vendure-ecommerce/vendure/commit/6fc421a)) * **core** Automatically assign Customer role to all new Channels ([da826f2](https://github.com/vendure-ecommerce/vendure/commit/da826f2)) * **core** Constrain channel-aware queries by channelId ([51c1b07](https://github.com/vendure-ecommerce/vendure/commit/51c1b07)), closes [#12](https://github.com/vendure-ecommerce/vendure/issues/12) * **core** Implement `assignProductsToChannel` mutation ([5fda66b](https://github.com/vendure-ecommerce/vendure/commit/5fda66b)), closes [#12](https://github.com/vendure-ecommerce/vendure/issues/12) * **core** Implement deleteChannel mutation ([989960b](https://github.com/vendure-ecommerce/vendure/commit/989960b)), closes [#12](https://github.com/vendure-ecommerce/vendure/issues/12) * **core** Implement deleteRole mutation ([7b338a4](https://github.com/vendure-ecommerce/vendure/commit/7b338a4)) * **core** Implement removeProductsFromChannel mutation ([6a165dc](https://github.com/vendure-ecommerce/vendure/commit/6a165dc)) * **core** Make product/variant events more granular ([4f9a186](https://github.com/vendure-ecommerce/vendure/commit/4f9a186)) * **core** Update search index on Product assigned/removed from Channel ([3a6c277](https://github.com/vendure-ecommerce/vendure/commit/3a6c277)), closes [#12](https://github.com/vendure-ecommerce/vendure/issues/12) * **elasticsearch-plugin** Add support for multiple channels ([aacfaf4](https://github.com/vendure-ecommerce/vendure/commit/aacfaf4)) ### BREAKING CHANGE * The `CatalogModificationEvent` which was previously published whenever changes were made to `Product` or `ProductVariant` entities has been replaced with a `ProductEvent` and `ProductVariantEvent`, including the type of event ('created', 'updated', 'deleted'). * The `SearchIndexItem` entity used by the `DefaultSearchPlugin` has a couple of new fields related to Channel handling. Once the schema is updated (either by synchronizing or running a migration), the search index should be rebuilt. ## <small>0.5.1 (2019-11-04)</small> #### Fixes * **admin-ui** Display correct net total in Order detail ([b177f2c](https://github.com/vendure-ecommerce/vendure/commit/b177f2c)), closes [#200](https://github.com/vendure-ecommerce/vendure/issues/200) #### Features * **admin-ui** Export CanDeactivateDetailGuard ([89c0699](https://github.com/vendure-ecommerce/vendure/commit/89c0699)) * **core** Allow lazy evaluation of APIExtensionDefinitions ([69dad0b](https://github.com/vendure-ecommerce/vendure/commit/69dad0b)) * **core** Export some entity utils from service helpers ([ddceb64](https://github.com/vendure-ecommerce/vendure/commit/ddceb64)) * **core** Export the Api decorator & ApiType type ([c7857d3](https://github.com/vendure-ecommerce/vendure/commit/c7857d3)) * **core** Update Nestjs to v6.8.5, TypeORM to v0.2.20 * **elasticsearch-plugin** Allow definition of custom mappings ([2c8b7df](https://github.com/vendure-ecommerce/vendure/commit/2c8b7df)) * **testing** Extract e2e testing tools into `@vendute/testing` package, closes [#198](https://github.com/vendure-ecommerce/vendure/issues/198) ## 0.5.0 (2019-10-23) #### Features * **admin-ui-plugin** Allow UI extensions to contain multiple modules ([b23c3e8](https://github.com/vendure-ecommerce/vendure/commit/b23c3e8)) * **admin-ui** Display hint if deleting Collection with descendants ([27b7080](https://github.com/vendure-ecommerce/vendure/commit/27b7080)) * **admin-ui** Export BaseListComponent & BaseDetailComponent ([d222449](https://github.com/vendure-ecommerce/vendure/commit/d222449)) * **admin-ui** Make CollectionList items expandable ([147bf17](https://github.com/vendure-ecommerce/vendure/commit/147bf17)) * **core** Allow log level to be set in migration helpers ([34cb07e](https://github.com/vendure-ecommerce/vendure/commit/34cb07e)) * **core** Auto-generate GraphQL ListOptions for plugin extensions ([aa40776](https://github.com/vendure-ecommerce/vendure/commit/aa40776)) * **core** Export all service-layer helpers in PluginCommonModule ([0d57eca](https://github.com/vendure-ecommerce/vendure/commit/0d57eca)) * **core** Export ListQueryBuilder helper ([5bb5c1e](https://github.com/vendure-ecommerce/vendure/commit/5bb5c1e)) #### Fixes * **admin-ui** Fix notification label for CollectionList ([cd02789](https://github.com/vendure-ecommerce/vendure/commit/cd02789)), closes [#186](https://github.com/vendure-ecommerce/vendure/issues/186) * **admin-ui** Import missing social-shapes icons ([7b5b943](https://github.com/vendure-ecommerce/vendure/commit/7b5b943)) * **admin-ui** Remove paging from CollectionList ([517fcd0](https://github.com/vendure-ecommerce/vendure/commit/517fcd0)) * **core** Correctly handle 404 and other Nestjs errors ([4f2c4df](https://github.com/vendure-ecommerce/vendure/commit/4f2c4df)), closes [#187](https://github.com/vendure-ecommerce/vendure/issues/187) * **core** Deleting a Collection also deletes descendants ([1ba9e2d](https://github.com/vendure-ecommerce/vendure/commit/1ba9e2d)), closes [#186](https://github.com/vendure-ecommerce/vendure/issues/186) * **core** Prevent unhandled promise rejection on worker SIGINT ([39ca526](https://github.com/vendure-ecommerce/vendure/commit/39ca526)), closes [#150](https://github.com/vendure-ecommerce/vendure/issues/150) * **create** Add .gitattributes to prevent eol conversions ([5fdeace](https://github.com/vendure-ecommerce/vendure/commit/5fdeace)), closes [#185](https://github.com/vendure-ecommerce/vendure/issues/185) ### BREAKING CHANGE * The API for configuring Admin UI extensions has changed to allow a single extension to define multiple Angular NgModules. This arose as a requirement when working on more complex UI extensions which e.g. define both a shared and a lazy module which share code. Such an arrangement was not possible using the existing API. Here's how to update: ```TypeScript // Old API extensions: [ { type: 'lazy', ngModulePath: path.join(__dirname, 'ui-extensions/greeter'), ngModuleFileName: 'greeter-extension.module.ts', ngModuleName: 'GreeterModule', } ], // New API extensions: [ { extensionPath: path.join(__dirname, 'ui-extensions/greeter'), ngModules: [{ type: 'lazy', ngModuleFileName: 'greeter-extension.module.ts', ngModuleName: 'GreeterModule', }], } ], ``` ## 0.4.0 (2019-10-16) #### Features * **admin-ui** Add coupon & date rage data to PromotionList ([4827aa4](https://github.com/vendure-ecommerce/vendure/commit/4827aa4)) * **admin-ui** Add date range & coupon code controls to PromotionDetail ([48def65](https://github.com/vendure-ecommerce/vendure/commit/48def65)), closes [#174](https://github.com/vendure-ecommerce/vendure/issues/174) * **admin-ui** Add detailed promotion & tax info to OrderDetail view ([cd823fe](https://github.com/vendure-ecommerce/vendure/commit/cd823fe)) * **admin-ui** Add visibility to Order notes ([760d519](https://github.com/vendure-ecommerce/vendure/commit/760d519)), closes [#180](https://github.com/vendure-ecommerce/vendure/issues/180) * **admin-ui** Create cross-browser datetime picker component ([78a713c](https://github.com/vendure-ecommerce/vendure/commit/78a713c)), closes [#181](https://github.com/vendure-ecommerce/vendure/issues/181) * **admin-ui** Display coupon code entries in order history ([9f269fe](https://github.com/vendure-ecommerce/vendure/commit/9f269fe)) * **core** Add couponCodes to Order & mutations to add/remove codes ([fdacb4b](https://github.com/vendure-ecommerce/vendure/commit/fdacb4b)), closes [#174](https://github.com/vendure-ecommerce/vendure/issues/174) * **core** Add date range and couponCode to Promotion entity ([e615d2f](https://github.com/vendure-ecommerce/vendure/commit/e615d2f)), closes [#174](https://github.com/vendure-ecommerce/vendure/issues/174) * **core** Add history entry to Order when vouchers applied/removed ([887cc6c](https://github.com/vendure-ecommerce/vendure/commit/887cc6c)) * **core** Add isPublic flag to AddNoteToOrderInput ([f97c3ac](https://github.com/vendure-ecommerce/vendure/commit/f97c3ac)), closes [#180](https://github.com/vendure-ecommerce/vendure/issues/180) * **core** Add validation to Promotion conditions ([74e7444](https://github.com/vendure-ecommerce/vendure/commit/74e7444)) * **core** Export database migration helpers ([d509805](https://github.com/vendure-ecommerce/vendure/commit/d509805)) * **core** Expose Order.promotions via GraphQL APIs ([02ebd9c](https://github.com/vendure-ecommerce/vendure/commit/02ebd9c)), closes [#174](https://github.com/vendure-ecommerce/vendure/issues/174) * **core** Implement per-customer usage limits for Promotions ([9d45069](https://github.com/vendure-ecommerce/vendure/commit/9d45069)), closes [#174](https://github.com/vendure-ecommerce/vendure/issues/174) * **core** Implement Promotion date range & coupon code checks ([f6eb343](https://github.com/vendure-ecommerce/vendure/commit/f6eb343)), closes [#174](https://github.com/vendure-ecommerce/vendure/issues/174) * **core** Log thrown errors ([ed7f5fb](https://github.com/vendure-ecommerce/vendure/commit/ed7f5fb)) * **core** Move error logging to the API Filter layer ([e8fd15d](https://github.com/vendure-ecommerce/vendure/commit/e8fd15d)) * **create** Generate README file with new projects ([4e2784f](https://github.com/vendure-ecommerce/vendure/commit/4e2784f)) * **create** Rework folder structure, add build & migration scripts ([746abff](https://github.com/vendure-ecommerce/vendure/commit/746abff)), closes [#175](https://github.com/vendure-ecommerce/vendure/issues/175) #### Fixes * **admin-ui** Fix creating new Channels ([b8e4c6c](https://github.com/vendure-ecommerce/vendure/commit/b8e4c6c)), closes [#182](https://github.com/vendure-ecommerce/vendure/issues/182) * **admin-ui** Fix customField product error: handle undef. case ([8265359](https://github.com/vendure-ecommerce/vendure/commit/8265359)) * **core** Allow nullable fields to be unset via GraphQL API ([d9f5c41](https://github.com/vendure-ecommerce/vendure/commit/d9f5c41)) * **core** Fix DefaultLogger logLevel Error ([d5405a0](https://github.com/vendure-ecommerce/vendure/commit/d5405a0)) * **core** Fix duplicate plugin entities being registered on bootstrap ([ce00406](https://github.com/vendure-ecommerce/vendure/commit/ce00406)) * **core** Fix order totals calculation with order % discount ([a4fea59](https://github.com/vendure-ecommerce/vendure/commit/a4fea59)) * **core** Fix OrderItem totals calculation logic ([3c66cf8](https://github.com/vendure-ecommerce/vendure/commit/3c66cf8)) ### BREAKING CHANGE * A new `couponCodes` column is added to the Order table, which will require a DB migration. * A new `promotions` relation has been added to the order table, and a `perCustomerUsageLimit` column to the promotion table. This will require a DB migration. * Removes `atLeastNOfProduct` from defaultPromotionConditions and `itemPercentageDiscount` & `buy1Get1Free` from defaultPromotionActions. They are either not useful or need to be re-implemented in a way that works correctly. ## <small>0.3.4 (2019-10-09)</small> #### Features * **admin-ui** Add entity info to detail views ([cf604aa](https://github.com/vendure-ecommerce/vendure/commit/cf604aa)), closes [#179](https://github.com/vendure-ecommerce/vendure/issues/179) #### Fixes * **admin-ui** Do not expose internal entity IDs ([2ca9cc1](https://github.com/vendure-ecommerce/vendure/commit/2ca9cc1)), closes [#178](https://github.com/vendure-ecommerce/vendure/issues/178) * **core** Add date fields to graphql Country type ([818be24](https://github.com/vendure-ecommerce/vendure/commit/818be24)) * **core** Fix uuid strategy, rework setting of ID data types in DB ([d50d488](https://github.com/vendure-ecommerce/vendure/commit/d50d488)), closes [#176](https://github.com/vendure-ecommerce/vendure/issues/176) ## <small>0.3.3 (2019-10-03)</small> #### Features * **admin-ui** Allow creation of verified Customers ([f451115](https://github.com/vendure-ecommerce/vendure/commit/f451115)), closes [#171](https://github.com/vendure-ecommerce/vendure/issues/171) * **admin-ui** Allow selection of payment to be refunded ([8009220](https://github.com/vendure-ecommerce/vendure/commit/8009220)) * **core** Improved Collection import ([c654d6f](https://github.com/vendure-ecommerce/vendure/commit/c654d6f)), closes [#173](https://github.com/vendure-ecommerce/vendure/issues/173) * **core** Verify admin-created Customers if password supplied ([9931e25](https://github.com/vendure-ecommerce/vendure/commit/9931e25)), closes [#171](https://github.com/vendure-ecommerce/vendure/issues/171) #### Fixes * **admin-ui** Correctly handle defaults for configurable operations ([9bd6a79](https://github.com/vendure-ecommerce/vendure/commit/9bd6a79)) * **admin-ui** Fix DisabledDirective making form dirty ([70e857d](https://github.com/vendure-ecommerce/vendure/commit/70e857d)) * **core** Do not duplicate plugins when running work in main process ([c040c0b](https://github.com/vendure-ecommerce/vendure/commit/c040c0b)) ## <small>0.3.2 (2019-09-26)</small> **Note** only the `@vendure/admin-ui`, `@vendure/admin-ui-plugin` & `@vendure/email-plugin` packages were updated in this release. #### Fixes * **admin-ui** Fix infinite loop hang on CollectionList page ([230703f](https://github.com/vendure-ecommerce/vendure/commit/230703f)), closes [#170](https://github.com/vendure-ecommerce/vendure/issues/170) * **email-plugin** Fix smtp auth ([98bc90a](https://github.com/vendure-ecommerce/vendure/commit/98bc90a)) ## <small>0.3.1 (2019-09-25)</small> #### Features * **admin-ui** Add controls for disabling & deleting a Promotion ([7568e20](https://github.com/vendure-ecommerce/vendure/commit/7568e20)), closes [#159](https://github.com/vendure-ecommerce/vendure/issues/159) * **admin-ui** Add permissions checks for Product list/detail views ([75dc385](https://github.com/vendure-ecommerce/vendure/commit/75dc385)), closes [#94](https://github.com/vendure-ecommerce/vendure/issues/94) * **admin-ui** Add permissions checks to main nav items ([78201fb](https://github.com/vendure-ecommerce/vendure/commit/78201fb)), closes [#94](https://github.com/vendure-ecommerce/vendure/issues/94) * **admin-ui** Add permissions checks to Promotions & Settings views ([2552191](https://github.com/vendure-ecommerce/vendure/commit/2552191)), closes [#94](https://github.com/vendure-ecommerce/vendure/issues/94) * **admin-ui** Allow extensions to define CustomField controls ([83d9090](https://github.com/vendure-ecommerce/vendure/commit/83d9090)), closes [#55](https://github.com/vendure-ecommerce/vendure/issues/55) * **admin-ui** Allow shared & lazy UI plugins to be specified ([5daf756](https://github.com/vendure-ecommerce/vendure/commit/5daf756)), closes [#55](https://github.com/vendure-ecommerce/vendure/issues/55) * **admin-ui** Can add custom buttons to list/detail views ([ef47c62](https://github.com/vendure-ecommerce/vendure/commit/ef47c62)), closes [#55](https://github.com/vendure-ecommerce/vendure/issues/55) * **admin-ui** Expose `query` & `mutation` method on DataService ([09250a8](https://github.com/vendure-ecommerce/vendure/commit/09250a8)) * **admin-ui** Implement readonly state for RichTextEditor ([5f2987c](https://github.com/vendure-ecommerce/vendure/commit/5f2987c)) * **admin-ui** Permissions checks for Facet & Collection views ([7f8163a](https://github.com/vendure-ecommerce/vendure/commit/7f8163a)), closes [#94](https://github.com/vendure-ecommerce/vendure/issues/94) * **admin-ui** Set up infrastructure for permission-based UI display ([6bd5181](https://github.com/vendure-ecommerce/vendure/commit/6bd5181)), closes [#94](https://github.com/vendure-ecommerce/vendure/issues/94) * **core** Add Promotion-specific CRUD permissions ([7ddd893](https://github.com/vendure-ecommerce/vendure/commit/7ddd893)) * **core** Allow length of custom field strings to be specified ([fe360f5](https://github.com/vendure-ecommerce/vendure/commit/fe360f5)), closes [#166](https://github.com/vendure-ecommerce/vendure/issues/166) * **core** Ensure SuperAdmin role has all permissions ([ab866c1](https://github.com/vendure-ecommerce/vendure/commit/ab866c1)) * **core** Expose active user permissions in Admin API ([b7cd6e5](https://github.com/vendure-ecommerce/vendure/commit/b7cd6e5)), closes [#94](https://github.com/vendure-ecommerce/vendure/issues/94) * **create** Add example fromAddress global template variable ([b727327](https://github.com/vendure-ecommerce/vendure/commit/b727327)) * **email-plugin** Added `from` field to the email config (#168) ([09eb34e](https://github.com/vendure-ecommerce/vendure/commit/09eb34e)), closes [#168](https://github.com/vendure-ecommerce/vendure/issues/168) #### Fixes * **admin-ui** Correctly disable selects/toggles based on permissions ([1e41b92](https://github.com/vendure-ecommerce/vendure/commit/1e41b92)) * **core** Correct permissions for tax-related resolvers ([d2b52ce](https://github.com/vendure-ecommerce/vendure/commit/d2b52ce)) * **core** Correct some permissions in Channel & Promotion resolvers ([e2a64fa](https://github.com/vendure-ecommerce/vendure/commit/e2a64fa)) * **core** Ensure all Roles always include the Authenticated permission ([c2de3de](https://github.com/vendure-ecommerce/vendure/commit/c2de3de)) ## 0.3.0 (2019-09-18) #### Features * **admin-ui-plugin** Add watch mode for UI extension development ([c0b4d3f](https://github.com/vendure-ecommerce/vendure/commit/c0b4d3f)), closes [#55](https://github.com/vendure-ecommerce/vendure/issues/55) * **admin-ui-plugin** Detect whether extensions need to be re-compiled ([ba8c44f](https://github.com/vendure-ecommerce/vendure/commit/ba8c44f)), closes [#55](https://github.com/vendure-ecommerce/vendure/issues/55) * **admin-ui** Display Order custom fields ([cbe11d2](https://github.com/vendure-ecommerce/vendure/commit/cbe11d2)), closes [#164](https://github.com/vendure-ecommerce/vendure/issues/164) * **admin-ui** Enable adding options to single-variant Products ([7303171](https://github.com/vendure-ecommerce/vendure/commit/7303171)), closes [#162](https://github.com/vendure-ecommerce/vendure/issues/162) * **admin-ui** Enable drag-drop reordering of assets ([0e624f4](https://github.com/vendure-ecommerce/vendure/commit/0e624f4)), closes [#156](https://github.com/vendure-ecommerce/vendure/issues/156) * **admin-ui** Enable drag-drop reordering of Collections ([ffab838](https://github.com/vendure-ecommerce/vendure/commit/ffab838)) * **admin-ui** Experimental system for extending the UI ([1dcb2e6](https://github.com/vendure-ecommerce/vendure/commit/1dcb2e6)), closes [#55](https://github.com/vendure-ecommerce/vendure/issues/55) * **admin-ui** Expose public API at @vendure/admin-ui/devkit ([c2742ec](https://github.com/vendure-ecommerce/vendure/commit/c2742ec)) * **admin-ui** Implement adding new variants by extending options ([fefe0ea](https://github.com/vendure-ecommerce/vendure/commit/fefe0ea)), closes [#162](https://github.com/vendure-ecommerce/vendure/issues/162) * **core** Re-architect entity-asset relations to allow ordering ([4ed2ce3](https://github.com/vendure-ecommerce/vendure/commit/4ed2ce3)), closes [#156](https://github.com/vendure-ecommerce/vendure/issues/156) * **create** Add ci option to test installs ([c2c7b82](https://github.com/vendure-ecommerce/vendure/commit/c2c7b82)) #### Fixes * **admin-ui** Trigger navigation confirm if assets have been changed ([6e751b0](https://github.com/vendure-ecommerce/vendure/commit/6e751b0)) * **core** Allow removal of all Assets from an entity ([528eb3c](https://github.com/vendure-ecommerce/vendure/commit/528eb3c)) * **core** Fix facet value CollectionFilter ([7b6fe6c](https://github.com/vendure-ecommerce/vendure/commit/7b6fe6c)), closes [#158](https://github.com/vendure-ecommerce/vendure/issues/158) * **core** Resolve collection assets field ([e32895f](https://github.com/vendure-ecommerce/vendure/commit/e32895f)), closes [#157](https://github.com/vendure-ecommerce/vendure/issues/157) * **core** Specify Collection.description as text type ([351e811](https://github.com/vendure-ecommerce/vendure/commit/351e811)), closes [#165](https://github.com/vendure-ecommerce/vendure/issues/165) ### BREAKING CHANGE * The internal representation of Asset relations has changed to enable explicit ordering of assets. This change means that the database schema had to be updated. ## <small>0.2.1 (2019-09-09)</small> #### Features * **admin-ui** Check for running jobs after each mutation ([8b2b0dc](https://github.com/vendure-ecommerce/vendure/commit/8b2b0dc)) * **core** Add optional metadata to JobInfo ([7ddec36](https://github.com/vendure-ecommerce/vendure/commit/7ddec36)) * **core** Create WorkerService for simpler communication to worker ([16ab03d](https://github.com/vendure-ecommerce/vendure/commit/16ab03d)) * **core** Enable custom fields on Order entity ([4ef0f15](https://github.com/vendure-ecommerce/vendure/commit/4ef0f15)) * **core** EventBus exposes Observable event stream with .ofType() ([506a0fa](https://github.com/vendure-ecommerce/vendure/commit/506a0fa)) * **core** Improve speed of bulk product import ([92abbcb](https://github.com/vendure-ecommerce/vendure/commit/92abbcb)) #### Fixes * **admin-ui** Fix error creating product with localeString custom prop ([4ae5b72](https://github.com/vendure-ecommerce/vendure/commit/4ae5b72)) * **core** Fix fetching entities with a single localeString custom field ([0d0545f](https://github.com/vendure-ecommerce/vendure/commit/0d0545f)) * **elasticsearch-plugin** Fix null productVariantPreview error ([571f7af](https://github.com/vendure-ecommerce/vendure/commit/571f7af)) #### Perf * **core** Move application of CollectionFilters to worker ([0a90982](https://github.com/vendure-ecommerce/vendure/commit/0a90982)), closes [#148](https://github.com/vendure-ecommerce/vendure/issues/148) ## 0.2.0 (2019-08-28) #### Features * **admin-ui** Add filtering to countries list ([fff6f19](https://github.com/vendure-ecommerce/vendure/commit/fff6f19)) * **admin-ui** Add filtering to orders list ([8dda408](https://github.com/vendure-ecommerce/vendure/commit/8dda408)) * **admin-ui** Add search input to customer list ([28e4e41](https://github.com/vendure-ecommerce/vendure/commit/28e4e41)) * **common** Add DeepRequired type ([c77e365](https://github.com/vendure-ecommerce/vendure/commit/c77e365)) * **core** Expose new RuntimeVendureConfig interface ([6ea7124](https://github.com/vendure-ecommerce/vendure/commit/6ea7124)) * **core** Include width and height in Asset entity ([338ef95](https://github.com/vendure-ecommerce/vendure/commit/338ef95)), closes [#79](https://github.com/vendure-ecommerce/vendure/issues/79) * **elasticsearch-plugin** Add options for customising term query ([7191842](https://github.com/vendure-ecommerce/vendure/commit/7191842)) * **elasticsearch-plugin** Allow facetValues size to be configured ([3a5aff4](https://github.com/vendure-ecommerce/vendure/commit/3a5aff4)) * **elasticsearch-plugin** Allow querying by price range ([573f345](https://github.com/vendure-ecommerce/vendure/commit/573f345)) * **elasticsearch-plugin** Extend response with price range data ([81eff46](https://github.com/vendure-ecommerce/vendure/commit/81eff46)) #### Fixes * **common** Add missing chars to normalizeString function ([f687cc8](https://github.com/vendure-ecommerce/vendure/commit/f687cc8)), closes [#144](https://github.com/vendure-ecommerce/vendure/issues/144) * **core** Correctly prefix asset urls for resolved properties ([0517b6c](https://github.com/vendure-ecommerce/vendure/commit/0517b6c)), closes [#146](https://github.com/vendure-ecommerce/vendure/issues/146) * **elasticsearch-plugin** Correctly remove deleted items from index ([f0a56fa](https://github.com/vendure-ecommerce/vendure/commit/f0a56fa)) * **elasticsearch-plugin** Correctly report facetValue counts ([2f8af7c](https://github.com/vendure-ecommerce/vendure/commit/2f8af7c)) * **elasticsearch-plugin** Fix error when creating new Product ([b6ae235](https://github.com/vendure-ecommerce/vendure/commit/b6ae235)), closes [#145](https://github.com/vendure-ecommerce/vendure/issues/145) * **elasticsearch-plugin** Make option optional ([da8b2f2](https://github.com/vendure-ecommerce/vendure/commit/da8b2f2)) ## <small>0.1.2-beta.12 (2019-08-20)</small> #### Fixes * **admin-ui** Add missing icon ([4027325](https://github.com/vendure-ecommerce/vendure/commit/4027325)) * **admin-ui** Fix error on creating product with empty option values ([452f5a9](https://github.com/vendure-ecommerce/vendure/commit/452f5a9)), closes [#141](https://github.com/vendure-ecommerce/vendure/issues/141) * **core** Add 'float' type to arg types for shipping operations ([f8626d1](https://github.com/vendure-ecommerce/vendure/commit/f8626d1)) * **core** Correctly filter out ineligible shipping methods ([911463a](https://github.com/vendure-ecommerce/vendure/commit/911463a)) * **core** Fix application hang when worker microservice fails to start ([25de044](https://github.com/vendure-ecommerce/vendure/commit/25de044)) * **create** Correctly log verbose output from server ([a4b76b2](https://github.com/vendure-ecommerce/vendure/commit/a4b76b2)) #### Features * **admin-ui-plugin** Automatically configure admin-ui auth method ([fd68d1e](https://github.com/vendure-ecommerce/vendure/commit/fd68d1e)), closes [#138](https://github.com/vendure-ecommerce/vendure/issues/138) * **admin-ui** Add shipping method eligibility testing tool ([300da15](https://github.com/vendure-ecommerce/vendure/commit/300da15)) * **admin-ui** Automatically populate shipping method code ([082e882](https://github.com/vendure-ecommerce/vendure/commit/082e882)) * **admin-ui** Display shipping calculator metadata ([4e5bce5](https://github.com/vendure-ecommerce/vendure/commit/4e5bce5)), closes [#136](https://github.com/vendure-ecommerce/vendure/issues/136) * **admin-ui** Enable deletion of shipping methods ([0032978](https://github.com/vendure-ecommerce/vendure/commit/0032978)) * **admin-ui** Support bearer token auth method ([c31a383](https://github.com/vendure-ecommerce/vendure/commit/c31a383)), closes [#138](https://github.com/vendure-ecommerce/vendure/issues/138) * **core** Add testEligibleShippingMethods query ([bc860e0](https://github.com/vendure-ecommerce/vendure/commit/bc860e0)) * **core** Allow ShippingCalculator to return arbitrary metadata ([bdbdf9a](https://github.com/vendure-ecommerce/vendure/commit/bdbdf9a)), closes [#136](https://github.com/vendure-ecommerce/vendure/issues/136) * **core** Automatically set CORS exposedHeaders for bearer auth ([f4cd718](https://github.com/vendure-ecommerce/vendure/commit/f4cd718)), closes [#137](https://github.com/vendure-ecommerce/vendure/issues/137) * **core** Implement deleteShippingMethod mutation, add tests ([0b1dfd5](https://github.com/vendure-ecommerce/vendure/commit/0b1dfd5)) ## <small>0.1.2-beta.11 (2019-08-08)</small> #### Fixes * **admin-ui** Correctly display long items in SimpleItemList ([ca2758f](https://github.com/vendure-ecommerce/vendure/commit/ca2758f)) * **admin-ui** Display zero shipping price in test tool ([0e7e2d3](https://github.com/vendure-ecommerce/vendure/commit/0e7e2d3)) * **admin-ui** Fix styling of order history ([8c5ff50](https://github.com/vendure-ecommerce/vendure/commit/8c5ff50)) * **admin-ui** Minor styling fixes ([c8fe561](https://github.com/vendure-ecommerce/vendure/commit/c8fe561)) * **core** Correct typing of PaymentMetadata ([e6d35df](https://github.com/vendure-ecommerce/vendure/commit/e6d35df)) * **core** Correctly update Refund state ([58caba7](https://github.com/vendure-ecommerce/vendure/commit/58caba7)) #### Features * **admin-ui** Add shipping method test UI ([b76eac5](https://github.com/vendure-ecommerce/vendure/commit/b76eac5)), closes [#133](https://github.com/vendure-ecommerce/vendure/issues/133) * **admin-ui** Display ProductVariant custom fields ([32017f3](https://github.com/vendure-ecommerce/vendure/commit/32017f3)) * **admin-ui** Display refund metadata ([eabd343](https://github.com/vendure-ecommerce/vendure/commit/eabd343)) * **admin-ui** Support extended ConfigurableOperations ([8cc0941](https://github.com/vendure-ecommerce/vendure/commit/8cc0941)), closes [#135](https://github.com/vendure-ecommerce/vendure/issues/135) * **core** Extend configurable operation arguments API ([d17aaa9](https://github.com/vendure-ecommerce/vendure/commit/d17aaa9)), closes [#135](https://github.com/vendure-ecommerce/vendure/issues/135) * **core** I18n for descriptions and labels of ConfigurableOperations ([a135e15](https://github.com/vendure-ecommerce/vendure/commit/a135e15)) * **core** Implement testShippingMethod query ([a3a9931](https://github.com/vendure-ecommerce/vendure/commit/a3a9931)), closes [#133](https://github.com/vendure-ecommerce/vendure/issues/133) ### BREAKING CHANGE * `adjustmentOperations` query has been replaced by `promotionConditions` and `promotionActions` * ConfigurableOperations (ShippingEligibilityChecker, ShippingCalculator, CollectionFilter, PromotionCondition, PromotionAction, PaymentMethodHandler) have a new API for defining their arguments. For existing Vendure installations, any Shipping Methods, Promotions and Collection will need to be re-configured after the update by removing any checker/calculator/filter/condition/action and re-adding it. * ConfigurableOperations descriptions must now be specified as an array of LocalizedString rather than just a plain string. This allows the descriptions to be adapted to other locales. ## <small>0.1.2-beta.10 (2019-08-01)</small> #### Features * **admin-ui** Display nested payment metadata ([f90e773](https://github.com/vendure-ecommerce/vendure/commit/f90e773)) * **admin-ui** Enable cancellation of active orders ([8224ddd](https://github.com/vendure-ecommerce/vendure/commit/8224ddd)) * **core** Add error handling to payments ([cba63e1](https://github.com/vendure-ecommerce/vendure/commit/cba63e1)) * **core** Allow cancellation of order by id ([8d0a0eb](https://github.com/vendure-ecommerce/vendure/commit/8d0a0eb)) * **core** Export OrderState & PaymentState types ([8ef699d](https://github.com/vendure-ecommerce/vendure/commit/8ef699d)) #### Fixes * **core** Correct ID types for SearchInput ([de78cc8](https://github.com/vendure-ecommerce/vendure/commit/de78cc8)) * **core** Fix incorrect import paths ([663fbd8](https://github.com/vendure-ecommerce/vendure/commit/663fbd8)) * **core** Remove LanguageCode arg from Shop API ([3b80224](https://github.com/vendure-ecommerce/vendure/commit/3b80224)), closes [#130](https://github.com/vendure-ecommerce/vendure/issues/130) * **core** Remove non-existent import ([e660d46](https://github.com/vendure-ecommerce/vendure/commit/e660d46)) * **elasticsearch-plugin** Remove references to Decode decorator ([0d3d8ef](https://github.com/vendure-ecommerce/vendure/commit/0d3d8ef)) ### BREAKING CHANGE * The `languageCode` argument has been removed from all Shop API queries, namely `product`, `products`, `collection` and `collections`. Instead, LanguageCode should be specified as a query param. ## <small>0.1.2-beta.9 (2019-07-25)</small> #### Features * **core** Make request pipeline compatible with REST requests ([42aa5fb](https://github.com/vendure-ecommerce/vendure/commit/42aa5fb)) * **core** Rewrite plugin system to use Nest modules ([7ec309b](https://github.com/vendure-ecommerce/vendure/commit/7ec309b)), closes [#123](https://github.com/vendure-ecommerce/vendure/issues/123) * **core** Use query param to specify language ([2035003](https://github.com/vendure-ecommerce/vendure/commit/2035003)), closes [#128](https://github.com/vendure-ecommerce/vendure/issues/128) * **create** Improve error handling ([b5e0b62](https://github.com/vendure-ecommerce/vendure/commit/b5e0b62)) * **create** Update config template to new plugin format ([eb5d4ff](https://github.com/vendure-ecommerce/vendure/commit/eb5d4ff)) #### Fixes * **admin-ui** Remove references to obsolete languageCode arguments ([1e81068](https://github.com/vendure-ecommerce/vendure/commit/1e81068)), closes [#128](https://github.com/vendure-ecommerce/vendure/issues/128) ### BREAKING CHANGE * All `languageCode` GraphQL arguments have been removed from queries and instead, a "languageCode" query param may be attached to the API URL to specify the language of any translatable entities. * Vendure plugins are now defined as Nestjs modules. For existing installations, the VendureConfig will need to be modified so that plugins are not instantiated, but use the static .init() method to pass options to the plugin, e.g.: ``` // before plugins: [ new AdminUiPlugin({ port: 3002 }) ], // after plugins: [ AdminUiPlugin.init({ port: 3002 }) ], ``` ## <small>0.1.2-beta.8 (2019-07-18)</small> #### Fixes * **core** Fix filtering PaginatedList results ([b6a365f](https://github.com/vendure-ecommerce/vendure/commit/b6a365f)) * **core** Fix graphQL schema errors with latest nestjs/graphql ([fbeecef](https://github.com/vendure-ecommerce/vendure/commit/fbeecef)), closes [#129](https://github.com/vendure-ecommerce/vendure/issues/129) #### Features * **admin-ui** Extend custom field controls to support new options ([019cd02](https://github.com/vendure-ecommerce/vendure/commit/019cd02)), closes [#85](https://github.com/vendure-ecommerce/vendure/issues/85) * **core** Add custom validation function to custom field config ([80eba9d](https://github.com/vendure-ecommerce/vendure/commit/80eba9d)), closes [#85](https://github.com/vendure-ecommerce/vendure/issues/85) * **core** Add nullable & defaultValue options to custom fields config ([b1722d8](https://github.com/vendure-ecommerce/vendure/commit/b1722d8)), closes [#85](https://github.com/vendure-ecommerce/vendure/issues/85) * **core** Add options to string custom field config ([bc0813e](https://github.com/vendure-ecommerce/vendure/commit/bc0813e)), closes [#85](https://github.com/vendure-ecommerce/vendure/issues/85) * **core** Add validation parameters to custom fields ([b6b13a5](https://github.com/vendure-ecommerce/vendure/commit/b6b13a5)), closes [#85](https://github.com/vendure-ecommerce/vendure/issues/85) * **core** Check for name conflict in custom fields, test sort/filter ([27abcff](https://github.com/vendure-ecommerce/vendure/commit/27abcff)), closes [#85](https://github.com/vendure-ecommerce/vendure/issues/85) * **core** Implement access control for custom fields ([8f763b2](https://github.com/vendure-ecommerce/vendure/commit/8f763b2)), closes [#85](https://github.com/vendure-ecommerce/vendure/issues/85) * **core** Improve error messages for invalid custom field inputs ([af13dc2](https://github.com/vendure-ecommerce/vendure/commit/af13dc2)), closes [#85](https://github.com/vendure-ecommerce/vendure/issues/85) ## <small>0.1.2-beta.7 (2019-07-10)</small> #### Features * **admin-ui** Implement deletion of Collections ([1d7ab26](https://github.com/vendure-ecommerce/vendure/commit/1d7ab26)) * **admin-ui** Implement deletion of ProductVariants ([bcc2662](https://github.com/vendure-ecommerce/vendure/commit/bcc2662)) * **admin-ui** Implement editing of ProductOptions ([420793d](https://github.com/vendure-ecommerce/vendure/commit/420793d)) * **admin-ui** Implement integrated ProductVariant creation ([58dad1d](https://github.com/vendure-ecommerce/vendure/commit/58dad1d)), closes [#124](https://github.com/vendure-ecommerce/vendure/issues/124) * **core** Add createProductVariant mutation & tests ([9d74d9d](https://github.com/vendure-ecommerce/vendure/commit/9d74d9d)), closes [#124](https://github.com/vendure-ecommerce/vendure/issues/124) * **core** Implement create and update of ProductOption ([601c766](https://github.com/vendure-ecommerce/vendure/commit/601c766)) * **core** Implement deleteCollection mutation ([051f2f3](https://github.com/vendure-ecommerce/vendure/commit/051f2f3)) * **core** Implement deleteProductVariant mutation ([8b22831](https://github.com/vendure-ecommerce/vendure/commit/8b22831)), closes [#124](https://github.com/vendure-ecommerce/vendure/issues/124) #### Fixes * **admin-ui** Do not hide dropdown panel ([bbbe70d](https://github.com/vendure-ecommerce/vendure/commit/bbbe70d)) * **common** Fix generateAllCombinations edge case ([016adf8](https://github.com/vendure-ecommerce/vendure/commit/016adf8)) * **core** Make ProductOption type fields non-nullable ([0ea150c](https://github.com/vendure-ecommerce/vendure/commit/0ea150c)) * **core** Publish CatalogModificationEvent when variant created ([65d18ee](https://github.com/vendure-ecommerce/vendure/commit/65d18ee)) ### BREAKING CHANGE * The `generateVariantsForProduct` mutation has been removed ## <small>0.1.2-beta.6 (2019-07-03)</small> #### Features * **admin-ui** Add controls to settle authorized payments ([32006ae](https://github.com/vendure-ecommerce/vendure/commit/32006ae)), closes [#117](https://github.com/vendure-ecommerce/vendure/issues/117) * **admin-ui** Display order history timeline ([3f5745d](https://github.com/vendure-ecommerce/vendure/commit/3f5745d)), closes [#118](https://github.com/vendure-ecommerce/vendure/issues/118) * **admin-ui** Implement adding notes to Order history ([1108914](https://github.com/vendure-ecommerce/vendure/commit/1108914)), closes [#118](https://github.com/vendure-ecommerce/vendure/issues/118) * **admin-ui** Implement cancellation & refund flows ([9295a90](https://github.com/vendure-ecommerce/vendure/commit/9295a90)), closes [#121](https://github.com/vendure-ecommerce/vendure/issues/121) * **admin-ui** Implement creating fulfillment for orders ([1a22d0d](https://github.com/vendure-ecommerce/vendure/commit/1a22d0d)), closes [#119](https://github.com/vendure-ecommerce/vendure/issues/119) * **admin-ui** Implement fulfillment controls ([a006545](https://github.com/vendure-ecommerce/vendure/commit/a006545)), closes [#119](https://github.com/vendure-ecommerce/vendure/issues/119) * **admin-ui** Implement manual refund settlement ([66006a1](https://github.com/vendure-ecommerce/vendure/commit/66006a1)), closes [#121](https://github.com/vendure-ecommerce/vendure/issues/121) * **admin-ui** Improve layout of OrderDetailComponent ([c1d8664](https://github.com/vendure-ecommerce/vendure/commit/c1d8664)) * **core** Add settlePayment mutation ([f2b9a12](https://github.com/vendure-ecommerce/vendure/commit/f2b9a12)), closes [#117](https://github.com/vendure-ecommerce/vendure/issues/117) * **core** Allow payment handler to reject settlement ([4cbae46](https://github.com/vendure-ecommerce/vendure/commit/4cbae46)), closes [#117](https://github.com/vendure-ecommerce/vendure/issues/117) * **core** Implement adding notes to an Order ([3682cbf](https://github.com/vendure-ecommerce/vendure/commit/3682cbf)), closes [#118](https://github.com/vendure-ecommerce/vendure/issues/118) * **core** Implement cancelOrder mutation ([a03fec7](https://github.com/vendure-ecommerce/vendure/commit/a03fec7)), closes [#120](https://github.com/vendure-ecommerce/vendure/issues/120) * **core** Implement createFulfillment mutation ([e501578](https://github.com/vendure-ecommerce/vendure/commit/e501578)), closes [#119](https://github.com/vendure-ecommerce/vendure/issues/119) * **core** Implement order history ([e4927c3](https://github.com/vendure-ecommerce/vendure/commit/e4927c3)), closes [#118](https://github.com/vendure-ecommerce/vendure/issues/118) * **core** Implement OrderItem-level cancellation ([35084f3](https://github.com/vendure-ecommerce/vendure/commit/35084f3)), closes [#120](https://github.com/vendure-ecommerce/vendure/issues/120) * **core** Implement Refund mutations ([8870b02](https://github.com/vendure-ecommerce/vendure/commit/8870b02)), closes [#121](https://github.com/vendure-ecommerce/vendure/issues/121) * **core** Implement resolver for Order.fulfillments ([ff0bb0a](https://github.com/vendure-ecommerce/vendure/commit/ff0bb0a)), closes [#119](https://github.com/vendure-ecommerce/vendure/issues/119) * **core** Simplify API for creating Fulfillments ([8cb4c41](https://github.com/vendure-ecommerce/vendure/commit/8cb4c41)) #### Fixes * **core** Fix AssetInterceptor stack overflow with cyclic response ([c90a2a4](https://github.com/vendure-ecommerce/vendure/commit/c90a2a4)) * **core** Make @types/fs-extra a dependency ([37e9865](https://github.com/vendure-ecommerce/vendure/commit/37e9865)) * **elasticsearch-plugin** Close down es client when app closes ([44809a1](https://github.com/vendure-ecommerce/vendure/commit/44809a1)) * **elasticsearch-plugin** Index products when updating by variantIds ([6d243d2](https://github.com/vendure-ecommerce/vendure/commit/6d243d2)) ## <small>0.1.2-beta.5 (2019-06-19)</small> #### Fixes * **admin-ui** Correctly display checkboxes and toggles ([bc42b95](https://github.com/vendure-ecommerce/vendure/commit/bc42b95)) * **admin-ui** Correctly handle boolean configurable inputs ([b5d10c1](https://github.com/vendure-ecommerce/vendure/commit/b5d10c1)), closes [#112](https://github.com/vendure-ecommerce/vendure/issues/112) * **admin-ui** Fix asset picker dialog filtering ([16e7fc1](https://github.com/vendure-ecommerce/vendure/commit/16e7fc1)), closes [#113](https://github.com/vendure-ecommerce/vendure/issues/113) * **admin-ui** Paginate Collections list ([17ac985](https://github.com/vendure-ecommerce/vendure/commit/17ac985)), closes [#114](https://github.com/vendure-ecommerce/vendure/issues/114) * **core** Clean up unused dependencies in DefaultSearchPlugin ([9b3cd26](https://github.com/vendure-ecommerce/vendure/commit/9b3cd26)) * **core** Close worker when app closes when running in main process ([33b2fe1](https://github.com/vendure-ecommerce/vendure/commit/33b2fe1)) * **core** Fix bad imports from common module ([960b647](https://github.com/vendure-ecommerce/vendure/commit/960b647)) * **core** Set worker to run off main process by default ([8e14213](https://github.com/vendure-ecommerce/vendure/commit/8e14213)) * **core** Wait for worker tasks to complete on app shutdown ([2a9fb0b](https://github.com/vendure-ecommerce/vendure/commit/2a9fb0b)) * **core** When populating, run search index builder on main process ([6564d3f](https://github.com/vendure-ecommerce/vendure/commit/6564d3f)) * **create** Run worker on main process when populating ([87dc49a](https://github.com/vendure-ecommerce/vendure/commit/87dc49a)) * **email-plugin** Move server setup to onBootstrap method ([5f7a65e](https://github.com/vendure-ecommerce/vendure/commit/5f7a65e)) #### Features * **core** Display more worker info on bootstrap ([edbcbc4](https://github.com/vendure-ecommerce/vendure/commit/edbcbc4)) * **core** FacetValue Collection filter can specify logical operator ([f136117](https://github.com/vendure-ecommerce/vendure/commit/f136117)), closes [#112](https://github.com/vendure-ecommerce/vendure/issues/112) * **core** Get DefaultSearchPlugin working with new Worker architecture ([6ca2ab4](https://github.com/vendure-ecommerce/vendure/commit/6ca2ab4)), closes [#115](https://github.com/vendure-ecommerce/vendure/issues/115) * **core** Prevent calling bootstrapWorker when runInMainProcess = true ([dc8e173](https://github.com/vendure-ecommerce/vendure/commit/dc8e173)) * **core** Set up worker architecture based on Nest microservices ([508bafd](https://github.com/vendure-ecommerce/vendure/commit/508bafd)), closes [#115](https://github.com/vendure-ecommerce/vendure/issues/115) * **create** Set an env variable during the create process ([b085e49](https://github.com/vendure-ecommerce/vendure/commit/b085e49)) * **create** Update to use separate worker process ([f3560f2](https://github.com/vendure-ecommerce/vendure/commit/f3560f2)) ## <small>0.1.2-beta.4 (2019-06-06)</small> #### Fixes * **admin-ui** Fix background image on login screen ([8066d9b](https://github.com/vendure-ecommerce/vendure/commit/8066d9b)) * **admin-ui** Fix styles to work with Clarity v2 ([6ab33cc](https://github.com/vendure-ecommerce/vendure/commit/6ab33cc)) * **core** Disable index builder worker thread for sql.js ([a49d1a3](https://github.com/vendure-ecommerce/vendure/commit/a49d1a3)) * **core** Fix i18next typing issues after update ([41a3e7a](https://github.com/vendure-ecommerce/vendure/commit/41a3e7a)) * **core** Fix TypeScript errors arising in v3.5.1 ([8e78450](https://github.com/vendure-ecommerce/vendure/commit/8e78450)) * **core** Queue concurrent search index writes to avoid key conflicts ([ae1145a](https://github.com/vendure-ecommerce/vendure/commit/ae1145a)) #### Features * **admin-ui** Display background jobs in UI ([59d8312](https://github.com/vendure-ecommerce/vendure/commit/59d8312)), closes [#111](https://github.com/vendure-ecommerce/vendure/issues/111) * **admin-ui** Improve polling logic for jobs ([ced3990](https://github.com/vendure-ecommerce/vendure/commit/ced3990)) * **admin-ui** Update to Angular 8 ([cb69306](https://github.com/vendure-ecommerce/vendure/commit/cb69306)) * **core** Background thread search indexing ([b78354e](https://github.com/vendure-ecommerce/vendure/commit/b78354e)) * **core** Create async job manager for long-running tasks ([a83945a](https://github.com/vendure-ecommerce/vendure/commit/a83945a)), closes [#111](https://github.com/vendure-ecommerce/vendure/issues/111) * **core** Process all updates to the search index on worker thread ([fe40641](https://github.com/vendure-ecommerce/vendure/commit/fe40641)) * **core** Update TypeORM to 0.2.18, compatible with sql.js 1.0 ([7eda23b](https://github.com/vendure-ecommerce/vendure/commit/7eda23b)) * **core** Use batching when reindexing search index ([40c5946](https://github.com/vendure-ecommerce/vendure/commit/40c5946)) * **core** Use batching when updating collection filters ([325b807](https://github.com/vendure-ecommerce/vendure/commit/325b807)) ### BREAKING CHANGE * The `reindex` mutation now returns a JobInfo type, which has an id that can then be polled via the new `job` query as to its progress and status. ## <small>0.1.2-beta.3 (2019-05-31)</small> #### Features * **admin-ui** Allow custom error messages passed to FormFieldComponent ([220d861](https://github.com/vendure-ecommerce/vendure/commit/220d861)) * **admin-ui** Update slug in product detail form after save ([2cecb39](https://github.com/vendure-ecommerce/vendure/commit/2cecb39)) * **admin-ui** Validate slug pattern in product detail form ([29509d8](https://github.com/vendure-ecommerce/vendure/commit/29509d8)), closes [#103](https://github.com/vendure-ecommerce/vendure/issues/103) * **core** Allow custom fields to be set on OrderLine ([a4b7e07](https://github.com/vendure-ecommerce/vendure/commit/a4b7e07)), closes [#109](https://github.com/vendure-ecommerce/vendure/issues/109) * **core** Allow product to be queried by slug ([a2d847d](https://github.com/vendure-ecommerce/vendure/commit/a2d847d)), closes [#108](https://github.com/vendure-ecommerce/vendure/issues/108) * **core** Enforce unique slugs for Products ([d8d5fcc](https://github.com/vendure-ecommerce/vendure/commit/d8d5fcc)), closes [#103](https://github.com/vendure-ecommerce/vendure/issues/103) * **core** Normalize product slug values ([e2235cb](https://github.com/vendure-ecommerce/vendure/commit/e2235cb)), closes [#103](https://github.com/vendure-ecommerce/vendure/issues/103) * **core** Rename SearchInput facetIds arg to facetValueIds ([8b116b2](https://github.com/vendure-ecommerce/vendure/commit/8b116b2)) #### Fixes * **asset-server-plugin** Fix type of assetUrlPrefix option ([d753f0e](https://github.com/vendure-ecommerce/vendure/commit/d753f0e)) * **core** Configure GraphQL Playground to include credentials ([4429730](https://github.com/vendure-ecommerce/vendure/commit/4429730)), closes [#107](https://github.com/vendure-ecommerce/vendure/issues/107) * **core** Do not list deleted productVariants in a Collection ([e1fecbb](https://github.com/vendure-ecommerce/vendure/commit/e1fecbb)), closes [#100](https://github.com/vendure-ecommerce/vendure/issues/100) * **core** Do not throw when deleting Facet with no FacetValues ([f7d337f](https://github.com/vendure-ecommerce/vendure/commit/f7d337f)), closes [#105](https://github.com/vendure-ecommerce/vendure/issues/105) * **core** Fix bad common import paths ([6a54be3](https://github.com/vendure-ecommerce/vendure/commit/6a54be3)) * **core** Fix error when searching ShopAPI with postgres ([f05360b](https://github.com/vendure-ecommerce/vendure/commit/f05360b)), closes [#99](https://github.com/vendure-ecommerce/vendure/issues/99) * **core** Fix postgres error when specifying custom fields ([d8b6c47](https://github.com/vendure-ecommerce/vendure/commit/d8b6c47)), closes [#85](https://github.com/vendure-ecommerce/vendure/issues/85) [#101](https://github.com/vendure-ecommerce/vendure/issues/101) * **email-plugin** Fix bad common import paths ([077fd6d](https://github.com/vendure-ecommerce/vendure/commit/077fd6d)) ### BREAKING CHANGE * The "facetIds" field of the SearchInput type has been renamed to "facetValueIds" to better reflect the expected id type. * This change allows custom fields to be defined on the OrderLine entity. When they are, then the "addItemToOrder" mutation will accept a third argument - "customFields", which matches the fields specified in the config. Additionally, a couple of mutations have been renamed: "removeItemFromOrder" -> "removeOrderLine", "adjustItemQuantity" -> "adjustOrderLine" and their "orderItemId" argument has been renamed to "orderLineId". ## <small>0.1.2-beta.2 (2019-05-24)</small> #### Fixes * **core** Fix CollectionBreadcrumb.name error ([5b6f93a](https://github.com/vendure-ecommerce/vendure/commit/5b6f93a)), closes [#97](https://github.com/vendure-ecommerce/vendure/issues/97) * **core** Fix intermittent "no active session" errors ([1313ca7](https://github.com/vendure-ecommerce/vendure/commit/1313ca7)) #### Features * **asset-server-plugin** Allow url prefix to be set in options ([c0ea092](https://github.com/vendure-ecommerce/vendure/commit/c0ea092)) ## <small>0.1.2-beta.1 (2019-05-22)</small> #### Fixes * **admin-ui** Fix publish flow to ensure correct version in UI ([dc52814](https://github.com/vendure-ecommerce/vendure/commit/dc52814)) ## <small>0.1.2-beta.0 (2019-05-22)</small> #### Fixes * **admin-ui** Correctly display configurable money values ([3546071](https://github.com/vendure-ecommerce/vendure/commit/3546071)) * **admin-ui** Correctly sort assets ([e57450b](https://github.com/vendure-ecommerce/vendure/commit/e57450b)) * **admin-ui** Do not run CanDeactivateGuard when switching tabs ([d8e6258](https://github.com/vendure-ecommerce/vendure/commit/d8e6258)) * **admin-ui** Fix boolean configurable input ([994264d](https://github.com/vendure-ecommerce/vendure/commit/994264d)) * **admin-ui** Fix creation of zone from country list ([0aa0bc8](https://github.com/vendure-ecommerce/vendure/commit/0aa0bc8)) * **admin-ui** Fix error with rich text editor (trix) ([b42ead6](https://github.com/vendure-ecommerce/vendure/commit/b42ead6)) * **admin-ui** Replace all clr-dropdown with vdr-dropdown ([4de2a6a](https://github.com/vendure-ecommerce/vendure/commit/4de2a6a)), closes [#95](https://github.com/vendure-ecommerce/vendure/issues/95) * **admin-ui** Reset page when filters changed in product list ([c9325b6](https://github.com/vendure-ecommerce/vendure/commit/c9325b6)) * **core** Add missing timestamp fields to Asset GraphQL type ([1c543db](https://github.com/vendure-ecommerce/vendure/commit/1c543db)) * **core** Add property resolver for Collection.featuredAsset ([cd367a7](https://github.com/vendure-ecommerce/vendure/commit/cd367a7)) * **core** Check existence of ProductVariant before updating ([fe5eedd](https://github.com/vendure-ecommerce/vendure/commit/fe5eedd)) * **core** Correctly intercept top-level Assets ([d767a9d](https://github.com/vendure-ecommerce/vendure/commit/d767a9d)) * **core** Correctly update country in customer address ([75f9492](https://github.com/vendure-ecommerce/vendure/commit/75f9492)) * **core** Fix bad import paths ([e126d2e](https://github.com/vendure-ecommerce/vendure/commit/e126d2e)) * **core** Fix bug which created new address for each order placed ([8703e25](https://github.com/vendure-ecommerce/vendure/commit/8703e25)) * **core** Fix error when updating variant stock level ([57c5499](https://github.com/vendure-ecommerce/vendure/commit/57c5499)) * **core** Fix reordering of collections ([75f8858](https://github.com/vendure-ecommerce/vendure/commit/75f8858)), closes [#75](https://github.com/vendure-ecommerce/vendure/issues/75) * **core** Fix search.facetValues resolver error ([ecfbf56](https://github.com/vendure-ecommerce/vendure/commit/ecfbf56)) * **core** Fix type error (missing isPrivate property) ([4d1cd65](https://github.com/vendure-ecommerce/vendure/commit/4d1cd65)) * **core** Implement property resolver for Collection.children ([e5f614e](https://github.com/vendure-ecommerce/vendure/commit/e5f614e)) * **core** Prevent race conditions when updating search index ([8872a94](https://github.com/vendure-ecommerce/vendure/commit/8872a94)) * **core** Relax engines check for Yarn ([9c4f8fb](https://github.com/vendure-ecommerce/vendure/commit/9c4f8fb)) * **core** Typo in mock product data ([cf0f842](https://github.com/vendure-ecommerce/vendure/commit/cf0f842)) * **email-plugin** Fix failing test ([cf2acbf](https://github.com/vendure-ecommerce/vendure/commit/cf2acbf)) #### Features * **admin-ui** Add ApiType to RequestContext ([9b55c17](https://github.com/vendure-ecommerce/vendure/commit/9b55c17)) * **admin-ui** Add asset preview dialog ([34413ce](https://github.com/vendure-ecommerce/vendure/commit/34413ce)) * **admin-ui** Add controls for stockOnHand & trackInventory ([4e021b8](https://github.com/vendure-ecommerce/vendure/commit/4e021b8)), closes [#81](https://github.com/vendure-ecommerce/vendure/issues/81) * **admin-ui** Add enabled/disabled toggle to ProductVariants ([406ab28](https://github.com/vendure-ecommerce/vendure/commit/406ab28)), closes [#62](https://github.com/vendure-ecommerce/vendure/issues/62) * **admin-ui** Add input for configurable string operators ([b5a07d1](https://github.com/vendure-ecommerce/vendure/commit/b5a07d1)), closes [#71](https://github.com/vendure-ecommerce/vendure/issues/71) * **admin-ui** Add toggle to enable/disable Product ([a117bbe](https://github.com/vendure-ecommerce/vendure/commit/a117bbe)), closes [#62](https://github.com/vendure-ecommerce/vendure/issues/62) * **admin-ui** Add UI controls for making Collections private ([4f17d3e](https://github.com/vendure-ecommerce/vendure/commit/4f17d3e)), closes [#71](https://github.com/vendure-ecommerce/vendure/issues/71) * **admin-ui** Add UI controls for private Facets ([290a576](https://github.com/vendure-ecommerce/vendure/commit/290a576)), closes [#80](https://github.com/vendure-ecommerce/vendure/issues/80) * **admin-ui** Collapse settings menu group by default ([c8539de](https://github.com/vendure-ecommerce/vendure/commit/c8539de)) * **admin-ui** Create ProductSearchInput bar ([0668443](https://github.com/vendure-ecommerce/vendure/commit/0668443)) * **admin-ui** Implement custom dropdown based on CDK Overlay ([409bb16](https://github.com/vendure-ecommerce/vendure/commit/409bb16)), closes [#95](https://github.com/vendure-ecommerce/vendure/issues/95) * **admin-ui** Improve collection list & child collection creation ([c996fa7](https://github.com/vendure-ecommerce/vendure/commit/c996fa7)) * **admin-ui** Improve layout of ProductVariantList card ([8ecd2c3](https://github.com/vendure-ecommerce/vendure/commit/8ecd2c3)) * **admin-ui** Link up product filters with url ([8aab908](https://github.com/vendure-ecommerce/vendure/commit/8aab908)) * **admin-ui** Make facet list values expandable ([13ce943](https://github.com/vendure-ecommerce/vendure/commit/13ce943)) * **admin-ui** More styling for product variant list ([0522e5c](https://github.com/vendure-ecommerce/vendure/commit/0522e5c)) * **admin-ui** Numerous style tweaks ([14ee458](https://github.com/vendure-ecommerce/vendure/commit/14ee458)) * **admin-ui** Reindex search index from product list ([de7f22d](https://github.com/vendure-ecommerce/vendure/commit/de7f22d)) * **admin-ui** Restyle form inputs ([438802d](https://github.com/vendure-ecommerce/vendure/commit/438802d)), closes [#60](https://github.com/vendure-ecommerce/vendure/issues/60) * **admin-ui** Set the global trackInventory setting ([bf4185b](https://github.com/vendure-ecommerce/vendure/commit/bf4185b)), closes [#81](https://github.com/vendure-ecommerce/vendure/issues/81) * **admin-ui** Standardise colour palette ([9cb73ae](https://github.com/vendure-ecommerce/vendure/commit/9cb73ae)), closes [#41](https://github.com/vendure-ecommerce/vendure/issues/41) * **admin-ui** Table view for product variants ([058749a](https://github.com/vendure-ecommerce/vendure/commit/058749a)) * **core** Add "enabled" field to Product & ProductVariant ([a877853](https://github.com/vendure-ecommerce/vendure/commit/a877853)), closes [#62](https://github.com/vendure-ecommerce/vendure/issues/62) * **core** Add "enabled" field to search index, add & fix e2e tests ([fcd3086](https://github.com/vendure-ecommerce/vendure/commit/fcd3086)), closes [#62](https://github.com/vendure-ecommerce/vendure/issues/62) * **core** Add isPrivate flag to Collection ([848c8b4](https://github.com/vendure-ecommerce/vendure/commit/848c8b4)), closes [#71](https://github.com/vendure-ecommerce/vendure/issues/71) * **core** Correctly handle disabled field for grouped search ([56cad72](https://github.com/vendure-ecommerce/vendure/commit/56cad72)), closes [#62](https://github.com/vendure-ecommerce/vendure/issues/62) * **core** Create entities & fields needed for stock control ([aace38f](https://github.com/vendure-ecommerce/vendure/commit/aace38f)), closes [#81](https://github.com/vendure-ecommerce/vendure/issues/81) * **core** Create Logger service ([65445cb](https://github.com/vendure-ecommerce/vendure/commit/65445cb)), closes [#86](https://github.com/vendure-ecommerce/vendure/issues/86) * **core** Create Sale stock movements when Order is completed ([e0a0441](https://github.com/vendure-ecommerce/vendure/commit/e0a0441)), closes [#81](https://github.com/vendure-ecommerce/vendure/issues/81) * **core** Create StockMovements when variant stock changed ([f8521db](https://github.com/vendure-ecommerce/vendure/commit/f8521db)), closes [#81](https://github.com/vendure-ecommerce/vendure/issues/81) * **core** Create workflow for updating a Customer email address ([f8065de](https://github.com/vendure-ecommerce/vendure/commit/f8065de)), closes [#87](https://github.com/vendure-ecommerce/vendure/issues/87) * **core** Export populate-collections CLI command ([0aef0b7](https://github.com/vendure-ecommerce/vendure/commit/0aef0b7)) * **core** Expose init CLI command ([4d5f0d9](https://github.com/vendure-ecommerce/vendure/commit/4d5f0d9)) * **core** Implement CollectionFilter based on ProductVariant name ([18549c7](https://github.com/vendure-ecommerce/vendure/commit/18549c7)), closes [#71](https://github.com/vendure-ecommerce/vendure/issues/71) * **core** Implement private Facets ([b6c3240](https://github.com/vendure-ecommerce/vendure/commit/b6c3240)), closes [#80](https://github.com/vendure-ecommerce/vendure/issues/80) * **core** Implement tax on shipping ([1b13aa3](https://github.com/vendure-ecommerce/vendure/commit/1b13aa3)), closes [#54](https://github.com/vendure-ecommerce/vendure/issues/54) * **core** Improved logging messages on bootstrap ([9efada8](https://github.com/vendure-ecommerce/vendure/commit/9efada8)), closes [#86](https://github.com/vendure-ecommerce/vendure/issues/86) * **core** Publish events on login/logout ([5ab83da](https://github.com/vendure-ecommerce/vendure/commit/5ab83da)), closes [#53](https://github.com/vendure-ecommerce/vendure/issues/53) * **core** Richer mock data ([089282e](https://github.com/vendure-ecommerce/vendure/commit/089282e)), closes [#96](https://github.com/vendure-ecommerce/vendure/issues/96) * **core** Update import CSV format to include stock fields ([3f732ab](https://github.com/vendure-ecommerce/vendure/commit/3f732ab)), closes [#81](https://github.com/vendure-ecommerce/vendure/issues/81) * **core** Use Logger to log TypeORM logs ([5966bec](https://github.com/vendure-ecommerce/vendure/commit/5966bec)), closes [#86](https://github.com/vendure-ecommerce/vendure/issues/86) * **create** Better error reporting on DB connection issues. ([1a7dc05](https://github.com/vendure-ecommerce/vendure/commit/1a7dc05)), closes [#90](https://github.com/vendure-ecommerce/vendure/issues/90) * **create** Update config with latest email-plugin API changes ([b2277c5](https://github.com/vendure-ecommerce/vendure/commit/b2277c5)) * **email-plugin** Create dev mode mailbox server ([e38075f](https://github.com/vendure-ecommerce/vendure/commit/e38075f)) * **email-plugin** Create handler for email address change ([8a5907e](https://github.com/vendure-ecommerce/vendure/commit/8a5907e)), closes [#87](https://github.com/vendure-ecommerce/vendure/issues/87) * **email-plugin** Generate test emails from dev mailbox ([35105ec](https://github.com/vendure-ecommerce/vendure/commit/35105ec)) * **email-plugin** Highlight open email in dev mailbox ([3fac1ac](https://github.com/vendure-ecommerce/vendure/commit/3fac1ac)) * **email-plugin** Improve styling of email templates ([8f0c6e7](https://github.com/vendure-ecommerce/vendure/commit/8f0c6e7)) * **email-plugin** Introduce globalTemplateVars option ([407d232](https://github.com/vendure-ecommerce/vendure/commit/407d232)) * **email-plugin** Simplify email config API ([d35420a](https://github.com/vendure-ecommerce/vendure/commit/d35420a)), closes [#88](https://github.com/vendure-ecommerce/vendure/issues/88)
# Contribution Guidelines Hi! Thank you for taking the time to contribute to Vendure! In order to make the best use of both your time and that of the Vendure maintainers, please follow the guidelines in this document. ## Branches There are 3 important branches to know about: * `master` - the default branch * `minor` - a branch for commits which introduce new features which would go in the next [SemVer minor](https://semver.org/) release. * `major` - a branch for commits which introduce breaking changes which would go in the next [SemVer major](https://semver.org/) release. Bug fixes should go direct in the `master` branch, from which new patch releases will be made regularly. Periodically the master branch will be merged into the `minor` and `major` branches. ## Bug fixes If you would like to contribute a bugfix, please first create an issue detailing the bug, and indicate that you intend to fix it. When creating commits, please follow the commit message format below. ## New features Again, please create a feature request detailing the functionality you intend to add, and state that you would like to implement it. When creating commits, please follow the commit message format below. New feature pull requests should be made against the `minor` branch. When adding new public APIs to support your new feature, add a `@since 1.2.0` tag (where "1.2.0" corresponds to what will be the next minor version) to the doc block. This will let readers of the documentation know the version in which the API was introduced. See the [docs readme](./docs/README.md) for more details on the valid docs tags. ```TypeScript /** * @description * Sets the value of the new API thing. * * @since 1.2.0 */ myNewApi: number; ``` ## Commit message format This repo uses [Conventional Commits](https://www.conventionalcommits.org). ``` type(scope): Message in present tense ``` `type` may be one of: * **feat** (new feature) * **fix** (bug fix) * **docs** (changes to documentation) * **perf** (performance improvements) * **style** (formatting, missing semi colons, etc; no code change) * **refactor** (refactoring production code) * **test** (adding missing tests, refactoring tests; no production code change) * **chore** (updating build tasks etc; no production code change) `scope` indicates the package affected by the commit: * admin-ui * admin-ui-plugin * asset-server-plugin * common * core * create * email-plugin * etc. If a commit affects more than one package, separate them with a comma: ``` fix(core,common): Fix the thing ``` If a commit applies to no particular package (e.g. a tooling change in the root package.json), the scope can be omitted. #### Breaking Changes If your contribution includes any breaking changes (including any changes to the DB schema; backwards-incompatible changes to the GraphQL APIs or VendureConfig; backwards-incompatible changes to current behavior), please include a `BREAKING CHANGE` section in your commit message as per the [Conventional Commits specification](https://www.conventionalcommits.org/en/v1.0.0/#commit-message-with-both-and-breaking-change-footer). Please also make your pull request against the `major` branch rather than `master` in the case of breaking changes. Example: ``` feat(core): Add new field to Customer Relates to #123. This commit adds the "foo" field to the Custom entity. BREAKING CHANGE: A DB migration will be required in order to add the new "foo" field to the customer table. ``` #### Linting Commit messages are linted on commit, so you'll know if your message is not quite right. ## Setting up the dev environment After cloning the Vendure repo, please follow the [Development guide](https://github.com/vendure-ecommerce/vendure/blob/master/README.md#development) in the README for instructions on how to get up and running locally. ## Contributing Admin UI translations If you wish to contribute translations of the Admin UI into another language (or improve an existing set of translations), please see the [Localization guide](https://github.com/vendure-ecommerce/vendure/blob/master/packages/admin-ui/README.md#localization) in the admin-ui package.
# Vendure An open-source headless commerce platform built on [Node.js](https://nodejs.org) with [GraphQL](https://graphql.org/), [Nest](https://nestjs.com/) & [TypeScript](http://www.typescriptlang.org/), with a focus on developer productivity and ease of customization. [![Build Status](https://github.com/vendure-ecommerce/vendure/workflows/Build%20&%20Test/badge.svg)](https://github.com/vendure-ecommerce/vendure/actions) ![Publish & Install](https://github.com/vendure-ecommerce/vendure/workflows/Publish%20&%20Install/badge.svg) [![lerna](https://img.shields.io/badge/maintained%20with-lerna-cc00ff.svg)](https://lernajs.io/) ![vendure_github_banner (1)](https://github.com/vendure-ecommerce/vendure/assets/6275952/0e25b1c7-a648-44a1-ba00-60012f0e7aaa) ### [www.vendure.io](https://www.vendure.io/) * [Getting Started](https://docs.vendure.io/getting-started/): Get Vendure up and running locally in a matter of minutes with a single command * [Live Demo](https://demo.vendure.io/) * [Vendure Discord](https://www.vendure.io/community) Join us on Discord for support and answers to your questions ## Branches - `master` - The latest stable release, currently the 2.x series. - `minor` - The next patch release, including new features - `major` - The next major release (v3.0) - `v1` - The 1.x series, which is no longer actively developed but may still receive critical fixes. ## Structure This project is a monorepo managed with [Lerna](https://github.com/lerna/lerna). Several npm packages are published from this repo, which can be found in the `packages/` directory. ``` vendure/ ├── docs/ # Documentation source ├── e2e-common/ # Shared config for package e2e tests ├── packages/ # Source for the Vendure server, admin-ui & plugin packages ├── scripts/ ├── changelog/ # Scripts used to generate the changelog based on the git history ├── codegen/ # Scripts used to generate TypeScript code from the GraphQL APIs ├── docs/ # Scripts used to generate documentation markdown from the source ``` ## Development The following instructions are for those who want to develop the Vendure core framework or plugins (e.g. if you intend to make a pull request). For instructions on how to build a project *using* Vendure, please see the [Getting Started guide](https://www.vendure.io/docs/getting-started/). ### 1. Install top-level dependencies `npm install` The root directory has a `package.json` which contains build-related dependencies for tasks including: * Building & deploying the docs * Generating TypeScript types from the GraphQL schema * Linting, formatting & testing tasks to run on git commit & push ### 2. Build all packages `npm run build` Packages must be built (i.e. TypeScript compiled, admin ui app built, certain assets copied etc.) before being used. Note that this can take a few minutes. ### 3. Set up the server The server requires an SQL database to be available. The simplest option is to use SQLite, but if you have Docker available you can use the [dev-server docker-compose file](./packages/dev-server/docker-compose.yml) which will start up both MariaDB and Postgres as well as their GUI management tools. Vendure uses [TypeORM](http://typeorm.io), and officially supports **MySQL**, **PostgreSQL** and **SQLite**, though other TypeORM-supported databases may work. 1. Configure the [dev config](./packages/dev-server/dev-config.ts), making sure the connection settings in the `getDbConfig()` function are correct for the database type you will be using. 2. Create the database using your DB admin tool of choice (e.g. phpMyAdmin if you are using the docker image suggested above). Name it according to the `getDbConfig()` settings. If you are using SQLite, you can skip this step. 3. Populate mock data: ```bash cd packages/dev-server DB=<mysql|postgres|sqlite> npm run populate ``` If you do not specify the `DB` variable, it will default to "mysql". ### 4. Run the dev server ``` cd packages/dev-server DB=<mysql|postgres|sqlite> npm run start ``` Or if you are in the root package ``` DB=<mysql|postgres|sqlite> npm run dev-server:start ``` If you do not specify the `DB` argument, it will default to "mysql". ### Testing admin ui changes locally If you are making changes to the admin ui, you need to start the admin ui independent from the dev-server: 1. `cd packages/admin-ui` 2. `npm run start` 3. Go to http://localhost:4200 and log in with "superadmin", "superadmin" This will auto restart when you make changes to the admin ui. You don't need this step when you just use the admin ui just to test backend changes. ### Testing your changes locally This example shows how to test changes to the `payments-plugin` package locally, but it will also work for other packages. 1. Open 2 terminal windows: - Terminal 1 for watching and compiling the changes of the package you are developing - Terminal 2 for running the dev-server ```shell # Terminal 1 cd packages/payments-plugin npm run watch ``` :warning: If you are developing changes for the `core`package, you also need to watch the `common` package: ```shell # Terminal 1 # Root of the project npm run watch:core-common ``` 2. After the changes in your package are compiled you have to stop and restart the dev-server: ```shell # Terminal 2 cd packages/dev-server DB=sqlite npm run start ``` 3. The dev-server will now have your local changes from the changed package. ### Code generation [graphql-code-generator](https://github.com/dotansimha/graphql-code-generator) is used to automatically create TypeScript interfaces for all GraphQL server operations and admin ui queries. These generated interfaces are used in both the admin ui and the server. Running `npm run codegen` will generate the following files: * [`packages/common/src/generated-types.ts`](./packages/common/src/generated-types.ts): Types, Inputs & resolver args relating to the Admin API * [`packages/common/src/generated-shop-types.ts`](./packages/common/src/generated-shop-types.ts): Types, Inputs & resolver args relating to the Shop API * [`packages/admin-ui/src/lib/core/src/common/generated-types.ts`](./packages/admin-ui/src/lib/core/src/common/generated-types.ts): Types & operations relating to the admin-ui queries & mutations. * [`packages/admin-ui/src/lib/core/src/common/introspection-result.ts`](./packages/admin-ui/src/lib/core/src/common/introspection-result.ts): Used by the Apollo Client [`IntrospectionFragmentMatcher`](https://www.apollographql.com/docs/react/data/fragments/#fragments-on-unions-and-interfaces) to correctly handle fragments in the Admin UI. * Also generates types used in e2e tests in those packages which feature e2e tests (core, elasticsearch-plugin, asset-server-plugin etc). ### Testing #### Server Unit Tests The core and several other packages have unit tests which are can be run all together by running `npm run test` from the root directory, or individually by running it from the package directory. Unit tests are co-located with the files which they test, and have the suffix `.spec.ts`. #### End-to-end Tests Certain packages have e2e tests, which are located at `/packages/<name>/e2e/`. All e2e tests can be run by running `npm run e2e` from the root directory, or individually by running it from the package directory. e2e tests use the `@vendure/testing` package. For details of how the setup works, see the [Testing docs](https://www.vendure.io/docs/developer-guide/testing/) When **debugging e2e tests**, set an environment variable `E2E_DEBUG=true` which will increase the global Jest timeout and allow you to step through the e2e tests without the tests automatically failing due to timeout. ### Release Process All packages in this repo are released at every version change (using [Lerna's fixed mode](https://github.com/lerna/lerna#fixedlocked-mode-default)). This simplifies both the development (tracking multiple disparate versions is tough) and also the developer experience for users of the framework (it is simple to see that all packages are up-to-date and compatible). To make a release: ##### 1. `npm run publish-release` It will run `lerna publish` which will prompt for which version to update to. Although we are using [conventional commits](https://www.conventionalcommits.org), the version is not automatically being calculated from the commit messages. Therefore the next version should be manually selected. Next it will build all packages to ensure the distributed files are up to date. Finally the command will create changelog entries for this release. ##### 2. `git push origin master --follow-tags` The reason we do not rely on Lerna to push the release to Git is that this repo has a lengthy pre-push hook which runs all tests and builds the admin ui. This long wait then invalidates the npm OTP and the publish will fail. So the solution is to publish first and then push. ## License MIT
# Security Policy ## Supported Versions | Version | Supported | | ------- | ------------------ | | 1.x.x | :white_check_mark: | | < 1.0 | :x: | ## Reporting a Vulnerability To report a security vulnarability, email [contact@vendure.io](mailto:contact@vendure.io).
# Vendure Code of Conduct ## Scope This code of conduct applies to those who wish to contribute to the Vendure project (any repo under the [vendure-ecommerce](https://github.com/vendure-ecommerce) organization) by way of issues and pull requests. It also applies to official project communications channels such as Discord. ## Standards Contributors should conduct themselves according to these guidelines: 1. Treat others as you would wish to be treated. 2. Keep your communication professional<sup>1</sup>. 3. Refrain from unkind or inflammatory communications. ## Enforcement Contributors and other community members can and should enforce the standard above. The mark of an effective and cohesive group is that the individual members enforce the mores of the group. However, in certain circumstances a report to the project maintainers may be warranted. In this case, contact us at *contact@vendure.io* so we can deal with it in an appropriate manner. --- <sup>1</sup>*Definition of "professional":* 1) characterized by or conforming to the technical or ethical standards of a profession 2) exhibiting a courteous, conscientious, and generally businesslike manner in the workplace [source: [www.merriam-webster.com](https://www.merriam-webster.com/dictionary/professional)]
# Description Please include a summary of the changes and the related issue. # Breaking changes Does this PR include any breaking changes we should be aware of? # Screenshots You can add screenshots here if applicable. # Checklist 📌 Always: - [ ] I have set a clear title - [ ] My PR is small and contains a single feature - [ ] I have [checked my own PR](## "Fix typo's and remove unused or commented out code") 👍 Most of the time: - [ ] I have added or updated test cases - [ ] I have updated the README if needed
--- name: Bug report about: Something not working as it should title: '' labels: "type: bug \U0001F41B" assignees: michaelbromley --- **Describe the bug** A clear and concise description of what the bug is. **To Reproduce** Steps to reproduce the behavior: 1. Go to '...' 2. Click on '....' 3. Scroll down to '....' 4. See error **Expected behavior** A clear and concise description of what you expected to happen. **Environment (please complete the following information):** - @vendure/core version: - Nodejs version - Database (mysql/postgres etc): **Additional context** Add any other context about the problem here.
--- name: Feature request about: Suggest an idea for this project title: '' labels: '' assignees: '' --- **Is your feature request related to a problem? Please describe.** A clear and concise description of what the problem is. Ex. I'm always frustrated when [...] **Describe the solution you'd like** A clear and concise description of what you want to happen. **Describe alternatives you've considered** A clear and concise description of any alternative solutions or features you've considered. **Additional context** Add any other context or screenshots about the feature request here.
# Website This website is built using [Docusaurus 2](https://docusaurus.io/), a modern static website generator. ### Installation ``` $ npm run ``` ### Local Development ``` $ npm run start ``` This command starts a local development server and opens up a browser window. Most changes are reflected live without having to restart the server. ### Build ``` $ npm run build ``` This command generates static content into the `build` directory and can be served using any static contents hosting service. ### Deployment Using SSH: ``` $ USE_SSH=true npm run deploy ``` Not using SSH: ``` $ GIT_USER=<Your GitHub username> npm run deploy ``` If you are using GitHub pages for hosting, this command is a convenient way to build the website and push to the `gh-pages` branch.
--- title: "Custom Template Loader" weight: 10 date: 2023-07-14T16:57:50.756Z showtoc: true generated: true --- <!-- This file was generated from the Vendure source. Do not modify. Instead, re-run the "docs:build" script --> # Custom Template Loader <div class="symbol"> # TemplateLoader {{< generation-info sourceFile="packages/email-plugin/src/types.ts" sourceLine="390" packageName="@vendure/email-plugin">}} Load an email template based on the given request context, type and template name and return the template as a string. *Example* ```TypeScript import { EmailPlugin, TemplateLoader } from '@vendure/email-plugin'; class MyTemplateLoader implements TemplateLoader { loadTemplate(injector, ctx, { type, templateName, templateVars }){ return myCustomTemplateFunction(ctx); } } // In vendure-config.ts: ... EmailPlugin.init({ templateLoader: new MyTemplateLoader() ... }) ``` ## Signature ```TypeScript interface TemplateLoader { loadTemplate(injector: Injector, ctx: RequestContext, input: LoadTemplateInput): Promise<string>; loadPartials?(): Promise<Partial[]>; } ``` ## Members ### loadTemplate {{< member-info kind="method" type="(injector: <a href='/typescript-api/common/injector#injector'>Injector</a>, ctx: <a href='/typescript-api/request/request-context#requestcontext'>RequestContext</a>, input: LoadTemplateInput) => Promise&#60;string&#62;" >}} {{< member-description >}}{{< /member-description >}} ### loadPartials {{< member-info kind="method" type="() => Promise&#60;Partial[]&#62;" >}} {{< member-description >}}{{< /member-description >}} </div>
--- title: TODO --- This part still needs to be written! ``` ( ° ᴗ°)~ð (/❛o❛\) ```
--- title: 'Auth' --- **Authentication** is the process of determining the identity of a user. Common ways of authenticating a user are by asking the user for secret credentials (username & password) or by a third-party authentication provider such as Facebook or Google login. **Authorization** is a related concept, which means that once we have verified the identity of a user, we can then determine what that user is allowed to do. For example, a user may be authorized to view a product, but not to edit it. The term **auth** is shorthand for _both_ authentication and authorization. Auth in Vendure applies to both **administrators** and **customers**. Authentication is controlled by the configured `AuthenticationStrategies`, and authorization is controlled by the configured `Roles` and `Permissions`. ## Administrator auth Administrators are required to authenticate before they can perform any operations in the Admin API. Here is a diagram of the parts that make up Administrator authentication: ![Administrator authentication](./admin.webp) Roles can be created to allow fine-grained control over what a particular administrator has access to (see the section below). ## Customer auth Customer only need to authenticate if they want to access a restricted operation related to their account, such as viewing past orders or updating an address. Here are the parts that make up Customer authentication: ![Customer authentication](./customer.webp) ### Guest customers Vendure also supports **guest customers**, meaning that a customer can place an order without needing to register an account, and thus not getting an associated user or role. A guest customer, having no roles and thus no permissions, is then unable to view past orders or access any other restricted API operations. However, a guest customer can at a later point register an account using the same email address, at which point they will get a user with the "Customer" role, and be able to view their past orders. ## Roles & Permissions Both the `Customer` and `Administrator` entities relate to a single [`User`](/reference/typescript-api/entities/user/) entity which in turn has one or more [`Roles`](/reference/typescript-api/entities/role/) for controlling permissions. ![Administrators & Roles](./admin-role.webp) In the example above, the administrator Sam Bailey has two roles assigned: "Order Manager" and "Catalog Manager". An administrator can have any number of roles assigned, and the permissions of all roles are combined to determine the permissions of the administrator. In this way, you can have fine-grained control over which administrators can perform which actions. There are 2 special roles which are created by default and cannot be changed: - **SuperAdmin**: This role has all permissions, and cannot be edited or deleted. It is assigned to the first administrator created when the server is started. - **Customer**: This role is assigned to all registered customers. All other roles can be user-defined. Here's an example of an "Inventory Manager" role being defined in the Admin UI: ![Inventory Manager role](./roles.webp) ## Native authentication By default, Vendure uses a username/email address and password to authenticate users, which is implemented by the [`NativeAuthenticationStrategy`](/reference/typescript-api/auth/native-authentication-strategy/). There is a `login` mutation available in both the Shop API and Admin API which allows a customer or administrator to authenticate using native authentication: ```graphql title="Admin API" mutation { login(username: "superadmin", password: "superadmin") { ...on CurrentUser { id identifier } ...on ErrorResult { errorCode message } } } ``` :::info See the [Managing Sessions guide](/guides/storefront/connect-api/#managing-sessions) for how to manage authenticated sessions in your storefront/client applications. ::: ## External authentication In addition to the built-in `NativeAuthenticationStrategy`, it is possible to define a custom [`AuthenticationStrategy`](/reference/typescript-api/auth/authentication-strategy) which allows your Vendure server to support other authentication methods such as: - Social logins (Facebook, Google, GitHub, etc.) - Single Sign-On (SSO) providers such as Keycloak, Auth0, etc. - Alternative factors such as SMS, TOTP, etc. Custom authentication strategies are set via the [`VendureConfig.authOptions` object](/reference/typescript-api/auth/auth-options/#shopauthenticationstrategy): ```ts title="src/vendure-config.ts" import { VendureConfig, NativeAuthenticationStrategy } from '@vendure/core'; import { FacebookAuthenticationStrategy } from './plugins/authentication/facebook-authentication-strategy'; import { GoogleAuthenticationStrategy } from './plugins/authentication/google-authentication-strategy'; import { KeycloakAuthenticationStrategy } from './plugins/authentication/keycloak-authentication-strategy'; export const config: VendureConfig = { authOptions: { shopAuthenticationStrategy: [ new NativeAuthenticationStrategy(), new FacebookAuthenticationStrategy(), new GoogleAuthenticationStrategy(), ], adminAuthenticationStrategy: [ new NativeAuthenticationStrategy(), new KeycloakAuthenticationStrategy(), ], } } ``` In the above example, we define the strategies available for authenticating in the Shop API and the Admin API. The `NativeAuthenticationStrategy` is the only one actually provided by Vendure out-of-the-box, and this is the default username/email + password strategy. The other strategies would be custom-built (or provided by future npm packages) by creating classes that implement the [`AuthenticationStrategy` interface](/reference/typescript-api/auth/authentication-strategy). Let's take a look at a couple of examples of what a custom AuthenticationStrategy implementation would look like. ## Custom authentication examples ### Google authentication This example demonstrates how to implement a Google login flow. #### Storefront setup In your storefront, you need to integrate the Google sign-in button as described in ["Integrating Google Sign-In into your web app"](https://developers.google.com/identity/sign-in/web/sign-in). Successful authentication will result in a `onSignIn` function being called in your app. It will look something like this: ```ts function onSignIn(googleUser) { graphQlQuery( `mutation Authenticate($token: String!) { authenticate(input: { google: { token: $token } }) { ...on CurrentUser { id identifier } } }`, { token: googleUser.getAuthResponse().id_token } ).then(() => { // redirect to account page }); } ``` #### Backend On the backend, you'll need to define an AuthenticationStrategy to take the authorization token provided by the storefront in the `authenticate` mutation, and use it to get the necessary personal information on that user from Google. To do this you'll need to install the `google-auth-library` npm package as described in the ["Authenticate with a backend server" guide](https://developers.google.com/identity/sign-in/web/backend-auth). ```ts title="src/plugins/authentication/google-authentication-strategy.ts" import { AuthenticationStrategy, ExternalAuthenticationService, Injector, RequestContext, User, } from '@vendure/core'; import { OAuth2Client } from 'google-auth-library'; import { DocumentNode } from 'graphql'; import gql from 'graphql-tag'; export type GoogleAuthData = { token: string; }; export class GoogleAuthenticationStrategy implements AuthenticationStrategy<GoogleAuthData> { readonly name = 'google'; private client: OAuth2Client; private externalAuthenticationService: ExternalAuthenticationService; constructor(private clientId: string) { // The clientId is obtained by creating a new OAuth client ID as described // in the Google guide linked above. this.client = new OAuth2Client(clientId); } init(injector: Injector) { // The ExternalAuthenticationService is a helper service which encapsulates much // of the common functionality related to dealing with external authentication // providers. this.externalAuthenticationService = injector.get(ExternalAuthenticationService); } defineInputType(): DocumentNode { // Here we define the expected input object expected by the `authenticate` mutation // under the "google" key. return gql` input GoogleAuthInput { token: String! } `; } async authenticate(ctx: RequestContext, data: GoogleAuthData): Promise<User | false> { // Here is the logic that uses the token provided by the storefront and uses it // to find the user data from Google. const ticket = await this.client.verifyIdToken({ idToken: data.token, audience: this.clientId, }); const payload = ticket.getPayload(); if (!payload || !payload.email) { return false; } // First we check to see if this user has already authenticated in our // Vendure server using this Google account. If so, we return that // User object, and they will be now authenticated in Vendure. const user = await this.externalAuthenticationService.findCustomerUser(ctx, this.name, payload.sub); if (user) { return user; } // If no user was found, we need to create a new User and Customer based // on the details provided by Google. The ExternalAuthenticationService // provides a convenience method which encapsulates all of this into // a single method call. return this.externalAuthenticationService.createCustomerAndUser(ctx, { strategy: this.name, externalIdentifier: payload.sub, verified: payload.email_verified || false, emailAddress: payload.email, firstName: payload.given_name, lastName: payload.family_name, }); } } ``` ### Facebook authentication This example demonstrates how to implement a Facebook login flow. #### Storefront setup In this example, we are assuming the use of the [Facebook SDK for JavaScript](https://developers.facebook.com/docs/javascript/) in the storefront. An implementation in React might look like this: ```tsx title="/storefront/src/components/FacebookLoginButton.tsx" /** * Renders a Facebook login button. */ export const FBLoginButton = () => { const fnName = `onFbLoginButtonSuccess`; const router = useRouter(); const [error, setError] = useState(''); const [socialLoginMutation] = useMutation(AuthenticateDocument); useEffect(() => { (window as any)[fnName] = function() { FB.getLoginStatus(login); }; return () => { delete (window as any)[fnName]; }; }, []); useEffect(() => { window?.FB?.XFBML.parse(); }, []); const login = async (response: any) => { const {status, authResponse} = response; if (status === 'connected') { const result = await socialLoginMutation({variables: {token: authResponse.accessToken}}); if (result.data?.authenticate.__typename === 'CurrentUser') { // The user has logged in, refresh the browser trackLogin('facebook'); router.reload(); return; } } setError('An error occurred!'); }; return ( <div className="text-center" style={{ width: 188, height: 28 }}> <FacebookSDK /> <div className="fb-login-button" data-width="" data-size="medium" data-button-type="login_with" data-layout="default" data-auto-logout-link="false" data-use-continue-as="false" data-scope="public_profile,email" data-onlogin={`${fnName}();`} /> {error && <div className="text-sm text-red-500">{error}</div>} </div> ); }; ``` #### Backend ```ts title="/src/plugins/authentication/facebook-authentication-strategy.ts" import { AuthenticationStrategy, ExternalAuthenticationService, Injector, Logger, RequestContext, User, UserService, } from '@vendure/core'; import { DocumentNode } from 'graphql'; import gql from 'graphql-tag'; import fetch from 'node-fetch'; export type FacebookAuthData = { token: string; }; export type FacebookAuthConfig = { appId: string; appSecret: string; clientToken: string; }; export class FacebookAuthenticationStrategy implements AuthenticationStrategy<FacebookAuthData> { readonly name = 'facebook'; private externalAuthenticationService: ExternalAuthenticationService; private userService: UserService; constructor(private config: FacebookAuthConfig) { } init(injector: Injector) { // The ExternalAuthenticationService is a helper service which encapsulates much // of the common functionality related to dealing with external authentication // providers. this.externalAuthenticationService = injector.get(ExternalAuthenticationService); this.userService = injector.get(UserService); } defineInputType(): DocumentNode { // Here we define the expected input object expected by the `authenticate` mutation // under the "google" key. return gql` input FacebookAuthInput { token: String! } `; } private async getAppAccessToken() { const resp = await fetch( `https://graph.facebook.com/oauth/access_token?client_id=${this.config.appId}&client_secret=${this.config.appSecret}&grant_type=client_credentials`, ); return await resp.json(); } async authenticate(ctx: RequestContext, data: FacebookAuthData): Promise<User | false> { const {token} = data; const {access_token} = await this.getAppAccessToken(); const resp = await fetch( `https://graph.facebook.com/debug_token?input_token=${token}&access_token=${access_token}`, ); const result = await resp.json(); if (!result.data) { return false; } const uresp = await fetch(`https://graph.facebook.com/me?access_token=${token}&fields=email,first_name,last_name`); const uresult = (await uresp.json()) as { id?: string; email: string; first_name: string; last_name: string }; if (!uresult.id) { return false; } const existingUser = await this.externalAuthenticationService.findCustomerUser(ctx, this.name, uresult.id); if (existingUser) { // This will select all the auth methods return (await this.userService.getUserById(ctx, existingUser.id))!; } Logger.info(`User Create: ${JSON.stringify(uresult)}`); const user = await this.externalAuthenticationService.createCustomerAndUser(ctx, { strategy: this.name, externalIdentifier: uresult.id, verified: true, emailAddress: uresult.email, firstName: uresult.first_name, lastName: uresult.last_name, }); user.verified = true; return user; } } ``` ### Keycloak authentication Here's an example of an AuthenticationStrategy intended to be used on the Admin API. The use-case is when the company has an existing identity server for employees, and you'd like your Vendure shop admins to be able to authenticate with their existing accounts. This example uses [Keycloak](https://www.keycloak.org/), a popular open-source identity management server. To get your own Keycloak server up and running in minutes, follow the [Keycloak on Docker](https://www.keycloak.org/getting-started/getting-started-docker) guide. #### Configure a login page & Admin UI In this example, we'll assume the login page is hosted at `http://intranet/login`. We'll also assume that a "login to Vendure" button has been added to that page and that the page is using the [Keycloak JavaScript adapter](https://www.keycloak.org/docs/latest/securing_apps/index.html#_javascript_adapter), which can be used to get the current user's authorization token: ```js title="/login/index.html" const vendureLoginButton = document.querySelector('#vendure-login-button'); vendureLoginButton.addEventListener('click', () => { return graphQlQuery(` mutation Authenticate($token: String!) { authenticate(input: { keycloak: { token: $token } }) { ...on CurrentUser { id } } }`, { token: keycloak.token }, ) .then((result) => { if (result.data?.authenticate.user) { // successfully authenticated - redirect to Vendure Admin UI window.location.replace('http://localhost:3000/admin'); } }); }); ``` We also need to tell the Admin UI application about the custom login URL, since we have no need for the default "username/password" login form. This can be done by setting the [`loginUrl` property](/reference/typescript-api/common/admin-ui/admin-ui-config#loginurl) in the AdminUiConfig: ```ts title="/src/vendure-config.ts" import { VendureConfig } from '@vendure/core'; import { AdminUiPlugin } from '@vendure/admin-ui-plugin'; export const config: VendureConfig = { // ... plugins: [ AdminUiPlugin.init({ port: 5001, adminUiConfig: { loginUrl: 'http://intranet/login', }, }), ], }; ``` #### Backend First we will need to be making an HTTP call to our Keycloak server to validate the token and get the user's details. We'll use the [`node-fetch`](https://www.npmjs.com/package/node-fetch) library to make the HTTP call: ```bash npm install node-fetch ``` The strategy is very similar to the Google authentication example (they both use the OpenID Connect standard), so we'll not duplicate the explanatory comments here: ```ts title="/src/plugins/authentication/keycloak-authentication-strategy.ts" import fetch from 'node-fetch'; import { AuthenticationStrategy, ExternalAuthenticationService, Injector, Logger, RequestContext, RoleService, User, } from '@vendure/core'; import { DocumentNode } from 'graphql'; import gql from 'graphql-tag'; export type KeycloakAuthData = { token: string; }; export class KeycloakAuthenticationStrategy implements AuthenticationStrategy<KeycloakAuthData> { readonly name = 'keycloak'; private externalAuthenticationService: ExternalAuthenticationService; private httpService: HttpService; private roleService: RoleService; init(injector: Injector) { this.externalAuthenticationService = injector.get(ExternalAuthenticationService); this.httpService = injector.get(HttpService); this.roleService = injector.get(RoleService); } defineInputType(): DocumentNode { return gql` input KeycloakAuthInput { token: String! } `; } async authenticate(ctx: RequestContext, data: KeycloakAuthData): Promise<User | false> { const { data: userInfo } = await fetch( 'http://localhost:9000/auth/realms/myrealm/protocol/openid-connect/userinfo', { headers: { Authorization: `Bearer ${data.token}`, }, }).then(res => res.json()); if (!userInfo) { return false; } const user = await this.externalAuthenticationService.findAdministratorUser(ctx, this.name, userInfo.sub); if (user) { return user; } // When creating an Administrator, we need to know what Role(s) to assign. // In this example, we've created a "merchant" role and assign that to all // new Administrators. In a real implementation, you can have more complex // logic to map an external user to a given role. const roles = await this.roleService.findAll(); const merchantRole = roles.items.find((r) => r.code === 'merchant'); if (!merchantRole) { Logger.error(`Could not find "merchant" role`); return false; } return this.externalAuthenticationService.createAdministratorAndUser(ctx, { strategy: this.name, externalIdentifier: userInfo.sub, identifier: userInfo.preferred_username, emailAddress: userInfo.email, firstName: userInfo.given_name, lastName: userInfo.family_name, roles: [merchantRole], }); } } ```
--- title: "Channels" --- Channels are a feature of Vendure which allows multiple sales channels to be represented in a single Vendure instance. A Channel allows you to: * Set Channel-specific currency, language, tax and shipping defaults * Assign only specific products to the channel (with channel-specific prices) * Create administrator roles limited to one or more channels * Assign specific stock locations, assets, facets, collections, promotions, and other entities to the channel * Have orders and customers associated with specific channels. This is useful for a number of use-cases, including: - **Multi-tenancy**: Each channel can be configured with its own set of products, shipping methods, payment methods, etc. This allows you to run multiple shops from a single Vendure server. - **Multi-vendor**: Each channel can represent a distinct vendor or seller, which can be used to implement a marketplace. - **Region-specific stores**: Each channel can be configured with its own set of languages, currencies, tax rates, etc. This allows you to run multiple stores for different regions from a single Vendure server. - **Distinct sales channels**: Each channel can represent a sales channel of a single business, with one channel for the online store, one for selling via Amazon, one for selling via Facebook etc. Every Vendure server always has a **default Channel**, which contains _all_ entities. Subsequent channels can then contain a subset of channel-aware entities. ![Channels high level](./channels.webp) ## Channel-aware entities Many entities are channel-aware, meaning that they can be associated with a multiple channels. The following entities are channel-aware: - [`Asset`](/reference/typescript-api/entities/asset/) - [`Collection`](/reference/typescript-api/entities/collection/) - [`Customer`](/reference/typescript-api/entities/customer-group/) - [`Facet`](/reference/typescript-api/entities/facet/) - [`FacetValue`](/reference/typescript-api/entities/facet-value/) - [`Order`](/reference/typescript-api/entities/order/) - [`PaymentMethod`](/reference/typescript-api/entities/payment-method/) - [`Product`](/reference/typescript-api/entities/product/) - [`ProductVariant`](/reference/typescript-api/entities/product-variant/) - [`Promotion`](/reference/typescript-api/entities/promotion/) - [`Role`](/reference/typescript-api/entities/role/) - [`ShippingMethod`](/reference/typescript-api/entities/shipping-method/) - [`StockLocation`](/reference/typescript-api/entities/stock-location/) ## Channels & Sellers Each channel is also assigned a single [`Seller`](/reference/typescript-api/entities/seller/). This entity is used to represent the vendor or seller of the products in the channel. This is useful for implementing a marketplace, where each channel represents a distinct vendor. The `Seller` entity can be extended with [custom fields](/guides/developer-guide/custom-fields/) to store additional information about the seller, such as a logo, contact details etc. ## Channels, Currencies & Prices Each Channel has a set of `availableCurrencyCodes`, and one of these is designated as the `defaultCurrencyCode`, which sets the default currency for all monetary values in that channel. ![Default currencies](./default-currency.webp) Internally, there is a one-to-many relation from [`ProductVariant`](/reference/typescript-api/entities/product-variant/) to [`ProductVariantPrice`](/reference/typescript-api/entities/product-variant-price). So the ProductVariant does _not_ hold a price for the product - this is actually stored on the `ProductVariantPrice` entity, and there will be at least one for each Channel to which the ProductVariant has been assigned. ![Product variant prices](./variant-prices.webp) In this diagram we can see that every channel has at least 1 `ProductVariantPrice`. In the case of the UK Channel, there are 2 prices assigned - one for GBP and one for USD. This means that you are able to define multiple prices in different currencies on a single product variant for a single channel. :::info **Note:** in the diagram above that the ProductVariant is **always assigned to the default Channel**, and thus will have a price in the default channel too. Likewise, the default Channel also has a defaultCurrencyCode. Depending on your requirements, you may or may not make use of the default Channel. ::: ### Keeping prices synchronized When you have products assigned to multiple channels, updates to the price of a product in one channel will not automatically be reflected in other channels. For instance, in the diagram above, both the Default channel and the UK channel have a price in USD for the same product variant. If an administrator of the UK channel changes the USD price to $20, the price in the Default channel will remain at $30. This is the default behavior, and is controlled by the [ProductVariantPriceUpdateStrategy](/reference/typescript-api/configuration/product-variant-price-update-strategy). If you want to keep prices synchronized across all channels, you can set the `syncPricesAcrossChannels` property of the [DefaultProductVariantPriceUpdateStrategy](/reference/typescript-api/configuration/product-variant-price-update-strategy#defaultproductvariantpriceupdatestrategy) to `true`. This will ensure that when the price of a product variant is updated in one channel, the price in all other channels (of that particular currency) will be updated to match. ```ts import { DefaultProductVariantPriceUpdateStrategy, VendureConfig } from '@vendure/core'; export const config: VendureConfig = { // ... // highlight-start productVariantPriceUpdateStrategy: new DefaultProductVariantPriceUpdateStrategy({ syncPricesAcrossChannels: true, }), // highlight-end // ... }; ``` You may however require even more sophisticated logic. For instance, you may want a one-way synchronization, where the price in the Default channel is always the master price, and the prices in other channels are updated to match. In this case, you can create a custom `ProductVariantPriceUpdateStrategy` which implements the desired logic. ## Use cases ### Single shop This is the simplest set-up. You just use the default Channel for everything. ### Multiple separate shops Let's say you are running multiple distinct businesses, each with its own distinct inventory and possibly different currencies. In this case, you set up a Channel for each shop and create the Product & Variants in the relevant shop's Channel. The default Channel can then be used by the superadmin for administrative purposes, but other than that the default Channel would not be used. Storefronts would only target a specific shop's Channel. ### Multiple shops sharing inventory Let's say you have a single inventory but want to split it between multiple shops. There might be overlap in the inventory, e.g. the US & EU shops share 80% of inventory, and then the rest is specific to either shop. In this case, you can create the entire inventory in the default Channel and then assign the Products & ProductVariants to each Channel as needed, setting the price as appropriate for the currency used by each shop. :::caution **Note:** When creating a new Product & ProductVariants inside a sub-Channel, it will also **always get assigned to the default Channel**. If your sub-Channel uses a different currency from the default Channel, you should be aware that in the default Channel, that ProductVariant will be assigned the **same price** as it has in the sub-Channel. If the currency differs between the Channels, you need to make sure to set the correct price in the default Channel if you are exposing it to Customers via a storefront. ::: ### Multi-vendor marketplace This is the most advanced use of channels. For a detailed guide to this use-case, see our [Multi-vendor marketplace guide](/guides/how-to/multi-vendor-marketplaces/). ## Specifying channel in the GraphQL API To specify which channel to use when making an API call, set the `'vendure-token'` header to match the token of the desired Channel. For example, if we have a UK Channel with the token set to "uk-channel" as shown in this screenshot: ![UK Channel](./channel-token.webp) Then we can make a GraphQL API call to the UK Channel by setting the `'vendure-token'` header to `'uk-channel'`: ```ts title="GraphQL API call to UK Channel" const { loading, error, data } = useQuery(GET_PRODUCT_LIST, { context: { // highlight-start headers: { 'vendure-token': 'uk-channel', }, // highlight-end }, }); ``` :::note This is an example using Apollo Client in React. The same principle applies to any GraphQL client library - set the `'vendure-token'` header to the token of the desired Channel. ::: With the above header set, the API call will be made to the UK Channel, and the response will contain only the entities which are assigned to that Channel.
--- title: 'Orders' --- import Tabs from '@theme/Tabs'; import TabItem from '@theme/TabItem'; In Vendure, the [`Order`](/reference/typescript-api/entities/order/) entity represents the entire lifecycle of an order, from the moment a customer adds an item to their cart, through to the point where the order is completed and the customer has received their goods. An [`Order`](/reference/typescript-api/entities/order/) is composed of one or more [`OrderLines`](/reference/typescript-api/entities/order-line/). Each order line represents a single product variant, and contains information such as the quantity, price, tax rate, etc. In turn, the order is associated with a [`Customer`](/reference/typescript-api/entities/customer/) and contains information such as the shipping address, billing address, shipping method, payment method, etc. ![Order](./order.webp) ## The Order Process Vendure defines an order process which is based on a [finite state machine](/reference/typescript-api/state-machine/fsm/) (a method of precisely controlling how the order moves from one state to another). This means that the [`Order.state` property](/reference/typescript-api/entities/order/#state) will be one of a set of [pre-defined states](/reference/typescript-api/orders/order-process/#orderstate). From the current state, the Order can then transition (change) to another state, and the available next states depend on what the current state is. :::note In Vendure, there is no distinction between a "cart" and an "order". The same entity is used for both. A "cart" is simply an order which is still "active" according to its current state. ::: You can see the current state of an order via `state` field on the `Order` type: <Tabs> <TabItem value="Request" label="Request" default> ```graphql title="Shop API" query ActiveOrder { activeOrder { id // highlight-next-line state } } ``` </TabItem> <TabItem value="Response" label="Response"> ```json { "data": { "activeOrder": { "id": "4", // highlight-next-line "state": "AddingItems" } } } ``` </TabItem> </Tabs> The next possible states can be queried via the [`nextOrderStates`](/reference/graphql-api/shop/queries/#nextorderstates) query: <Tabs> <TabItem value="Request" label="Request" default> ```graphql title="Shop API" query NextStates { nextOrderStates } ``` </TabItem> <TabItem value="Response" label="Response"> ```json { "data": { "nextOrderStates": [ "ArrangingPayment", "Cancelled" ] } } ``` </TabItem> </Tabs> The available states and the permissible transitions between them are defined by the configured [`OrderProcess`](/reference/typescript-api/orders/order-process/). By default, Vendure defines a [`DefaultOrderProcess`](/reference/typescript-api/orders/order-process/#defaultorderprocess) which is suitable for typical B2C use-cases. Here's a simplified diagram of the default order process: ![Default order process](./order-process.webp) Let's take a look at each of these states, and the transitions between them: * **`AddingItems:`** All orders begin in the `AddingItems` state. This means that the customer is adding items to his or her shopping cart. This is the state an order would be in as long as the customer is still browsing the store. * **`ArrangingPayment:`** From there, the Order can transition to the `ArrangingPayment`, which will prevent any further modifications to the order, which ensures the price that is sent to the payment provider is the same as the price that the customer saw when they added the items to their cart. At this point, the storefront will execute the [`addPaymentToOrder` mutation](/reference/graphql-api/shop/mutations/#addpaymenttoorder). * **`PaymentAuthorized:`** Depending on the configured payment method, the order may then transition to the `PaymentAuthorized` state, which indicates that the payment has been successfully authorized by the payment provider. This is the state that the order will be in if the payment is not captured immediately. Once the payment is captured, the order will transition to the `PaymentSettled` state. * **`PaymentSettled:`** If the payment captured immediately, the order will transition to the `PaymentSettled` state once the payment succeeds. * At this point, one or more fulfillments can be created. A `Fulfillment` represents the process of shipping one or more items to the customer ("shipping" applies equally to physical or digital goods - it just means getting the product to the customer by any means). A fulfillment can be created via the [`addFulfillmentToOrder` mutation](/reference/graphql-api/admin/mutations/#addfulfillmenttoorder), or via the Admin UI. If multiple fulfillments are created, then the order can end up partial states - `PartiallyShipped` or `PartiallyDelivered`. If there is only a single fulfillment which includes the entire order, then partial states are not possible. * **`Shipped:`** When all fulfillments have been shipped, the order will transition to the `Shipped` state. This means the goods have left the warehouse and are en route to the customer. * **`Delivered:`** When all fulfillments have been delivered, the order will transition to the `Delivered` state. This means the goods have arrived at the customer's address. This is the final state of the order. ## Customizing the Default Order Process It is possible to customize the [defaultOrderProcess](/reference/typescript-api/orders/order-process/#defaultorderprocess) to better match your business needs. For example, you might want to disable some of the constraints that are imposed by the default process, such as the requirement that a customer must have a shipping address before the Order can be completed. This can be done by creating a custom version of the default process using the [configureDefaultOrderProcess](/reference/typescript-api/orders/order-process/#configuredefaultorderprocess) function, and then passing it to the [`OrderOptions.process`](/reference/typescript-api/orders/order-options/#process) config property. ```ts title="src/vendure-config.ts" import { configureDefaultOrderProcess, VendureConfig } from '@vendure/core'; const myCustomOrderProcess = configureDefaultOrderProcess({ // Disable the constraint that requires // Orders to have a shipping method assigned // before payment. arrangingPaymentRequiresShipping: false, // Other constraints which can be disabled. See the // DefaultOrderProcessOptions interface docs for full // explanations. // // checkModificationPayments: false, // checkAdditionalPaymentsAmount: false, // checkAllVariantsExist: false, // arrangingPaymentRequiresContents: false, // arrangingPaymentRequiresCustomer: false, // arrangingPaymentRequiresStock: false, // checkPaymentsCoverTotal: false, // checkAllItemsBeforeCancel: false, // checkFulfillmentStates: false, }); export const config: VendureConfig = { orderOptions: { process: [myCustomOrderProcess], }, }; ``` ## Custom Order Processes Sometimes you might need to extend things beyond what is provided by the default Order process to better match your business needs. This is done by defining one or more [`OrderProcess`](/reference/typescript-api/orders/order-process#orderprocess) objects and passing them to the [`OrderOptions.process`](/reference/typescript-api/orders/order-options/#process) config property. ### Adding a new state Let's say your company can only sell to customers with a valid EU tax ID. We'll assume that you've already used a [custom field](/guides/developer-guide/custom-fields/) to store that code on the Customer entity. Now you want to add a step _before_ the customer handles payment, where we can collect and verify the tax ID. So we want to change the default process of: ```text AddingItems -> ArrangingPayment ``` to instead be: ```text AddingItems -> ValidatingCustomer -> ArrangingPayment ``` Here's how we would define the new state: ```ts title="src/plugins/tax-id/customer-validation-process.ts" import { OrderProcess } from '@vendure/core'; export const customerValidationProcess: OrderProcess<'ValidatingCustomer'> = { transitions: { AddingItems: { to: ['ValidatingCustomer'], mergeStrategy: 'replace', }, ValidatingCustomer: { to: ['ArrangingPayment', 'AddingItems'], }, }, }; ``` This object means: * the `AddingItems` state may _only_ transition to the `ValidatingCustomer` state (`mergeStrategy: 'replace'` tells Vendure to discard any existing transition targets and replace with this one). * the `ValidatingCustomer` may transition to the `ArrangingPayment` state (assuming the tax ID is valid) or back to the `AddingItems` state. And then add this configuration to our main VendureConfig: ```ts title="src/vendure-config.ts" import { defaultOrderProcess, VendureConfig } from '@vendure/core'; import { customerValidationProcess } from './plugins/tax-id/customer-validation-process'; export const config: VendureConfig = { // ... orderOptions: { process: [defaultOrderProcess, customerValidationProcess], }, }; ``` Note that we also include the `defaultOrderProcess` in the array, otherwise we will lose all the default states and transitions. To add multiple new States you need to extend the generic type like this: ```ts import { OrderProcess } from '@vendure/core'; export const customerValidationProcess: OrderProcess<'ValidatingCustomer'|'AnotherState'> = {...} ``` This way multiple custom states get defined. ### Intercepting a state transition Now we have defined our new `ValidatingCustomer` state, but there is as yet nothing to enforce that the tax ID is valid. To add this constraint, we'll use the [`onTransitionStart` state transition hook](/reference/typescript-api/state-machine/state-machine-config#ontransitionstart). This allows us to perform our custom logic and potentially prevent the transition from occurring. We will also assume that we have a provider named `TaxIdService` available which contains the logic to validate a tax ID. ```ts title="src/plugins/tax-id/customer-validation-process.ts" import { OrderProcess } from '@vendure/core'; import { TaxIdService } from './services/tax-id.service'; let taxIdService: TaxIdService; const customerValidationProcess: OrderProcess<'ValidatingCustomer'> = { transitions: { AddingItems: { to: ['ValidatingCustomer'], mergeStrategy: 'replace', }, ValidatingCustomer: { to: ['ArrangingPayment', 'AddingItems'], }, }, init(injector) { taxIdService = injector.get(TaxIdService); }, // The logic for enforcing our validation goes here async onTransitionStart(fromState, toState, data) { if (fromState === 'ValidatingCustomer' && toState === 'ArrangingPayment') { const isValid = await taxIdService.verifyTaxId(data.order.customer); if (!isValid) { // Returning a string is interpreted as an error message. // The state transition will fail. return `The tax ID is not valid`; } } }, }; ``` :::info For an explanation of the `init()` method and `injector` argument, see the guide on [injecting dependencies in configurable operations](/guides/developer-guide/strategies-configurable-operations/#injecting-dependencies). ::: ### Responding to a state transition Once an order has successfully transitioned to a new state, the [`onTransitionEnd` state transition hook](/reference/typescript-api/state-machine/state-machine-config#ontransitionend) is called. This can be used to perform some action upon successful state transition. In this example, we have a referral service which creates a new referral for a customer when they complete an order. We want to create the referral only if the customer has a referral code associated with their account. ```ts import { OrderProcess, OrderState } from '@vendure/core'; import { ReferralService } from '../service/referral.service'; let referralService: ReferralService; export const referralOrderProcess: OrderProcess<OrderState> = { init: (injector) => { referralService = injector.get(ReferralService); }, onTransitionEnd: async (fromState, toState, data) => { const { order, ctx } = data; if (toState === 'PaymentSettled') { if (order.customFields.referralCode) { await referralService.createReferralForOrder(ctx, order); } } }, }; ``` :::caution Use caution when modifying an order inside the `onTransitionEnd` function. The `order` object that gets passed in to this function will later be persisted to the database. Therefore any changes must be made to that `order` object, otherwise the changes might be lost. As an example, let's say we want to add a Surcharge to the order. The following code **will not work as expected**: ```ts export const myOrderProcess: OrderProcess<OrderState> = { async onTransitionEnd(fromState, toState, data) { if (fromState === 'AddingItems' && toState === 'ArrangingPayment') { // highlight-start // WARNING: This will not work! await orderService.addSurchargeToOrder(ctx, order.id, { description: 'Test', listPrice: 42, listPriceIncludesTax: false, }); // highlight-end } } }; ``` Instead, you need to ensure you **mutate the `order` object**: ```ts export const myOrderProcess: OrderProcess<OrderState> = { async onTransitionEnd(fromState, toState, data) { if (fromState === 'AddingItems' && toState === 'ArrangingPayment') { // highlight-start const {surcharges} = await orderService.addSurchargeToOrder(ctx, order.id, { description: 'Test', listPrice: 42, listPriceIncludesTax: false, }); // Important: mutate the order object order.surcharges = surcharges; // highlight-end } }, } ``` ::: ## TypeScript Typings To make your custom states compatible with standard services you should declare your new states in the following way: ```ts title="src/plugins/tax-id/types.ts" import { CustomOrderStates } from '@vendure/core'; declare module '@vendure/core' { interface CustomOrderStates { ValidatingCustomer: never; } } ``` This technique uses advanced TypeScript features - [declaration merging](https://www.typescriptlang.org/docs/handbook/declaration-merging.html#merging-interfaces) and [ambient modules](https://www.typescriptlang.org/docs/handbook/modules.html#ambient-modules). ## Controlling custom states in the Admin UI If you have defined custom order states, the Admin UI will allow you to manually transition an order from one state to another: ![./custom-order-ui.webp](./custom-order-ui.webp)
--- title: 'Payment' --- import Tabs from '@theme/Tabs'; import TabItem from '@theme/TabItem'; Vendure can support many kinds of payment workflows, such as authorizing and capturing payment in a single step upon checkout or authorizing on checkout and then capturing on fulfillment. :::info For complete working examples of real payment integrations, see the [payments-plugins](https://github.com/vendure-ecommerce/vendure/tree/master/packages/payments-plugin/src) ::: ## Authorization & Settlement Typically, there are 2 parts to an online payment: **authorization** and **settlement**: - **Authorization** is the process by which the customer's bank is contacted to check whether the transaction is allowed. At this stage, no funds are removed from the customer's account. - **Settlement** (also known as "capture") is the process by which the funds are transferred from the customer's account to the merchant. Some merchants do both of these steps at once, when the customer checks out of the store. Others do the authorize step at checkout, and only do the settlement at some later point, e.g. upon shipping the goods to the customer. This two-step workflow can also be applied to other non-card forms of payment: e.g. if providing a "payment on delivery" option, the authorization step would occur on checkout, and the settlement step would be triggered upon delivery, either manually by an administrator of via an app integration with the Admin API. ## Creating an integration Payment integrations are created by defining a new [PaymentMethodHandler](/reference/typescript-api/payment/payment-method-handler/) and passing that handler into the [`paymentOptions.paymentMethodHandlers`](/reference/typescript-api/payment/payment-options#paymentmethodhandlers) array in the VendureConfig. ```ts title="src/plugins/payment-plugin/my-payment-handler.ts" import { CancelPaymentResult, CancelPaymentErrorResult, PaymentMethodHandler, VendureConfig, CreatePaymentResult, SettlePaymentResult, SettlePaymentErrorResult } from '@vendure/core'; import { sdk } from 'payment-provider-sdk'; /** * This is a handler which integrates Vendure with an imaginary * payment provider, who provide a Node SDK which we use to * interact with their APIs. */ const myPaymentHandler = new PaymentMethodHandler({ code: 'my-payment-method', description: [{ languageCode: LanguageCode.en, value: 'My Payment Provider', }], args: { apiKey: {type: 'string'}, }, /** This is called when the `addPaymentToOrder` mutation is executed */ createPayment: async (ctx, order, amount, args, metadata): Promise<CreatePaymentResult> => { try { const result = await sdk.charges.create({ amount, apiKey: args.apiKey, source: metadata.token, }); return { amount: order.total, state: 'Authorized' as const, transactionId: result.id.toString(), metadata: { cardInfo: result.cardInfo, // Any metadata in the `public` field // will be available in the Shop API, // All other metadata is private and // only available in the Admin API. public: { referenceCode: result.publicId, } }, }; } catch (err) { return { amount: order.total, state: 'Declined' as const, metadata: { errorMessage: err.message, }, }; } }, /** This is called when the `settlePayment` mutation is executed */ settlePayment: async (ctx, order, payment, args): Promise<SettlePaymentResult | SettlePaymentErrorResult> => { try { const result = await sdk.charges.capture({ apiKey: args.apiKey, id: payment.transactionId, }); return {success: true}; } catch (err) { return { success: false, errorMessage: err.message, } } }, /** This is called when a payment is cancelled. */ cancelPayment: async (ctx, order, payment, args): Promise<CancelPaymentResult | CancelPaymentErrorResult> => { try { const result = await sdk.charges.cancel({ apiKey: args.apiKey, id: payment.transactionId, }); return {success: true}; } catch (err) { return { success: false, errorMessage: err.message, } } }, }); ``` We can now add this handler to our configuration: ```ts title="src/vendure-config.ts" import { VendureConfig } from '@vendure/core'; import { myPaymentHandler } from './plugins/payment-plugin/my-payment-handler'; export const config: VendureConfig = { // ... paymentOptions: { paymentMethodHandlers: [myPaymentHandler], }, }; ``` :::info If your PaymentMethodHandler needs access to the database or other providers, see the [configurable operation dependency injection guide](/guides/developer-guide/strategies-configurable-operations/#injecting-dependencies). ::: ## The PaymentMethod entity Once the PaymentMethodHandler is defined as above, you can use it to create a new [`PaymentMethod`](/reference/typescript-api/entities/payment-method/) via the Admin UI (_Settings_ -> _Payment methods_, then _Create new payment method_) or via the Admin API `createPaymentMethod` mutation. A payment method consists of an optional [`PaymentMethodEligibilityChecker`](/reference/typescript-api/payment/payment-method-eligibility-checker/), which is used to determine whether the payment method is available to the customer, and a [`PaymentMethodHandler`](/reference/typescript-api/payment/payment-method-handler). The payment method also has a **code**, which is a string identifier used to specify this method when adding a payment to an order. ![Payment method](./payment-method.webp) ## Payment flow ### Eligible payment methods Once the active Order has been transitioned to the `ArrangingPayment` state (see the [Order guide](/guides/core-concepts/orders/)), we can query the available payment methods by executing the [`eligiblePaymentMethods` query](/reference/graphql-api/shop/queries#eligiblepaymentmethods). <Tabs> <TabItem value="Request" label="Request" default> ```graphql title="Shop API" query GetEligiblePaymentMethods { eligiblePaymentMethods { code name isEligible eligibilityMessage } } ``` </TabItem> <TabItem value="Response" label="Response"> ```json { "data": { "eligiblePaymentMethods": [ { "code": "my-payment-method", "name": "My Payment Method", "isEligible": true, "eligibilityMessage": null } ] } } ``` </TabItem> </Tabs> ### Add payment to order One or more Payments are created by executing the [`addPaymentToOrder` mutation](/reference/graphql-api/shop/mutations#addpaymenttoorder). This mutation has a required `method` input field, which _must_ match the `code` of an eligible `PaymentMethod`. In the case above, this would be set to `"my-payment-method"`. <Tabs> <TabItem value="Request" label="Request" default> ```graphql title="Shop API" mutation { addPaymentToOrder( input: { method: "my-payment-method" metadata: { token: "<some token from the payment provider>" } } ) { ... on Order { id code state # ... etc } ... on ErrorResult { errorCode message } ...on PaymentFailedError { paymentErrorMessage } ...on PaymentDeclinedError { paymentErrorMessage } ...on IneligiblePaymentMethodError { eligibilityCheckerMessage } } } ``` </TabItem> <TabItem value="Response" label="Response"> ```json { "data": { "addPaymentToOrder": { "id": "12345", "code": "J9AC5PY13BQGRKTF", "state": "PaymentAuthorized" } } } ``` </TabItem> </Tabs> :::info The `metadata` field is used to store the specific data required by the payment provider. E.g. some providers have a client-side part which begins the transaction and returns a token which must then be verified on the server side. The `metadata` field is required, so if your payment provider does not require any additional data, you can simply pass an empty object: `metadata: {}`. ::: 3. This mutation internally invokes the [PaymentMethodHandler's `createPayment()` function](/reference/typescript-api/payment/payment-method-config-options/#createpayment). This function returns a [CreatePaymentResult object](/reference/typescript-api/payment/payment-method-types#createpaymentfn) which is used to create a new [Payment](reference/typescript-api/entities/payment). If the Payment amount equals the order total, then the Order is transitioned to either the `PaymentAuthorized` or `PaymentSettled` state and the customer checkout flow is complete. ### Single-step If the `createPayment()` function returns a result with the state set to `'Settled'`, then this is a single-step ("authorize & capture") flow, as illustrated below: ![./payment_sequence_one_step.png](./payment_sequence_one_step.png) ### Two-step If the `createPayment()` function returns a result with the state set to `'Authorized'`, then this is a two-step flow, and the settlement / capture part is performed at some later point, e.g. when shipping the goods, or on confirmation of payment-on-delivery. ![./payment_sequence_two_step.png](./payment_sequence_two_step.png) ## Custom Payment Flows If you need to support an entirely different payment flow than the above, it is also possible to do so by configuring a [PaymentProcess](/reference/typescript-api/payment/payment-process). This allows new Payment states and transitions to be defined, as well as allowing custom logic to run on Payment state transitions. Here's an example which adds a new "Validating" state to the Payment state machine, and combines it with a [OrderProcess](/reference/typescript-api/orders/order-process), [PaymentMethodHandler](/reference/typescript-api/payment/payment-method-handler) and [OrderPlacedStrategy](/reference/typescript-api/orders/order-placed-strategy). ```text ├── plugins └── my-payment-plugin ├── payment-process.ts ├── payment-method-handler.ts ├── order-process.ts └── order-placed-strategy.ts ``` ```ts title="src/plugins/my-payment-plugin/payment-process.ts" import { PaymentProcess } from '@vendure/core'; /** * Declare your custom state in special interface to make it type-safe */ declare module '@vendure/core' { interface PaymentStates { Validating: never; } } /** * Define a new "Validating" Payment state, and set up the * permitted transitions to/from it. */ const customPaymentProcess: PaymentProcess<'Validating'> = { transitions: { Created: { to: ['Validating'], mergeStrategy: 'replace', }, Validating: { to: ['Settled', 'Declined', 'Cancelled'], }, }, }; ``` ```ts title="src/plugins/my-payment-plugin/order-process.ts" import { OrderProcess } from '@vendure/core'; /** * Define a new "ValidatingPayment" Order state, and set up the * permitted transitions to/from it. */ const customOrderProcess: OrderProcess<'ValidatingPayment'> = { transitions: { ArrangingPayment: { to: ['ValidatingPayment'], mergeStrategy: 'replace', }, ValidatingPayment: { to: ['PaymentAuthorized', 'PaymentSettled', 'ArrangingAdditionalPayment'], }, }, }; ``` ```ts title="src/plugins/my-payment-plugin/payment-method-handler.ts" import { LanguageCode, PaymentMethodHandler } from '@vendure/core'; /** * This PaymentMethodHandler creates the Payment in the custom "Validating" * state. */ const myPaymentHandler = new PaymentMethodHandler({ code: 'my-payment-handler', description: [{languageCode: LanguageCode.en, value: 'My payment handler'}], args: {}, createPayment: (ctx, order, amount, args, metadata) => { // payment provider logic omitted return { state: 'Validating' as any, amount, metadata, }; }, settlePayment: (ctx, order, payment) => { return { success: true, }; }, }); ``` ```ts title="src/plugins/my-payment-plugin/order-placed-strategy.ts" import { OrderPlacedStrategy, OrderState, RequestContext } from '@vendure/core'; /** * This OrderPlacedStrategy tells Vendure to set the Order as "placed" * when it transitions to the custom "ValidatingPayment" state. */ class MyOrderPlacedStrategy implements OrderPlacedStrategy { shouldSetAsPlaced(ctx: RequestContext, fromState: OrderState, toState: OrderState): boolean | Promise<boolean> { return fromState === 'ArrangingPayment' && toState === ('ValidatingPayment' as any); } } ``` ```ts title="src/vendure-config.ts" import { defaultOrderProcess, defaultPaymentProcess, VendureConfig } from '@vendure/core'; import { customOrderProcess } from './plugins/my-payment-plugin/order-process'; import { customPaymentProcess } from './plugins/my-payment-plugin/payment-process'; import { myPaymentHandler } from './plugins/my-payment-plugin/payment-method-handler'; import { MyOrderPlacedStrategy } from './plugins/my-payment-plugin/order-placed-strategy'; // Combine the above in the VendureConfig export const config: VendureConfig = { // ... orderOptions: { process: [defaultOrderProcess, customOrderProcess], orderPlacedStrategy: new MyOrderPlacedStrategy(), }, paymentOptions: { process: [defaultPaymentProcess, customPaymentProcess], paymentMethodHandlers: [myPaymentHandler], }, }; ``` ### Integration with hosted payment pages A hosted payment page is a system that works similar to [Stripe checkout](https://stripe.com/payments/checkout). The idea behind this flow is that the customer does not enter any credit card data anywhere on the merchant's site which waives the merchant from the responsibility to take care of sensitive data. The checkout flow works as follows: 1. The user makes a POST to the card processor's URL via a Vendure served page 2. The card processor accepts card information from the user and authorizes a payment 3. The card processor redirects the user back to Vendure via a POST which contains details about the processed payment 4. There is a pre-shared secret between the merchant and processor used to sign cross-site POST requests When integrating with a system like this, you would need to create a Controller to accept POST redirects from the payment processor (usually a success and a failure URL), as well as serve a POST form on your store frontend. With a hosted payment form the payment is already authorized by the time the card processor makes the POST request to Vendure, possibly settled even, so the payment handler won't do anything in particular - just return the data it has been passed. The validation of the POST request is done in the controller or service and the payment amount and payment reference are just passed to the payment handler which passes them on.
--- title: 'Promotions' --- Promotions are a means of offering discounts on an order based on various criteria. A Promotion consists of _conditions_ and _actions_. - **conditions** are the rules which determine whether the Promotion should be applied to the order. - **actions** specify exactly how this Promotion should modify the order. ## Parts of a Promotion ### Constraints All Promotions can have the following constraints applied to them: - **Date range** Using the "starts at" and "ends at" fields, the Promotion can be scheduled to only be active during the given date range. - **Coupon code** A Promotion can require a coupon code first be activated using the [`applyCouponCode` mutation](/reference/graphql-api/shop/mutations/#applycouponcode) in the Shop API. - **Per-customer limit** A Promotion coupon may be limited to a given number of uses per Customer. ### Conditions A Promotion may be additionally constrained by one or more conditions. When evaluating whether a Promotion should be applied, each of the defined conditions is checked in turn. If all the conditions evaluate to `true`, then any defined actions are applied to the order. Vendure comes with some built-in conditions, but you can also create your own conditions (see section below). ### Actions A promotion action defines exactly how the order discount should be calculated. **At least one** action must be specified for a valid Promotion. Vendure comes with some built-in actions, but you can also create your own actions (see section below). ## Creating custom conditions To create a custom condition, you need to define a new [`PromotionCondition` object](/reference/typescript-api/promotions/promotion-condition/). A promotion condition is an example of a [configurable operation](/guides/developer-guide/strategies-configurable-operations/#configurable-operations). Here is an annotated example of one of the built-in PromotionConditions. ```ts import { LanguageCode, PromotionCondition } from '@vendure/core'; export const minimumOrderAmount = new PromotionCondition({ /** A unique identifier for the condition */ code: 'minimum_order_amount', /** * A human-readable description. Values defined in the * `args` object can be interpolated using the curly-braces syntax. */ description: [ {languageCode: LanguageCode.en, value: 'If order total is greater than { amount }'}, ], /** * Arguments which can be specified when configuring the condition * in the Admin UI. The values of these args are then available during * the execution of the `check` function. */ args: { amount: { type: 'int', // The optional `ui` object allows you to customize // how this arg is rendered in the Admin UI. ui: {component: 'currency-form-input'}, }, taxInclusive: {type: 'boolean'}, }, /** * This is the business logic of the condition. It is a function that * must resolve to a boolean value indicating whether the condition has * been satisfied. */ check(ctx, order, args) { if (args.taxInclusive) { return order.subTotalWithTax >= args.amount; } else { return order.subTotal >= args.amount; } }, }); ``` Custom promotion conditions are then passed into the VendureConfig [PromotionOptions](/reference/typescript-api/promotions/promotion-options/) to make them available when setting up Promotions: ```ts title="src/vendure-config.ts" import { defaultPromotionConditions, VendureConfig } from '@vendure/core'; import { minimumOrderAmount } from './minimum-order-amount'; export const config: VendureConfig = { // ... promotionOptions: { promotionConditions: [ ...defaultPromotionConditions, minimumOrderAmount, ], } } ``` ## Creating custom actions There are three kinds of PromotionAction: - [`PromotionItemAction`](/reference/typescript-api/promotions/promotion-action#promotionitemaction) applies a discount on the `OrderLine` level, i.e. it would be used for a promotion like "50% off USB cables". - [`PromotionOrderAction`](/reference/typescript-api/promotions/promotion-action#promotionorderaction) applies a discount on the `Order` level, i.e. it would be used for a promotion like "5% off the order total". - [`PromotionShippingAction`](/reference/typescript-api/promotions/promotion-action#promotionshippingaction) applies a discount on the shipping, i.e. it would be used for a promotion like "free shipping". The implementations of each type is similar, with the difference being the arguments passed to the `execute()`. Here's an example of a simple PromotionOrderAction. ```ts import { LanguageCode, PromotionOrderAction } from '@vendure/core'; export const orderPercentageDiscount = new PromotionOrderAction({ // See the custom condition example above for explanations // of code, description & args fields. code: 'order_percentage_discount', description: [{languageCode: LanguageCode.en, value: 'Discount order by { discount }%'}], args: { discount: { type: 'int', ui: { component: 'number-form-input', suffix: '%', }, }, }, /** * This is the function that defines the actual amount to be discounted. * It should return a negative number representing the discount in * pennies/cents etc. Rounding to an integer is handled automatically. */ execute(ctx, order, args) { const orderTotal = ctx.channel.pricesIncludeTax ? order.subTotalWithTax : order.subTotal; return -orderTotal * (args.discount / 100); }, }); ``` Custom PromotionActions are then passed into the VendureConfig [PromotionOptions](/reference/typescript-api/promotions/promotion-options) to make them available when setting up Promotions: ```ts title="src/vendure-config.ts" import { defaultPromotionActions, VendureConfig } from '@vendure/core'; import { orderPercentageDiscount } from './order-percentage-discount'; export const config: VendureConfig = { // ... promotionOptions: { promotionActions: [ ...defaultPromotionActions, orderPercentageDiscount, ], } }; ``` ## Free gift promotions Vendure v1.8 introduced a new **side effect API** to PromotionActions, which allow you to define some additional action to be performed when a Promotion becomes active or inactive. A primary use-case of this API is to add a free gift to the Order. Here's an example of a plugin which implements a "free gift" action: ```ts title="src/plugins/free-gift/free-gift.plugin.ts" import { ID, idsAreEqual, isGraphQlErrorResult, LanguageCode, Logger, OrderLine, OrderService, PromotionItemAction, VendurePlugin, } from "@vendure/core"; import { createHash } from "crypto"; let orderService: OrderService; export const freeGiftAction = new PromotionItemAction({ code: "free_gift", description: [{ languageCode: LanguageCode.en, value: "Add free gifts to the order" }], args: { productVariantIds: { type: "ID", list: true, ui: { component: "product-selector-form-input" }, label: [{ languageCode: LanguageCode.en, value: "Gift product variants" }], }, }, init(injector) { orderService = injector.get(OrderService); }, execute(ctx, orderLine, args) { // This part is responsible for ensuring the variants marked as // "free gifts" have their price reduced to zero if (lineContainsIds(args.productVariantIds, orderLine)) { const unitPrice = orderLine.productVariant.listPriceIncludesTax ? orderLine.unitPriceWithTax : orderLine.unitPrice; return -unitPrice; } return 0; }, // The onActivate function is part of the side effect API, and // allows us to perform some action whenever a Promotion becomes active // due to it's conditions & constraints being satisfied. async onActivate(ctx, order, args, promotion) { for (const id of args.productVariantIds) { if ( !order.lines.find( (line) => idsAreEqual(line.productVariant.id, id) && line.customFields.freeGiftPromotionId == null ) ) { // The order does not yet contain this free gift, so add it const result = await orderService.addItemToOrder(ctx, order.id, id, 1, { freeGiftPromotionId: promotion.id.toString(), }); if (isGraphQlErrorResult(result)) { Logger.error(`Free gift action error for variantId "${id}": ${result.message}`); } } } }, // The onDeactivate function is the other part of the side effect API and is called // when an active Promotion becomes no longer active. It should reverse any // side effect performed by the onActivate function. async onDeactivate(ctx, order, args, promotion) { const linesWithFreeGift = order.lines.filter( (line) => line.customFields.freeGiftPromotionId === promotion.id.toString() ); for (const line of linesWithFreeGift) { await orderService.removeItemFromOrder(ctx, order.id, line.id); } }, }); function lineContainsIds(ids: ID[], line: OrderLine): boolean { return !!ids.find((id) => idsAreEqual(id, line.productVariant.id)); } @VendurePlugin({ configuration: (config) => { config.customFields.OrderLine.push({ name: "freeGiftPromotionId", type: "string", public: true, readonly: true, nullable: true, }); config.customFields.OrderLine.push({ name: "freeGiftDescription", type: "string", public: true, readonly: true, nullable: true, }); config.promotionOptions.promotionActions.push(freeGiftAction); return config; }, }) export class FreeGiftPromotionPlugin {} ``` ## Dependency relationships It is possible to establish dependency relationships between a PromotionAction and one or more PromotionConditions. For example, if we want to set up a "buy 1, get 1 free" offer, we need to: 1. Establish whether the Order contains the particular ProductVariant under offer (done in the PromotionCondition) 2. Apply a discount to the qualifying OrderItem (done in the PromotionAction) In this scenario, we would have to repeat the logic for checking the Order contents in _both_ the PromotionCondition _and_ the PromotionAction. Not only is this duplicated work for the server, it also means that setting up the promotion relies on the same parameters being input into the PromotionCondition and the PromotionAction. Instead, we can say that the PromotionAction _depends_ on the PromotionCondition: ```ts export const buy1Get1FreeAction = new PromotionItemAction({ code: 'buy_1_get_1_free', description: [{ languageCode: LanguageCode.en, value: 'Buy 1, get 1 free', }], args: {}, // highlight-next-line conditions: [buyXGetYFreeCondition], execute(ctx, orderItem, orderLine, args, state) { // highlight-next-line const freeItemIds = state.buy_x_get_y_free.freeItemIds; if (idsContainsItem(freeItemIds, orderItem)) { const unitPrice = ctx.channel.pricesIncludeTax ? orderLine.unitPriceWithTax : orderLine.unitPrice; return -unitPrice; } return 0; }, }); ``` In the above code, we are stating that this PromotionAction _depends_ on the `buyXGetYFreeCondition` PromotionCondition. Attempting to create a Promotion using the `buy1Get1FreeAction` without also using the `buyXGetYFreeCondition` will result in an error. In turn, the `buyXGetYFreeCondition` can return a _state object_ with the type `{ [key: string]: any; }` instead of just a `true` boolean value. This state object is then passed to the PromotionConditions which depend on it, as part of the last argument (`state`). ```ts export const buyXGetYFreeCondition = new PromotionCondition({ code: 'buy_x_get_y_free', description: [{ languageCode: LanguageCode.en, value: 'Buy { amountX } of { variantIdsX } products, get { amountY } of { variantIdsY } products free', }], args: { // omitted for brevity }, async check(ctx, order, args) { // logic omitted for brevity if (freeItemIds.length === 0) { return false; } // highlight-next-line return {freeItemIds}; }, }); ``` ## Injecting providers If your PromotionCondition or PromotionAction needs access to the database or other providers, they can be injected by defining an `init()` function in your PromotionAction or PromotionCondition. See the [configurable operation guide](/guides/developer-guide/strategies-configurable-operations/#injecting-dependencies) for details.
--- title: "Shipping & Fulfillment" --- import Tabs from '@theme/Tabs'; import TabItem from '@theme/TabItem'; Shipping in Vendure is handled by [ShippingMethods](/reference/typescript-api/entities/shipping-method/). A ShippingMethod is composed of a **checker** and a **calculator**. * The [`ShippingEligibilityChecker`](/reference/typescript-api/shipping/shipping-eligibility-checker/) determines whether the order is eligible for the ShippingMethod. It can contain custom logic such as checking the total weight of the order, or whether the order is being shipped to a particular country. * The [`ShippingCalculator`](/reference/typescript-api/shipping/shipping-calculator/) calculates the cost of shipping the order. The calculation can be performed directly by the calculator itself, or it could call out to a third-party API to determine the cost. ![Shipping method](./shipping-method.webp) Multiple shipping methods can be set up and then your storefront can query [`eligibleShippingMethods`](/reference/graphql-api/shop/queries/#eligibleshippingmethods) to find out which ones can be applied to the active order. When querying `eligibleShippingMethods`, each of the defined ShippingMethods' checker functions is executed to find out whether the order is eligible for that method, and if so, the calculator is executed to determine what the cost of shipping will be for that method. <Tabs> <TabItem value="Request" label="Request" default> ```graphql title="Shop API" query GetEligibleShippingMethods { eligibleShippingMethods { id name price priceWithTax } } ``` </TabItem> <TabItem value="Response" label="Response"> ```json { "data": { "eligibleShippingMethods": [ { "id": "1", "name": "Standard Shipping", "price": 500, "priceWithTax": 500 }, { "id": "2", "name": "Express Shipping", "price": 1000, "priceWithTax": 1000 } ] } } ``` </TabItem> </Tabs> ## Creating a custom checker Custom checkers can be created by defining a [`ShippingEligibilityChecker` object](/reference/typescript-api/shipping/shipping-eligibility-checker/). For example, you could create a checker which works with a custom "weight" field to only apply to orders below a certain weight: ```ts title="src/shipping-methods/max-weight-checker.ts" import { LanguageCode, ShippingEligibilityChecker } from '@vendure/core'; export const maxWeightChecker = new ShippingEligibilityChecker({ code: 'max-weight-checker', description: [ {languageCode: LanguageCode.en, value: 'Max Weight Checker'} ], args: { maxWeight: { type: 'int', ui: {component: 'number-form-input', suffix: 'grams'}, label: [{languageCode: LanguageCode.en, value: 'Maximum order weight'}], description: [ { languageCode: LanguageCode.en, value: 'Order is eligible only if its total weight is less than the specified value', }, ], }, }, /** * Must resolve to a boolean value, where `true` means that the order is * eligible for this ShippingMethod. * * (This example assumes a custom field "weight" is defined on the * ProductVariant entity) */ check: (ctx, order, args) => { const totalWeight = order.lines .map(l => l.productVariant.customFields.weight ?? 0 * l.quantity) .reduce((total, lineWeight) => total + lineWeight, 0); return totalWeight <= args.maxWeight; }, }); ``` Custom checkers are then passed into the VendureConfig [ShippingOptions](/reference/typescript-api/shipping/shipping-options/#shippingeligibilitycheckers) to make them available when setting up new ShippingMethods: ```ts title="src/vendure-config.ts" import { defaultShippingEligibilityChecker, VendureConfig } from '@vendure/core'; import { maxWeightChecker } from './shipping-methods/max-weight-checker'; export const config: VendureConfig = { // ... shippingOptions: { shippingEligibilityCheckers: [ defaultShippingEligibilityChecker, maxWeightChecker, ], } } ``` ## Creating a custom calculator Custom calculators can be created by defining a [`ShippingCalculator` object](/reference/typescript-api/shipping/shipping-calculator/). For example, you could create a calculator which consults an external data source (e.g. a spreadsheet, database or 3rd-party API) to find out the cost and estimated delivery time for the order. ```ts title="src/shipping-methods/external-shipping-calculator.ts" import { LanguageCode, ShippingCalculator } from '@vendure/core'; import { shippingDataSource } from './shipping-data-source'; export const externalShippingCalculator = new ShippingCalculator({ code: 'external-shipping-calculator', description: [{languageCode: LanguageCode.en, value: 'Calculates cost from external source'}], args: { taxRate: { type: 'int', ui: {component: 'number-form-input', suffix: '%'}, label: [{languageCode: LanguageCode.en, value: 'Tax rate'}], }, }, calculate: async (ctx, order, args) => { // `shippingDataSource` is assumed to fetch the data from some // external data source. const { rate, deliveryDate, courier } = await shippingDataSource.getRate({ destination: order.shippingAddress, contents: order.lines, }); return { price: rate, priceIncludesTax: ctx.channel.pricesIncludeTax, taxRate: args.taxRate, // metadata is optional but can be used to pass arbitrary // data about the shipping estimate to the storefront. metadata: { courier, deliveryDate }, }; }, }); ``` Custom calculators are then passed into the VendureConfig [ShippingOptions](/reference/typescript-api/shipping/shipping-options/#shippingcalculators) to make them available when setting up new ShippingMethods: ```ts import { defaultShippingCalculator, VendureConfig } from '@vendure/core'; import { externalShippingCalculator } from './external-shipping-calculator'; export const config: VendureConfig = { // ... shippingOptions: { shippingCalculators: [ defaultShippingCalculator, externalShippingCalculator, ], } } ``` :::info If your ShippingEligibilityChecker or ShippingCalculator needs access to the database or other providers, see the [configurable operation dependency injection guide](/guides/developer-guide/strategies-configurable-operations/#injecting-dependencies). ::: ## Fulfillments Fulfillments represent the actual shipping status of items in an order. When an order is placed and payment has been settled, the order items are then delivered to the customer in one or more Fulfillments. * **Physical goods:** A fulfillment would represent the actual boxes or packages which are shipped to the customer. When the package leaves the warehouse, the fulfillment is marked as `Shipped`. When the package arrives with the customer, the fulfillment is marked as `Delivered`. * **Digital goods:** A fulfillment would represent the means of delivering the digital goods to the customer, e.g. a download link or a license key. For example, when the link is sent to the customer, the fulfillment can be marked as `Shipped` and then `Delivered`. ### FulfillmentHandlers It is often required to integrate your fulfillment process, e.g. with an external shipping API which provides shipping labels or tracking codes. This is done by defining [FulfillmentHandlers](/reference/typescript-api/fulfillment/fulfillment-handler/) (click the link for full documentation) and passing them in to the `shippingOptions.fulfillmentHandlers` array in your config. By default, Vendure uses a manual fulfillment handler, which requires the Administrator to manually enter the method and tracking code of the Fulfillment. ### Fulfillment state machine Like Orders, Fulfillments are governed by a [finite state machine](/reference/typescript-api/state-machine/fsm/) and by default, a Fulfillment can be in one of the [following states](/reference/typescript-api/fulfillment/fulfillment-state#fulfillmentstate): * `Pending` The Fulfillment has been created * `Shipped` The Fulfillment has been shipped * `Delivered` The Fulfillment has arrived with the customer * `Cancelled` The Fulfillment has been cancelled These states cover the typical workflow for fulfilling orders. However, it is possible to customize the fulfillment workflow by defining a [FulfillmentProcess](/reference/typescript-api/fulfillment/fulfillment-process) and passing it to your VendureConfig: ```ts title="src/vendure-config.ts" import { FulfillmentProcess, VendureConfig } from '@vendure/core'; import { myCustomFulfillmentProcess } from './my-custom-fulfillment-process'; export const config: VendureConfig = { // ... shippingOptions: { process: [myCustomFulfillmentProcess], }, }; ``` :::info For a more detailed look at how custom processes are used, see the [custom order processes guide](/guides/core-concepts/orders/#custom-order-processes). :::
--- title: "Stock Control" --- import Tabs from '@theme/Tabs'; import TabItem from '@theme/TabItem'; Vendure includes features to help manage your stock levels, stock allocations and back orders. The basic purpose is to help you keep track of how many of a given ProductVariant you have available to sell. Stock control is enabled globally via the Global Settings: ![./global-stock-control.webp](./global-stock-control.webp) It can be disabled if, for example, you manage your stock with a separate inventory management system and synchronize stock levels into Vendure automatically. The setting can also be overridden at the individual ProductVariant level. ## Stock Locations Vendure uses the concept of [`StockLocations`](/reference/typescript-api/entities/stock-location/) to represent the physical locations where stock is stored. This could be a warehouse, a retail store, or any other location. If you do not have multiple stock locations, then you can simply use the default location which is created automatically. ![Stock levels](./stock-levels.webp) ### Selecting a stock location When you have multiple stock locations set up, you need a way to determine which location to use when querying stock levels and when allocating stock to orders. This is handled by the [`StockLocationStrategy`](/reference/typescript-api/products-stock/stock-location-strategy/). This strategy exposes a number of methods which are used to determine which location (or locations) to use when: - querying stock levels (`getAvailableStock`) - allocating stock to orders (`forAllocation`) - releasing stock from orders (`forRelease`) - creating sales upon fulfillment (`forSale`) - returning items to stock upon cancellation (`forCancellation`) The default strategy is the [`DefaultStockLocationStrategy`](/reference/typescript-api/products-stock/default-stock-location-strategy), which simply uses the default location for all of the above methods. This is suitable for all cases where there is just a single stock location. If you have multiple stock locations, you'll need to implement a custom strategy which uses custom logic to determine which stock location to use. For instance, you could: - Use the location with the most stock available - Use the location closest to the customer - Use the location which has the cheapest shipping cost ### Displaying stock levels in the storefront The [`StockDisplayStrategy`](/reference/typescript-api/products-stock/stock-display-strategy/) is used to determine how stock levels are displayed in the storefront. The default strategy is the [`DefaultStockDisplayStrategy`](/reference/typescript-api/products-stock/default-stock-display-strategy), which will only display one of three states: `'IN_STOCK'`, `'OUT_OF_STOCK'` or `'LOW_STOCK'`. This is to avoid exposing your exact stock levels to the public, which can sometimes be undesirable. You can implement a custom strategy to display stock levels in a different way. Here's how you would implement a custom strategy to display exact stock levels: ```ts title="src/exact-stock-display-strategy.ts" import { RequestContext, StockDisplayStrategy, ProductVariant } from '@vendure/core'; export class ExactStockDisplayStrategy implements StockDisplayStrategy { getStockLevel(ctx: RequestContext, productVariant: ProductVariant, saleableStockLevel: number): string { return saleableStockLevel.toString(); } } ``` This strategy is then used in your config: ```ts title="src/vendure-config.ts" import { VendureConfig } from '@vendure/core'; import { ExactStockDisplayStrategy } from './exact-stock-display-strategy'; export const config: VendureConfig = { // ... catalogOptions: { stockDisplayStrategy: new ExactStockDisplayStrategy(), }, }; ``` ## Stock Control Concepts * **Stock on hand:** This refers to the number of physical units of a particular variant which you have in stock right now. This can be zero or more, but not negative. * **Allocated:** This refers to the number of units which have been assigned to Orders, but which have not yet been fulfilled. * **Out-of-stock threshold:** This value determines the stock level at which the variant is considered "out of stock". This value is set globally, but can be overridden for specific variants. It defaults to `0`. * **Saleable:** This means the number of units that can be sold right now. The formula is: `saleable = stockOnHand - allocated - outOfStockThreshold` Here's a table to better illustrate the relationship between these concepts: Stock on hand | Allocated | Out-of-stock threshold | Saleable --------------|-----------|------------------------|---------- 10 | 0 | 0 | 10 10 | 0 | 3 | 7 10 | 5 | 0 | 5 10 | 5 | 3 | 2 10 | 10 | 0 | 0 10 | 10 | -5 | 5 The saleable value is what determines whether the customer is able to add a variant to an order. If there is 0 saleable stock, then any attempt to add to the order will result in an [`InsufficientStockError`](/reference/graphql-api/admin/object-types/#insufficientstockerror). <Tabs> <TabItem value="Request" label="Request" default> ```graphql title="Shop API" query AddItemToOrder { addItemToOrder(productVariantId: 123, quantity: 150) { ...on Order { id code totalQuantity } ...on ErrorResult { errorCode message } ...on InsufficientStockError { errorCode message quantityAvailable order { id totalQuantity } } } } ``` </TabItem> <TabItem value="Response" label="Response"> ```json { "data": { "addItemToOrder": { "errorCode": "INSUFFICIENT_STOCK_ERROR", "message": "Only 105 items were added to the order due to insufficient stock", "quantityAvailable": 105, "order": { "id": "2", "totalQuantity": 106 } } } } ``` </TabItem> </Tabs> ### Stock allocation Allocation mean we are setting stock aside because it has been purchased but not yet shipped. It prevents us from selling more of a particular item than we are able to deliver. By default, stock gets allocated to an order once the order transitions to the `PaymentAuthorized` or `PaymentSettled` state. This is defined by the [`DefaultStockAllocationStrategy`](/reference/typescript-api/orders/default-stock-allocation-strategy). Using a custom [`StockAllocationStrategy`](/reference/typescript-api/orders/stock-allocation-strategy/) you can define your own rules for when stock is allocated. With the [`defaultFulfillmentProcess`](/reference/typescript-api/fulfillment/fulfillment-process/#defaultfulfillmentprocess), allocated stock will be converted to **sales** and minused from the `stockOnHand` value when a Fulfillment is created. ### Back orders You may have noticed that the `outOfStockThreshold` value can be set to a negative number. This allows you to sell variants even when you don't physically have them in stock. This is known as a "back order". Back orders can be really useful to allow orders to keep flowing even when stockOnHand temporarily drops to zero. For many businesses with predictable re-supply schedules they make a lot of sense. Once a customer completes checkout, those variants in the order are marked as `allocated`. When a Fulfillment is created, those allocations are converted to Sales and the `stockOnHand` of each variant is adjusted. Fulfillments may only be created if there is sufficient stock on hand. ### Stock movements There is a [`StockMovement`](/reference/typescript-api/entities/stock-movement/) entity which records the history of stock changes. `StockMovement` is actually an abstract class, with the following concrete implementations: - [`Allocation`](/reference/typescript-api/entities/stock-movement/#allocation): When stock is allocated to an order, before the order is fulfilled. Adds stock to `allocated`, which reduces the saleable stock. - [`Sale`](/reference/typescript-api/entities/stock-movement/#sale): When allocated stock gets fulfilled. Removes stock from `allocated` as well as `stockOnHand`. - [`Cancellation`](/reference/typescript-api/entities/stock-movement/#cancellation): When items from a fulfilled order are cancelled, the stock is returned to `stockOnHand`. Adds stock to `stockOnHand`. - [`Release`](/reference/typescript-api/entities/stock-movement/#release): When items which have been allocated (but not yet converted to sales via the creation of a Fulfillment) are cancelled. Removes stock from `allocated`. - [`StockAdjustment`](/reference/typescript-api/entities/stock-movement/#stockadjustment): A general-purpose stock adjustment. Adds or removes stock from `stockOnHand`. Used when manually setting stock levels via the Admin UI, for example. Stock movements can be queried via the `ProductVariant.stockMovements`. Here's an example where we query the stock levels and stock movements of a particular variant: <Tabs> <TabItem value="Request" label="Request" default> ```graphql title="Admin API" query GetStockMovements { productVariant(id: 1) { id name stockLevels { stockLocation { name } stockOnHand stockAllocated } stockMovements { items { ...on StockMovement { createdAt type quantity } } } } } ``` </TabItem> <TabItem value="Response" label="Response"> ```json { "data": { "productVariant": { "id": "1", "name": "Laptop 13 inch 8GB", "stockLevels": [ { "stockLocation": { "name": "Default Stock Location" }, "stockOnHand": 100, "stockAllocated": 0 } ], "stockMovements": { "items": [ { "createdAt": "2023-07-13T13:21:10.000Z", "type": "ADJUSTMENT", "quantity": 100 } ] } } } } ``` </TabItem> </Tabs>
--- title: "Deploying the Admin UI" showtoc: true --- If you have customized the Admin UI with extensions, you should [compile your extensions ahead of time as part of the deployment process](/guides/extending-the-admin-ui/getting-started/#compiling-as-a-deployment-step). ## Setting the API host & port When running in development mode, the Admin UI app will "guess" the API host and port based on the current URL in the browser. Typically, this will be `http://localhost:3000`. For production deployments where the Admin UI app is served from a different host or port than the Vendure server, you'll need to configure the Admin UI app to point to the correct API host and port. ```ts title="src/vendure-config.ts" import { VendureConfig } from '@vendure/core'; import { AdminUiPlugin } from '@vendure/admin-ui-plugin'; const config: VendureConfig = { // ... plugins: [ AdminUiPlugin.init({ port: 3001, route: 'admin', adminUiConfig: { apiHost: 'https://api.example.com', apiPort: 443, }, }), ], }; ``` ## Deploying a stand-alone Admin UI Usually, the Admin UI is served from the Vendure server via the AdminUiPlugin. However, you may wish to deploy the Admin UI app elsewhere. Since it is just a static Angular app, it can be deployed to any static hosting service such as Vercel or Netlify. #### Metrics The AdminUiPlugin not only serves the Admin UI app, but also provides a `metricSummary` query which is used to display the order metrics on the dashboard. If you wish to deploy the Admin UI app stand-alone (not served by the AdminUiPlugin), but still want to display the metrics on the dashboard, you'll need to include the AdminUiPlugin in your server's plugins array, but do not call `init()`: ```ts title="src/vendure-config.ts" import { AdminUiPlugin } from '@vendure/admin-ui-plugin'; const config: VendureConfig = { plugins: [ AdminUiPlugin, // <== include the plugin, but don't call init() ], // ... }; ``` #### Example Script Here's an example script that can be run as part of your host's `build` command, which will generate a stand-alone app bundle and configure it to point to your remote server API. This example is for Vercel, and assumes: * A `BASE_HREF` environment variable to be set to `/` * A public (output) directory set to `build/dist` * A build command set to `npm run build` or `yarn build` * A package.json like this: ```json title="package.json" { "name": "standalone-admin-ui", "version": "0.1.0", "private": true, "scripts": { "build": "ts-node compile.ts" }, "devDependencies": { "@vendure/ui-devkit": "^1.4.5", "ts-node": "^10.2.1", "typescript": "~4.3.5" } } ``` ```ts title="compile.ts" import { compileUiExtensions } from '@vendure/ui-devkit/compiler'; import { DEFAULT_BASE_HREF } from '@vendure/ui-devkit/compiler/constants'; import path from 'path'; import { promises as fs } from 'fs'; /** * Compiles the Admin UI. If the BASE_HREF is defined, use that. * Otherwise, go back to the default admin route. */ compileUiExtensions({ outputPath: path.join(__dirname, 'build'), baseHref: process.env.BASE_HREF ?? DEFAULT_BASE_HREF, extensions: [ /* any UI extensions would go here, or leave empty */ ], }) .compile?.() .then(() => { // If building for Vercel deployment, replace the config to make // api calls to api.example.com instead of localhost. if (process.env.VERCEL) { console.log('Overwriting the vendure-ui-config.json for Vercel deployment.'); return fs.writeFile( path.join(__dirname, 'build', 'dist', 'vendure-ui-config.json'), JSON.stringify({ apiHost: 'https://api.example.com', apiPort: '443', adminApiPath: 'admin-api', tokenMethod: 'cookie', defaultLanguage: 'en', availableLanguages: ['en', 'de'], hideVendureBranding: false, hideVersion: false, }), ); } }) .then(() => { process.exit(0); }); ```
--- title: "Getting data into production" showtoc: true weight: 4 --- # Getting data into production Once you have set up your production deployment, you'll need some way to get your products and other data into the system. The main tasks will be: 1. Creation of the database schema 2. Importing initial data like roles, tax rates, countries etc. 3. Importing catalog data like products, variants, options, facets 4. Importing other data used by your application ## Creating the database schema The first item - creation of the schema - can be automatically handled by TypeORM's `synchronize` feature. Switching it on for the initial run will automatically create the schema. This can be done by using an environment variable: ```ts title="src/vendure-config.ts" import { VendureConfig } from '@vendure/core'; export const config: VendureConfig = { // ... dbConnectionOptions: { type: 'postgres', // highlight-next-line synchronize: process.env.DB_SYNCHRONIZE, host: process.env.DB_HOST, port: process.env.DB_PORT, username: process.env.DB_USER, password: process.env.DB_PASSWORD, database: process.env.DB_DATABASE, }, // ... }; ``` Set the `DB_SYNCHRONIZE` variable to `true` on first start, and then after the schema is created, set it to `false`. ## Importing initial & catalog data Importing initial and catalog data can be handled by Vendure `populate()` helper function - see the [Importing Product Data guide](/guides/developer-guide/importing-data/). ## Importing other data Any kinds of data not covered by the `populate()` function can be imported using a custom script, which can use any Vendure service or service defined by your custom plugins to populate data in any way you like. See the [Stand-alone scripts guide](/guides/developer-guide/stand-alone-scripts/).
--- title: "Horizontal scaling" showtoc: true weight: 2 --- # Horizontal scaling "Horizontal scaling" refers to increasing the performance capacity of your application by running multiple instances. This type of scaling has two main advantages: 1. It can enable increased throughput (requests/second) by distributing the incoming requests between multiple instances. 2. It can increase resilience because if a single instance fails, the other instances will still be able to service requests. As discussed in the [Server resource requirements guide](/guides/deployment/server-resource-requirements), horizontal scaling can be the most cost-effective way of deploying your Vendure server due to the single-threaded nature of Node.js. In Vendure, both the server and the worker can be scaled horizontally. Scaling the server will increase the throughput of the GraphQL APIs, whereas scaling the worker can increase the speed with which the job queue is processed by allowing more jobs to be run in parallel. ## Multi-instance configuration In order to run Vendure in a multi-instance configuration, there are some important configuration changes you'll need to make. The key consideration in configuring Vendure for this scenario is to ensure that any persistent state is managed externally from the Node process, and is shared by all instances. Namely: * The JobQueue should be stored externally using the [DefaultJobQueuePlugin](/reference/typescript-api/job-queue/default-job-queue-plugin/) (which stores jobs in the database) or the [BullMQJobQueuePlugin](/reference/core-plugins/job-queue-plugin/bull-mqjob-queue-plugin) (which stores jobs in Redis), or some other custom JobQueueStrategy. **Note:** the BullMQJobQueuePlugin is much more efficient than the DefaultJobQueuePlugin, and is recommended for production applications. * A custom [SessionCacheStrategy](/reference/typescript-api/auth/session-cache-strategy/) must be used which stores the session cache externally (such as in the database or Redis), since the default strategy stores the cache in-memory and will cause inconsistencies in multi-instance setups. [Example Redis-based SessionCacheStrategy](/reference/typescript-api/auth/session-cache-strategy/) * When using cookies to manage sessions, make sure all instances are using the _same_ cookie secret: ```ts title="src/vendure-config.ts" const config: VendureConfig = { authOptions: { cookieOptions: { secret: 'some-secret' } } } ``` * Channel and Zone data gets cached in-memory as this data is used in virtually every request. The cache time-to-live defaults to 30 seconds, which is probably fine for most cases, but it can be configured in the [EntityOptions](/reference/typescript-api/configuration/entity-options/#channelcachettl). ## Using Docker or Kubernetes One way of implementing horizontal scaling is to use Docker to wrap your Vendure server & worker in a container, which can then be run as multiple instances. Some hosting providers allow you to provide a Docker image and will then run multiple instances of that image. Kubernetes can also be used to manage multiple instances of a Docker image. For a more complete guide, see the [Using Docker guide](/guides/deployment/using-docker). ## Using PM2 [PM2](https://pm2.keymetrics.io/) is a process manager which will spawn multiple instances of your server or worker, as well as re-starting any instances that crash. PM2 can be used on VPS hosts to manage multiple instances of Vendure without needing Docker or Kubernetes. PM2 must be installed on your server: ```sh npm install pm2@latest -g ``` Your processes can then be run in [cluster mode](https://pm2.keymetrics.io/docs/usage/cluster-mode/) with the following command: ```sh pm2 start ./dist/index.js -i 4 ``` The above command will start a cluster of 4 instances. You can also instruct PM2 to use the maximum number of available CPUs with `-i max`. Note that if you are using pm2 inside a Docker container, you should use the `pm2-runtime` command: ```dockerfile # ... your existing Dockerfile config RUN npm install pm2 -g CMD ["pm2-runtime", "app.js", "-i", "max"] ```
--- title: 'Server resource requirements' showtoc: true weight: 1 --- ## Server resource requirements ### RAM The Vendure server and worker process each use around 200-300MB of RAM when idle. This figure will increase under load. The total RAM required by a single instance of the server depends on your project size (the number of products, variants, customers, orders etc.) as well as expected load (the number of concurrent users you expect). As a rule, 512MB per process would be a practical minimum for a smaller project with low expected load. ### CPU CPU resources are generally measured in "cores" or "vCPUs" (virtual CPUs) depending on the type of hosting. The exact relationship between vCPUs and physical CPU cores is out of the scope of this guide, but for our purposes we will use "CPU" to refer to both physical and virtual CPU resources. Because Node.js is single-threaded, a single instance of the Vendure server or worker will not be able to take advantage of multiple CPUs. For example, if you set up a server instance running with 4 CPUs, the server will only use 1 of those CPUs and the other 3 will be wasted. Therefore, when looking to optimize performance (for example, the number of requests that can be serviced per second), it makes sense to scale horizontally by running multiple instances of the Vendure server. See the [Horizontal Scaling guide](/guides/deployment/horizontal-scaling). ## Load testing It is important to test whether your current server configuration will be able to handle the loads you expect when you go into production. There are numerous tools out there to help you load test your application, such as: - [k6](https://k6.io/) - [Artillery](https://www.artillery.io/) - [jMeter](https://jmeter.apache.org/)
--- title: "Using docker" showtoc: true weight: 3 --- # Using Docker [Docker](https://docs.docker.com/) is a technology which allows you to run your Vendure application inside a [container](https://docs.docker.com/get-started/#what-is-a-container). The default installation with `@vendure/create` includes a sample Dockerfile: ```dockerfile title="Dockerfile" FROM node:16 WORKDIR /usr/src/app COPY package.json ./ COPY package-lock.json ./ RUN npm install --production COPY . . RUN npm run build ``` This Dockerfile can then be built into an "image" using: ```sh docker build -t vendure . ``` This same image can be used to run both the Vendure server and the worker: ```sh # Run the server docker run -dp 3000:3000 --name vendure-server vendure npm run start:server # Run the worker docker run -dp 3000:3000 --name vendure-worker vendure npm run start:worker ``` Here is a breakdown of the command used above: - `docker run` - run the image we created with `docker build` - `-dp 3000:3000` - the `-d` flag means to run in "detached" mode, so it runs in the background and does not take control of your terminal. `-p 3000:3000` means to expose port 3000 of the container (which is what Vendure listens on by default) as port 3000 on your host machine. - `--name vendure-server` - we give the container a human-readable name. - `vendure` - we are referencing the tag we set up during the build. - `npm run start:server` - this last part is the actual command that should be run inside the container. ## Docker Compose Managing multiple docker containers can be made easier using [Docker Compose](https://docs.docker.com/compose/). In the below example, we use the same Dockerfile defined above, and we also define a Postgres database to connect to: ```yaml version: "3" services: server: build: context: . dockerfile: Dockerfile ports: - 3000:3000 command: ["npm", "run", "start:server"] volumes: - /usr/src/app environment: DB_HOST: database DB_PORT: 5432 DB_NAME: vendure DB_USERNAME: postgres DB_PASSWORD: password worker: build: context: . dockerfile: Dockerfile command: ["npm", "run", "start:worker"] volumes: - /usr/src/app environment: DB_HOST: database DB_PORT: 5432 DB_NAME: vendure DB_USERNAME: postgres DB_PASSWORD: password database: image: postgres volumes: - /var/lib/postgresql/data ports: - 5432:5432 environment: POSTGRES_PASSWORD: password POSTGRES_DB: vendure ``` ## Kubernetes [Kubernetes](https://kubernetes.io/) is used to manage multiple containerized applications. This deployment starts the shop container we created above as both worker and server. ```yaml apiVersion: apps/v1 kind: Deployment metadata: name: vendure-shop spec: selector: matchLabels: app: vendure-shop replicas: 1 template: metadata: labels: app: vendure-shop spec: containers: - name: server image: vendure-shop:latest command: - node args: - "dist/index.js" env: # your env config here ports: - containerPort: 3000 - name: worker image: vendure-shop:latest imagePullPolicy: Always command: - node args: - "dist/index-worker.js" env: # your env config here ports: - containerPort: 3000 ``` ## Health/Readiness Checks If you wish to deploy with Kubernetes or some similar system, you can make use of the health check endpoints. ### Server This is a regular REST route (note: _not_ GraphQL), available at `/health`. ```text REQUEST: GET http://localhost:3000/health ``` ```json { "status": "ok", "info": { "database": { "status": "up" } }, "error": {}, "details": { "database": { "status": "up" } } } ``` Health checks are built on the [Nestjs Terminus module](https://docs.nestjs.com/recipes/terminus). You can also add your own health checks by creating plugins that make use of the [HealthCheckRegistryService](/reference/typescript-api/health-check/health-check-registry-service/). ### Worker Although the worker is not designed as an HTTP server, it contains a minimal HTTP server specifically to support HTTP health checks. To enable this, you need to call the `startHealthCheckServer()` method after bootstrapping the worker: ```ts bootstrapWorker(config) .then(worker => worker.startJobQueue()) .then(worker => worker.startHealthCheckServer({ port: 3020 })) .catch(err => { console.log(err); }); ``` This will make the `/health` endpoint available. When the worker instance is running, it will return the following: ```text REQUEST: GET http://localhost:3020/health ``` ```json { "status": "ok" } ```
--- title: "Deploying to Digital Ocean" --- ![Deploy to Digital Ocean App Platform](./deploy-to-do-app-platform.webp) [App Platform](https://www.digitalocean.com/products/app-platform) is a fully managed platform which allows you to deploy and scale your Vendure server and infrastructure with ease. :::note The configuration in this guide will cost around $22 per month to run. ::: ## Prerequisites First of all you'll need to [create a new Digital Ocean account](https://cloud.digitalocean.com/registrations/new) if you don't already have one. For this guide you'll need to have your Vendure project in a git repo on either GitHub or GitLab. App Platform also supports deploying from docker registries, but that is out of the scope of this guide. :::info If you'd like to quickly get started with a ready-made Vendure project which includes sample data, you can clone our [Vendure one-click-deploy repo](https://github.com/vendure-ecommerce/one-click-deploy). ::: ## Configuration ### Database connection :::info The following is already pre-configured if you are using the one-click-deploy repo. ::: Make sure your DB connection options uses the following environment variables: ```ts title="src/vendure-config.ts" import { VendureConfig } from '@vendure/core'; export const config: VendureConfig = { // ... dbConnectionOptions: { // ... type: 'postgres', database: process.env.DB_NAME, host: process.env.DB_HOST, port: +process.env.DB_PORT, username: process.env.DB_USERNAME, password: process.env.DB_PASSWORD, ssl: process.env.DB_CA_CERT ? { ca: process.env.DB_CA_CERT, } : undefined, }, }; ``` ### Asset storage :::info The following is already pre-configured if you are using the one-click-deploy repo. ::: Since App Platform services do not include any persistent storage, we need to configure Vendure to use Digital Ocean's Spaces service, which is an S3-compatible object storage service. This means you'll need to make sure to have the following packages installed: ``` npm install @aws-sdk/client-s3 @aws-sdk/lib-storage ``` and set up your AssetServerPlugin like this: ```ts title="src/vendure-config.ts" import { VendureConfig } from '@vendure/core'; import { AssetServerPlugin, configureS3AssetStorage } from '@vendure/asset-server-plugin'; export const config: VendureConfig = { // ... plugins: [ AssetServerPlugin.init({ route: 'assets', assetUploadDir: process.env.ASSET_UPLOAD_DIR || path.join(__dirname, '../static/assets'), // highlight-start // If the MINIO_ENDPOINT environment variable is set, we'll use // Minio as the asset storage provider. Otherwise, we'll use the // default local provider. storageStrategyFactory: process.env.MINIO_ENDPOINT ? configureS3AssetStorage({ bucket: 'vendure-assets', credentials: { accessKeyId: process.env.MINIO_ACCESS_KEY, secretAccessKey: process.env.MINIO_SECRET_KEY, }, nativeS3Configuration: { endpoint: process.env.MINIO_ENDPOINT, forcePathStyle: true, signatureVersion: 'v4', // The `region` is required by the AWS SDK even when using MinIO, // so we just use a dummy value here. region: 'eu-west-1', }, }) : undefined, // highlight-end }), ], // ... }; ``` ## Create Spaces Object Storage First we'll create a Spaces bucket to store our assets. Click the "Spaces Object Storage" nav item and create a new space and call it "vendure-assets". ![Create Spaces Object Storage](./01-create-space.webp) Next we need to create an access key and secret. Click the "API" nav item and generate a new key. ![Create API key](./02-space-access-keys.webp) Name the key something meaningful like "vendure-assets-key" and then **make sure to copy the secret as it will only be shown once**. Store the access key and secret key in a safe place for later - we'll be using it when we set up our app's environment variables. :::caution If you forget to copy the secret key, you'll need to delete the key and create a new one. ::: ## Create the server resource Now we're ready to create our app infrastructure! Click the "Create" button in the top bar and select "Apps". ![Create App](./03-create-app.webp) Now connect to your git repo, and select the repo of your Vendure project. Depending on your repo, App Platform may suggest more than one app: in this screenshot we are using the one-click-deploy repo which contains a Dockerfile, so App Platform is suggesting two different ways to deploy the app. We'll select the Dockerfile option, but either option should work fine. Delete the unused resource. We need to edit the details of the server app. Click the "Edit" button and set the following: * **Resource Name**: "vendure-server" * **Resource Type**: Web Service * **Run Command**: `node ./dist/index.js` * **HTTP Port**: 3000 At this point you can also click the "Edit Plan" button to select the resource allocation for the server, which will determine performance and price. For testing purposes the smallest Basic server (512MB, 1vCPU) is fine. This can also be changed later. ### Add a database Next click "Add Resource", select **Database** and click "Add", and then accept the default Postgres database. Click the "Create and Attach" to create the database and attach it to the server app. Your config should now look like this: ![App setup](./04-configure-server.webp) ## Set up environment variables Next we need to set up the environment variables. Since these will be shared by both the server and worker apps, we'll create them at the Global level. You can use the "bulk editor" to paste in the following variables (making sure to replace the values in `<angle brackets>` with your own values): ```sh DB_NAME=${db.DATABASE} DB_USERNAME=${db.USERNAME} DB_PASSWORD=${db.PASSWORD} DB_HOST=${db.HOSTNAME} DB_PORT=${db.PORT} DB_CA_CERT=${db.CA_CERT} // highlight-next-line COOKIE_SECRET=<add some random characters> SUPERADMIN_USERNAME=superadmin // highlight-next-line SUPERADMIN_PASSWORD=<create some strong password> // highlight-start MINIO_ACCESS_KEY=<use the key generated earlier> MINIO_SECRET_KEY=<use the secret generated earlier> MINIO_ENDPOINT=<use the endpoint of your spaces bucket> // highlight-end ``` :::note The values starting with `${db...}` are automatically populated by App Platform and should not be changed, unless you chose to name your database something other than `db`. ::: After saving your environment variables you can click through the confirmation screens to create the app. ## Create the worker resource Now we need to set up the [Vendure worker](/guides/developer-guide/worker-job-queue/) which will handle background tasks. From the dashboard of your newly-created app, click the "Create" button and then select "Create Resources From Source Code". You will be prompted to select the repo again, and then you'll need to set up a new single resource with the following settings: * **Resource Name**: "vendure-worker" * **Resource Type**: Worker * **Run Command**: `node ./dist/index-worker.js` Again you can edit the plan, and the smallest Basic plan is fine for testing purposes. No new environment variables are needed since we'll be sharing the Global variables with the worker. ## Test your Vendure server Once everything has finished deploying, you can click the app URL to open your Vendure server in a new tab. ![Open app](./05-open-app.webp) :::info Append `/admin` to the URL to access the admin UI, and log in with the superadmin credentials you set in the environment variables. :::
--- title: "Deploying to Google Cloud Run" images: - "/docs/deployment/deploy-to-google-cloud-run/deploy-to-gcr.webp" --- ![./deploy-to-gcr.webp](./deploy-to-gcr.webp) [Google Cloud Run](https://cloud.google.com/run) is a fully managed platform which allows you to run containerized apps and only pay while your app code is actually running. This guide was written by Martijn from [Pinelab](https://pinelab.studio/), who have been successfully running multiple Vendure projects on Google Cloud Run. The step by step commands can be found here on GitHub: - https://github.com/Pinelab-studio/vendure-google-cloud-run-starter/blob/main/README.md. ## Prerequisites This guide assumes you have: * Google cloud's `gcloud` cli installed locally * Created a Google Cloud project and enabled the API's we need: https://github.com/Pinelab-studio/vendure-google-cloud-run-starter/blob/main/README.md#create-a-google-cloud-project ## Setting up a MySQL database with Google Cloud SQL Google Cloud SQL is a fully-managed relational database service that makes it easy to set up, maintain, and manage databases in the cloud. Vendure requires an SQL database to store its data, and Google Cloud SQL is a great option for this because it provides a reliable, scalable, and secure way to host our database. You can find the `gcloud` commands to create a MySQL database here: https://github.com/Pinelab-studio/vendure-google-cloud-run-starter/blob/main/README.md#create-a-mysql-database ## Google Cloud Storage for assets Vendure stores assets such as product images on file system by default. However, Google Cloud Run does not have internal file storage, so we need to use an external storage service. Google Cloud Storage is a great option for this because it provides a scalable and reliable way to store our assets in the cloud. Use these `gcloud` [commands](https://github.com/Pinelab-studio/vendure-google-cloud-run-starter/blob/main/README.md#asset-storage) to create a storage bucket for our assets. ## Google Cloud Tasks for Vendure's worker Vendure uses a worker process to perform asynchronous tasks such as sending emails. To communicate between the main application and the worker process, we need a message queue. Google Cloud Tasks is a great option for this because it provides a fully-managed, scalable, and reliable way to send and receive messages between applications. You don't need to do anything to enable Cloud Tasks: [this plugin](https://github.com/Pinelab-studio/vendure-google-cloud-run-starter/blob/8fd342c15fa7b38e3662311f176901a5d38cde3d/src/vendure-config.ts#L88) automatically creates task queues for you. ## Running locally Let's test out our application locally before deploying to Cloud Run. Copy [this](https://github.com/Pinelab-studio/vendure-google-cloud-run-starter/blob/main/.env.example) `.env.example` to `.env` and fill in your variables. You can skip the `WORKER_HOST` variable, because we don't have it yet. ## Dockerize Vendure Google Cloud Run allows us to deploy containerized applications without worrying about the underlying infrastructure. To deploy Vendure to Google Cloud Run, we need to Dockerize it. Dockerizing Vendure means packaging the application and its dependencies into a container that can be easily deployed to Google Cloud Run. The setup for containerizing Vendure is already done: [This file](https://github.com/Pinelab-studio/vendure-google-cloud-run-starter/blob/main/Dockerfile) and [this file](https://github.com/Pinelab-studio/vendure-google-cloud-run-starter/blob/main/build-docker.sh) will build your container. ## Deployment The example repository contains GitHub action definitions to automatically deploy your app to Cloud Run when you push to the `main` branch. Follow [these steps](https://github.com/Pinelab-studio/vendure-google-cloud-run-starter/blob/main/build-docker.sh) to create a service account and set your variables as repository secret in GitHub. ## Keep alive As final improvement, you can use Google Cloud Scheduler to poll your Cloud Run instance to prevent cold starts with [this command](https://github.com/Pinelab-studio/vendure-google-cloud-run-starter/blob/main/build-docker.sh). That's it! Feel free to reach out for any questions, or create a [Pull Request in the repository](https://github.com/Pinelab-studio/vendure-google-cloud-run-starter/pulls) if you have any improvements.
--- title: "Deploying to Northflank" showtoc: true images: - "/docs/deployment/deploy-to-northflank/deploy-to-northflank.webp" --- import Tabs from '@theme/Tabs'; import TabItem from '@theme/TabItem'; ![./deploy-to-northflank.webp](./deploy-to-northflank.webp) [Northflank](https://northflank.com) is a comprehensive developer platform to build and scale your apps. It has an outstanding developer experience and has a free tier for small projects, and is well-suited for deploying and scaling Vendure applications. This guide will walk you through the steps to deploy [a sample Vendure application](https://github.com/vendure-ecommerce/one-click-deploy) to Northflank. ## Set up a Northflank account Go to the Northflank [sign up page](https://app.northflank.com/signup) to create a new account. As part of the sign-up you'll be asked for credit card details, but you won't be charged unless you upgrade to a paid plan. ## Create a custom template A template defines the infrastructure that is needed to run your Vendure server. Namely, a **server**, a **worker**, **MinIO object storage** for assets and a **Postgres database**. Click the templates menu item in the navbar and click the "Create template" button. ![./01-create-template-screen.webp](./01-create-template-screen.webp) Now paste the following configuration into the editor in the "code" tab: ![./02-paste-config.webp](./02-paste-config.webp) <Tabs> <TabItem label="Full Template" value="Full Template"> :::note This template configures a production-like setup for Vendure, with the server and worker running in separate processes and a separate MinIO instance for asset storage. The resources configured here will cost around $20 per month. If you want to use the free plan, use the "Lite Template". ::: <div class="limited-height-code-block"> ```json { "apiVersion": "v1", "name": "Vendure Template", "description": "Vendure is a modern, open-source composable commerce platform", "project": { "spec": { "name": "Vendure", "region": "europe-west", "description": "Vendure is a modern, open-source composable commerce platform", "color": "#57637A" } }, "spec": { "kind": "Workflow", "spec": { "type": "sequential", "steps": [ { "kind": "Workflow", "spec": { "type": "parallel", "steps": [ { "kind": "Addon", "ref": "database", "spec": { "name": "database", "type": "postgres", "version": "14-latest", "billing": { "deploymentPlan": "nf-compute-20", "storageClass": "ssd", "storage": 4096, "replicas": 1 }, "tlsEnabled": false, "externalAccessEnabled": false, "ipPolicies": [], "pitrEnabled": false } }, { "kind": "Addon", "ref": "storage", "spec": { "name": "minio", "type": "minio", "version": "latest", "billing": { "deploymentPlan": "nf-compute-20", "storageClass": "ssd", "storage": 4096, "replicas": 1 }, "tlsEnabled": true, "externalAccessEnabled": false, "ipPolicies": [], "pitrEnabled": false, "typeSpecificSettings": {}, "backupSchedules": [] } } ] } }, { "kind": "SecretGroup", "spec": { "secretType": "environment-arguments", "priority": 10, "name": "secrets", "secrets": { "variables": { "APP_ENV": "production", "COOKIE_SECRET": "${fn.randomSecret(32)}", "SUPERADMIN_USERNAME": "superadmin", "SUPERADMIN_PASSWORD": "${fn.randomSecret(16)}", "DB_SCHEMA": "public" }, "files": {} }, "addonDependencies": [ { "addonId": "${refs.database.id}", "keys": [ { "keyName": "HOST", "aliases": [ "DB_HOST" ] }, { "keyName": "PORT", "aliases": [ "DB_PORT" ] }, { "keyName": "DATABASE", "aliases": [ "DB_NAME" ] }, { "keyName": "USERNAME", "aliases": [ "DB_USERNAME" ] }, { "keyName": "PASSWORD", "aliases": [ "DB_PASSWORD" ] } ] }, { "addonId": "${refs.storage.id}", "keys": [ { "keyName": "MINIO_ENDPOINT", "aliases": [ "MINIO_ENDPOINT" ] }, { "keyName": "ACCESS_KEY", "aliases": [ "MINIO_ACCESS_KEY" ] }, { "keyName": "SECRET_KEY", "aliases": [ "MINIO_SECRET_KEY" ] } ] } ], "restrictions": { "restricted": false, "nfObjects": [], "tags": [] } } }, { "kind": "BuildService", "ref": "builder", "spec": { "name": "builder", "billing": { "deploymentPlan": "nf-compute-20" }, "vcsData": { "projectUrl": "https://github.com/vendure-ecommerce/one-click-deploy", "projectType": "github" }, "buildSettings": { "dockerfile": { "buildEngine": "kaniko", "dockerFilePath": "/Dockerfile", "dockerWorkDir": "/", "useCache": false } }, "disabledCI": false, "buildArguments": {} } }, { "kind": "Build", "spec": { "id": "${refs.builder.id}", "type": "service", "branch": "master", "buildOverrides": { "buildArguments": {} }, "reuseExistingBuilds": true }, "condition": "success", "ref": "build" }, { "kind": "Workflow", "spec": { "type": "parallel", "steps": [ { "kind": "DeploymentService", "spec": { "deployment": { "instances": 1, "docker": { "configType": "customCommand", "customCommand": "node ./dist/index.js" }, "internal": { "buildId": "${refs.build.id}", "buildSHA": "latest" } }, "name": "server", "billing": { "deploymentPlan": "nf-compute-20" }, "ports": [ { "name": "app", "internalPort": 3000, "public": true, "protocol": "HTTP", "security": { "credentials": [], "policies": [] }, "domains": [], "disableNfDomain": false } ], "runtimeEnvironment": {}, "runtimeFiles": {} } }, { "kind": "DeploymentService", "spec": { "name": "worker", "billing": { "deploymentPlan": "nf-compute-10" }, "deployment": { "instances": 1, "docker": { "configType": "customCommand", "customCommand": "node ./dist/index-worker.js" }, "internal": { "buildId": "${refs.build.id}", "buildSHA": "latest" } }, "ports": [], "runtimeEnvironment": {} } } ] } } ] } } } ``` </div> </TabItem> <TabItem label="Lite Template" value="Lite Template"> :::note This template runs the Vendure server & worker in a single process, and as such will fit within the resource limits of the Northflank free plan. Local disk storage is used for assets, which means that horizontal scaling is not possible. This setup is suitable for testing purposes, but is not recommended for production use. ::: <div class="limited-height-code-block"> ```json { "apiVersion": "v1", "name": "Vendure Lite Template", "description": "Vendure is a modern, open-source composable commerce platform", "project": { "spec": { "name": "Vendure Lite", "region": "europe-west", "description": "Vendure is a modern, open-source composable commerce platform", "color": "#17b9ff" } }, "spec": { "kind": "Workflow", "spec": { "type": "sequential", "steps": [ { "kind": "Addon", "spec": { "name": "database", "type": "postgres", "version": "14-latest", "billing": { "deploymentPlan": "nf-compute-20", "storageClass": "ssd", "storage": 4096, "replicas": 1 }, "tlsEnabled": false, "externalAccessEnabled": false, "ipPolicies": [], "pitrEnabled": false } }, { "kind": "SecretGroup", "spec": { "name": "secrets", "secretType": "environment-arguments", "priority": 10, "secrets": { "variables": { "APP_ENV": "production", "COOKIE_SECRET": "${fn.randomSecret(32)}", "SUPERADMIN_USERNAME": "superadmin", "SUPERADMIN_PASSWORD": "${fn.randomSecret(16)}", "DB_SCHEMA": "public", "ASSET_UPLOAD_DIR": "/data", "RUN_JOB_QUEUE_FROM_SERVER": "true" } }, "addonDependencies": [ { "addonId": "database", "keys": [ { "keyName": "HOST", "aliases": [ "DB_HOST" ] }, { "keyName": "PORT", "aliases": [ "DB_PORT" ] }, { "keyName": "DATABASE", "aliases": [ "DB_NAME" ] }, { "keyName": "USERNAME", "aliases": [ "DB_USERNAME" ] }, { "keyName": "PASSWORD", "aliases": [ "DB_PASSWORD" ] } ] } ], "restrictions": { "restricted": false, "nfObjects": [], "tags": [] } } }, { "kind": "BuildService", "spec": { "name": "builder", "billing": { "deploymentPlan": "nf-compute-10" }, "vcsData": { "projectUrl": "https://github.com/vendure-ecommerce/one-click-deploy", "projectType": "github" }, "buildSettings": { "dockerfile": { "buildEngine": "kaniko", "dockerFilePath": "/Dockerfile", "dockerWorkDir": "/", "useCache": false } }, "disabledCI": false, "buildArguments": {} } }, { "kind": "Build", "ref": "build", "spec": { "id": "builder", "type": "service", "branch": "master", "reuseExistingBuilds": true }, "condition": "success" }, { "kind": "DeploymentService", "ref": "server", "spec": { "name": "server", "billing": { "deploymentPlan": "nf-compute-20" }, "deployment": { "instances": 1, "docker": { "configType": "customCommand", "customCommand": "yarn start:server" }, "internal": { "buildId": "${refs.build.id}", "buildSHA": "latest" } }, "ports": [ { "name": "app", "internalPort": 3000, "public": true, "protocol": "HTTP", "security": { "credentials": [], "policies": [] }, "domains": [] } ], "runtimeEnvironment": {} } }, { "kind": "Volume", "spec": { "spec": { "storageSize": 5120, "accessMode": "ReadWriteOnce", "storageClassName": "ssd" }, "name": "storage", "mounts": [ { "containerMountPath": "/data", "volumeMountPath": "" } ], "attachedObjects": [ { "id": "${refs.server.id}", "type": "service" } ] } } ] } } } ``` </div> </TabItem> </Tabs> Then click the "Create template" button. ## Run the template Next, click the "run template" button to start the deployment process. ![./03-run-template.webp](./03-run-template.webp) Once the template run has completed, you should be able to see the newly-created project in the project selector. ![./04-find-project.webp](./04-find-project.webp) ## Find the public URL Click the "Services" menu item in the left sidebar and then click the "Server" service. ![./05-server-service.webp](./05-server-service.webp) In the top right corner you'll see the public URL of your new Vendure server! Note that it may take a few minutes for the server to start up and populate all the test data because the free tier has limited CPU and memory resources. Once it is ready, you can navigate to the public URL and append `/admin` to the end of the URL to access the admin panel. ![./06-find-url.webp](./06-find-url.webp) :::note The superadmin password was generated for you by the template, and can be found in the "Secrets" section from the project nav bar as `SUPERADMIN_PASSWORD`. ::: Congratulations on deploying your Vendure server! ## Next steps Now that you have a basic Vendure server up and running, you can explore some of the other features offered by Northflank that you might need for a full production setup: - Configure [health checks](https://northflank.com/docs/v1/application/observe/configure-health-checks) to ensure any container crashes are rapidly detected and restarted. Also see the [Vendure health check docs](/guides/deployment/using-docker#healthreadiness-checks). - [Set up a Redis instance](https://northflank.com/docs/v1/application/databases-and-persistence/deploy-databases-on-northflank/deploy-redis-on-northflank) so that you can take advantage of our highly performant [BullMQJobQueuePlugin](/reference/core-plugins/job-queue-plugin/bull-mqjob-queue-plugin) and set up [Redis-based session caching](/reference/typescript-api/auth/session-cache-strategy/) to handle multi-instance deployments. - With the above in place, you can safely start to [scale your server instances](https://northflank.com/docs/v1/application/scale/scaling-replicas) to handle more traffic. - [Add a custom domain](https://northflank.com/docs/v1/application/domains/add-a-domain-to-your-account) using Northflank's powerful DNS management system. - Set up [infrastructure alerts](https://northflank.com/docs/v1/application/observe/set-infrastructure-alerts) to be notified when any of your containers crash or experience load spikes.
--- title: "Deploying to Railway" --- ![Deploy to Railway](./deploy-to-railway.webp) [Railway](https://railway.app/) is a managed hosting platform which allows you to deploy and scale your Vendure server and infrastructure with ease. :::note This guide should be runnable on the Railway free trial plan, which means you can deploy it for free and thereafter pay only for the resources you use, which should be around $5 per month. ::: ## Prerequisites First of all you'll need to create a new Railway account (click "login" on the website and enter your email address) if you don't already have one. You'll also need a GitHub account and you'll need to have your Vendure project hosted there. In order to use the Railway trial plan, you'll need to connect your GitHub account to Railway via the Railway dashboard. :::info If you'd like to quickly get started with a ready-made Vendure project which includes sample data, you can clone our [Vendure one-click-deploy repo](https://github.com/vendure-ecommerce/one-click-deploy). ::: ## Configuration ### Port Railway defines the port via the `PORT` environment variable, so make sure your Vendure Config uses this variable: ```ts title="src/vendure-config.ts" import { VendureConfig } from '@vendure/core'; export const config: VendureConfig = { apiOptions: { // highlight-next-line port: +(process.env.PORT || 3000), // ... }, // ... }; ``` ### Database connection :::info The following is already pre-configured if you are using the one-click-deploy repo. ::: Make sure your DB connection options uses the following environment variables: ```ts title="src/vendure-config.ts" import { VendureConfig } from '@vendure/core'; export const config: VendureConfig = { // ... dbConnectionOptions: { // ... database: process.env.DB_NAME, host: process.env.DB_HOST, port: +process.env.DB_PORT, username: process.env.DB_USERNAME, password: process.env.DB_PASSWORD, }, }; ``` ### Asset storage :::info The following is already pre-configured if you are using the one-click-deploy repo. ::: In this guide we will use the AssetServerPlugin's default local disk storage strategy. Make sure you use the `ASSET_UPLOAD_DIR` environment variable to set the path to the directory where the uploaded assets will be stored. ```ts title="src/vendure-config.ts" import { VendureConfig } from '@vendure/core'; import { AssetServerPlugin } from '@vendure/asset-server-plugin'; export const config: VendureConfig = { // ... plugins: [ AssetServerPlugin.init({ route: 'assets', // highlight-next-line assetUploadDir: process.env.ASSET_UPLOAD_DIR || path.join(__dirname, '../static/assets'), }), ], // ... }; ``` ## Create a new Railway project From the Railway dashboard, click "New Project" and select "Empty Project". You'll be taken to a screen where you can add the first service to your project. ## Create the database Click the "Add a Service" button and select "database". Choose a database that matches the one you are using in your Vendure project. If you are following along using the one-click-deploy repo, then choose "Postgres". ## Create the Vendure server Click the "new" button to create a new service, and select "GitHub repo". Select the repository which contains your Vendure project. You may need to configure access to this repo if you haven't already done so. ![Create new service](./01-new-service.webp) ### Configure the server service You should then see a card representing this service in the main area of the dashboard. Click the card and go to the "settings" tab. * Scroll to the "Service" section and rename the service to "vendure-server". * Check the "Build" section and make sure the build settings make sense for your repo. If you are using the one-click-deploy repo, then it should detect the Dockerfile. * In the "Deploy" section, set the "Custom start command" to `node ./dist/index.js`. * Finally, scroll up to the "Networking" section and click "Generate domain" to set up a temporary domain for your Vendure server. ### Create a Volume In order to persist the uploaded product images, we need to create a volume. Click the "new" button and select "Volume". Attach it to the "vendure-server" service and set the mount path to `/vendure-assets`. ### Configure server env vars Click on the "vendure-server" service and go to the "Variables" tab. This is where we will set up the environment variables which are used in our Vendure Config. You can use the raw editor to add the following variables, making sure to replace the highlighted values with your own: ```sh DB_NAME=${{Postgres.PGDATABASE}} DB_USERNAME=${{Postgres.PGUSER}} DB_PASSWORD=${{Postgres.PGPASSWORD}} DB_HOST=${{Postgres.PGHOST}} DB_PORT=${{Postgres.PGPORT}} ASSET_UPLOAD_DIR=/vendure-assets // highlight-next-line COOKIE_SECRET=<add some random characters> SUPERADMIN_USERNAME=superadmin // highlight-next-line SUPERADMIN_PASSWORD=<create some strong password> ``` ![Setting env vars](./02-env-vars.webp) :::note The variables starting with `${{Postgres...}}` assume that your database service is called "Postgres". If you have named it differently, then you'll need to change these variables accordingly. ::: ## Create the Vendure worker Finally, we need to define the worker process which will run the background tasks. Click the "new" button and select "GitHub repo". Select again the repository which contains your Vendure project. ### Configure the worker service You should then see a card representing this service in the main area of the dashboard. Click the card and go to the "settings" tab. * Scroll to the "Service" section and rename the service to "vendure-worker". * Check the "Build" section and make sure the build settings make sense for your repo. If you are using the one-click-deploy repo, then it should detect the Dockerfile. * In the "Deploy" section, set the "Custom start command" to `node ./dist/index-worker.js`. ### Configure worker env vars The worker will need to know how to connect to the database, so add the following variables to the "Variables" tab: ```sh DB_NAME=${{Postgres.PGDATABASE}} DB_USERNAME=${{Postgres.PGUSER}} DB_PASSWORD=${{Postgres.PGPASSWORD}} DB_HOST=${{Postgres.PGHOST}} DB_PORT=${{Postgres.PGPORT}} ``` ## Test your Vendure server To test that everything is working, click the "vendure-server" card and then the link to the temporary domain. ![Test server](./03-test-server.webp) ## Next Steps This setup gives you a basic Vendure server to get started with. When moving to a more production-ready setup, you'll want to consider the following: - Use MinIO for asset storage. This is a more robust and scalable solution than the local disk storage used here. - [MinIO template for Railway](https://railway.app/template/SMKOEA), - [Configuring the AssetServerPlugin for MinIO](/reference/core-plugins/asset-server-plugin/s3asset-storage-strategy/#usage-with-minio) - Use Redis to power the job queue and session cache. This is not only more performant, but will enable horizontal scaling of your server and worker instances. - [Railway Redis docs](https://docs.railway.app/guides/redis) - [Vendure horizontal scaling docs](/guides/deployment/horizontal-scaling)
--- title: "Deploying to Render" --- ![Deploy to Render](./deploy-to-render.webp) [Render](https://render.com/) is a managed hosting platform which allows you to deploy and scale your Vendure server and infrastructure with ease. :::note The configuration in this guide will cost from around $12 per month to run. ::: ## Prerequisites First of all you'll need to [create a new Render account](https://dashboard.render.com/register) if you don't already have one. For this guide you'll need to have your Vendure project in a git repo on either GitHub or GitLab. :::info If you'd like to quickly get started with a ready-made Vendure project which includes sample data, you can use our [Vendure one-click-deploy repo](https://github.com/vendure-ecommerce/one-click-deploy), which means you won't have to set up your own git repo. ::: ## Configuration ### Port Render defines the port via the `PORT` environment variable and [defaults to `10000`](https://docs.render.com/web-services#host-and-port-configuration), so make sure your Vendure Config uses this variable: ```ts title="src/vendure-config.ts" import { VendureConfig } from '@vendure/core'; export const config: VendureConfig = { apiOptions: { // highlight-next-line port: +(process.env.PORT || 3000), // ... }, // ... }; ``` ### Database connection :::info The following is already pre-configured if you are using the one-click-deploy repo. ::: Make sure your DB connection options uses the following environment variables: ```ts title="src/vendure-config.ts" import { VendureConfig } from '@vendure/core'; export const config: VendureConfig = { // ... dbConnectionOptions: { // ... database: process.env.DB_NAME, host: process.env.DB_HOST, port: +process.env.DB_PORT, username: process.env.DB_USERNAME, password: process.env.DB_PASSWORD, }, }; ``` ### Asset storage :::info The following is already pre-configured if you are using the one-click-deploy repo. ::: In this guide we will use the AssetServerPlugin's default local disk storage strategy. Make sure you use the `ASSET_UPLOAD_DIR` environment variable to set the path to the directory where the uploaded assets will be stored. ```ts title="src/vendure-config.ts" import { VendureConfig } from '@vendure/core'; import { AssetServerPlugin } from '@vendure/asset-server-plugin'; export const config: VendureConfig = { // ... plugins: [ AssetServerPlugin.init({ route: 'assets', // highlight-next-line assetUploadDir: process.env.ASSET_UPLOAD_DIR || path.join(__dirname, '../static/assets'), }), ], // ... }; ``` ## Create a database From the Render dashboard, click the "New" button and select "PostgreSQL" from the list of services: ![Create a new PostgreSQL database](./01-create-db.webp) Give the database a name (e.g. "postgres"), select a region close to you, select an appropriate plan and click "Create Database". ## Create the Vendure server Click the "New" button again and select "Web Service" from the list of services. Choose the "Build and deploy from a Git repository" option. In the next step you will be prompted to connect to either GitHub or GitLab. Select the appropriate option and follow the instructions to connect your account and grant access to the repository containing your Vendure project. :::info If you are using the one-click-deploy repo, you should instead use the "Public Git repository" option and enter the URL of the repo: ``` https://github.com/vendure-ecommerce/one-click-deploy ``` ::: ### Configure the server service In the next step you will configure the server: - **Name**: "vendure-server" - **Region**: Select a region close to you - **Branch**: Select the branch you want to deploy, usually "main" or "master" - **Runtime**: If you have a Dockerfile then it should be auto-detected. If not you should select "Node" and enter the appropriate build and start commands. For a typical Vendure project these would be: - **Build Command**: `yarn; yarn build` or `npm install; npm run build` - **Start Command**: `node ./dist/index.js` - **Instance Type**: Select the appropriate instance type. Since we want to use a persistent volume to store our assets, we need to use at least the "Starter" instance type or higher. Click the "Advanced" button to expand the advanced options: - Click "Add Disk" to set up a persistent volume for the assets and use the following settings: - **Name**: "vendure-assets" - **Mount Path**: `/vendure-assets` - **Size**: As appropriate. For testing purposes you can use the smallest size (1GB) - **Health Check Path**: `/health` - **Docker Command**: `node ./dist/index.js` (if you are _not_ using a Dockerfile this option will not be available) Click "Create Web Service" to create the service. :::note If you have not already set up payment, you will be prompted to enter credit card details at this point. ::: ## Configure environment variables Next we need to set up the environment variables which will be used by both the server and worker. Click the "Env Groups" tab and then click the "New Environment Group" button. Name the group "vendure configuration" and add the following variables. The database variables can be found by navigating to the database service, clicking the "Info" tab and scrolling to the "Connections" section: ![Database connection settings](./03-db-connection.webp) ```shell DB_NAME=<database "Database"> DB_USERNAME=<database "Username"> DB_PASSWORD=<database "Password"> DB_HOST=<database "Hostname"> DB_PORT=<database "Port"> ASSET_UPLOAD_DIR=/vendure-assets // highlight-next-line COOKIE_SECRET=<add some random characters> SUPERADMIN_USERNAME=superadmin // highlight-next-line SUPERADMIN_PASSWORD=<create some strong password> ``` Once the correct values have been entered, click "Create Environment Group". Next, click the "vendure-server" service and go to the "Environment" tab to link the environment group to the service: ![Link environment group](./04-link-env-group.webp) ## Create the Vendure worker Finally, we need to define the worker process which will run the background tasks. Click the "New" button and select "Background Worker". Select the same git repo as before, and in the next step configure the worker: - **Name**: "vendure-worker" - **Region**: Same as the server - **Branch**: Select the branch you want to deploy, usually "main" or "master" - **Runtime**: If you have a Dockerfile then it should be auto-detected. If not you should select "Node" and enter the appropriate build and start commands. For a typical Vendure project these would be: - **Build Command**: `yarn; yarn build` or `npm install; npm run build` - **Start Command**: `node ./dist/index-worker.js` - **Instance Type**: Select the appropriate instance type. The Starter size is fine to get started. Click the "Advanced" button to expand the advanced options: - **Docker Command**: `node ./dist/index-worker.js` (if you are _not_ using a Dockerfile this option will not be available) Click "Create Background Worker" to create the worker. Finally, click the "Environment" tab and link the "vendure configuration" environment group to the worker. ## Test your Vendure server Navigate back to the dashboard, click the "vendure-server" service, and you should see a link to the temporary domain: ![Test server](./05-server-url.webp) Click the link and append `/admin` to the URL to open the Admin UI. Log in with the username and password you set in the environment variables. ## Next Steps This setup gives you a basic Vendure server to get started with. When moving to a more production-ready setup, you'll want to consider the following: - Use MinIO for asset storage. This is a more robust and scalable solution than the local disk storage used here. - [Deploying MinIO to Render](https://docs.render.com/deploy-minio), - [Configuring the AssetServerPlugin for MinIO](/reference/core-plugins/asset-server-plugin/s3asset-storage-strategy/#usage-with-minio) - Use Redis to power the job queue and session cache. This is not only more performant, but will enable horizontal scaling of your server and worker instances. - [Render Redis docs](https://docs.render.com/redis#creating-a-redis-instance) - [Vendure horizontal scaling docs](/guides/deployment/horizontal-scaling)
--- title: 'Production configuration' showtoc: true weight: 0 --- # Production configuration This is a guide to the recommended configuration for a production Vendure application. ## Environment variables Keep sensitive information or context-dependent settings in environment variables. In local development you can store the values in a `.env` file. For production, you should use the mechanism provided by your hosting platform to set the values for production. The default `@vendure/create` project scaffold makes use of environment variables already. For example: ```ts const IS_DEV = process.env.APP_ENV === 'dev'; ``` The `APP_ENV` environment variable can then be set using the admin dashboard of your hosting provider: ![A typical UI for setting env vars](./env-var-ui.webp) If you are using [Docker or Kubernetes](/guides/deployment/using-docker), they include their own methods of setting environment variables. ## Superadmin credentials Ensure you set the superadmin credentials to something other than the default of `superadmin:superadmin`. Use your hosting platform's environment variables to set a **strong** password for the Superadmin account. ```ts import { VendureConfig } from '@vendure/core'; export const config: VendureConfig = { authOptions: { tokenMethod: ['bearer', 'cookie'], superadminCredentials: { identifier: process.env.SUPERADMIN_USERNAME, password: process.env.SUPERADMIN_PASSWORD, }, }, // ... }; ``` ## API hardening It is recommended that you install and configure the [HardenPlugin](/reference/core-plugins/harden-plugin/) for all production deployments. This plugin locks down your schema (disabling introspection and field suggestions) and protects your Shop API against malicious queries that could otherwise overwhelm your server. Install the plugin: ```sh npm install @vendure/harden-plugin # or yarn add @vendure/harden-plugin ``` Then add it to your VendureConfig: ```ts import { VendureConfig } from '@vendure/core'; import { HardenPlugin } from '@vendure/harden-plugin'; const IS_DEV = process.env.APP_ENV === 'dev'; export const config: VendureConfig = { // ... plugins: [ HardenPlugin.init({ maxQueryComplexity: 500, apiMode: IS_DEV ? 'dev' : 'prod', }), // ... ] }; ``` :::info For a detailed explanation of how to best configure this plugin, see the [HardenPlugin docs](/reference/core-plugins/harden-plugin/). ::: ## ID Strategy By default, Vendure uses auto-increment integer IDs as entity primary keys. While easier to work with in development, sequential primary keys can leak information such as the number of orders or customers in the system. For this reason you should consider using the UuidIdStrategy for production. ```ts title="src/vendure-config.ts" import { UuidIdStrategy, VendureConfig } from '@vendure/core'; export const config: VendureConfig = { entityOptions: { entityIdStrategy: new UuidIdStrategy(), }, // ... } ``` Another option, if you wish to stick with integer IDs, is to create a custom [EntityIdStrategy](/reference/typescript-api/configuration/entity-id-strategy/) which uses the `encodeId()` and `decodeId()` methods to obfuscate the sequential nature of the ID. ## Database Timezone Vendure internally treats all dates & times as UTC. However, you may sometimes run into issues where dates are offset by some fixed amount of hours. E.g. you place an order at 17:00, but it shows up in the Admin UI as being placed at 19:00. Typically, this is caused by the timezone of your database not being set to UTC. You can check the timezone in **MySQL/MariaDB** by executing: ```SQL SELECT TIMEDIFF(NOW(), UTC_TIMESTAMP); ``` and you should expect to see `00:00:00`. In **Postgres**, you can execute: ```SQL show timezone; ``` and you should expect to see `UTC` or `Etc/UTC`.
--- title: "CLI" --- import Tabs from '@theme/Tabs'; import TabItem from '@theme/TabItem'; The Vendure CLI is a command-line tool for boosting your productivity as a developer by automating common tasks such as creating new plugins, entities, API extensions and more. It is much more than just a scaffolding tool - it is able to analyze your project and intelligently modify your existing codebase to integrate new functionality. ## Installation :::info The Vendure CLI comes installed with a new Vendure project by default from v2.2.0+ ::: To manually install the CLI, run: <Tabs groupId="package-manager"> <TabItem value="npm" label="npm" default> ```bash npm install -D @vendure/cli ``` </TabItem> <TabItem value="yarn" label="yarn"> ```bash yarn add -D @vendure/cli ``` </TabItem> </Tabs> ## The Add Command The `add` command is used to add new entities, resolvers, services, plugins, and more to your Vendure project. From your project's **root directory**, run: <Tabs groupId="package-manager"> <TabItem value="npm" label="npm" default> ```bash npx vendure add ``` </TabItem> <TabItem value="yarn" label="yarn"> ```bash yarn vendure add ``` </TabItem> </Tabs> ![Add command](./add-command.webp) The CLI will guide you through the process of adding new functionality to your project. The `add` command is much more than a simple file generator. It is able to analyze your project source code to deeply understand and correctly update your project files. ## The Migrate Command The `migrate` command is used to generate and manage [database migrations](/guides/developer-guide/migrations) for your Vendure project. From your project's **root directory**, run: <Tabs groupId="package-manager"> <TabItem value="npm" label="npm" default> ```bash npx vendure migrate ``` </TabItem> <TabItem value="yarn" label="yarn"> ```bash yarn vendure migrate ``` </TabItem> </Tabs> ![Migrate command](./migrate-command.webp)
--- title: "Configuration" sidebar_position: 3 --- # Configuration Every aspect of the Vendure server is configured via a single, central [`VendureConfig`](/reference/typescript-api/configuration/vendure-config/) object. This object is passed into the [`bootstrap`](/reference/typescript-api/common/bootstrap/) and [`bootstrapWorker`](/reference/typescript-api/worker/bootstrap-worker/) functions to start up the Vendure server and worker respectively. The `VendureConfig` object is organised into sections, grouping related settings together. For example, [`VendureConfig.apiOptions`](/reference/typescript-api/configuration/api-options/) contains all the config for the GraphQL APIs, whereas [`VendureConfig.authOptions`](/reference/typescript-api/auth/auth-options/) deals with authentication. ## Important Configuration Settings In this guide, we will take a look at those configuration options needed for getting the server up and running. :::tip A description of every available configuration option can be found in the [`VendureConfig` reference docs](/reference/typescript-api/configuration/vendure-config/). ::: ### Specifying API hostname & port etc The [`VendureConfig.apiOptions`](/reference/typescript-api/configuration/api-options/) object is used to set the hostname, port, as well as other API-related concerns. Express middleware and Apollo Server plugins may also be specified here. Example: ```ts title="src/vendure-config.ts" import { VendureConfig } from '@vendure/core'; export const config: VendureConfig = { apiOptions: { hostname: 'localhost', port: 3000, adminApiPath: '/admin', shopApiPath: '/shop', middleware: [{ // add some Express middleware to the Shop API route handler: timeout('5s'), route: 'shop', }] }, // ... } ``` ### Connecting to the database The database connection is configured with the `VendureConfig.dbConnectionOptions` object. This object is actually the [TypeORM DataSourceOptions object](https://typeorm.io/data-source-options) and is passed directly to TypeORM. Example: ```ts title="src/vendure-config.ts" import { VendureConfig } from '@vendure/core'; export const config: VendureConfig = { dbConnectionOptions: { type: 'postgres', host: process.env.DB_HOST, port: process.env.DB_PORT, synchronize: false, username: process.env.DB_USERNAME, password: process.env.DB_PASSWORD, database: 'vendure', migrations: [path.join(__dirname, 'migrations/*.ts')], }, // ... } ``` ### Configuring authentication Authentication settings are configured with [`VendureConfig.authOptions`](/reference/typescript-api/auth/auth-options/). The most important setting here is whether the storefront client will use cookies or bearer tokens to manage user sessions. For more detail on this topic, see [the Managing Sessions guide](/guides/storefront/connect-api/#managing-sessions). The username and default password of the superadmin user can also be specified here. In production, it is advisable to use environment variables for these settings (see the following section on usage of environment variables). Example: ```ts title="src/vendure-config.ts" import { VendureConfig } from '@vendure/core'; export const config: VendureConfig = { authOptions: { tokenMethod: 'cookie', requireVerification: true, cookieOptions: { secret: process.env.COOKIE_SESSION_SECRET, }, superadminCredentials: { identifier: process.env.SUPERADMIN_USERNAME, password: process.env.SUPERADMIN_PASSWORD, }, }, // ... } ``` ## Working with the VendureConfig object Since the `VendureConfig` is just a JavaScript object, it can be managed and manipulated according to your needs. For example: ### Using environment variables Environment variables can be used when you don't want to hard-code certain values which may change, e.g. depending on whether running locally, in staging or in production: ```ts title="src/vendure-config.ts" import { VendureConfig } from '@vendure/core'; export const config: VendureConfig = { apiOptions: { hostname: process.env.HOSTNAME, port: process.env.PORT, } // ... }; ``` They are also useful so that sensitive credentials do not need to be hard-coded and committed to source control: ```ts title="src/vendure-config.ts" import { VendureConfig } from '@vendure/core'; export const config: VendureConfig = { dbConnectionOptions: { type: 'postgres', username: process.env.DB_USERNAME, password: process.env.DB_PASSWORD, database: 'vendure', }, // ... } ``` When you create a Vendure project with `@vendure/create`, it comes with the [dotenv](https://www.npmjs.com/package/dotenv) package installed, which allows you to store environment variables in a `.env` file in the root of your project. To define new environment variables, you can add them to the `.env` file. For instance, if you are using a plugin that requires an API key, you can ```txt title=".env" APP_ENV=dev COOKIE_SECRET=toh8soqdlj SUPERADMIN_USERNAME=superadmin SUPERADMIN_PASSWORD=superadmin // highlight-next-line MY_API_KEY=12345 ``` In order to tell TypeScript about the existence of this new variable, you can add it to the `src/environment.d.ts` file: ```ts title="src/environment.d.ts" export {}; // Here we declare the members of the process.env object, so that we // can use them in our application code in a type-safe manner. declare global { namespace NodeJS { interface ProcessEnv { APP_ENV: string; COOKIE_SECRET: string; SUPERADMIN_USERNAME: string; SUPERADMIN_PASSWORD: string; // highlight-next-line MY_API_KEY: string; } } } ```` You can then use the environment variable in your config file: ```ts title="src/vendure-config.ts" import { VendureConfig } from '@vendure/core'; export const config: VendureConfig = { plugins: [ MyPlugin.init({ apiKey: process.env.MY_API_KEY, }), ], // ... } ``` :::info In production, the way you manage environment variables will depend on your hosting provider. Read more about this in our [Production Configuration guide](/guides/deployment/production-configuration/). ::: ### Splitting config across files If the config object grows too large, you can split it across several files. For example, the `plugins` array in a real-world project can easily grow quite big: ```ts title="src/vendure-config-plugins.ts" import { AssetServerPlugin, DefaultJobQueuePlugin, VendureConfig } from '@vendure/core'; import { ElasticsearchPlugin } from '@vendure/elasticsearch-plugin'; import { EmailPlugin } from '@vendure/email-plugin'; import { CustomPlugin } from './plugins/custom-plugin'; export const plugins: VendureConfig['plugins'] = [ CustomPlugin, AssetServerPlugin.init({ route: 'assets', assetUploadDir: path.join(__dirname, 'assets'), port: 5002, }), DefaultJobQueuePlugin, ElasticsearchPlugin.init({ host: 'localhost', port: 9200, }), EmailPlugin.init({ // ...lots of lines of config }), ]; ``` ```ts title="src/vendure-config.ts" import { VendureConfig } from '@vendure/core'; import { plugins } from './vendure-config-plugins'; export const config: VendureConfig = { plugins, // ... } ```
--- title: 'Custom Fields' sidebar_position: 3 --- import Tabs from '@theme/Tabs'; import TabItem from '@theme/TabItem'; import CustomFieldProperty from '@site/src/components/CustomFieldProperty'; Custom fields allow you to add your own custom data properties almost every Vendure entity. The entities which may have custom fields defined are listed in the [CustomFields interface documentation](/reference/typescript-api/custom-fields/). Some use-cases for custom fields include: * Storing the weight, dimensions or other product-specific data on the `ProductVariant` entity. * Storing additional product codes on the `ProductVariant` entity such as ISBN or GTIN. * Adding a `downloadable` flag to the `Product` entity to indicate whether the product is a digital download. * Storing an external identifier (e.g. from a payment provider) on the `Customer` entity. * Adding a longitude and latitude to the `StockLocation` for use in selecting the closest location to a customer. ## Defining custom fields Custom fields are specified in the VendureConfig: ```ts const config = { // ... customFields: { Product: [ { name: 'infoUrl', type: 'string' }, { name: 'downloadable', type: 'boolean' }, { name: 'shortName', type: 'localeString' }, ], User: [ { name: 'socialLoginToken', type: 'string', unique: true }, ], }, }; ``` With the example config above, the following will occur: 1. The database schema will be altered, and a column will be added for each custom field. **Note: changes to custom fields require a database migration**. See the [Migrations guide](/guides/developer-guide/migrations/). 2. The GraphQL APIs will be modified to add the custom fields to the `Product` and `User` types respectively. 3. If you are using the [AdminUiPlugin](/reference/core-plugins/admin-ui-plugin/), the Admin UI detail pages will now contain form inputs to allow the custom field data to be added or edited, and the list view data tables will allow custom field columns to be added, sorted and filtered. ![custom-fields-data-table.webp](custom-fields-data-table.webp) The values of the custom fields can then be set and queried via the GraphQL APIs: <Tabs> <TabItem value="Request" label="Request" default> ```graphql mutation { updateProduct(input: { id: 1 // highlight-start customFields: { infoUrl: "https://some-url.com", downloadable: true, } // highlight-end translations: [ // highlight-next-line { languageCode: en, customFields: { shortName: "foo" } } ] }) { id name // highlight-start customFields { infoUrl downloadable shortName } // highlight-end } } ``` </TabItem> <TabItem value="Response" label="Response"> ```json { "data": { "product": { "id": "1", "name": "Laptop", "customFields": { "infoUrl": "https://some-url.com", "downloadable": true, "shortName": "foo" } } } } ``` </TabItem> </Tabs> The custom fields will also extend the filter and sort options available to the `products` list query: ```graphql query { products(options: { // highlight-start filter: { infoUrl: { contains: "new" }, downloadable: { eq: true } }, sort: { infoUrl: ASC } // highlight-end }) { items { id name // highlight-start customFields { infoUrl downloadable shortName } // highlight-end } } } ``` ## Available custom field types The following types are available for custom fields: | Type | Description | Example | |----------------|------------------------------|----------------------------------------------------------| | `string` | Short string data | url, label | | `localeString` | Localized short strings | localized url | | `text` | Long text data | extended product info, json config object | | `localeText` | Localized long text | localized extended product info | | `int` | Integer | product weight, customer loyalty points, monetary values | | `float` | Floating point number | product review rating | | `boolean` | Boolean | isDownloadable flag on product | | `datetime` | A datetime | date that variant is back in stock | | `relation` | A relation to another entity | Asset used as a customer avatar, related Products | To see the underlying DB data type and GraphQL type used for each, see the [CustomFieldType doc](/reference/typescript-api/custom-fields/custom-field-type). #### Relations It is possible to set up custom fields that hold references to other entities using the `'relation'` type: ```ts const config = { // ... customFields: { Customer: [ { name: 'avatar', // highlight-start type: 'relation', entity: Asset, // highlight-end }, ], }, }; ``` In this example, we set up a many-to-one relationship from Customer to Asset, allowing us to specify an avatar image for each Customer. Relation custom fields are unique in that the input and output names are not the same - the input will expect an ID and will be named `'<field name>Id'` or `'<field name>Ids'` for list types. ```graphql mutation { updateCustomer(input: { id: 1 customFields: { avatarId: 42, } }) { id customFields { avatar { id name preview } } } } ``` ## Accessing custom fields in TypeScript As well as exposing custom fields via the GraphQL APIs, you can also access them directly in your TypeScript code. This is useful for plugins which need to access custom field data. Given the following custom field configuration: ```ts title="src/vendure-config.ts" import { VendureConfig } from '@vendure/core'; const config: VendureConfig = { // ... customFields: { Customer: [ { name: 'externalId', type: 'string' }, { name: 'avatar', type: 'relation', entity: Asset }, ], }, }; ``` the `externalId` will be available whenever you access a `Customer` entity: ```ts const customer = await this.connection.getRepository(ctx, Customer).findOne({ where: { id: 1 }, }); console.log(customer.externalId); ``` The `avatar` relation will require an explicit join to be performed in order to access the data, since it is not eagerly loaded by default: ```ts const customer = await this.connection.getRepository(ctx, Customer).findOne({ where: { id: 1 }, relations: { customFields: { avatar: true, } } }); console.log(customer.avatar); ``` or if using the QueryBuilder API: ```ts const customer = await this.connection.getRepository(ctx, Customer).createQueryBuilder('customer') .leftJoinAndSelect('customer.customFields.avatar', 'avatar') .where('customer.id = :id', { id: 1 }) .getOne(); console.log(customer.avatar); ``` or using the EntityHydrator: ```ts const customer = await this.customerService.findOne(ctx, 1); await this.entityHydrator.hydrate(ctx, customer, { relations: ['customFields.avatar'] }); console.log(customer.avatar); ``` ## Custom field config properties ### Common properties All custom fields share some common properties: - [`name`](#name) - [`type`](#type) - [`list`](#list) - [`label`](#label) - [`description`](#description) - [`public`](#public) - [`readonly`](#readonly) - [`internal`](#internal) - [`defaultValue`](#defaultvalue) - [`nullable`](#nullable) - [`unique`](#unique) - [`validate`](#validate) - [`requiresPermission`](#requirespermission) #### name <CustomFieldProperty required={true} type="string"/> The name of the field. This is used as the column name in the database, and as the GraphQL field name. The name should not contain spaces and by convention should be camelCased. ```ts title="src/vendure-config.ts" const config = { // ... customFields: { Product: [ { // highlight-next-line name: 'infoUrl', type: 'string' }, ] } }; ``` #### type <CustomFieldProperty required={true} type="CustomFieldType" typeLink="/reference/typescript-api/custom-fields/custom-field-type"/> The type of data that will be stored in the field. #### list <CustomFieldProperty required={false} type="boolean" /> If set to `true`, then the field will be an array of the specified type. Defaults to `false`. ```ts title="src/vendure-config.ts" const config = { // ... customFields: { Product: [ { name: 'infoUrls', type: 'string', // highlight-next-line list: true, }, ] } }; ``` Setting a custom field to be a list has the following effects: * The GraphQL type will be an array of the specified type. * The Admin UI will display a list of inputs for the field. * For lists of primitive types (anything except `relation`), the database type will be set to `simple-json` which serializes the data into a JSON string. For lists of `relation` types, a separate many-to-many table will be created. #### label <CustomFieldProperty required={false} type="LocalizedStringArray" typeLink="/reference/typescript-api/configurable-operation-def/localized-string-array"/> An array of localized labels for the field. These are used in the Admin UI to label the field. ```ts title="src/vendure-config.ts" import { LanguageCode } from '@vendure/core'; const config = { // ... customFields: { Product: [ { name: 'infoUrl', type: 'string', // highlight-start label: [ {languageCode: LanguageCode.en, value: 'Info URL'}, {languageCode: LanguageCode.de, value: 'Info-URL'}, {languageCode: LanguageCode.es, value: 'URL de información'}, ], // highlight-end }, ] } }; ``` #### description <CustomFieldProperty required={false} type="LocalizedStringArray" typeLink="/reference/typescript-api/configurable-operation-def/localized-string-array"/> An array of localized descriptions for the field. These are used in the Admin UI to describe the field. ```ts title="src/vendure-config.ts" import { LanguageCode } from '@vendure/core'; const config = { // ... customFields: { Product: [ { name: 'infoUrl', type: 'string', // highlight-start description: [ {languageCode: LanguageCode.en, value: 'A URL to more information about the product'}, {languageCode: LanguageCode.de, value: 'Eine URL zu weiteren Informationen über das Produkt'}, {languageCode: LanguageCode.es, value: 'Una URL con más información sobre el producto'}, ], // highlight-end }, ] } }; ``` #### public <CustomFieldProperty required={false} type="boolean" /> Whether the custom field is available via the Shop API. Defaults to `true`. ```ts title="src/vendure-config.ts" const config = { // ... customFields: { Product: [ { name: 'profitMargin', type: 'int', // highlight-next-line public: false, }, ] } }; ``` #### readonly <CustomFieldProperty required={false} type="boolean" /> Whether the custom field can be updated via the GraphQL APIs. Defaults to `false`. If set to `true`, then the field can only be updated via direct manipulation via TypeScript code in a plugin. ```ts title="src/vendure-config.ts" const config = { // ... customFields: { Product: [ { name: 'profitMargin', type: 'int', // highlight-next-line readonly: true, }, ] } }; ``` #### internal <CustomFieldProperty required={false} type="boolean" /> Whether the custom field is exposed at all via the GraphQL APIs. Defaults to `false`. If set to `true`, then the field will not be available via the GraphQL API, but can still be used in TypeScript code in a plugin. Internal fields are useful for storing data which is not intended to be exposed to the outside world, but which can be used in plugin logic. ```ts title="src/vendure-config.ts" const config = { // ... customFields: { OrderLine: [ { name: 'referralId', type: 'string', // highlight-next-line internal: true, }, ] } }; ``` #### defaultValue <CustomFieldProperty required={false} type="any" /> The default value when an Entity is created with this field. If not provided, then the default value will be `null`. Note that if you set `nullable: false`, then you should also provide a `defaultValue` to avoid database errors when creating new entities. ```ts title="src/vendure-config.ts" const config = { // ... customFields: { Product: [ { name: 'reviewRating', type: 'float', // highlight-next-line defaultValue: 0, }, ] } }; ``` #### nullable <CustomFieldProperty required={false} type="boolean" /> Whether the field is nullable in the database. If set to `false`, then a `defaultValue` should be provided. ```ts title="src/vendure-config.ts" const config = { // ... customFields: { Product: [ { name: 'reviewRating', type: 'float', // highlight-start nullable: false, defaultValue: 0, // highlight-end }, ] } }; ``` #### unique <CustomFieldProperty required={false} type="boolean" /> Whether the value of the field should be unique. When set to `true`, a UNIQUE constraint is added to the column. Defaults to `false`. ```ts title="src/vendure-config.ts" const config = { // ... customFields: { Customer: [ { name: 'externalId', type: 'string', // highlight-next-line unique: true, }, ] } }; ``` #### validate <CustomFieldProperty required={false} type="(value: any, injector: Injector, ctx: RequestContext) => string | LocalizedString[] | void" /> A custom validation function. If the value is valid, then the function should not return a value. If a string or LocalizedString array is returned, this is interpreted as an error message. Note that string, number and date fields also have some built-in validation options such as `min`, `max`, `pattern` which you can read about in the following sections. ```ts title="src/vendure-config.ts" import { LanguageCode } from '@vendure/core'; const config = { // ... customFields: { Product: [ { name: 'infoUrl', type: 'string', // highlight-start validate: (value: any) => { if (!value.startsWith('http')) { // If a localized error message is not required, a simple string can be returned. // return 'The URL must start with "http"'; // If a localized error message is required, return an array of LocalizedString objects. return [ {languageCode: LanguageCode.en, value: 'The URL must start with "http"'}, {languageCode: LanguageCode.de, value: 'Die URL muss mit "http" beginnen'}, {languageCode: LanguageCode.es, value: 'La URL debe comenzar con "http"'}, ]; } }, // highlight-end }, ] } }; ``` This function can even be asynchronous and may use the [Injector](/reference/typescript-api/common/injector/) to access providers. ```ts title="src/vendure-config.ts" const config = { // ... customFields: { ProductVariant: [ { name: 'partCode', type: 'string', // highlight-start validate: async (value, injector, ctx) => { const partCodeService = injector.get(PartCodeService); const isValid = await partCodeService.validateCode(value); if (!isValid) { return `Part code ${value} is not valid`; } }, // highlight-end }, ] } }; ``` #### requiresPermission <CustomFieldProperty required={false} type="Permission | Permission[] | string | string[]" /> Since v2.2.0, you can restrict access to custom field data by specifying a permission or permissions which are required to read and update the field. For instance, you might want to add a particular custom field to the `Product` entity, but you do not want all administrators to be able to view or update the field. In the Admin UI, the custom field will not be displayed if the current administrator lacks the required permission. In the GraphQL API, if the current user does not have the required permission, then the field will always return `null`. Attempting to set the value of a field for which the user does not have the required permission will cause the mutation to fail with an error. ```ts title="src/vendure-config.ts" import { Permission } from '@vendure/core'; const config = { // ... customFields: { Product: [ { name: 'internalNotes', type: 'text', // highlight-start requiresPermission: Permission.SuperAdmin, // highlight-end }, { name: 'shippingType', type: 'string', // highlight-start // You can also use an array of permissions, // and the user must have at least one of the permissions // to access the field. requiresPermission: [ Permission.SuperAdmin, Permission.ReadShippingMethod, ], // highlight-end }, ] } }; ``` ### Properties for `string` fields In addition to the common properties, the `string` custom fields have some type-specific properties: - [`pattern`](#pattern) - [`options`](#options) - [`length`](#length) #### pattern <CustomFieldProperty required={false} type="string" /> A regex pattern which the field value must match. If the value does not match the pattern, then the validation will fail. ```ts title="src/vendure-config.ts" const config = { // ... customFields: { ProductVariant: [ { name: 'gtin', type: 'string', // highlight-next-line pattern: '^\d{8}(?:\d{4,6})?$', }, ] } }; ``` #### options <CustomFieldProperty required={false} type="{ value: string; label?: LocalizedString[]; }[]" /> An array of pre-defined options for the field. This is useful for fields which should only have a limited set of values. The `value` property is the value which will be stored in the database, and the `label` property is an optional array of localized strings which will be displayed in the admin UI. ```ts title="src/vendure-config.ts" import { LanguageCode } from '@vendure/core'; const config = { // ... customFields: { ProductVariant: [ { name: 'condition', type: 'string', // highlight-start options: [ {value: 'new', label: [{languageCode: LanguageCode.en, value: 'New'}]}, {value: 'used', label: [{languageCode: LanguageCode.en, value: 'Used'}]}, ], // highlight-end }, ] } }; ``` Attempting to set the value of the field to a value which is not in the `options` array will cause the validation to fail. #### length <CustomFieldProperty required={false} type="number" /> The max length of the varchar created in the database. Defaults to 255. Maximum is 65,535. ```ts title="src/vendure-config.ts" const config = { // ... customFields: { ProductVariant: [ { name: 'partCode', type: 'string', // highlight-next-line length: 20, }, ] } }; ``` ### Properties for `localeString` fields In addition to the common properties, the `localeString` custom fields have some type-specific properties: - [`pattern`](#pattern-1) - [`length`](#length-1) #### pattern <CustomFieldProperty required={false} type="string" /> Same as the `pattern` property for `string` fields. #### length <CustomFieldProperty required={false} type="number" /> Same as the `length` property for `string` fields. ### Properties for `int` & `float` fields In addition to the common properties, the `int` & `float` custom fields have some type-specific properties: - [`min`](#min) - [`max`](#max) - [`step`](#step) #### min <CustomFieldProperty required={false} type="number" /> The minimum permitted value. If the value is less than this, then the validation will fail. ```ts title="src/vendure-config.ts" const config = { // ... customFields: { ProductVariant: [ { name: 'reviewRating', type: 'int', // highlight-next-line min: 0, }, ] } }; ``` #### max <CustomFieldProperty required={false} type="number" /> The maximum permitted value. If the value is greater than this, then the validation will fail. ```ts title="src/vendure-config.ts" const config = { // ... customFields: { ProductVariant: [ { name: 'reviewRating', type: 'int', // highlight-next-line max: 5, }, ] } }; ``` #### step <CustomFieldProperty required={false} type="number" /> The step value. This is used in the Admin UI to determine the increment/decrement value of the input field. ```ts title="src/vendure-config.ts" const config = { // ... customFields: { ProductVariant: [ { name: 'reviewRating', type: 'int', // highlight-next-line step: 0.5, }, ] } }; ``` ### Properties for `datetime` fields In addition to the common properties, the `datetime` custom fields have some type-specific properties. The min, max & step properties for datetime fields are intended to be used as described in [the MDN datetime-local docs](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/datetime-local#Additional_attributes) - [`min`](#min-1) - [`max`](#max-1) - [`step`](#step-1) #### min <CustomFieldProperty required={false} type="string" /> The earliest permitted date. If the value is earlier than this, then the validation will fail. ```ts title="src/vendure-config.ts" const config = { // ... customFields: { ProductVariant: [ { name: 'releaseDate', type: 'datetime', // highlight-next-line min: '2019-01-01T00:00:00.000Z', }, ] } }; ``` #### max <CustomFieldProperty required={false} type="string" /> The latest permitted date. If the value is later than this, then the validation will fail. ```ts title="src/vendure-config.ts" const config = { // ... customFields: { ProductVariant: [ { name: 'releaseDate', type: 'datetime', // highlight-next-line max: '2019-12-31T23:59:59.999Z', }, ] } }; ``` #### step <CustomFieldProperty required={false} type="string" /> The step value. See [the MDN datetime-local docs](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/datetime-local#step) to understand how this is used. ### Properties for `relation` fields In addition to the common properties, the `relation` custom fields have some type-specific properties: - [`entity`](#entity) - [`eager`](#eager) - [`graphQLType`](#graphqltype) - [`inverseSide`](#inverseside) #### entity <CustomFieldProperty required={true} type="VendureEntity" typeLink="/reference/typescript-api/entities/vendure-entity" /> The entity which this custom field is referencing. This can be one of the built-in entities, or a custom entity. If the entity is a custom entity, it must extend the `VendureEntity` class. ```ts title="src/vendure-config.ts" import { Product } from '\@vendure/core'; const config = { // ... customFields: { Product: [ { name: 'relatedProducts', list: true, // highlight-next-line type: 'relation', // highlight-next-line entity: Product, }, ] } }; ``` #### eager <CustomFieldProperty required={false} type="boolean" /> Whether to [eagerly load](https://typeorm.io/#/eager-and-lazy-relations) the relation. Defaults to false. Note that eager loading has performance implications, so should only be used when necessary. ```ts title="src/vendure-config.ts" import { Product } from '\@vendure/core'; const config = { // ... customFields: { Product: [ { name: 'relatedProducts', list: true, type: 'relation', entity: Product, // highlight-next-line eager: true, }, ] } }; ``` #### graphQLType <CustomFieldProperty required={false} type="string" /> The name of the GraphQL type that corresponds to the entity. Can be omitted if the GraphQL type name is the same as the entity name, which is the case for all of the built-in entities. ```ts title="src/vendure-config.ts" import { CmsArticle } from './entities/cms-article.entity'; const config = { // ... customFields: { Product: [ { name: 'blogPosts', list: true, type: 'relation', entity: CmsArticle, // highlight-next-line graphQLType: 'BlogPost', }, ] } }; ``` In the above example, the `CmsArticle` entity is being used as a related entity. However, the GraphQL type name is `BlogPost`, so we must specify this in the `graphQLType` property, otherwise Vendure will try to extend the GraphQL schema with reference to a non-existent "CmsArticle" type. #### inverseSide <CustomFieldProperty required={false} type="string | ((object: VendureEntity) => any)" /> Allows you to specify the [inverse side of the relation](https://typeorm.io/#inverse-side-of-the-relationship). Let's say you are adding a relation from `Product` to a custom entity which refers back to the product. You can specify this inverse relation like so: ```ts title="src/vendure-config.ts" import { Product } from '\@vendure/core'; import { ProductReview } from './entities/product-review.entity'; const config = { // ... customFields: { Product: [ { name: 'reviews', list: true, type: 'relation', entity: ProductReview, // highlight-start inverseSide: (review: ProductReview) => review.product, // highlight-end }, ] } }; ``` This then allows you to query the `ProductReview` entity and include the `product` relation: ```ts const { productReviews } = await this.connection.getRepository(ProductReview).findOne({ where: { id: 1 }, relations: ['product'], }); ``` ## Custom Field UI In the Admin UI, an appropriate default form input component is used for each custom field type. The Admin UI comes with a set of ready-made form input components, but it is also possible to create custom form input components. The ready-made components are: - `text-form-input`: A single-line text input - `password-form-input`: A single-line password input - `select-form-input`: A select input - `textarea-form-input`: A multi-line textarea input - `rich-text-form-input`: A rich text editor input that saves the content as HTML - `json-editor-form-input`: A simple JSON editor input - `html-editor-form-input`: A simple HTML text editor input - `number-form-input`: A number input - `currency-form-input`: A number input with currency formatting - `boolean-form-input`: A checkbox input - `date-form-input`: A date input - `relation-form-input`: A generic entity relation input which allows an ID to be manually specified - `customer-group-form-input`: A select input for selecting a CustomerGroup - `facet-value-form-input`: A select input for selecting a FacetValue - `product-selector-form-input`: A select input for selecting a Product from an autocomplete list - `product-multi-form-input`: A modal dialog for selecting multiple Products or ProductVariants #### Default form inputs This table shows the default form input component used for each custom field type: | Type | Form input component | |--------------------------|----------------------------------------------------------------------------------------------| | `string`, `localeString` | `text-form-input` or, if options are defined, `select-form-input` | | `text`, `localeText` | `textarea-form-input` | | `int`, `float` | `number-form-input` | | `boolean` | `boolean-form-input` | | `datetime` | `date-form-input` | | `relation` | Depends on related entity, defaults to `relation-form-input` if no specific component exists | :::info **UI for relation type** The Admin UI app has built-in selection components for "relation" custom fields that reference certain common entity types, such as Asset, Product, ProductVariant and Customer. If you are relating to an entity not covered by the built-in selection components, you will see a generic relation component which allows you to manually enter the ID of the entity you wish to select. If the generic selector is not suitable, or is you wish to replace one of the built-in selector components, you can create a UI extension that defines a custom field control for that custom field. You can read more about this in the [custom form input guide](/guides/extending-the-admin-ui/custom-form-inputs/) ::: ### Specifying the input component The defaults listed above can be overridden by using the `ui` property of the custom field config object. For example, if we want a number to be displayed as a currency input: ```ts title="src/vendure-config.ts" const config = { // ... customFields: { ProductVariant: [ { name: 'rrp', type: 'int', // highlight-next-line ui: { component: 'currency-form-input' }, }, ] } } ``` Here's an example config demonstrating several ways to customize the UI controls for custom fields: ```ts import { LanguageCode, VendureConfig } from '@vendure/core'; const config: VendureConfig = { // ... customFields: { Product: [ // Rich text editor {name: 'additionalInfo', type: 'text', ui: {component: 'rich-text-form-input'}}, // JSON editor {name: 'specs', type: 'text', ui: {component: 'json-editor-form-input'}}, // Numeric with suffix { name: 'weight', type: 'int', ui: {component: 'number-form-input', suffix: 'g'}, }, // Currency input { name: 'RRP', type: 'int', ui: {component: 'currency-form-input'}, }, // Select with options { name: 'pageType', type: 'string', ui: { component: 'select-form-input', options: [ {value: 'static', label: [{languageCode: LanguageCode.en, value: 'Static'}]}, {value: 'dynamic', label: [{languageCode: LanguageCode.en, value: 'Dynamic'}]}, ], }, }, // Text with prefix { name: 'link', type: 'string', ui: { component: 'text-form-input', prefix: 'https://', }, }, ], }, }; ``` and the resulting UI: ![custom-fields-ui.webp](custom-fields-ui.webp) :::info The various configuration options for each of the built-in form input (e.g. `suffix`) is documented in the [`DefaultFormConfigHash` object](/reference/typescript-api/configurable-operation-def/default-form-config-hash/). ::: ### Custom form input components If none of the built-in form input components are suitable, you can create your own. This is a more advanced topic which is covered in detail in the [Custom Form Input Components](/guides/extending-the-admin-ui/custom-form-inputs/) guide. ## Tabbed custom fields With a large, complex project, it's common for lots of custom fields to be required. This can get visually noisy in the UI, so Vendure supports tabbed custom fields. Just specify the tab name in the `ui` object, and those fields with the same tab name will be grouped in the UI! The tab name can also be a translation token if you need to support multiple languages. :::note Tabs will only be displayed if there is more than one tab name used in the custom fields. A lack of a `tab` property is counted as a tab (the "general" tab). ::: ```ts title="src/vendure-config.ts" const config = { // ... customFields: { Product: [ { name: 'additionalInfo', type: 'text', ui: {component: 'rich-text-form-input'} }, { name: 'specs', type: 'text', ui: {component: 'json-editor-form-input'} }, { name: 'width', type: 'int', ui: {tab: 'Shipping'} }, { name: 'height', type: 'int', ui: {tab: 'Shipping'} }, { name: 'depth', type: 'int', ui: {tab: 'Shipping'} }, { name: 'weight', type: 'int', ui: {tab: 'Shipping'} }, ], }, } ``` ## TypeScript Typings Because custom fields are generated at run-time, TypeScript has no way of knowing about them based on your VendureConfig. Consider the example above - let's say we have a [plugin](/guides/developer-guide/plugins/) which needs to access the custom field values on a Product entity. Attempting to access the custom field will result in a TS compiler error: ```ts {hl_lines=[12,13]} import { RequestContext, TransactionalConnection, ID, Product } from '@vendure/core'; export class MyService { constructor(private connection: TransactionalConnection) { } async getInfoUrl(ctx: RequestContext, productId: ID) { const product = await this.connection .getRepository(ctx, Product) .findOne(productId); return product.customFields.infoUrl; } // ^ TS2339: Property 'infoUrl' } // does not exist on type 'CustomProductFields'. ``` The "easy" way to solve this is to assert the `customFields` object as `any`: ```ts return (product.customFields as any).infoUrl; ``` However, this sacrifices type safety. To make our custom fields type-safe we can take advantage of a couple of more advanced TypeScript features - [declaration merging](https://www.typescriptlang.org/docs/handbook/declaration-merging.html#merging-interfaces) and [ambient modules](https://www.typescriptlang.org/docs/handbook/modules.html#ambient-modules). This allows us to extend the built-in `CustomProductFields` interface to add our custom fields to it: ```ts // types.ts // Note: we are using deep a import here, rather than importing from `@vendure/core` due to // a possible bug in TypeScript (https://github.com/microsoft/TypeScript/issues/46617) which // causes issues when multiple plugins extend the same custom fields interface. import { CustomProductFields } from '@vendure/core/dist/entity/custom-entity-fields'; declare module '@vendure/core/dist/entity/custom-entity-fields' { interface CustomProductFields { infoUrl: string; downloadable: boolean; shortName: string; } } ``` When this file is then imported into our service file (either directly or indirectly), TypeScript will know about our custom fields, and we do not need to do any type assertions. ```ts return product.customFields.infoUrl; // no error, plus TS autocomplete works. ``` :::caution Note that for the typings to work correctly, **order of imports matters**. One way to ensure that your custom field typings always get imported first is to include them as the first item in the tsconfig "include" array. ::: :::tip For a working example of this setup, see the [real-world-vendure repo](https://github.com/vendure-ecommerce/real-world-vendure/blob/master/src/plugins/reviews/types.ts) :::
--- title: "Define custom permissions" showtoc: true --- Vendure uses a fine-grained access control system based on roles & permissions. This is described in detail in the [Auth guide](/guides/core-concepts/auth/). The built-in [`Permission` enum](/reference/typescript-api/common/permission/) includes a range of permissions to control create, read, update, and delete access to the built-in entities. When building plugins, you may need to define new permissions to control access to new functionality. This guide explains how to do so. ## Defining a single permission For example, let's imagine you are creating a plugin which exposes a new mutation that can be used by remote services to sync your inventory. First of all we will define the new permission using the [`PermissionDefinition`](/reference/typescript-api/auth/permission-definition/) class: ```ts title="src/plugins/inventory-sync/constants.ts" import { PermissionDefinition } from '@vendure/core'; export const sync = new PermissionDefinition({ name: 'SyncInventory', description: 'Allows syncing stock levels via Admin API' }); ``` This permission can then be used in conjuction with the [@Allow() decorator](/reference/typescript-api/request/allow-decorator/) to limit access to the mutation: ```ts title="src/plugins/inventory-sync/api/inventory-sync.resolver.ts" import { Mutation, Resolver } from '@nestjs/graphql'; import { Allow } from '@vendure/core'; import { sync } from '../constants'; @Resolver() export class InventorySyncResolver { // highlight-next-line @Allow(sync.Permission) @Mutation() syncInventory(/* ... */) { // ... } } ``` Finally, the `sync` PermissionDefinition must be passed into the VendureConfig so that Vendure knows about this new custom permission: ```ts title="src/plugins/inventory-sync/inventory-sync.plugin.ts" import gql from 'graphql-tag'; import { VendurePlugin } from '@vendure/core'; import { InventorySyncResolver } from './api/inventory-sync.resolver' import { sync } from './constants'; @VendurePlugin({ adminApiExtensions: { schema: gql` input InventoryDataInput { # omitted for brevity } extend type Mutation { syncInventory(input: InventoryDataInput!): Boolean! } `, resolvers: [InventorySyncResolver] }, configuration: config => { // highlight-next-line config.authOptions.customPermissions.push(sync); return config; }, }) export class InventorySyncPlugin {} ``` On starting the Vendure server, this custom permission will now be visible in the Role detail view of the Admin UI, and can be assigned to Roles. ## Custom CRUD permissions Quite often your plugin will define a new entity on which you must perform create, read, update and delete (CRUD) operations. In this case, you can use the [CrudPermissionDefinition](/reference/typescript-api/auth/permission-definition/#crudpermissiondefinition) which simplifies the creation of the set of 4 CRUD permissions. For example, let's imagine we are creating a plugin which adds a new entity called `ProductReview`. We can define the CRUD permissions like so: ```ts title="src/plugins/product-review/constants.ts" import { CrudPermissionDefinition } from '@vendure/core'; export const productReviewPermission = new CrudPermissionDefinition('ProductReview'); ``` These permissions can then be used in our resolver: ```ts title="src/plugins/product-review/api/product-review.resolver.ts" import { Mutation, Resolver } from '@nestjs/graphql'; import { Allow, Transaction } from '@vendure/core'; import { productReviewPermission } from '../constants'; @Resolver() export class ProductReviewResolver { // highlight-next-line @Allow(productReviewPermission.Read) @Query() productReviews(/* ... */) { // ... } // highlight-next-line @Allow(productReviewPermission.Create) @Mutation() @Transaction() createProductReview(/* ... */) { // ... } // highlight-next-line @Allow(productReviewPermission.Update) @Mutation() @Transaction() updateProductReview(/* ... */) { // ... } // highlight-next-line @Allow(productReviewPermission.Delete) @Mutation() @Transaction() deleteProductReview(/* ... */) { // ... } } ``` Finally, the `productReview` CrudPermissionDefinition must be passed into the VendureConfig so that Vendure knows about this new custom permission: ```ts title="src/plugins/product-review/product-review.plugin.ts" import gql from 'graphql-tag'; import { VendurePlugin } from '@vendure/core'; import { ProductReviewResolver } from './api/product-review.resolver' import { productReviewPermission } from './constants'; @VendurePlugin({ adminApiExtensions: { schema: gql` # omitted for brevity `, resolvers: [ProductReviewResolver] }, configuration: config => { // highlight-next-line config.authOptions.customPermissions.push(productReviewPermission); return config; }, }) export class ProductReviewPlugin {} ``` ## Custom permissions for custom fields Since Vendure v2.2.0, it is possible to define custom permissions for custom fields. This is useful when you want to control access to specific custom fields on an entity. For example, imagine a "product reviews" plugin which adds a `rating` custom field to the `Product` entity. You may want to restrict access to this custom field to only those roles which have permissions on the product review plugin. ```ts title="src/plugins/product-review.plugin.ts" import { VendurePlugin } from '@vendure/core'; import { productReviewPermission } from './constants'; @VendurePlugin({ configuration: config => { config.authOptions.customPermissions.push(productReviewPermission); config.customFields.Product.push({ name: 'rating', type: 'int', // highlight-start requiresPermission: [ productReviewPermission.Read, productReviewPermission.Update, ], // highlight-end }); return config; }, }) export class ProductReviewPlugin {} ```
--- title: "Define a database entity" showtoc: true --- :::cli Use `npx vendure add` to easily add a new entity to a plugin. ::: Your plugin can define new database entities to model the data it needs to store. For instance, a product review plugin would need a way to store reviews. This would be done by defining a new database entity. This example shows how new [TypeORM database entities](https://typeorm.io/entities) can be defined by plugins. ## Create the entity class ```ts title="src/plugins/reviews/entities/product-review.entity.ts" import { DeepPartial } from '@vendure/common/lib/shared-types'; import { VendureEntity, Product, EntityId, ID } from '@vendure/core'; import { Column, Entity, ManyToOne } from 'typeorm'; @Entity() class ProductReview extends VendureEntity { constructor(input?: DeepPartial<ProductReview>) { super(input); } @ManyToOne(type => Product) product: Product; @EntityId() productId: ID; @Column() text: string; @Column() rating: number; } ``` :::note Any custom entities *must* extend the [`VendureEntity`](/reference/typescript-api/entities/vendure-entity/) class. ::: In this example, we are making use of the following TypeORM decorators: * [`@Entity()`](https://typeorm.io/decorator-reference#entity) - defines the entity as a TypeORM entity. This is **required** for all entities. It tells TypeORM to create a new table in the database for this entity. * [`@Column()`](https://typeorm.io/decorator-reference#column) - defines a column in the database table. The data type of the column is inferred from the TypeScript type of the property, but can be overridden by passing an options object to the decorator. The `@Column()` also supports many other options for defining the column, such as `nullable`, `default`, `unique`, `primary`, `enum` etc. * [`@ManyToOne()`](https://typeorm.io/decorator-reference#manytoone) - defines a many-to-one relationship between this entity and another entity. In this case, many `ProductReview` entities can be associated with a given `Product`. There are other types of relations that can be defined - see the [TypeORM relations docs](https://typeorm.io/relations). There is an additional Vendure-specific decorator: * [`@EntityId()`](/reference/typescript-api/configuration/entity-id-decorator) marks a property as the ID of another entity. In this case, the `productId` property is the ID of the `Product` entity. The reason that we have a special decorator for this is that Vendure supports both numeric and string IDs, and the `@EntityId()` decorator will automatically set the database column to be the correct type. This `productId` is not _necessary_, but it is a useful convention to allow access to the ID of the associated entity without having to perform a database join. ## Register the entity The new entity is then passed to the `entities` array of the VendurePlugin metadata: ```ts title="src/plugins/reviews/reviews-plugin.ts" import { VendurePlugin } from '@vendure/core'; import { ProductReview } from './entities/product-review.entity'; @VendurePlugin({ // highlight-next-line entities: [ProductReview], }) export class ReviewsPlugin {} ``` :::note Once you have added a new entity to your plugin, and the plugin has been added to your VendureConfig plugins array, you must create a [database migration](/guides/developer-guide/migrations/) to create the new table in the database. ::: ## Using the entity The new entity can now be used in your plugin code. For example, you might want to create a new product review when a customer submits a review via the storefront: ```ts title="src/plugins/reviews/services/review.service.ts" import { Injectable } from '@nestjs/common'; import { RequestContext, Product, TransactionalConnection } from '@vendure/core'; import { ProductReview } from '../entities/product-review.entity'; @Injectable() export class ReviewService { constructor(private connection: TransactionalConnection) {} async createReview(ctx: RequestContext, productId: string, rating: number, text: string) { const product = await this.connection.getEntityOrThrow(ctx, Product, productId); // highlight-start const review = new ProductReview({ product, rating, text, }); return this.connection.getRepository(ctx, ProductReview).save(review); // highlight-end } } ``` ## Available entity decorators In addition to the decorators described above, there are many other decorators provided by TypeORM. Some commonly used ones are: - [`@OneToOne()`](https://typeorm.io/decorator-reference#onetoone) - [`@OneToMany()`](https://typeorm.io/decorator-reference#onetomany) - [`@ManyToMany()`](https://typeorm.io/decorator-reference#manytomany) - [`@Index()`](https://typeorm.io/decorator-reference#index) - [`@Unique()`](https://typeorm.io/decorator-reference#unique) There is also another Vendure-specific decorator for representing monetary values specifically: - [`@Money()`](/reference/typescript-api/money/money-decorator): This works together with the [`MoneyStrategy`](/reference/typescript-api/money/money-strategy) to allow configurable control over how monetary values are stored in the database. For more information see the [Money & Currency guide](/guides/core-concepts/money/#the-money-decorator). :::info The full list of TypeORM decorators can be found in the [TypeORM decorator reference](https://typeorm.io/decorator-reference) ::: ## Corresponding GraphQL type Once you have defined a new DB entity, it is likely that you want to expose it in your GraphQL API. Here's how to [define a new type in your GraphQL API](/guides/developer-guide/extend-graphql-api/#defining-a-new-type). ## Supporting custom fields From Vendure v2.2, it is possible to add support for [custom fields](/guides/developer-guide/custom-fields/) to your custom entities. This is useful when you are defining a custom entity as part of a plugin which is intended to be used by other developers. For example, a plugin which defines a new entity for storing product reviews might want to allow the developer to add custom fields to the review entity. First you need to update your entity class to implement the `HasCustomFields` interface, and provide an empty class which will be used to store the custom field values: ```ts title="src/plugins/reviews/entities/product-review.entity.ts" import { DeepPartial, HasCustomFields, Product, VendureEntity, } from '@vendure/core'; import { Column, Entity, ManyToOne } from 'typeorm'; // highlight-next-line export class CustomProductReviewFields {} @Entity() // highlight-next-line export class ProductReview extends VendureEntity implements HasCustomFields { constructor(input?: DeepPartial<ProductReview>) { super(input); } // highlight-start @Column(type => CustomProductReviewFields) customFields: CustomProductReviewFields; // highlight-end @ManyToOne(type => Product) product: Product; @EntityId() productId: ID; @Column() text: string; @Column() rating: number; } ``` Now you'll be able to add custom fields to the `ProductReview` entity via the VendureConfig: ```ts title="src/vendure-config.ts" import { VendureConfig } from '@vendure/core'; export const config: VendureConfig = { // ... customFields: { ProductReview: [ { name: 'reviewerName', type: 'string' }, { name: 'reviewerLocation', type: 'string' }, ], }, }; ```
--- title: "Database subscribers" --- # Defining database subscribers TypeORM allows us to define [subscribers](https://typeorm.io/listeners-and-subscribers#what-is-a-subscriber). With a subscriber, we can listen to specific entity events and take actions based on inserts, updates, deletions and more. If you need lower-level access to database changes that you get with the [Vendure EventBus system](/reference/typescript-api/events/event-bus/), TypeORM subscribers can be useful. ## Simple subscribers The simplest way to register a subscriber is to pass it to the `dbConnectionOptions.subscribers` array: ```ts title="src/plugins/my-plugin/product-subscriber.ts" import { Product, VendureConfig } from '@vendure/core'; import { EntitySubscriberInterface, EventSubscriber, UpdateEvent } from 'typeorm'; @EventSubscriber() export class ProductSubscriber implements EntitySubscriberInterface<Product> { listenTo() { return Product; } beforeUpdate(event: UpdateEvent<Product>) { console.log(`BEFORE PRODUCT UPDATED: `, event.entity); } } ``` ```ts title="src/vendure-config.ts" import { VendureConfig } from '@vendure/core'; import { ProductSubscriber } from './plugins/my-plugin/product-subscriber'; // ... export const config: VendureConfig = { dbConnectionOptions: { // ... subscribers: [ProductSubscriber], } } ``` The limitation of this method is that the `ProductSubscriber` class cannot make use of dependency injection, since it is not known to the underlying NestJS application and is instead instantiated by TypeORM directly. If you need to make use of providers in your subscriber class, you'll need to use the following pattern. ## Injectable subscribers By defining the subscriber as an injectable provider, and passing it to a Vendure plugin, you can take advantage of Nest's dependency injection inside the subscriber methods. ```ts title="src/plugins/my-plugin/product-subscriber.ts" import { PluginCommonModule, Product, TransactionalConnection, VendureConfig, VendurePlugin, } from '@vendure/core'; import { Injectable } from '@nestjs/common'; import { EntitySubscriberInterface, EventSubscriber, UpdateEvent } from 'typeorm'; import { MyService } from './services/my.service'; @Injectable() @EventSubscriber() export class ProductSubscriber implements EntitySubscriberInterface<Product> { constructor(private connection: TransactionalConnection, private myService: MyService) { // This is how we can dynamically register the subscriber // with TypeORM connection.rawConnection.subscribers.push(this); } listenTo() { return Product; } async beforeUpdate(event: UpdateEvent<Product>) { console.log(`BEFORE PRODUCT UPDATED: `, event.entity); // Now we can make use of our injected provider await this.myService.handleProductUpdate(event); } } ``` ```ts title="src/plugins/my-plugin/my.plugin.ts" @VendurePlugin({ imports: [PluginCommonModule], providers: [ProductSubscriber, MyService], }) class MyPlugin { } ``` ```ts title="src/vendure-config.ts" // ... export const config: VendureConfig = { dbConnectionOptions: { // We no longer need to pass the subscriber here // subscribers: [ProductSubscriber], }, plugins: [ MyPlugin, ], } ``` ## Troubleshooting subscribers An important factor when working with TypeORM subscribers is that they are very low-level and require some understanding of the Vendure schema. For example consider the `ProductSubscriber` above. If an admin changes a product's name in the Admin UI, this subscriber **will not fire**. The reason is that the `name` property is actually stored on the `ProductTranslation` entity, rather than on the `Product` entity. So if your subscribers do not seem to work as expected, check your database schema and make sure you are really targeting the correct entity which has the property that you are interested in.
--- title: "Extend the GraphQL API" showtoc: true --- Extension to the GraphQL API consists of two parts: 1. **Schema extensions**. These define new types, fields, queries and mutations. 2. **Resolvers**. These provide the logic that backs up the schema extensions. The Shop API and Admin APIs can be extended independently: ```ts title="src/plugins/top-products/top-products.plugin.ts" import { PluginCommonModule, VendurePlugin } from '@vendure/core'; import gql from 'graphql-tag'; import { TopSellersResolver } from './api/top-products.resolver'; const schemaExtension = gql` extend type Query { topProducts: [Product!]! } ` @VendurePlugin({ imports: [PluginCommonModule], // highlight-start // We pass our schema extension and any related resolvers // to our plugin metadata shopApiExtensions: { schema: schemaExtension, resolvers: [TopProductsResolver], }, // Likewise, if you want to extend the Admin API, // you would use `adminApiExtensions` in exactly the // same way. // adminApiExtensions: { // schema: someSchemaExtension // resolvers: [SomeResolver], // }, // highlight-end }) export class TopProductsPlugin { } ``` There are a number of ways the GraphQL APIs can be modified by a plugin. ## Adding a new Query Let's take a simple example where we want to be able to display a banner in our storefront. First let's define a new query in the schema: ```ts title="src/plugins/banner/api/api-extensions.ts" import gql from 'graphql-tag'; export const shopApiExtensions = gql` extend type Query { // highlight-next-line activeBanner(locationId: String!): String } `; ``` This defines a new query called `activeBanner` which takes a `locationId` string argument and returns a string. :::tip `!` = non-nullable In GraphQL, the `!` in `locationId: String!` indicates that the argument is required, and the lack of a `!` on the return type indicates that the return value can be `null`. ::: We can now define the resolver for this query: ```ts title="src/plugins/banner/api/banner-shop.resolver.ts" import { Args, Query, Resolver } from '@nestjs/graphql'; import { Ctx, RequestContext } from '@vendure/core'; import { BannerService } from '../services/banner.service.ts'; @Resolver() class BannerShopResolver { constructor(private bannerService: BannerService) {} // highlight-start @Query() activeBanner(@Ctx() ctx: RequestContext, @Args() args: { locationId: string; }) { return this.bannerService.getBanner(ctx, args.locationId); } // highlight-end } ``` The `BannerService` would implement the actual logic for fetching the banner text from the database. Finally, we need to add the resolver to the plugin metadata: ```ts title="src/plugins/banner/banner.plugin.ts" import { PluginCommonModule, VendurePlugin } from '@vendure/core'; import { BannerService } from './services/banner.service'; import { BannerShopResolver } from './api/banner-shop.resolver'; import { shopApiExtensions } from './api/api-extensions'; @VendurePlugin({ imports: [PluginCommonModule], // highlight-start shopApiExtensions: { schema: shopApiExtensions, resolvers: [BannerShopResolver], }, // highlight-end providers: [BannerService], }) export class BannerPlugin {} ``` ## Adding a new Mutation Let's continue the `BannerPlugin` example and now add a mutation which allows the administrator to set the banner text. First we define the mutation in the schema: ```ts title="src/plugins/banner/api/api-extensions.ts" import gql from 'graphql-tag'; export const adminApiExtensions = gql` extend type Mutation { // highlight-next-line setBannerText(locationId: String!, text: String!): String! } `; ``` Here we are defining a new mutation called `setBannerText` which takes two arguments, `locationId` and `text`, both of which are required strings. The return type is a non-nullable string. Now let's define a resolver to handle that mutation: ```ts title="src/plugins/banner/api/banner-admin.resolver.ts" import { Args, Mutation, Resolver } from '@nestjs/graphql'; import { Allow, Ctx, RequestContext, Permission, Transaction } from '@vendure/core'; import { BannerService } from '../services/banner.service.ts'; @Resolver() class BannerAdminResolver { constructor(private bannerService: BannerService) {} // highlight-start @Allow(Permission.UpdateSettings) @Transaction() @Mutation() setBannerText(@Ctx() ctx: RequestContext, @Args() args: { locationId: string; text: string; }) { return this.bannerService.setBannerText(ctx, args.locationId, args.text); } // highlight-end } ``` Note that we have used the `@Allow()` decorator to ensure that only users with the `UpdateSettings` permission can call this mutation. We have also wrapped the resolver in a transaction using `@Transaction()`, which is a good idea for any mutation which modifies the database. :::info For more information on the available decorators, see the [API Layer "decorators" guide](/guides/developer-guide/the-api-layer/#api-decorators). ::: Finally, we add the resolver to the plugin metadata: ```ts title="src/plugins/banner/banner.plugin.ts" import { PluginCommonModule, VendurePlugin } from '@vendure/core'; import { BannerService } from './services/banner.service'; import { BannerShopResolver } from './api/banner-shop.resolver'; import { BannerAdminResolver } from './api/banner-admin.resolver'; import { shopApiExtensions, adminApiExtensions } from './api/api-extensions'; @VendurePlugin({ imports: [PluginCommonModule], shopApiExtensions: { schema: shopApiExtensions, resolvers: [BannerShopResolver], }, // highlight-start adminApiExtensions: { schema: adminApiExtensions, resolvers: [BannerAdminResolver], }, // highlight-end providers: [BannerService], }) export class BannerPlugin {} ``` ## Defining a new type If you have defined a new database entity, it is likely that you'll want to expose this entity in your GraphQL API. To do so, you'll need to define a corresponding GraphQL type. Using the `ProductReview` entity from the [Define a database entity guide](/guides/developer-guide/database-entity//), let's see how we can expose it as a new type in the API. As a reminder, here is the `ProductReview` entity: ```ts title="src/plugins/reviews/product-review.entity.ts" import { DeepPartial } from '@vendure/common/lib/shared-types'; import { VendureEntity, Product, EntityId, ID } from '@vendure/core'; import { Column, Entity, ManyToOne } from 'typeorm'; @Entity() class ProductReview extends VendureEntity { constructor(input?: DeepPartial<ProductReview>) { super(input); } @ManyToOne(type => Product) product: Product; @EntityId() productId: ID; @Column() text: string; @Column() rating: number; } ``` Let's define a new GraphQL type which corresponds to this entity: ```ts title="src/plugins/reviews/api/api-extensions.ts" import gql from 'graphql-tag'; export const apiExtensions = gql` // highlight-start type ProductReview implements Node { id: ID! createdAt: DateTime! updatedAt: DateTime! product: Product! productId: ID! text: String! rating: Float! } // highlight-end `; ``` :::info Assuming the entity is a standard `VendureEntity`, it is good practice to always include the `id`, `createdAt` and `updatedAt` fields in the GraphQL type. Additionally, we implement `Node` which is a built-in GraphQL interface. ::: Now we can add this type to both the Admin and Shop APIs: ```ts title="src/plugins/reviews/reviews.plugin.ts" import gql from 'graphql-tag'; import { PluginCommonModule, VendurePlugin } from '@vendure/core'; import { ReviewsResolver } from './api/reviews.resolver'; import { apiExtensions } from './api/api-extensions'; import { ProductReview } from './entities/product-review.entity'; @VendurePlugin({ imports: [PluginCommonModule], shopApiExtensions: { // highlight-next-line schema: apiExtensions, }, entities: [ProductReview], }) export class ReviewsPlugin {} ``` ## Add fields to existing types Let's say you want to add a new field to the `ProductVariant` type to allow the storefront to display some indication of how long a particular product variant would take to deliver, based on data from some external service. First we extend the `ProductVariant` GraphQL type: ```ts title="src/plugins/delivery-time/api/api-extensions.ts" import gql from 'graphql-tag'; export const shopApiExtensions = gql` type DeliveryEstimate { from: Int! to: Int! } // highlight-start extend type ProductVariant { delivery: DeliveryEstimate! } // highlight-end }`; ``` This schema extension says that the `delivery` field will be added to the `ProductVariant` type, and that it will be of type `DeliveryEstimate!`, i.e. a non-nullable instance of the `DeliveryEstimate` type. Next we need to define an "entity resolver" for this field. Unlike the resolvers we have seen above, this resolver will be handling fields on the `ProductVariant` type _only_. This is done by scoping the resolver class that type by passing the type name to the `@Resolver()` decorator: ```ts title="src/plugins/delivery-time/product-variant-entity.resolver.ts" import { Parent, ResolveField, Resolver } from '@nestjs/graphql'; import { Ctx, RequestContext, ProductVariant } from '@vendure/core'; import { DeliveryEstimateService } from '../services/delivery-estimate.service'; // highlight-next-line @Resolver('ProductVariant') export class ProductVariantEntityResolver { constructor(private deliveryEstimateService: DeliveryEstimateService) { } // highlight-start @ResolveField() delivery(@Ctx() ctx: RequestContext, @Parent() variant: ProductVariant) { return this.deliveryEstimateService.getEstimate(ctx, variant.id); } // highlight-end } ``` Finally we need to pass these schema extensions and the resolver to our plugin metadata: ```ts title="src/plugins/delivery-time/delivery-time.plugin.ts" import gql from 'graphql-tag'; import { PluginCommonModule, VendurePlugin } from '@vendure/core'; import { ProductVariantEntityResolver } from './api/product-variant-entity.resolver'; import { shopApiExtensions } from './api/api-extensions'; @VendurePlugin({ imports: [PluginCommonModule], shopApiExtensions: { // highlight-start schema: shopApiExtensions, resolvers: [ProductVariantEntityResolver] // highlight-end } }) export class DeliveryTimePlugin {} ``` ## Override built-in resolvers It is also possible to override an existing built-in resolver function with one of your own. To do so, you need to define a resolver with the same name as the query or mutation you wish to override. When that query or mutation is then executed, your code, rather than the default Vendure resolver, will handle it. ```ts import { Args, Query, Mutation, Resolver } from '@nestjs/graphql'; import { Ctx, RequestContext } from '@vendure/core' @Resolver() class OverrideExampleResolver { @Query() products(@Ctx() ctx: RequestContext, @Args() args: any) { // when the `products` query is executed, this resolver function will // now handle it. } @Transaction() @Mutation() addItemToOrder(@Ctx() ctx: RequestContext, @Args() args: any) { // when the `addItemToOrder` mutation is executed, this resolver function will // now handle it. } } ``` The same can be done for resolving fields: ```ts import { Parent, ResolveField, Resolver } from '@nestjs/graphql'; import { Ctx, RequestContext, Product } from '@vendure/core'; @Resolver('Product') export class FieldOverrideExampleResolver { @ResolveField() description(@Ctx() ctx: RequestContext, @Parent() product: Product) { return this.wrapInFormatting(ctx, product.id); } private wrapInFormatting(ctx: RequestContext, id: ID): string { // implementation omitted, but wraps the description // text in some special formatting required by the storefront } } ``` ## Resolving union results When dealing with operations that return a GraphQL union type, there is an extra step needed. Union types are commonly returned from mutations in the Vendure APIs. For more detail on this see the section on [ErrorResults](/guides/developer-guide/error-handling#expected-errors-errorresults). For example: ```graphql type MyCustomErrorResult implements ErrorResult { errorCode: ErrorCode! message: String! } union MyCustomMutationResult = Order | MyCustomErrorResult extend type Mutation { myCustomMutation(orderId: ID!): MyCustomMutationResult! } ``` In this example, the resolver which handles the `myCustomMutation` operation will be returning either an `Order` object or a `MyCustomErrorResult` object. The problem here is that the GraphQL server has no way of knowing which one it is at run-time. Luckily Apollo Server (on which Vendure is built) has a means to solve this: > To fully resolve a union, Apollo Server needs to specify which of the union's types is being returned. To achieve this, you define a `__resolveType` function for the union in your resolver map. > > The `__resolveType` function is responsible for determining an object's corresponding GraphQL type and returning the name of that type as a string. > -- <cite>Source: [Apollo Server docs](https://www.apollographql.com/docs/apollo-server/schema/unions-interfaces/#resolving-a-union)</cite> In order to implement a `__resolveType` function as part of your plugin, you need to create a dedicated Resolver class with a single field resolver method which will look like this: ```ts import { Parent, ResolveField, Resolver } from '@nestjs/graphql'; import { Ctx, RequestContext, ProductVariant } from '@vendure/core'; @Resolver('MyCustomMutationResult') export class MyCustomMutationResultResolver { @ResolveField() __resolveType(value: any): string { // If it has an "id" property we can assume it is an Order. return value.hasOwnProperty('id') ? 'Order' : 'MyCustomErrorResult'; } } ``` This resolver is then passed in to your plugin metadata like any other resolver: ```ts @VendurePlugin({ imports: [PluginCommonModule], shopApiExtensions: { schema: apiExtensions, resolvers: [/* ... */, MyCustomMutationResultResolver] } }) export class MyPlugin {} ``` ## Defining custom scalars By default, Vendure bundles `DateTime` and a `JSON` custom scalars (from the [graphql-scalars library](https://github.com/Urigo/graphql-scalars)). From v1.7.0, you can also define your own custom scalars for use in your schema extensions: ```ts import { GraphQLScalarType} from 'graphql'; import { GraphQLEmailAddress } from 'graphql-scalars'; // Scalars can be custom-built as like this one, // or imported from a pre-made scalar library like // the GraphQLEmailAddress example. const FooScalar = new GraphQLScalarType({ name: 'Foo', description: 'A test scalar', serialize(value) { // ... }, parseValue(value) { // ... }, }); @VendurePlugin({ imports: [PluginCommonModule], shopApiExtensions: { schema: gql` scalar Foo scalar EmailAddress `, scalars: { // The key must match the scalar name // given in the schema Foo: FooScalar, EmailAddress: GraphQLEmailAddress, }, }, }) export class CustomScalarsPlugin {} ```
--- title: "Importing Data" showtoc: true --- If you have hundreds, thousands or more products, inputting all the data by hand via the Admin UI can be too inefficient. To solve this, Vendure supports bulk-importing product and other data. Data import is also useful for setting up test or demo environments, and is also used by the `@vendure/testing` package for end-to-end tests. ## Product Import Format Vendure uses a flat **.csv** format for importing product data. The format encodes data about: * products * product variants * product & variant assets * product & variant facets * product & variant custom fields Here's an example which defines 2 products, "Laptop" and "Clacky Keyboard". The laptop has 4 variants, and the keyboard only a single variant. ```csv name , slug , description , assets , facets , optionGroups , optionValues , sku , price , taxCategory , stockOnHand , trackInventory , variantAssets , variantFacets Laptop , laptop , "Description of laptop" , laptop_01.jpg|laptop_02.jpg , category:electronics|brand:Apple , screen size|RAM , 13 inch|8GB , L2201308 , 1299.00 , standard , 100 , false , , , , , , , , 15 inch|8GB , L2201508 , 1399.00 , standard , 100 , false , , , , , , , , 13 inch|16GB , L2201316 , 2199.00 , standard , 100 , false , , , , , , , , 15 inch|16GB , L2201516 , 2299.00 , standard , 100 , false , , Clacky Keyboard , clacky-keyboard , "Description of keyboard" , keyboard_01.jpg , category:electronics|brand:Logitech , , , A4TKLA45535 , 74.89 , standard , 100 , false , , ``` Here's an explanation of each column: * `name`: The name of the product. Rows with an empty "name" are interpreted as variants of the preceeding product row. * `slug`: The product's slug. Can be omitted, in which case will be generated from the name. * `description`: The product description. * `assets`: One or more asset file names separated by the pipe (`|`) character. The files can be located on the local file system, in which case the path is interpreted as being relative to the [`importAssetsDir`](/reference/typescript-api/import-export/import-export-options/#importassetsdir) as defined in the VendureConfig. Files can also be urls which will be fetched from a remote http/https url. If you need more control over how assets are imported, you can implement a custom [AssetImportStrategy](/reference/typescript-api/import-export/asset-import-strategy#assetimportstrategy). The first asset will be set as the featuredAsset. * `facets`: One or more facets to apply to the product separated by the pipe (`|`) character. A facet has the format `<facet-name>:<facet-value>`. * `optionGroups`: OptionGroups define what variants make up the product. Applies only to products with more than one variant. * `optionValues`: For each optionGroup defined, a corresponding value must be specified for each variant. Applies only to products with more than one variant. * `sku`: The Stock Keeping Unit (unique product code) for this product variant. * `price`: The price can be either with or without taxes, depending on your channel settings (can be set later). * `taxCategory`: The name of an existing tax category. Tax categories can be also be imported using the InitialData object. * `stockOnHand`: The number of units in stock. * `trackInventory`: Whether this variant should have its stock level tracked, i.e. the stock level is automatically decreased for each unit ordered. * `variantAssets`: Same as `assets` but applied to the product variant. * `variantFacets`: Same as `facets` but applied to the product variant. ### Importing Custom Field Data If you have [CustomFields]({{< relref "customizing-models" >}}) defined on your Product or ProductVariant entities, this data can also be encoded in the import csv: * `product:<customFieldName>`: The value of this column will populate `Product.customFields[customFieldName]`. * `variant:<customFieldName>`: The value of this column will populate `ProductVariant.customFields[customFieldName]`. :::info For a real example, see the [products.csv file used to populate the Vendure demo data](https://github.com/vendure-ecommerce/vendure/blob/master/packages/core/mock-data/data-sources/products.csv) ::: #### Importing `relation` custom fields To import custom fields with the type `relation`, the value in the CSV must be a stringified object with an `id` property: ```csv ... ,product:featuredReview ... ,"{ ""id"": 123 }" ``` #### Importing `list` custom fields To import custom fields with `list` set to `true`, the data should be separated with a pipe (`|`) character: ```csv ... ,product:keywords ... ,tablet|pad|android ``` #### Importing data in multiple languages If a field is translatable (i.e. of `localeString` type), you can use column names with an appended language code (e.g. `name:en`, `name:de`, `product:keywords:en`, `product:keywords:de`) to specify its value in multiple languages. Use of language codes has to be consistent throughout the file. You don't have to translate every translatable field. If there are no translated columns for a field, the generic column's value will be used for all languages. But when you do translate columns, the set of languages for each of them needs to be the same. As an example, you cannot use `name:en` and `name:de`, but only provide `slug:en` (it's okay to use only a `slug` column though, in which case this slug will be used for both the English and the German version). ## Initial Data As well as product data, other initialization data can be populated using the [`InitialData` object](/reference/typescript-api/import-export/initial-data/). **This format is intentionally limited**; more advanced requirements (e.g. setting up ShippingMethods that use custom checkers & calculators) should be carried out via [custom populate scripts](#populating-the-server). ```ts import { InitialData, LanguageCode } from '@vendure/core'; export const initialData: InitialData = { paymentMethods: [ { name: 'Standard Payment', handler: { code: 'dummy-payment-handler', arguments: [{ name: 'automaticSettle', value: 'false' }], }, }, ], roles: [ { code: 'administrator', description: 'Administrator', permissions: [ Permission.CreateCatalog, Permission.ReadCatalog, Permission.UpdateCatalog, Permission.DeleteCatalog, Permission.CreateSettings, Permission.ReadSettings, Permission.UpdateSettings, Permission.DeleteSettings, Permission.CreateCustomer, Permission.ReadCustomer, Permission.UpdateCustomer, Permission.DeleteCustomer, Permission.CreateCustomerGroup, Permission.ReadCustomerGroup, Permission.UpdateCustomerGroup, Permission.DeleteCustomerGroup, Permission.CreateOrder, Permission.ReadOrder, Permission.UpdateOrder, Permission.DeleteOrder, Permission.CreateSystem, Permission.ReadSystem, Permission.UpdateSystem, Permission.DeleteSystem, ], }, ], defaultLanguage: LanguageCode.en, countries: [ { name: 'Austria', code: 'AT', zone: 'Europe' }, { name: 'Malaysia', code: 'MY', zone: 'Asia' }, { name: 'United Kingdom', code: 'GB', zone: 'Europe' }, ], defaultZone: 'Europe', taxRates: [ { name: 'Standard Tax', percentage: 20 }, { name: 'Reduced Tax', percentage: 10 }, { name: 'Zero Tax', percentage: 0 }, ], shippingMethods: [{ name: 'Standard Shipping', price: 500 }, { name: 'Express Shipping', price: 1000 }], collections: [ { name: 'Electronics', filters: [ { code: 'facet-value-filter', args: { facetValueNames: ['Electronics'], containsAny: false }, }, ], assetPaths: ['jakob-owens-274337-unsplash.jpg'], }, ], }; ``` * `paymentMethods`: Defines which payment methods are available. * `name`: Name of the payment method. * `handler`: Payment plugin handler information. * `roles`: Defines which user roles are available. * `code`: Role code name. * `description`: Role description. * `permissions`: List of permissions to apply to the role. * `defaultLanguage`: Sets the language that will be used for all translatable entities created by the initial data e.g. Products, ProductVariants, Collections etc. Should correspond to the language used in your product csv file. * `countries`: Defines which countries are available. * `name`: The name of the country in the language specified by `defaultLanguage` * `code`: A standardized code for the country, e.g. [ISO 3166-1](https://en.wikipedia.org/wiki/List_of_ISO_3166_country_codes) * `zone`: A [Zone](/reference/typescript-api/entities/zone) to which this country belongs. * `defaultZone`: Sets the default shipping & tax zone for the default Channel. The zone must correspond to a value of `zone` set in the `countries` array. * `taxRates`: For each item, a new [TaxCategory](/reference/typescript-api/entities/tax-category/) is created, and then a [TaxRate](/reference/typescript-api/entities/tax-rate) is created for each unique zone defined in the `countries` array. * `shippingMethods`: Allows simple flat-rate [ShippingMethods](/reference/typescript-api/entities/shipping-method) to be defined. * `collections`: Allows Collections to be created. Currently, only collections based on facet values can be created (`code: 'facet-value-filter'`). The `assetPaths` and `facetValueNames` values must correspond to a value specified in the products csv file. The name should match the value specified in the product csv file (or can be a normalized - lower-case & hyphenated - version thereof). If there are FacetValues in multiple Facets with the same name, the facet may be specified with a colon delimiter, e.g. `brand:apple`, `flavour: apple`. ## Populating The Server ### The `populate()` function The `@vendure/core` package exposes a [`populate()` function](/reference/typescript-api/import-export/populate/) which can be used along with the data formats described above to populate your Vendure server: ```ts title="src/my-populate-script.ts" import { bootstrap, DefaultJobQueuePlugin } from '@vendure/core'; import { populate } from '@vendure/core/cli'; import path from "path"; import { config } from './vendure-config'; import { initialData } from './my-initial-data'; const productsCsvFile = path.join(__dirname, 'path/to/products.csv') const populateConfig = { ...config, plugins: (config.plugins || []).filter( // Remove your JobQueuePlugin during populating to avoid // generating lots of unnecessary jobs as the Collections get created. plugin => plugin !== DefaultJobQueuePlugin, ), } populate( () => bootstrap(populateConfig), initialData, productsCsvFile, 'my-channel-token' // optional - used to assign imported ) // entities to the specified Channel .then(app => { return app.close(); }) .then( () => process.exit(0), err => { console.log(err); process.exit(1); }, ); ``` :::note When removing the `DefaultJobQueuePlugin` from the plugins list as in the code snippet above, one should manually rebuild the search index in order for the newly added products to appear. In the Admin UI, this can be done by navigating to the product list view and clicking the three icon next to the search input: ![Rebuild search index](./reindex.webp) ::: ### Populating test data When installing with @vendure/create, you have the option of populating test data (products, payment methods, countries, zones, tax rates etc). This guide illustrates how to populate that test data again on an existing Vendure installation, without needing to re-install from scratch. 1. `npm install --save-dev @vendure/create`. This installs the "create" package, which contains the test data we will need. 2. drop all tables from your database, but leave the actual database there. 3. create a script that looks like this: ```ts title="src/populate-test-data.ts" import { populate } from '@vendure/core/cli'; import { bootstrap, VendureConfig } from '@vendure/core'; import { config } from './vendure-config'; populate( () => bootstrap({ ...config, importExportOptions: { importAssetsDir: path.join( require.resolve('@vendure/create/assets/products.csv'), '../images' ), }, dbConnectionOptions: {...config.dbConnectionOptions, synchronize: true} }), require('@vendure/create/assets/initial-data.json'), require.resolve('@vendure/create/assets/products.csv') ) .then(app => app.close()) .catch(err => { console.log(err); process.exit(1); }); ``` Running this script will populate the database with the test data like when you first installed Vendure. ### Custom populate scripts If you require more control over how your data is being imported - for example if you also need to import data into custom entities, or import customer or order information - you can create your own CLI script to do this: see [Stand-Alone CLI Scripts](/guides/developer-guide/stand-alone-scripts/). In addition to all the services available in the [Service Layer](/guides/developer-guide/the-service-layer/), the following specialized import services are available: * [`ImportParser`](/reference/typescript-api/import-export/import-parser): Used to parse the CSV file into an array of objects. * [`FastImporterService`](/reference/typescript-api/import-export/fast-importer-service): Used to create new products & variants in bulk, optimized for speed. * [`Populator`](/reference/typescript-api/import-export/populator): Used to populate the initial data. * [`AssetImporter`](/reference/typescript-api/import-export/asset-importer): Creates new Assets in bulk, using the configured [`AssetImportStrategy`](/reference/typescript-api/import-export/asset-import-strategy). * [`Importer`](/reference/typescript-api/import-export/importer/): Uses all of the above services in combination - this is the basis of the `populate()` function described above. Using these specialized import services is preferable to using the normal service-layer services (`ProductService`, `ProductVariantService` etc.) for bulk imports. This is because these import services are optimized for bulk imports (they omit unnecessary checks, use optimized SQL queries) and also do not publish events when creating new entities. However, it is still possible to use the normal service-layer services if you prefer. For example, the following code snippet shows how to create a new ProductVariant using the `ProductVariantService`: ## Importing from other platforms If you are migrating from another platform, you can create a custom import script to import your data into Vendure. Your existing platform may provide an API which you can use to fetch the data, or it may provide a mechanism for exporting the data to a file. Therefore, you have a couple of options: 1. Export the data to a file, and then transform this into the Vendure CSV format for import as above. 2. Write a script which import the data via the other platform's API, and then import this data into Vendure using the services described above, or any other of the Vendure core services. The first option is the simplest, but may not be possible if the other platform does not provide a suitable export format. The second option is more complex, but allows for more flexibility and can be used to import data from any source, as well as allowing the import of other data such as customer and order information. As an illustrative example, let's imagine we are migrating away from an imaginary commerce platform, "OldCommerce", and we want to import our data into Vendure. Luckily, OldCommerce provides a client package which allows us to easily interact with their API. :::note This is a much-simplified example, but it should serve to illustrate the general approach. ::: ```ts title="src/import-from-other-platform.ts" import { INestApplicationContext } from '@nestjs/common'; import { bootstrapWorker, ConfigService, Importer, LanguageCode, ParsedProductWithVariants, RequestContext, RequestContextService, TransactionalConnection, User, SearchService, } from '@vendure/core'; import { createClient, OldCommerceProduct } from '@old-commerce/client'; import { config } from './vendure-config'; if (require.main === module) { importData().then( () => process.exit(0), err => { console.log(err); process.exit(1); }, ); } async function importData() { // We use the bootstrapWorker() function instead of bootstrap() because we don't // need to start the server, we just need access to the services. const {app} = await bootstrapWorker(config); // Create an instace of the client we'll be using to interact with the // OldCommerce API const client = createClient({ // OldCommerce client config }); // Let's grab a reference to each of the Vendure services we'll need. const importer = app.get(Importer); // Most service methods require a RequestContext, so we'll create one here. const ctx = await getSuperadminContext(app); // To reindex after importing products const searchService = app.get(SearchService); // Fetch all the products to import from the OldCommerce API const productsToImport: OldCommerceProduct[] = await client.getAllProducts(); // Transform the OldCommerce products into the format expected by the Importer const importRows: ParsedProductWithVariants[] = productsToImport.map(product => ({ product: { translations: [ { languageCode: LanguageCode.en, name: product.name, slug: product.slug, description: product.description, customFields: {}, }, ], assetPaths: product.images.map(image => image.sourceUrl), facets: [], optionGroups: product.options.map(option => ({ translations: [ { languageCode: LanguageCode.en, name: option.name, values: option.values.map(value => value.name), }, ], })), }, variants: product.variations.map(variation => { const optionValues = variation.options.map(option => option.value); return { sku: variation.productCode, price: variation.price, stockOnHand: variation.stock, translations: [{languageCode: LanguageCode.en, optionValues}], }; }), })); // Import the products await importer.importProducts(ctx, importRows, progress => { console.log(`Imported ${progress.imported} of ${importRows.length} products`); }); // Rebuild search index await searchService.reindex(ctx); // Close the app await app.close(); } /** * Creates a RequestContext configured for the default Channel with the activeUser set * as the superadmin user. */ export async function getSuperadminContext(app: INestApplicationContext): Promise<RequestContext> { const {superadminCredentials} = app.get(ConfigService).authOptions; const superAdminUser = await app.get(TransactionalConnection) .getRepository(User) .findOneOrFail({where: {identifier: superadminCredentials.identifier}}); return app.get(RequestContextService).create({ apiType: 'admin', user: superAdminUser, }); } ```
--- title: "Logging" showtoc: true --- # Logging Logging allows you to see what is happening inside the Vendure server. It is useful for debugging and for monitoring the health of the server in production. In Vendure, logging is configured using the `logger` property of the [VendureConfig](/reference/typescript-api/configuration/vendure-config/#logger) object. The logger must implement the [VendureLogger](/reference/typescript-api/logger/vendure-logger) interface. :::info To implement a custom logger, see the [Implementing a custom logger](/reference/typescript-api/logger/#implementing-a-custom-logger) guide. ::: ## Log levels Vendure uses 5 log levels, in order of increasing severity: | Level | Description | |-----------|----------------------------------------------------------------------------------------------------------| | `Debug` | The most verbose level, used for debugging purposes. The output can be very noisy at this level | | `Verbose` | More information than the Info level, but less than `Debug` | | `Info` | General information about the normal running of the server | | `Warning` | Issues which might need attention or action, but which do not prevent the server from continuing to run. | | `Error` | Errors which should be investigated and handled; something has gone wrong. | ## DefaultLogger Vendure ships with a [DefaultLogger](/reference/typescript-api/logger/default-logger) which logs to the console (process.stdout). It can be configured with the desired log level: ```ts title="src/vendure-config.ts" import { DefaultLogger, VendureConfig } from '@vendure/core'; const config: VendureConfig = { // ... logger: new DefaultLogger({ level: LogLevel.Debug }), }; ``` ## Logging database queries To log database queries, set the `logging` property of the `dbConnectionOptions` as well as setting the logger to `Debug` level. ```ts title="src/vendure-config.ts" import { DefaultLogger, LogLevel, VendureConfig } from '@vendure/core'; const config: VendureConfig = { // ... logger: new DefaultLogger({ level: LogLevel.Debug }), dbConnectionOptions: { // ... etc logging: true, // You can also specify which types of DB events to log: // logging: ['error', 'warn', 'schema', 'query', 'info', 'log'], }, }; ``` More information about the `logging` option can be found in the [TypeORM logging documentation](https://typeorm.io/logging). ## Logging in your own plugins When you extend Vendure by creating your own plugins, it's a good idea to log useful information about what your plugin is doing. To do this, you need to import the [Logger](/reference/typescript-api/logger/) class from `@vendure/core` and use it in your plugin: ```ts title="src/plugins/my-plugin/my.plugin.ts" import { Logger } from '@vendure/core'; // It is customary to define a logger context for your plugin // so that the log messages can be easily identified. const loggerCtx = 'MyPlugin'; // somewhere in your code Logger.info(`My plugin is doing something!`, loggerCtx); ```
--- title: "Breaking API Changes" sidebar_position: 3 --- # Breaking API Changes ## Breaks from updated dependencies ### TypeScript - v2 is built on TypeScript **v4.9.5**. You should update your TypeScript version to match this. Doing so is quite likely to reveal new compiler errors (as is usual with TypeScript minor release updates). - If you are using `ts-node`, update it to the latest version - If you are targeting `ES2022` or `ESNEXT` in your `tsconfig.json`, you'll need to set `"useDefineForClassFields": false`. See [this issue](https://github.com/vendure-ecommerce/vendure/issues/2099) for more context. ### Apollo Server & GraphQL If you have any custom ApolloServerPlugins, the plugin methods must now return a Promise. Example: ```diff export class TranslateErrorsPlugin implements ApolloServerPlugin { constructor(private i18nService: I18nService) {} - requestDidStart(): GraphQLRequestListener { + async requestDidStart(): Promise<GraphQLRequestListener> { return { - willSendResponse: requestContext => { + willSendResponse: async requestContext => { const { errors, context } = requestContext; if (errors) { (requestContext.response as any).errors = errors.map(err => { return this.i18nService.translateError(context.req, err as GraphQLError) as any; }); } }, }; } } ``` With the update to GraphQL v16, you might run into issues with other packages in the GraphQL ecosystem that also depend on the `graphql` package, such as `graphql-code-generator`. In this case these packages will also need to be updated. For instance, if you are using the "typescript-compatibility" plugin to generate namespaced types, you'll need to drop this, as it is [no longer maintained](https://the-guild.dev/blog/whats-new-in-graphql-codegen-v2#typescript-compatibility). ### TypeORM TypeORM 0.3.x introduced a large number of breaking changes. For a complete guide, see the [TypeORM v0.3.0 release notes](https://github.com/typeorm/typeorm/releases/tag/0.3.0). Here are the main API changes you'll likely need to make: - You can no longer compare to `null`, you need to use the new `IsNull()` helper: ```diff + import { IsNull } from 'typeorm'; - .find({ where: { deletedAt: null } }) + .find({ where: { deletedAt: IsNull() } }) ``` - The `findOne()` method returns `null` rather than `undefined` if a record is not found. - The `findOne()` method no longer accepts an id argument. Lookup based on id must be done with a `where` clause: ```diff - .findOne(variantId) + .findOne({ where: { id: variantId } }) ``` - Where clauses must use an entity id rather than passing an entity itself: ```diff - .find({ where: { user } }) + .find({ where: { user: { id: user.id } } }) ``` - The `findByIds()` method has been deprecated. Use the new `In` helper instead: ```diff + import { In } from 'typeorm'; - .findByIds(ids) + .find({ where: { id: In(ids) } }) ``` ## Vendure TypeScript API Changes ### Custom Order / Fulfillment / Payment processes In v2, the hard-coded states & transition logic for the Order, Fulfillment and Payment state machines has been extracted from the core services and instead reside in a default `OrderProcess`, `FulfillmentProcess` and `PaymentProcess` object. This allows you to _fully_ customize these flows without having to work around the assumptions & logic implemented by the default processes. What this means is that if you are defining a custom process, you'll now need to explicitly add the default process to the array. ```diff + import { defaultOrderProcess } from '@vendure/core'; orderOptions: { - process: [myCustomOrderProcess], + process: [defaultOrderProcess, myCustomOrderProcess], } ``` Also note that `shippingOptions.customFulfillmentProcess` and `paymentOptions.customPaymentProcess` are both now renamed to `process`. The old names are still usable but are deprecated. ### OrderItem no longer exists As a result of [#1981](https://github.com/vendure-ecommerce/vendure/issues/1981), the `OrderItem` entity no longer exists. The function and data of `OrderItem` is now transferred to `OrderLine`. As a result, the following APIs which previously used OrderItem arguments have now changed: - `FulfillmentHandler` - `ChangedPriceHandlingStrategy` - `PromotionItemAction` - `TaxLineCalculationStrategy` If you have implemented any of these APIs, you'll need to check each one, remove the `OrderItem` argument from any methods that are using it, and update any logic as necessary. You may also be joining the OrderItem relation in your own TypeORM queries, so you'll need to check for code like this: ```diff const order = await this.connection .getRepository(Order) .createQueryBuilder('order') .leftJoinAndSelect('order.lines', 'line') - .leftJoinAndSelect('line.items', 'items') ``` or ```diff const order = await this.connection .getRepository(Order) .findOne(ctx, orderId, { - relations: ['lines', 'lines.items'], + relations: ['lines'], }); ``` ### ProductVariant stock changes With [#1545](https://github.com/vendure-ecommerce/vendure/issues/1545) we have changed the way we model stock levels in order to support multiple stock locations. This means that the `ProductVariant.stockOnHand` and `ProductVariant.stockAllocated` properties no longer exist on the `ProductVariant` entity in TypeScript. Instead, this information is now located at `ProductVariant.stockLevels`, which is an array of [StockLevel]({{< relref "stock-level" >}}) entities. ### New return type for Channel, TaxCategory & Zone lists - The `ChannelService.findAll()` method now returns a `PaginatedList<Channel>` instead of `Channel[]`. - The `channels` GraphQL query now returns a `PaginatedList` rather than a simple array of Channels. - The `TaxCategoryService.findAll()` method now returns a `PaginatedList<TaxCategory>` instead of `TaxCategory[]`. - The `taxCategories` GraphQL query now returns a `PaginatedList` rather than a simple array of TaxCategories. - The `ZoneService.findAll()` method now returns a `PaginatedList<Zone>` instead of `Zone[]`. The old behaviour of `ZoneService.findAll()` (all Zones, cached for rapid access) can now be found under the new `ZoneService.getAllWithMembers()` method. - The `zones` GraphQL query now returns a `PaginatedList` rather than a simple array of Zones. ### Admin UI changes If you are using the `@vendure/ui-devkit` package to generate custom ui extensions, here are the breaking changes to be aware of: - As part of the major refresh to the Admin UI app, certain layout elements had be changed which can cause your custom routes to look bad. Wrapping all your custom pages in `<vdr-page-block>` (or `<div class="page-block">` if not built with Angular components) will improve things. There will soon be a comprehensive guide published on how to create seamless ui extensions that look just like the built-in screens. - If you use any of the scoped method of the Admin UI `DataService`, you might find that some no longer exist. They are now deprecated and will eventually be removed. Use the `dataService.query()` and `dataService.mutation()` methods only, passing your own GraphQL documents: ```ts // Old way this.dataService.product.getProducts().single$.subscribe(...); ``` ```ts // New way const GET_PRODUCTS = gql` query GetProducts { products { items { id name # ... etc } } } `; this.dataService.query(GET_PRODUCTS).single$.subscribe(...); ``` - The Admin UI component `vdr-product-selector` has been renamed to `vdr-product-variant-selector` to more accurately represent what it does. If you are using `vdr-product-selector` if any ui extensions code, update it to use the new selector. ### Other breaking API changes - **End-to-end tests using Jest** will likely run into issues due to our move towards using some dependencies that make use of ES modules. We have found the best solution to be to migrate tests over to [Vitest](https://vitest.dev), which can handle this and is also significantly faster than Jest. See the updated [Testing guide]({{< relref "/guides/developer-guide/testing" >}}) for instructions on getting started with Vitest. - Internal `ErrorResult` classes now take a single object argument rather than multiple args. - All monetary values are now represented in the GraphQL APIs with a new `Money` scalar type. If you use [graphql-code-generator](https://the-guild.dev/graphql/codegen), you'll want to tell it to treat this scalar as a number: ```ts import { CodegenConfig } from '@graphql-codegen/cli' const config: CodegenConfig = { schema: 'http://localhost:3000/shop-api', documents: ['src/**/*graphql.ts'], config: { scalars: { Money: 'number', }, }, generates: { // .. } }; ``` - A new `Region` entity has been introduced, which is a base class for `Country` and the new `Province` entity. The `Zone.members` property is now an array of `Region` rather than `Country`, since Zones may now be composed of both countries and provinces. If you have defined any custom fields on `Country`, you'll need to change it to `Region` in your custom fields config. - If you are using the **s3 storage strategy** of the AssetServerPlugin, it has been updated to use v3 of the AWS SDKs. This update introduces an [improved modular architecture to the AWS sdk](https://aws.amazon.com/blogs/developer/modular-packages-in-aws-sdk-for-javascript/), resulting in smaller bundle sizes. You need to install the `@aws-sdk/client-s3` & `@aws-sdk/lib-storage` packages, and can remove the `aws-sdk` package. If you are using it in combination with MinIO, you'll also need to rename a config property and provide a region: ```diff nativeS3Configuration: { endpoint: 'http://localhost:9000', - s3ForcePathStyle: true, + forcePathStyle: true, signatureVersion: 'v4', + region: 'eu-west-1', } ``` - The **Stripe plugin** has been made channel aware. This means your api key and webhook secret are now stored in the database, per channel, instead of environment variables. To migrate to v2 of the Stripe plugin from @vendure/payments you need to: 1. Remove the apiKey and webhookSigningSecret from the plugin initialization in vendure-config.ts: ```diff StripePlugin.init({ - apiKey: process.env.YOUR_STRIPE_SECRET_KEY, - webhookSigningSecret: process.env.YOUR_STRIPE_WEBHOOK_SIGNING_SECRET, storeCustomersInStripe: true, }), ``` 2. Start the server and login as administrator. For each channel that you'd like to use Stripe payments, you need to create a payment method with payment handler Stripe payment and the apiKey and webhookSigningSecret belonging to that channel's Stripe account. - If you are using the **BullMQJobQueuePlugin**, the minimum Redis recommended version is 6.2.0. - The `WorkerHealthIndicator` which was deprecated in v1.3.0 has been removed, as well as the `jobQueueOptions.enableWorkerHealthCheck` config option. - The `CustomerGroupEntityEvent` (fired on creation, update or deletion of a CustomerGroup) has been renamed to `CustomerGroupEvent`, and the former `CustomerGroupEvent` (fired when Customers are added to or removed from a group) has been renamed to `CustomerGroupChangeEvent`. - We introduced the [plugin compatibility API]({{< relref "vendure-plugin-metadata" >}}#compatibility) to allow plugins to indicate what version of Vendure they are compatible with. To avoid bootstrap messages you should add this property to your plugins.
--- title: "Database Migration" sidebar_position: 2 --- # v2 Database Migration Vendure v2 introduces a number of breaking changes to the database schema, some of which require quite complex migrations in order to preserve existing data. To make this process as smooth as possible, we have created a migration tool which will handle the hard parts for you! {{< alert "warning" >}} **Important!** It is _critical_ that you back up your production data prior to attempting this migration. **Note for MySQL/MariaDB users:** transactions for migrations are [not supported by these databases](https://dev.mysql.com/doc/refman/5.7/en/cannot-roll-back.html). This means that if the migration fails for some reason, the statements that have executed will not get rolled back, and your DB schema can be left in an inconsistent state from which is it can be hard to recover. Therefore, it is doubly critical that you have a good backup that you can easily restore prior to attempting this migration. {{< /alert >}} 1. Make sure all your Vendure packages to the latest v2 versions. 2. Use your package manager to install the [v2 migration tool](https://github.com/vendure-ecommerce/v2-migration-tool): `npm install @vendure/migrate-v2` - Note, if you run into the error `"Cannot find module '@ardatan/aggregate-error'"`, delete node_modules and the lockfile and reinstall. 3. Add the `MigrationV2Plugin` to your plugins array: ```ts import { MigrationV2Plugin } from '@vendure/migrate-v2'; //... const config: VendureConfig = { //.. plugins: [ MigrationV2Plugin, ] } ``` The sole function of this plugin is to temporarily remove some "NOT NULL" constraints from certain columns, which allows us to run the next part of the migration. 4. Generate a new migration file, `npm run migration:generate v2` 5. Edit the newly-created migration file by following the comments in these examples: - [postgres](https://github.com/vendure-ecommerce/v2-migration-tool/blob/master/src/migrations/1686649098749-v201-postgres.ts) - [mysql](https://github.com/vendure-ecommerce/v2-migration-tool/blob/master/src/migrations/1686655918823-v201-mysql.ts) In your migrations files, you'll import the `vendureV2Migrations` from `@vendure/migrate-v2`. 6. Run the migration with `npm run migration:run`. 7. Upon successful migration, remove the `MigrationV2Plugin` from your plugins array, and generate _another_ migration. This one will add back the missing "NOT NULL" constraints now that all your data has been successfully migrated.
--- title: "Migrating from v1" weight: 2 sidebar_position: 1 --- # Migrating from Vendure 1 to 2 This section contains guides for migrating from Vendure v1 to v2. There are a number of breaking changes between the two versions, which are due to a few major factors: 1. To support new features such as multi-vendor marketplace APIs and multiple stock locations, we had to make some changes to the database schema and some of the internal APIs. 2. We have updated all of our major dependencies to their latest versions. Some of these updates involve breaking changes in the dependencies themselves, and in those cases where you are using those dependencies directly (most notably TypeORM), you will need to make the corresponding changes to your code. 3. We have removed some old APIs which were previously marked as "deprecated". ## Migration steps Migration will consist of these main steps: 1. **Update your Vendure dependencies** to the latest versions ```diff { // ... "dependencies": { - "@vendure/common": "1.9.7", - "@vendure/core": "1.9.7", + "@vendure/common": "2.0.0", + "@vendure/core": "2.0.0", // etc. }, "devDependencies": { - "typescript": "4.3.5", + "typescript": "4.9.5", // etc. } } ``` 2. **Migrate your database**. This is covered in detail in the [database migration section](/guides/developer-guide/migrating-from-v1/database-migration). 3. **Update your custom code** (configuration, plugins, admin ui extensions) to handle the breaking changes. Details of these changes are covered in the [breaking API changes section](/guides/developer-guide/migrating-from-v1/breaking-api-changes). 4. **Update your storefront** to handle some small breaking changes in the Shop GraphQL API. See the [storefront migration section](/guides/developer-guide/migrating-from-v1/storefront-migration) for details.
--- title: "Storefront Migration" sidebar_position: 4 --- # Storefront migration There are relatively few breaking changes that will affect the storefront. - The `setOrderShippingMethod` mutation now takes an array of shipping method IDs rather than just a single one. This is so we can support multiple shipping methods per Order. ```diff -mutation setOrderShippingMethod($shippingMethodId: ID!) { +mutation setOrderShippingMethod($shippingMethodId: [ID!]!) { setOrderShippingMethod(shippingMethodId: $shippingMethodId) { # ... etc } } ``` - The `OrderLine.fulfillments` field has been changed to `OrderLine.fulfillmentLines`. Your storefront may be using this when displaying the details of an Order. - If you are using the `graphql-code-generator` package to generate types for your storefront, all monetary values such as `Order.totalWithTax` or `ProductVariant.priceWithTax` are now represented by the new `Money` scalar rather than by an `Int`. You'll need to tell your codegen about this scalar and configure it to be interpreted as a number type: ```diff documents: - "app/**/*.{ts,tsx}" - "!app/generated/*" +config: + scalars: + Money: number generates: # ... etc ```
--- title: "Migrations" --- import Tabs from '@theme/Tabs'; import TabItem from '@theme/TabItem'; Database migrations are needed whenever the database schema changes. This can be caused by: * changes to the [custom fields](/guides/developer-guide/custom-fields/) configuration * new [database entities defined by plugins](/guides/developer-guide/database-entity/) * occasional changes to the core Vendure database schema when updating to newer versions ## Synchronize vs migrate TypeORM (which Vendure uses to interact with the database) has a `synchronize` option which, when set to `true`, will automatically update your database schema to reflect the current Vendure configuration. This is equivalent to automatically generating and running a migration _every time_ the server starts up. This is convenient while developing, but **should not be used in production**, since a misconfiguration could potentially delete production data. In this case, migrations should be used. ```ts title="src/vendure-config.ts" import { VendureConfig } from '@vendure/core'; export const config: VendureConfig = { // ... dbConnectionOptions: { // ... // highlight-next-line synchronize: false, } }; ``` ## Migration workflow This section assumes a standard Vendure installation based on `@vendure/create`. Let's assume you have defined a new "keywords" custom field on the Product entity. The next time you start your server you'll see a message like this: ```bash [server] Your database schema does not match your current configuration. Generate a new migration for the following changes: [server] - ALTER TABLE "product" ADD "customFieldsKeywords" character varying(255) ``` Since we have `synchronize` set to `false`, we need to generate a migration to apply these changes to the database. The workflow for this is as follows: ### 1. Generate a migration :::cli Run `npx vendure migrate` and select "Generate a new migration" ::: ### 2. Check the migration file This will have created a new migration file in the `src/migrations` directory. Open this file and check that it looks correct. It should look something like this: ```ts title="src/migrations/1690558104092-add-keywords-field.ts" import {MigrationInterface, QueryRunner} from "typeorm"; export class addKeywordsField1690558104092 implements MigrationInterface { public async up(queryRunner: QueryRunner): Promise<any> { await queryRunner.query(`ALTER TABLE "product" ADD "customFieldsKeywords" character varying(255)`, undefined); } public async down(queryRunner: QueryRunner): Promise<any> { await queryRunner.query(`ALTER TABLE "product" DROP COLUMN "customFieldsKeywords"`, undefined); } } ``` The `up()` function is what will be executed when the migration is run. The `down()` function is what will be executed if the migration is reverted. In this case, the `up()` function is adding a new column to the `product` table, and the `down()` function is removing it. :::note The exact query will depend on the database you are using. The above example is for PostgreSQL. ::: ### 3. Run the migration Assuming the migration file looks correct, the next time you start the server, the migration will be run automatically. This is because the `runMigrations` function is called in the `src/index.ts` file: ```ts title="src/index.ts" import { bootstrap, runMigrations } from '@vendure/core'; import { config } from './vendure-config'; // highlight-next-line runMigrations(config) .then(() => bootstrap(config)) .catch(err => { console.log(err); }); ``` It is also possible to run the migration manually without starting the server: :::cli Run `npx vendure migrate` and select "Run pending migrations" ::: :::caution TypeORM will attempt to run each migration inside a transaction. This means that if one of the migration commands fails, then the entire transaction will be rolled back to its original state. _However_ this is **not supported by MySQL / MariaDB**. This means that when using MySQL or MariaDB, errors in your migration script could leave your database in a broken or inconsistent state. Therefore it is **critical** that you first create a backup of your database before running a migration. You can read more about this issue in [typeorm/issues/7054](https://github.com/typeorm/typeorm/issues/7054) ::: ## Migrations in-depth Now we'll dive into what's going on under the hood. Vendure exposes a some helper function which wrap around the underlying [TypeORM migration functionality](https://typeorm.io/migrations). The reason for using these helper functions rather than using the TypeORM CLI directly is that Vendure generates additional schema information based on custom fields and plugin configurations which are not available to the TypeORM CLI. In a standard Vendure installation prior to v2.2.0, you'll see the following migration script in your project root directory. Running the `vendure migrate` command also uses a very similar script internally. ```ts title="migration.ts" import { generateMigration, revertLastMigration, runMigrations } from '@vendure/core'; import program from 'commander'; import { config } from './src/vendure-config'; program .command('generate <name>') .description('Generate a new migration file with the given name') .action(name => { return generateMigration(config, { name, outputDir: './src/migrations' }); }); program .command('run') .description('Run all pending migrations') .action(() => { return runMigrations(config); }); program .command('revert') .description('Revert the last applied migration') .action(() => { return revertLastMigration(config); }); program.parse(process.argv); ``` and a set of scripts in your `package.json` file: ```json { // ... "scripts": { "migration:generate": "ts-node migration.ts generate", "migration:run": "ts-node migration.ts run", "migration:revert": "ts-node migration.ts revert" } } ``` When running and reverting migrations, Vendure is looking for migration files in the directory specified by the `dbConnectionOptions.migrations` option is set in your VendureConfig: ```ts title="src/vendure-config.ts" import { VendureConfig } from '@vendure/core'; import path from 'path'; export const config: VendureConfig = { // ... dbConnectionOptions: { // ... // highlight-next-line migrations: [path.join(__dirname, './migrations/*.+(js|ts)')], } }; ``` TypeORM keeps track of which migrations have been run by creating a new `migrations` table in your database, and each time a migration is successfully run it adds a row to this table with the name of the migration class and a timestamp. This prevents the same migration from being run twice, and also allows TypeORM to know which migration to revert when the `revertLastMigration` function is called. ![Migrations table](./migration.webp) These are the underlying function exposed by Vendure which are used to generate, run and revert migrations: - [`generateMigration` function](/reference/typescript-api/migration/generate-migration/) - [`runMigrations` function](/reference/typescript-api/migration/run-migrations/) - [`revertLastMigration` function](/reference/typescript-api/migration/revert-last-migration/) ### Reverting a migration The `revertLastMigration` function will revert the last applied migration by applying the `down()` method. If run again it will then revert the one before that, and so on. In doing so, it will also remove the corresponding row from the `migrations` table.
--- title: "Nest Devtools" --- The NestJS core team have built a [powerful set of dev tools](https://docs.nestjs.com/devtools/overview) which can be used to inspect, analyze and debug NestJS applications. Since a Vendure server is a NestJS application, these tools can be used to debug your Vendure application. :::note Nest Devtools is a paid service. You can [sign up for a free trial](https://devtools.nestjs.com/). ::: ## Installation First you'll need to install the `@nestjs/devtools-integration` package: ```bash npm i @nestjs/devtools-integration ``` ## Configuration Next you need to create a plugin which imports the `DevToolsModule` and adds it to the `imports` array: ```ts title="src/plugins/devtools/devtools-plugin.ts" import { VendurePlugin } from '@vendure/core'; import { DevtoolsModule } from '@nestjs/devtools-integration'; @VendurePlugin({ imports: [ DevtoolsModule.register({ // The reason we are checking the NODE_ENV environment // variable here is that you should never use this module in production! http: process.env.NODE_ENV !== 'production', }), ], }) class DevtoolsPlugin {} ``` Now we need to add this plugin to the `plugins` array in the `VendureConfig`. We need to make sure we are only adding it to the server config, and not the worker, otherwise we will get a port config when running the server and worker at the same time. Lastly we must set the `snapshot` option when bootstrapping the server. Note: this is only possible with Vendure v2.2 or later. ```ts title="src/index.ts" import { bootstrap } from '@vendure/core'; import { config } from './vendure-config'; const configWithDevtools = { ...config, plugins: [ ...config.plugins, DevtoolsPlugin, ], }; bootstrap(configWithDevtools, { nestApplicationOptions: { snapshot: true } }) .catch(err => { console.log(err); process.exit(1); }); ``` ## Usage Now you can start the server, and navigate to [devtools.nestjs.com](https://devtools.nestjs.com/) to start view your Vendure server in the Nest Devtools dashboard. ![Nest Devtools graphql explorer](./nest-devtools-graph.webp) ![Nest Devtools bootstrap performance](./nest-devtools-bootstrap-perf.webp)
--- title: "Vendure Overview" sidebar_position: 2 --- Read this page to gain a high-level understanding of Vendure and concepts you will need to know to build your application. ## Architecture Vendure is a headless e-commerce platform. By "headless" we mean that it exposes all of its functionality via APIs. Specifically, Vendure features two GraphQL APIs: one for storefronts (Shop API) and the other for administrative functions (Admin API). These are the major parts of a Vendure application: * **Server**: The Vendure server is the part that handles requests coming in to the GraphQL APIs. It serves both the [Shop API](/reference/graphql-api/shop/queries) and [Admin API](/reference/graphql-api/admin/queries), and can send jobs to the Job Queue to be processed by the Worker. * **Worker**: The Worker runs in the background and deals with tasks such as updating the search index, sending emails, and other tasks which may be long-running, resource-intensive or require retries. * **Admin UI**: The Admin UI is how shop administrators manage orders, customers, products, settings and so on. It is not actually part of the Vendure core, but is provided as a plugin (the [AdminUiPlugin](/reference/core-plugins/admin-ui-plugin/)) which is installed for you in a standard Vendure installation. The Admin UI can be further extended to support custom functionality, as detailed in the [Extending the Admin UI](/guides/extending-the-admin-ui/getting-started/) section * **Storefront**: With headless commerce, you are free to implement your storefront exactly as you see fit, unconstrained by the back-end, using any technologies that you like. To make this process easier, we have created a number of [storefront starter kits](/guides/storefront/storefront-starters/), as well as [guides on building a storefront](/guides/storefront/connect-api/). ![./Vendure_docs-architecture.webp](./Vendure_docs-architecture.webp) ## Technology stack Vendure is built on the following open-source technologies: - **SQL Database**: Vendure requires an SQL database compatible with [TypeORM](https://typeorm.io/). Officially we support **PostgreSQL**, **MySQL/MariaDB** and **SQLite** but Vendure can also be used with API-compatible variants such [Amazon Aurora](https://aws.amazon.com/rds/aurora/), [CockroachDB](https://www.cockroachlabs.com/), or [PlanetScale](https://planetscale.com/). - **TypeScript & Node.js**: Vendure is written in [TypeScript](https://www.typescriptlang.org/) and runs on [Node.js](https://nodejs.org). - **NestJS**: The underlying framework is [NestJS](https://nestjs.com/), which is a full-featured application development framework for Node.js. Building on NestJS means that Vendure benefits from the well-defined structure and rich feature-set and ecosystem that NestJS provides. - **GraphQL**: The Shop and Admin APIs use [GraphQL](https://graphql.org/), which is a modern API technology which allows you to specify the exact data that your client application needs in a convenient and type-safe way. Internally we use [Apollo Server](https://www.apollographql.com/docs/apollo-server/) to power our GraphQL APIs. - **Angular**: The Admin UI is built with [Angular](https://angular.io/), a popular, stable application framework from Google. Note that you do not need to know Angular to use Vendure, and UI extensions can even be written in the front-end framework of your choice, such as React or Vue. ## Design principles Vendure is designed to be: - **Flexible**: Vendure is designed to be flexible enough to support a wide range of e-commerce use-cases, while taking care of the common functionality for you. It is not a "one-size-fits-all" solution, but rather a framework which you can extend and customize to suit your needs. - **Extensible**: A typical e-commerce application needs to integrate with many external systems for payments, shipping, inventory management, email sending, and so on. Vendure makes heavy use of the **strategy pattern** - a software design pattern which allows you to replace default behaviors with your own custom implementations as needed. - **Modular**: Vendure is built with a modular architecture, where each unit of functionality of your application is encapsulated in a **plugin**. This makes it easy to add or remove functionality as needed, and to share plugins with the community. - **Type-safe**: Vendure is written in TypeScript, which means that you get the benefits of static type-checking and code completion in your IDE. Our use of GraphQL for our APIs brings static typing to the API layer, enabling rapid development with type-safety across the entire stack.
--- title: "Add a REST endpoint" showtoc: true --- REST-style endpoints can be defined as part of a [plugin](/guides/developer-guide/plugins/). :::info REST endpoints are implemented as NestJS Controllers. For comprehensive documentation, see the [NestJS controllers documentation](https://docs.nestjs.com/controllers). ::: In this guide we will define a plugin that adds a single REST endpoint at `http://localhost:3000/products` which returns a list of all products. ## Create a controller First let's define the controller: ```ts title="src/plugins/rest-plugin/api/products.controller.ts" // products.controller.ts import { Controller, Get } from '@nestjs/common'; import { Ctx, ProductService, RequestContext } from '@vendure/core'; @Controller('products') export class ProductsController { constructor(private productService: ProductService) { } @Get() findAll(@Ctx() ctx: RequestContext) { return this.productService.findAll(ctx); } } ``` The key points to note here are: - The `@Controller()` decorator defines the base path for all endpoints defined in this controller. In this case, all endpoints will be prefixed with `/products`. - The `@Get()` decorator defines a GET endpoint at the base path. The method name `findAll` is arbitrary. - The `@Ctx()` decorator injects the [RequestContext](/reference/typescript-api/request/request-context/) which is required for all service methods. ## Register the controller with the plugin ```ts title="src/plugins/rest-plugin/rest.plugin.ts" import { PluginCommonModule, VendurePlugin } from '@vendure/core'; import { ProductsController } from './api/products.controller'; @VendurePlugin({ imports: [PluginCommonModule], controllers: [ProductsController], }) export class RestPlugin {} ``` :::info **Note:** [The `PluginCommonModule`](/reference/typescript-api/plugin/plugin-common-module/) should be imported to gain access to Vendure core providers - in this case it is required in order to be able to inject `ProductService` into our controller. ::: The plugin can then be added to the `VendureConfig`: ```ts title="src/vendure-config.ts" import { VendureConfig } from '@vendure/core'; import { RestPlugin } from './plugins/rest-plugin/rest.plugin'; export const config: VendureConfig = { // ... plugins: [ // ... // highlight-next-line RestPlugin, ], }; ``` ## Controlling access to REST endpoints You can use the [`@Allow()` decorator](/reference/typescript-api/request/allow-decorator/) to declare the permissions required to access a REST endpoint: ```ts title="src/plugins/rest-plugin/api/products.controller.ts" import { Controller, Get } from '@nestjs/common'; import { Allow, Permission, Ctx, ProductService, RequestContext } from '@vendure/core'; @Controller('products') export class ProductsController { constructor(private productService: ProductService) {} // highlight-next-line @Allow(Permission.ReadProduct) @Get() findAll(@Ctx() ctx: RequestContext) { return this.productService.findAll(ctx); } } ``` :::tip The following Vendure [API decorators](/guides/developer-guide/the-api-layer/#api-decorators) can also be used with NestJS controllers: `@Allow()`, `@Transaction()`, `@Ctx()`. Additionally, NestJS supports a number of other REST decorators detailed in the [NestJS controllers guide](https://docs.nestjs.com/controllers#request-object) :::
--- title: "Stand-alone CLI Scripts" --- # Stand-alone CLI Scripts It is possible to create stand-alone scripts that can be run from the command-line by using the [bootstrapWorker function](/reference/typescript-api/worker/bootstrap-worker/). This can be useful for a variety of use-cases such as running cron jobs or importing data. ## Minimal example Here's a minimal example of a script which will bootstrap the Vendure Worker and then log the number of products in the database: ```ts title="src/get-product-count.ts" import { bootstrapWorker, Logger, ProductService, RequestContextService } from '@vendure/core'; import { config } from './vendure-config'; if (require.main === module) { getProductCount() .then(() => process.exit(0)) .catch(err => { Logger.error(err); process.exit(1); }); } async function getProductCount() { // This will bootstrap an instance of the Vendure Worker, providing // us access to all of the services defined in the Vendure core. // (but without the unnecessary overhead of the API layer). const { app } = await bootstrapWorker(config); // Using `app.get()` we can grab an instance of _any_ provider defined in the // Vendure core as well as by our plugins. const productService = app.get(ProductService); // For most service methods, we'll need to pass a RequestContext object. // We can use the RequestContextService to create one. const ctx = await app.get(RequestContextService).create({ apiType: 'admin', }); // We use the `findAll()` method to get the total count. Since we aren't // interested in the actual product objects, we can set the `take` option to 0. const { totalItems } = await productService.findAll(ctx, {take: 0}); Logger.info( [ '\n-----------------------------', `There are ${totalItems} products`, '------------------------------', ].join('\n'), ) } ``` This script can then be run from the command-line: ```shell npx ts-node src/get-product-count.ts # or yarn ts-node src/get-product-count.ts ``` resulting in the following output: ```shell info 01/08/23, 11:50 - [Vendure Worker] Bootstrapping Vendure Worker (pid: 4428)... info 01/08/23, 11:50 - [Vendure Worker] Vendure Worker is ready info 01/08/23, 11:50 - [Vendure Worker] ----------------------------------------- There are 56 products in the database ----------------------------------------- ``` ## The `app` object The `app` object returned by the `bootstrapWorker()` function is an instance of the [NestJS Application Context](https://docs.nestjs.com/standalone-applications). It has full access to the NestJS dependency injection container, which means that you can use the `app.get()` method to retrieve any of the services defined in the Vendure core or by any plugins. ```ts title="src/import-customer-data.ts" import { bootstrapWorker, CustomerService } from '@vendure/core'; import { config } from './vendure-config'; // ... async function importCustomerData() { const { app } = await bootstrapWorker(config); // highlight-start const customerService = app.get(CustomerService); // highlight-end } ``` ## Creating a RequestContext Almost all the methods exposed by Vendure's core services take a `RequestContext` object as the first argument. Usually, this object is created in the [API Layer](/guides/developer-guide/the-api-layer/#resolvers) by the `@Ctx()` decorator, and contains information related to the current API request. When running a stand-alone script, we aren't making any API requests, so we need to create a `RequestContext` object manually. This can be done using the [`RequestContextService`](/reference/typescript-api/request/request-context-service/): ```ts title="src/get-product-count.ts" // ... import { RequestContextService } from '@vendure/core'; async function getProductCount() { const { app } = await bootstrapWorker(config); const productService = app.get(ProductService); // highlight-start const ctx = await app.get(RequestContextService).create({ apiType: 'admin', }); // highlight-end const { totalItems } = await productService.findAll(ctx, {take: 0}); } ```
--- title: "Testing" showtoc: true --- # Testing Vendure plugins allow you to extend all aspects of the standard Vendure server. When a plugin gets somewhat complex (defining new entities, extending the GraphQL schema, implementing custom resolvers), you may wish to create automated tests to ensure your plugin is correct. The `@vendure/testing` package gives you some simple but powerful tooling for creating end-to-end tests for your custom Vendure code. By "end-to-end" we mean we are testing the _entire server stack_ - from API, to services, to database - by making a real API request, and then making assertions about the response. This is a very effective way to ensure that _all_ parts of your plugin are working correctly together. :::info For a working example of a Vendure plugin with e2e testing, see the [real-world-vendure Reviews plugin](https://github.com/vendure-ecommerce/real-world-vendure/tree/master/src/plugins/reviews) ::: ## Usage ### Install dependencies * [`@vendure/testing`](https://www.npmjs.com/package/@vendure/testing) * [`vitest`](https://vitest.dev/) You'll need to install a testing framework. In this example, we will use [Vitest](https://vitest.dev/) as it has very good support for the modern JavaScript features that Vendure uses, and is very fast. * [`graphql-tag`](https://www.npmjs.com/package/graphql-tag) This is not strictly required but makes it much easier to create the DocumentNodes needed to query your server. * We also need to install some packages to allow us to compile TypeScript code that uses decorators: - `@swc/core` - `unplugin-swc` ### Configure Vitest Create a `vitest.config.js` file in the root of your project: ```ts import path from 'path'; import swc from 'unplugin-swc'; import { defineConfig } from 'vitest/config'; export default defineConfig({ test: { include: '**/*.e2e-spec.ts', typecheck: { tsconfig: path.join(__dirname, 'tsconfig.e2e.json'), }, }, plugins: [ // SWC required to support decorators used in test plugins // See https://github.com/vitest-dev/vitest/issues/708#issuecomment-1118628479 // Vite plugin swc.vite({ jsc: { transform: { // See https://github.com/vendure-ecommerce/vendure/issues/2099 useDefineForClassFields: false, }, }, }), ], }); ``` and a `tsconfig.e2e.json` tsconfig file for the tests: ```json { "extends": "../tsconfig.json", "compilerOptions": { "types": ["node"], "lib": ["es2015"], "useDefineForClassFields": false, "skipLibCheck": true, "inlineSourceMap": false, "sourceMap": true, "allowSyntheticDefaultImports": true, "experimentalDecorators": true, "emitDecoratorMetadata": true, "esModuleInterop": true } } ``` ### Register database-specific initializers The `@vendure/testing` package uses "initializers" to create the test databases and populate them with initial data. We ship with initializers for `sqljs`, `postgres` and `mysql`. Custom initializers can be created to support running e2e tests against other databases supported by TypeORM. See the [`TestDbInitializer` docs](/reference/typescript-api/testing/test-db-initializer/) for more details. ```ts title="src/plugins/my-plugin/e2e/my-plugin.e2e-spec.ts" import { MysqlInitializer, PostgresInitializer, SqljsInitializer, registerInitializer, } from '@vendure/testing'; const sqliteDataDir = path.join(__dirname, '__data__'); registerInitializer('sqljs', new SqljsInitializer(sqliteDataDir)); registerInitializer('postgres', new PostgresInitializer()); registerInitializer('mysql', new MysqlInitializer()); ``` :::info Note re. the `sqliteDataDir`: The first time this test suite is run with the `SqljsInitializer`, the populated data will be saved into an SQLite file, stored in the directory specified by this constructor arg. On subsequent runs of the test suite, the data-population step will be skipped and the initial data directly loaded from the SQLite file. This method of caching significantly speeds up the e2e test runs. All the .sqlite files created in the `sqliteDataDir` can safely be deleted at any time. ::: ### Create a test environment The `@vendure/testing` package exports a [`createTestEnvironment` function](/reference/typescript-api/testing/create-test-environment/) which is used to set up a Vendure server and GraphQL clients to interact with both the Shop and Admin APIs: ```ts title="src/plugins/my-plugin/e2e/my-plugin.e2e-spec.ts" import { createTestEnvironment, testConfig } from '@vendure/testing'; import { describe } from 'vitest'; import { MyPlugin } from '../my-plugin.ts'; describe('my plugin', () => { const {server, adminClient, shopClient} = createTestEnvironment({ ...testConfig, plugins: [MyPlugin], }); }); ``` Notice that we pass a [`VendureConfig`](/reference/typescript-api/configuration/vendure-config/) object into the `createTestEnvironment` function. The testing package provides a special [`testConfig`](/reference/typescript-api/testing/test-config/) which is pre-configured for e2e tests, but any aspect can be overridden for your tests. Here we are configuring the server to load the plugin under test, `MyPlugin`. :::caution **Note**: If you need to deeply merge in some custom configuration, use the [`mergeConfig` function](/reference/typescript-api/configuration/merge-config/) which is provided by `@vendure/core`. ::: ### Initialize the server The [`TestServer`](/reference/typescript-api/testing/test-server/) needs to be initialized before it can be used. The `TestServer.init()` method takes an options object which defines how to populate the server: ```ts title="src/plugins/my-plugin/e2e/my-plugin.e2e-spec.ts" import { beforeAll, afterAll } from 'vitest'; import { myInitialData } from './fixtures/my-initial-data.ts'; // ... beforeAll(async () => { await server.init({ productsCsvPath: path.join(__dirname, 'fixtures/e2e-products.csv'), initialData: myInitialData, customerCount: 2, }); await adminClient.asSuperAdmin(); }, 60000); afterAll(async () => { await server.destroy(); }); ``` An explanation of the options: * `productsCsvPath` This is a path to an optional CSV file containing product data. See [Product Import Format](/guides/developer-guide/importing-data/#product-import-format). You can see [an example used in the Vendure e2e tests](https://github.com/vendure-ecommerce/vendure/blob/master/packages/core/e2e/fixtures/e2e-products-full.csv) to get an idea of how it works. To start with you can just copy this file directly and use it as-is. * `initialData` This is an object which defines how other non-product data (Collections, ShippingMethods, Countries etc.) is populated. See [Initial Data Format](/guides/developer-guide/importing-data/#initial-data). You can [copy this example from the Vendure e2e tests](https://github.com/vendure-ecommerce/vendure/blob/master/e2e-common/e2e-initial-data.ts) * `customerCount` Specifies the number of fake Customers to create. Defaults to 10 if not specified. ### Write your tests Now we are all set up to create a test. Let's test one of the GraphQL queries used by our fictional plugin: ```ts title="src/plugins/my-plugin/e2e/my-plugin.e2e-spec.ts" import gql from 'graphql-tag'; import { it, expect, beforeAll, afterAll } from 'vitest'; import { myInitialData } from './fixtures/my-initial-data.ts'; it('myNewQuery returns the expected result', async () => { adminClient.asSuperAdmin(); // log in as the SuperAdmin user const query = gql` query MyNewQuery($id: ID!) { myNewQuery(id: $id) { field1 field2 } } `; const result = await adminClient.query(query, {id: 123}); expect(result.myNewQuery).toEqual({ /* ... */}) }); ``` Running the test will then assert that your new query works as expected. ### Run your tests All that's left is to run your tests to find out whether your code behaves as expected! :::caution **Note:** When using **Vitest** with multiple test suites (multiple `.e2e-spec.ts` files), it will attempt to run them in parallel. If all the test servers are running on the same port (the default in the `testConfig` is `3050`), then this will cause a port conflict. To avoid this, you can manually set a unique port for each test suite: ```ts title="src/plugins/my-plugin/e2e/my-plugin.e2e-spec.ts" import { createTestEnvironment, testConfig } from '@vendure/testing'; import { describe } from 'vitest'; import { MyPlugin } from '../my-plugin.ts'; describe('my plugin', () => { const {server, adminClient, shopClient} = createTestEnvironment({ ...testConfig, // highlight-next-line port: 3051, plugins: [MyPlugin], }); }); ``` ::: ## Accessing internal services It is possible to access any internal service of the Vendure server via the `server.app` object, which is an instance of the NestJS `INestApplication`. For example, to access the `ProductService`: ```ts title="src/plugins/my-plugin/e2e/my-plugin.e2e-spec.ts" import { createTestEnvironment, testConfig } from '@vendure/testing'; import { describe, beforeAll } from 'vitest'; import { MyPlugin } from '../my-plugin.ts'; describe('my plugin', () => { const { server, adminClient, shopClient } = createTestEnvironment({ ...testConfig, plugins: [MyPlugin], }); // highlight-next-line let productService: ProductService; beforeAll(async () => { await server.init({ productsCsvPath: path.join(__dirname, 'fixtures/e2e-products.csv'), initialData: myInitialData, customerCount: 2, }); await adminClient.asSuperAdmin(); // highlight-next-line productService = server.app.get(ProductService); }, 60000); }); ```
--- title: "Translations" showtoc: true --- The following items in Vendure can be translated: - Entities which implement the [`Translatable`](/reference/typescript-api/entities/interfaces/#translatable) interface. - Admin UI text labels and messages - Server error message ## Translatable entities The following entities implement the `Translatable` interface: - [Collection](/reference/typescript-api/entities/collection/) - [Country](/reference/typescript-api/entities/country/) - [Facet](/reference/typescript-api/entities/facet/) - [FacetValue](/reference/typescript-api/entities/facet-value/) - [PaymentMethod](/reference/typescript-api/entities/payment-method/) - [Product](/reference/typescript-api/entities/product/) - [ProductOption](/reference/typescript-api/entities/product-option/) - [ProductOptionGroup](/reference/typescript-api/entities/product-option-group/) - [ProductVariant](/reference/typescript-api/entities/product-variant/) - [Promotion](/reference/typescript-api/entities/promotion/) - [Province](/reference/typescript-api/entities/province/) - [Region](/reference/typescript-api/entities/region/) - [ShippingMethod](/reference/typescript-api/entities/shipping-method/) To understand how translatable entities are implemented, let's take a look at a simplified version of the `Facet` entity: ```ts @Entity() export class Facet extends VendureEntity implements Translatable { // highlight-next-line name: LocaleString; @Column({ unique: true }) code: string; // highlight-next-line @OneToMany(type => FacetTranslation, translation => translation.base, { eager: true }) // highlight-next-line translations: Array<Translation<Facet>>; } ``` All translatable entities have a `translations` field which is a relation to the translations. Any fields that are to be translated are of type `LocaleString`, and **do note have a `@Column()` decorator**. This is because the `name` field here does not in fact exist in the database in the `facet` table. Instead, it belongs to the `facet_translations` table, which brings us to the `FacetTranslation` entity (again simplified for clarity): ```ts @Entity() export class FacetTranslation extends VendureEntity implements Translation<Facet> { @Column('varchar') languageCode: LanguageCode; // highlight-next-line @Column() name: string; @Index() @ManyToOne(type => Facet, base => base.translations, { onDelete: 'CASCADE' }) base: Facet; } ``` Thus there is a one-to-many relation between `Facet` and `FacetTranslation`, which allows Vendure to handle multiple translations of the same entity. The `FacetTranslation` entity also implements the `Translation` interface, which requires the `languageCode` field and a reference to the base entity. ### Loading translatable entities If your plugin needs to load a translatable entity, you will need to use the [`TranslatorService`](/reference/typescript-api/service-helpers/translator-service/) to hydrate all the `LocaleString` fields will the actual translated values from the correct translation. For example, if you are loading a `Facet` entity, you would do the following: ```ts import { Facet } from '@vendure/core'; import { LanguageCode, RequestContext, TranslatorService, TransactionalConnection } from '@vendure/core'; @Injectable() export class MyService { constructor(private connection: TransactionalConnection, private translator: TranslatorService) {} async getFacet(ctx: RequestContext, id: ID): Promise<Facet | undefined> { const facet = await this.connection.getRepository(ctx, Facet).findOne(id); if (facet) { // highlight-next-line return this.translatorService.translate(facet, ctx); } } async getFacets(ctx: RequestContext): Promise<Facet[]> { // highlight-next-line const facets = await this.connection.getRepository(ctx, Facet).find(); // highlight-next-line return Promise.all(facets.map(facet => this.translatorService.translate(facet, ctx))); } } ``` ## Admin UI translations See the [Adding Admin UI Translations guide](/guides/extending-the-admin-ui/adding-ui-translations/). ## Server message translations Let's say you've implemented some custom server-side functionality as part of a plugin. You may be returning custom errors or other messages. Here's how you can provide these messages in multiple languages. Using [`addTranslation`](/reference/typescript-api/common/i18n-service/#addtranslation) inside the `onApplicationBootstrap` ([Nestjs lifecycle hooks](https://docs.nestjs.com/fundamentals/lifecycle-events)) of a Plugin is the easiest way to add new translations. While Vendure is only using `error`, `errorResult` and `message` resource keys you are free to use your own. ### Translatable Error This example shows how to create a custom translatable error ```ts /** * Custom error class */ class CustomError extends ErrorResult { readonly __typename = 'CustomError'; readonly errorCode = 'CUSTOM_ERROR'; readonly message = 'CUSTOM_ERROR'; //< looks up errorResult.CUSTOM_ERROR } @VendurePlugin({ imports: [PluginCommonModule], providers: [I18nService], // ... }) export class TranslationTestPlugin implements OnApplicationBootstrap { constructor(private i18nService: I18nService) { } onApplicationBootstrap(): any { this.i18nService.addTranslation('en', { errorResult: { CUSTOM_ERROR: 'A custom error message', }, anything: { foo: 'bar' } }); this.i18nService.addTranslation('de', { errorResult: { CUSTOM_ERROR: 'Eine eigene Fehlermeldung', }, anything: { foo: 'bar' } }); } } ``` To receive an error in a specific language you need to use the `languageCode` query parameter `query(QUERY_WITH_ERROR_RESULT, { variables }, { languageCode: LanguageCode.de });` ### Use translations Vendure uses the internationalization-framework [i18next](https://www.i18next.com/). Therefore you are free to use the i18next translate function to [access keys](https://www.i18next.com/translation-function/essentials#accessing-keys) \ `i18next.t('error.any-message');`
--- title: "Updating Vendure" showtoc: true --- # Updating Vendure This guide provides guidance for updating the Vendure core framework to a newer version. ## How to update First, check the [changelog](https://github.com/vendure-ecommerce/vendure/blob/master/CHANGELOG.md) for an overview of the changes and any breaking changes in the next version. In your project's `package.json` file, find all the `@vendure/...` packages and change the version to the latest. All the Vendure packages have the same version, and are all released together. ```diff { // ... "dependencies": { - "@vendure/common": "1.1.5", + "@vendure/common": "1.2.0", - "@vendure/core": "1.1.5", + "@vendure/core": "1.2.0", // etc. } } ``` Then run `npm install` or `yarn install` depending on which package manager you prefer. ## Admin UI changes If you are using UI extensions to create your own custom Admin UI using the [`compileUiExtensions`](/reference/admin-ui-api/ui-devkit/compile-ui-extensions/) function, then you'll need to **delete and re-compile your admin-ui directory after upgrading** (this is the directory specified by the [`outputPath`](/reference/admin-ui-api/ui-devkit/ui-extension-compiler-options#outputpath) property). If you also have an `.angular` directory in your project, you should delete this too after the update to ensure that any stale cached files are removed. ## Versioning Policy & Breaking changes Vendure generally follows the [SemVer convention](https://semver.org/) for version numbering. This means that breaking API changes will only be introduced with changes to the major version (the first of the 3 digits in the version). However, there are some exceptions to this rule: - In minor versions, (e.g. v2.0 to v2.1) we may update underlying dependencies to new major versions, which may in turn introduce breaking changes. These will be clearly noted in the changelog. - In minor versions we may also occasionally introduce non-destructive changes to the database schema. For instance, we may add a new column which would then require a database migration. We will _not_ introduce database schema changes that could potentially result in data loss in a minor version. Any instances of these exceptions will be clearly indicated in the [Changelog](https://github.com/vendure-ecommerce/vendure/blob/master/CHANGELOG.md). The reasoning for these exceptions is discussed in the [Versioning policy RFC](https://github.com/vendure-ecommerce/vendure/issues/1846). ### What kinds of breaking changes can be expected? Major version upgrades (e.g. v1.x to v2.x) can include: * Changes to the database schema * Changes to the GraphQL schema * Updates of major underlying libraries, such as upgrading NestJS to a new major version Every release will be accompanied by an entry in the [changelog](https://github.com/vendure-ecommerce/vendure/blob/master/CHANGELOG.md), listing the changes in that release. And breaking changes are clearly listed under a **BREAKING CHANGE** heading. ### Database migrations Database changes are one of the most common causes for breaking changes. In most cases, the changes are minor (such as the addition of a new column) and non-destructive (i.e. performing the migration has no risk of data loss). However, some more fundamental changes occasionally require a careful approach to database migration in order to preserve existing data. The key rule is **never run your production instance with the `synchronize` option set to `true`**. Doing so can cause inadvertent data loss in rare cases. For any database schema changes, it is advised to: 1. Read the changelog breaking changes entries to see what changes to expect 2. **Important:** Make a backup of your database! 3. Create a new database migration as described in the [Migrations guide](/guides/developer-guide/migrations/) 4. Manually check the migration script. In some cases manual action is needed to customize the script in order to correctly migrate your existing data. 5. Test the migration script against non-production data. 6. Only when you have verified that the migration works as expected, run it against your production database. ### GraphQL schema changes If you are using a code-generation tool (such as [graphql-code-generator](https://graphql-code-generator.com/)) for your custom plugins or storefront, it is a good idea to re-generate after upgrading, which will catch any errors caused by changes to the GraphQL schema. ### TypeScript API changes If you are using Vendure providers (services, JobQueue, EventBus etc.) in your custom plugins, you should look out for breakages caused by changes to those services. Major changes will be listed in the changelog, but occasionally internal changes may also impact your code. The best way to check whether this is the case is to build your entire project after upgrading, to see if any new TypeScript compiler errors emerge.
--- title: "Uploading Files" showtoc: true --- # Uploading Files Vendure handles file uploads with the [GraphQL multipart request specification](https://github.com/jaydenseric/graphql-multipart-request-spec). Internally, we use the [graphql-upload package](https://github.com/jaydenseric/graphql-upload). Once uploaded, a file is known as an [Asset](/guides/core-concepts/images-assets/). Assets are typically used for images, but can represent any kind of binary data such as PDF files or videos. ## Upload clients Here is a [list of client implementations](https://github.com/jaydenseric/graphql-multipart-request-spec#client) that will allow you to upload files using the spec. If you are using Apollo Client, then you should install the [apollo-upload-client](https://github.com/jaydenseric/apollo-upload-client) npm package. For testing, it is even possible to use a [plain curl request](https://github.com/jaydenseric/graphql-multipart-request-spec#single-file). ## The `createAssets` mutation The [createAssets mutation](/reference/graphql-api/admin/mutations/#createassets) in the Admin API is the only means of uploading files by default. Here's an example of how a file upload would look using the `apollo-upload-client` package: ```tsx import { gql, useMutation } from "@apollo/client"; const MUTATION = gql` mutation CreateAssets($input: [CreateAssetInput!]!) { createAssets(input: $input) { ... on Asset { id name fileSize } ... on ErrorResult { message } } } `; function UploadFile() { const [mutate] = useMutation(MUTATION); function onChange(event) { const {target} = event; if (target.validity.valid) { mutate({ variables: { input: Array.from(target.files).map((file) => ({file})); } }); } } return <input type="file" required onChange={onChange}/>; } ``` ## Custom upload mutations How about if you want to implement a custom mutation for file uploads? Let's take an example where we want to allow customers to set an avatar image. To do this, we'll add a [custom field](/guides/developer-guide/custom-fields/) to the Customer entity and then define a new mutation in the Shop API. ### Configuration Let's define a custom field to associate the avatar `Asset` with the `Customer` entity. To keep everything encapsulated, we'll do all of this in a [plugin](/guides/developer-guide/plugins/) ```ts title="src/plugins/customer-avatar/customer-avatar.plugin.ts" import { Asset, LanguageCode, PluginCommonModule, VendurePlugin } from '@vendure/core'; @VendurePlugin({ imports: [PluginCommonModule], configure: config => { // highlight-start config.customFields.Customer.push({ name: 'avatar', type: 'relation', label: [{languageCode: LanguageCode.en, value: 'Customer avatar'}], entity: Asset, nullable: true, }); // highlight-end return config; }, }) export class CustomerAvatarPlugin {} ``` ### Schema definition Next, we will define the schema for the mutation: ```ts title="src/plugins/customer-avatar/api/api-extensions.ts" import gql from 'graphql-tag'; export const shopApiExtensions = gql` extend type Mutation { setCustomerAvatar(file: Upload!): Asset }` ``` ### Resolver The resolver will make use of the built-in [AssetService]({{< relref "asset-service" >}}) to handle the processing of the uploaded file into an Asset. ```ts title="src/plugins/customer-avatar/api/customer-avatar.resolver.ts" import { Args, Mutation, Resolver } from '@nestjs/graphql'; import { Asset } from '@vendure/common/lib/generated-types'; import { Allow, AssetService, Ctx, CustomerService, isGraphQlErrorResult, Permission, RequestContext, Transaction } from '@vendure/core'; @Resolver() export class CustomerAvatarResolver { constructor(private assetService: AssetService, private customerService: CustomerService) {} @Transaction() @Mutation() @Allow(Permission.Authenticated) async setCustomerAvatar( @Ctx() ctx: RequestContext, @Args() args: { file: any }, ): Promise<Asset | undefined> { const userId = ctx.activeUserId; if (!userId) { return; } const customer = await this.customerService.findOneByUserId(ctx, userId); if (!customer) { return; } // Create an Asset from the uploaded file const asset = await this.assetService.create(ctx, { file: args.file, tags: ['avatar'], }); // Check to make sure there was no error when // creating the Asset if (isGraphQlErrorResult(asset)) { // MimeTypeError throw asset; } // Asset created correctly, so assign it as the // avatar of the current Customer await this.customerService.update(ctx, { id: customer.id, customFields: { avatarId: asset.id, }, }); return asset; } } ``` ### Complete Customer Avatar Plugin Let's put all these parts together into the plugin: ```ts import { Asset, PluginCommonModule, VendurePlugin } from '@vendure/core'; import { shopApiExtensions } from './api/api-extensions'; import { CustomerAvatarResolver } from './api/customer-avatar.resolver'; @VendurePlugin({ imports: [PluginCommonModule], shopApiExtensions: { schema: shopApiExtensions, resolvers: [CustomerAvatarResolver], }, configuration: config => { config.customFields.Customer.push({ name: 'avatar', type: 'relation', label: [{languageCode: LanguageCode.en, value: 'Customer avatar'}], entity: Asset, nullable: true, }); return config; }, }) export class CustomerAvatarPlugin { } ``` ### Uploading a Customer Avatar In our storefront, we would then upload a Customer's avatar like this: ```tsx import { gql, useMutation } from "@apollo/client"; const MUTATION = gql` mutation SetCustomerAvatar($file: Upload!) { setCustomerAvatar(file: $file) { id name fileSize } } `; function UploadAvatar() { const [mutate] = useMutation(MUTATION); function onChange(event) { const { target } = event; if (target.validity.valid && target.files.length === 1) { mutate({ variables: { file: target.files[0], } }); } } return <input type="file" required onChange={onChange} />; } ```
--- title: 'Page ActionBar Buttons' weight: 5 --- import Tabs from '@theme/Tabs'; import TabItem from '@theme/TabItem'; The `ActionBar` is the horizontal area at the top of each list or detail page, which contains the main buttons for that page. This guide explains how to add new buttons and dropdown menu items to the ActionBar. For example, consider an "order invoice" extension that allows you to print invoices for orders. You can add a "print invoice" button to the ActionBar of the order detail page, either as a button or as a dropdown menu item. ## ActionBar button example Adding a button is done using the [`addActionBarItem`](/reference/admin-ui-api/action-bar/add-action-bar-item/) function. ```ts title="src/plugins/invoice/ui/providers.ts" import { addActionBarItem } from '@vendure/admin-ui/core'; export default [ addActionBarItem({ id: 'print-invoice', locationId: 'order-detail', label: 'Print invoice', icon: 'printer', routerLink: route => { const id = route.snapshot.params.id; return ['./extensions/order-invoices', id]; }, requiresPermission: 'ReadOrder', }), ]; ``` ![./ui-extensions-actionbar.webp](./ui-extensions-actionbar.webp) In each list or detail view in the app, the ActionBar has a unique `locationId` which is how the app knows in which view to place your button. The complete list of available locations into which you can add new ActionBar can be found in the [PageLocationId docs](/reference/admin-ui-api/action-bar/page-location-id/). You can also press `ctrl + u` when in development mode to see the location of all UI extension points. ## ActionBar dropdown menu example Vendure v2.2.0 introduced the ability to add dropdown menu items to the ActionBar. If you want to add an action which is less commonly used, or want to take up less space in the action bar, then a dropdown menu item is a good choice. This is done using the [`addActionBarDropdownMenuItem`](/reference/admin-ui-api/action-bar/add-action-bar-dropdown-menu-item/) function. Let's re-work the "print invoice" button example to display it instead as a dropdown menu item: ```ts title="src/plugins/invoice/ui/providers.ts" import { addActionBarDropdownMenuItem } from '@vendure/admin-ui/core'; export default [ addActionBarDropdownMenuItem({ id: 'print-invoice', locationId: 'order-detail', label: 'Print invoice', icon: 'printer', routerLink: route => { const id = route.snapshot.params.id; return ['./extensions/order-invoices', id]; }, requiresPermission: 'ReadOrder', // When set to `true`, a horizontal divider will be // displayed above this item in the dropdown menu. hasDivider: true, }), ]; ``` ![./ui-extensions-actionbar-dropdown.webp](./ui-extensions-actionbar-dropdown.webp) ## Handling button clicks There are two ways to handle the click event of an ActionBar button or dropdown menu item: 1. Use the `routerLink` property to navigate to a new route when the button is clicked. 2. Use the `onClick` property to execute a function when the button is clicked. ### Using routerLink The `routerLink` property allows you to specify a route to navigate to when the button is clicked. The route can be a constant value, or it can be a function which receives the current route as well as a [`context` object](/reference/admin-ui-api/action-bar/action-bar-context) as arguments. <Tabs> <TabItem value="routerLink constant" label="routerLink constant" default> ```ts title="src/plugins/invoice/ui/providers.ts" import { addActionBarItem } from '@vendure/admin-ui/core'; export default [ addActionBarItem({ id: 'print-invoice', label: 'Print invoice', locationId: 'order-detail', // highlight-start // The route can be a constant value... routerLink: ['./extensions/order-invoices'], // highlight-end }), ]; ``` </TabItem> <TabItem value="routerLink function" label="routerLink function"> ```ts title="src/plugins/invoice/ui/providers.ts" import { addActionBarItem } from '@vendure/admin-ui/core'; export default [ addActionBarItem({ id: 'print-invoice', label: 'Print invoice', locationId: 'order-detail', // highlight-start // The route can be a function routerLink: route => { const id = route.snapshot.params.id; return ['./extensions/order-invoices', id]; }, // highlight-end }), ]; ``` </TabItem> </Tabs> ### Using onClick The onClick property of the addActionBarItem function allows you to define a function that will be executed when the ActionBar button is clicked. This function receives two arguments: the click event and the current context. The context object provides access to commonly-used services, which allows you to perform GraphQL queries and mutations, and the current route, which can be used to get parameters from the URL. Here's an example of how to use the onClick property to perform a GraphQL mutation when the ActionBar button is clicked: ```ts title="src/plugins/invoice/ui/providers.ts" import gql from 'graphql-tag'; import { firstValueFrom } from 'rxjs'; import { addActionBarItem } from '@vendure/admin-ui/core'; const mutation = gql` mutation MyMutation($orderId: ID!) { myMutation(orderId: $orderId) } `; export default [ addActionBarItem({ id: 'myButtonId', label: 'My Button Label', locationId: 'order-detail', // highlight-start onClick: async (event, context) => { try { const orderId = context.route.snapshot.params.id; await firstValueFrom(context.dataService.mutate(mutation, { orderId })); } catch (error) { context.notificationService.error('Error executing mutation: ' + error.message); } }, // highlight-end }), ]; ``` In this example, clicking the ActionBar button triggers a GraphQL mutation. The `context.dataService` is utilized to execute the mutation. It can also be employed to retrieve additional information about the current order if needed. The `context.route` is used to extract the ID of the current order from the URL. The utility function `firstValueFrom` from the RxJS library is used in this example to convert the Observable returned by `context.dataService.mutate(...)` into a Promise. This conversion allows the use of the `await` keyword to pause execution until the Observable emits its first value or completes. ## Setting visibility & disabled state Use the `buttonState` property (added in v2.1) to control the visibility and disabled state of the button. This property is a function which receives the current context as an argument and returns an Observable of the button state: ```ts title="src/plugins/invoice/ui/providers.ts" import { map, switchMap } from 'rxjs/operators'; import { addActionBarItem } from '@vendure/admin-ui/core'; export default [ addActionBarItem({ id: 'print-invoice', label: 'Print invoice', locationId: 'order-detail', buttonState: context => { // For any of the detail pages, we can get an observable stream // of the entity via `context.entity$`: return context.entity$.pipe( map(order => ({ disabled: order?.state === 'AddingItems', visible: true, })), ); }, }), ]; ``` :::note The `context.entity$` property was introduced in Vendure v2.2. If you are using v2.1, you can achieve equivalent functionality with this code: ```ts buttonState: context => { return context.route.data.pipe( switchMap(data => data.detail.entity), map((order: any) => ({ disabled: order.state === 'AddingItems', visible: true, })), ); } ``` ::: ## Restricting access by permissions You can use the `requiresPermission` property to restrict access to the button by permission. This property accepts a single permission string or an array of permission strings. If the current user does not have the required permission, the button will not be visible. ```ts title="src/plugins/invoice/ui/providers.ts" import { addActionBarItem } from '@vendure/admin-ui/core'; export default [ addActionBarItem({ id: 'print-invoice', label: 'Print invoice', locationId: 'order-detail', routerLink: ['./extensions/order-invoices'], // highlight-next-line requiresPermission: 'CreateInvoice', }), ]; ```
--- title: 'Adding UI Translations' --- The Vendure Admin UI is fully localizable, allowing you to: * create custom translations for your UI extensions * override existing translations * add complete translations for whole new languages ![The UI language is set from the User menu](./ui-translations-01.webp) ## Translation format The Admin UI uses the [Messageformat](https://messageformat.github.io/messageformat/) specification to convert i18n tokens to localized strings in the browser. Each language should have a corresponding JSON file containing the translations for that language. Here is an excerpt from the `en.json` file that ships with the Admin UI: ```JSON title="en.json" { "admin": { "create-new-administrator": "Create new administrator" }, "asset": { "add-asset": "Add asset", "add-asset-with-count": "Add {count, plural, 0 {assets} one {1 asset} other {{count} assets}}", "assets-selected-count": "{ count } assets selected", "dimensions": "Dimensions" } } ``` The translation tokens are grouped into a single-level deep nested structure. In the Angular code, these are referenced like this: ```HTML <label>{{ 'asset.assets-selected-count' | translate:{ count } }}</label> ``` That is, the `{ ... }` represent variables that are passed from the application code and interpolated into the final localized string. ## Adding a new language The Admin UI ships with built-in support for many languages, but allows you to add support for any other language without the need to modify the package internals. 1. **Create your translation file** Start by copying the contents of the [English language file](https://github.com/vendure-ecommerce/vendure/blob/master/packages/admin-ui/src/lib/static/i18n-messages/en.json) into a new file, `<languageCode>.json`, where `languageCode` is the 2-character [ISO 639-1 code](https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes) for the language. Replace the strings with the translation for the new language. 2. **Install `@vendure/ui-devkit`** If not already installed, install the `@vendure/ui-devkit` package, which allows you to create custom builds of the Admin UI. 3. **Register the translation file** Here's a minimal directory structure and sample code to add your new translation: ```text /src ├─ vendure-config.ts └─ translations/ └─ ms.json ``` And the config code to register the translation file: ```ts title="src.vendure-config.ts" import path from 'path'; import { VendureConfig } from '@vendure/core'; import { AdminUiPlugin } from '@vendure/admin-ui-plugin'; import { compileUiExtensions } from '@vendure/ui-devkit/compiler'; export const config: VendureConfig = { // ... plugins: [ AdminUiPlugin.init({ port: 3002, app: compileUiExtensions({ outputPath: path.join(__dirname, '../admin-ui'), extensions: [{ translations: { ms: path.join(__dirname, 'translations/ms.json'), } }], }), adminUiConfig:{ defaultLanguage: LanguageCode.ms, availableLanguages: [LanguageCode.ms, LanguageCode.en], } }), ], }; ``` ## Translating UI Extensions You can also create translations for your own UI extensions, in much the same way as outlined above in "Adding a new language". Your translations can be split over several files, since the `translations` config object can take a glob, e.g.: ```ts translations: { de: path.join(__dirname, 'ui-extensions/my-extension/**/*.de.json'), } ``` This allows you, if you wish, to co-locate your translation files with your components. Care should be taken to uniquely namespace your translation tokens, as conflicts with the base translation file will cause your translations to overwrite the defaults. This can be solved by using a unique section name, e.g.: ```JSON { "my-reviews-plugin": { "all-reviews": "All reviews", "approve review": "Approve review" } } ```
--- title: 'Admin UI Theming & Branding' --- The Vendure Admin UI can be themed to your company's style and branding. ## AdminUiPlugin branding settings The `AdminUiPlugin` allows you to specify your "brand" name, and allows you to control whether to display the Vendure name and version in the UI. Specifying a brand name will also set it as the title of the Admin UI in the browser. ```ts title="src/vendure-config.ts" import { VendureConfig } from '@vendure/core'; import { AdminUiPlugin } from '@vendure/admin-ui-plugin'; export const config: VendureConfig = { // ... plugins: [ AdminUiPlugin.init({ // ... adminUiConfig:{ brand: 'My Store', hideVendureBranding: false, hideVersion: false, } }), ], }; ``` :::note For the simple level of branding shown above, the `@vendure/ui-devkit` package is not required. ::: ## Specifying custom logos You can replace the Vendure logos and favicon with your own brand logo: 1. Install `@vendure/ui-devkit` 2. Configure the AdminUiPlugin to compile a custom build featuring your logos: ```ts title="src/vendure-config.ts" import path from 'path'; import { AdminUiPlugin } from '@vendure/admin-ui-plugin'; import { VendureConfig } from '@vendure/core'; import { compileUiExtensions, setBranding } from '@vendure/ui-devkit/compiler'; export const config: VendureConfig = { // ... plugins: [ AdminUiPlugin.init({ app: compileUiExtensions({ outputPath: path.join(__dirname, '../admin-ui'), extensions: [ setBranding({ // The small logo appears in the top left of the screen smallLogoPath: path.join(__dirname, 'images/my-logo-sm.png'), // The large logo is used on the login page largeLogoPath: path.join(__dirname, 'images/my-logo-lg.png'), faviconPath: path.join(__dirname, 'images/my-favicon.ico'), }), ], }), }), ], } ``` ## Theming Much of the visual styling of the Admin UI can be customized by providing your own themes in a Sass stylesheet. For the most part, the Admin UI uses [CSS custom properties](https://developer.mozilla.org/en-US/docs/Web/CSS/--*) to control colors and other styles. Here's a simple example which changes the color of links: 1. Install `@vendure/ui-devkit` 2. Create a custom stylesheet which overrides one or more of the CSS custom properties used in the Admin UI: ```css title="my-theme.scss" :root { --clr-link-active-color: hsl(110, 65%, 57%); --clr-link-color: hsl(110, 65%, 57%); --clr-link-hover-color: hsl(110, 65%, 57%); --clr-link-visited-color: hsl(110, 55%, 75%); } ``` To get an idea of which custom properties are available for theming, take a look at the source of the [Default theme](https://github.com/vendure-ecommerce/vendure/tree/master/packages/admin-ui/src/lib/static/styles/theme/default.scss) and the [Dark theme](https://github.com/vendure-ecommerce/vendure/tree/master/packages/admin-ui/src/lib/static/styles/theme/dark.scss) 3. Set this as a globalStyles extension: ```ts title="src/vendure-config.ts" import path from 'path'; import { AdminUiPlugin } from '@vendure/admin-ui-plugin'; import { VendureConfig } from '@vendure/core'; import { compileUiExtensions } from '@vendure/ui-devkit/compiler'; export const config: VendureConfig = { // ... plugins: [ AdminUiPlugin.init({ app: compileUiExtensions({ outputPath: path.join(__dirname, '../admin-ui'), extensions: [{ globalStyles: path.join(__dirname, 'my-theme.scss') }], }), }), ], } ``` Some customizable styles in [Clarity](https://clarity.design/), the Admin UI's underlying UI framework, are controlled by Sass variables, which can be found on the [project's GitHub page](https://github.com/vmware-clarity/ng-clarity/blob/689a572344149aea90df1676eae04479795754f3/projects/angular/src/utils/_variables.clarity.scss). Similar to above, you can also provide your own values, which will override defaults set by the framework. Here's an example which changes the [height of the main header](https://github.com/vmware-clarity/ng-clarity/blob/689a572344149aea90df1676eae04479795754f3/projects/angular/src/layout/main-container/_variables.header.scss#L10): 1. Install `@vendure/ui-devkit` if not already installed 2. Create a custom stylesheet which overrides the target variable(s): ```css title="my-variables.scss" $clr-header-height: 4rem; ``` 3. Set this as a `sassVariableOverrides` extension: ```ts title="src/vendure-config.ts" import path from 'path'; import { AdminUiPlugin } from '@vendure/admin-ui-plugin'; import { VendureConfig } from '@vendure/core'; import { compileUiExtensions } from '@vendure/ui-devkit/compiler'; export const config: VendureConfig = { // ... plugins: [ AdminUiPlugin.init({ app: compileUiExtensions({ outputPath: path.join(__dirname, 'admin-ui'), extensions: [{ sassVariableOverrides: path.join(__dirname, 'my-variables.scss') }], }), }), ], } ``` `globalStyles` and `sassVariableOverrides` extensions can be used in conjunction or separately.
--- title: 'Alerts' --- Alerts appear in the top bar of the Admin UI and provide a way of notifying the administrator of important information that may require action. You can define custom alerts with the [`registerAlert` function](/reference/admin-ui-api/alerts/register-alert/). Let's say you have a custom order process where certain orders require manual review & approval. You could define an alert to notify the administrator when there are orders that require review: ```ts title="src/plugins/manual-order-review/ui/providers.ts" import { registerAlert } from '@vendure/admin-ui/core'; import { Router } from '@angular/router'; import { interval } from 'rxjs'; import { ManualOrderReviewService } from './providers/manual-order-review.service'; export default [ ManualOrderReviewService, registerAlert({ id: 'orders-require-approval', // This function is responsible for fetching the data needed to determine // whether the alert should be displayed. check: ({ injector }) => { const manualOrderReviewService = injector.get(ManualOrderReviewService); return manualOrderReviewService.getOrdersRequiringApproval() .then(orders => orders.length); }, // This function is responsible for determining whether and how often the // `check` function should be called. In this case, we will check every 60 seconds. recheck: () => interval(60_000), // This function gets passed the data returned by the `check` function and // should return `true` if the alert should be displayed. isAlert: orderCount => orderCount > 0, // This function is called when the alert is clicked. Here, we will navigate to // a new route to display the orders requiring approval. action: (orderCount, { injector }) => { injector.get(Router).navigate(['/extensions/manual-order-review']); }, // This function is called to determine the label of the alert. label: (orderCount) => ({ text: `${orderCount} ${orderCount === 1 ? 'order' : 'orders'} require approval`, }), }), ]; ``` With this example, a check will be performed every 60 seconds to see if there are any orders requiring approval. The actual implementation of the check is left to the `ManualOrderReviewService` which in this case would make a request to the Vendure server to fetch the required data. If there are orders requiring approval, the alert will appear in the Admin UI like this: ![Alerts](./alerts-01.webp)
--- title: 'Bulk Actions for List Views' --- List views in the Admin UI support bulk actions, which are performed on any selected items in the list. There are a default set of bulk actions that are defined by the Admin UI itself (e.g. delete, assign to channels), but using the `@vendure/ui-devit` package you are also able to define your own bulk actions. ![./bulk-actions-screenshot.webp](./bulk-actions-screenshot.webp) Use cases for bulk actions include things like: - Sending multiple products to a 3rd-party localization service - Exporting selected products to csv - Bulk-updating custom field data ### Bulk Action Example Bulk actions are declared using the [`registerBulkAction` function](/reference/admin-ui-api/bulk-actions/register-bulk-action/) ```ts title="src/plugins/translation/ui/providers.ts" import { ModalService, registerBulkAction } from '@vendure/admin-ui/core'; import { ProductDataTranslationService } from './product-data-translation.service'; export default [ ProductDataTranslationService, // Here is where we define our bulk action // for sending the selected products to a 3rd-party // translation API registerBulkAction({ // This tells the Admin UI that this bulk action should be made // available on the product list view. location: 'product-list', label: 'Send to translation service', icon: 'language', // Here is the logic that is executed when the bulk action menu item // is clicked. onClick: ({injector, selection}) => { const modalService = injector.get(ModalService); const translationService = injector.get(ProductDataTranslationService); modalService .dialog({ title: `Send ${selection.length} products for translation?`, buttons: [ {type: 'secondary', label: 'cancel'}, {type: 'primary', label: 'send', returnValue: true}, ], }) .subscribe(response => { if (response) { translationService.sendForTranslation(selection.map(item => item.productId)); } }); }, }), ]; ``` ### Conditionally displaying bulk actions Sometimes a bulk action only makes sense in certain circumstances. For example, the "assign to channel" action only makes sense when your server has multiple channels set up. We can conditionally control the display of a bulk action with the `isVisible` function, which should return a Promise resolving to a boolean: ```ts title="src/plugins/my-plugin/ui/providers.ts" import { registerBulkAction, DataService } from '@vendure/admin-ui/core'; export default [ registerBulkAction({ location: 'product-list', label: 'Assign to channel', // Only display this action if there are multiple channels isVisible: ({ injector }) => injector.get(DataService).client .userStatus() .mapSingle(({ userStatus }) => 1 < userStatus.channels.length) .toPromise(), // ... }), ]; ```
--- title: 'Creating Detail Views' --- # Creating Detail Views The two most common type of components you'll be creating in your UI extensions are list components and detail components. In Vendure, we have standardized the way you write these components so that your ui extensions can be made to fit seamlessly into the rest of the app. :::note The specific pattern described here is for Angular-based components. It is also possible to create detail views using React components, but in that case you won't be able to use the built-in Angular-specific components. ::: ## Example: Creating a Product Detail View Let's say you have a plugin which adds a new entity to the database called `ProductReview`. You have already created a [list view](/guides/extending-the-admin-ui/creating-list-views/), and now you need a detail view which can be used to view and edit individual reviews. ### Extend the TypedBaseDetailComponent class The detail component itself is an Angular component which extends the [BaseDetailComponent](/reference/admin-ui-api/list-detail-views/base-detail-component/) or [TypedBaseDetailComponent](/reference/admin-ui-api/list-detail-views/typed-base-detail-component) class. This example assumes you have set up your project to use code generation as described in the [GraphQL code generation guide](/guides/how-to/codegen/#codegen-for-admin-ui-extensions). ```ts title="src/plugins/reviews/ui/components/review-detail/review-detail.component.ts" import { ResultOf } from '@graphql-typed-document-node/core'; import { ChangeDetectionStrategy, Component, OnInit, OnDestroy } from '@angular/core'; import { FormBuilder } from '@angular/forms'; import { TypedBaseDetailComponent, LanguageCode, NotificationService, SharedModule } from '@vendure/admin-ui/core'; // This is the TypedDocumentNode & type generated by GraphQL Code Generator import { graphql } from '../../gql'; export const reviewDetailFragment = graphql(` fragment ReviewDetail on ProductReview { id createdAt updatedAt title rating text authorName productId } `); export const getReviewDetailDocument = graphql(` query GetReviewDetail($id: ID!) { review(id: $id) { ...ReviewDetail } } `); export const createReviewDocument = graphql(` mutation CreateReview($input: CreateProductReviewInput!) { createProductReview(input: $input) { ...ReviewDetail } } `); export const updateReviewDocument = graphql(` mutation UpdateReview($input: UpdateProductReviewInput!) { updateProductReview(input: $input) { ...ReviewDetail } } `); @Component({ selector: 'review-detail', templateUrl: './review-detail.component.html', styleUrls: ['./review-detail.component.scss'], changeDetection: ChangeDetectionStrategy.OnPush, standalone: true, imports: [SharedModule], }) export class ReviewDetailComponent extends TypedBaseDetailComponent<typeof getReviewDetailDocument, 'review'> implements OnInit, OnDestroy { detailForm = this.formBuilder.group({ title: [''], rating: [1], authorName: [''], }); constructor(private formBuilder: FormBuilder, private notificationService: NotificationService) { super(); } ngOnInit() { this.init(); } ngOnDestroy() { this.destroy(); } create() { const { title, rating, authorName } = this.detailForm.value; if (!title || rating == null || !authorName) { return; } this.dataService .mutate(createReviewDocument, { input: { title, rating, authorName }, }) .subscribe(({ createProductReview }) => { if (createProductReview.id) { this.notificationService.success('Review created'); this.router.navigate(['extensions', 'reviews', createProductReview.id]); } }); } update() { const { title, rating, authorName } = this.detailForm.value; this.dataService .mutate(updateReviewDocument, { input: { id: this.id, title, rating, authorName }, }) .subscribe(() => { this.notificationService.success('Review updated'); }); } protected setFormValues(entity: NonNullable<ResultOf<typeof getReviewDetailDocument>['review']>, languageCode: LanguageCode): void { this.detailForm.patchValue({ title: entity.name, rating: entity.rating, authorName: entity.authorName, productId: entity.productId, }); } } ``` ### Create the template Here is the standard layout for detail views: ```html <vdr-page-block> <vdr-action-bar> <vdr-ab-left></vdr-ab-left> <vdr-ab-right> <button class="button primary" *ngIf="isNew$ | async; else updateButton" (click)="create()" [disabled]="detailForm.pristine || detailForm.invalid" > {{ 'common.create' | translate }} </button> <ng-template #updateButton> <button class="btn btn-primary" (click)="update()" [disabled]="detailForm.pristine || detailForm.invalid" > {{ 'common.update' | translate }} </button> </ng-template> </vdr-ab-right> </vdr-action-bar> </vdr-page-block> <form class="form" [formGroup]="detailForm"> <vdr-page-detail-layout> <!-- The sidebar is used for displaying "metadata" type information about the entity --> <vdr-page-detail-sidebar> <vdr-card *ngIf="entity$ | async as entity"> <vdr-page-entity-info [entity]="entity" /> </vdr-card> </vdr-page-detail-sidebar> <!-- The main content area is used for displaying the entity's fields --> <vdr-page-block> <!-- The vdr-card is the container for grouping items together on a page --> <!-- it can also take an optional [title] property to display a title --> <vdr-card> <!-- the form-grid class is used to lay out the form fields --> <div class="form-grid"> <vdr-form-field label="Title" for="title"> <input id="title" type="text" formControlName="title" /> </vdr-form-field> <vdr-form-field label="Rating" for="rating"> <input id="rating" type="number" min="1" max="5" formControlName="rating" /> </vdr-form-field> <!-- etc --> </div> </vdr-card> </vdr-page-block> </vdr-page-detail-layout> </form> ``` ### Route config Here's how the routing would look for a typical list & detail view: ```ts title="src/plugins/reviews/ui/routes.ts" import { registerRouteComponent } from '@vendure/admin-ui/core'; import { ReviewDetailComponent, getReviewDetailDocument } from './components/review-detail/review-detail.component'; import { ReviewListComponent } from './components/review-list/review-list.component'; export default [ // List view registerRouteComponent({ path: '', component: ReviewListComponent, breadcrumb: 'Product reviews', }), // highlight-start // Detail view registerRouteComponent({ path: ':id', component: ReviewDetailComponent, query: getReviewDetailDocument, entityKey: 'productReview', getBreadcrumbs: entity => [ { label: 'Product reviews', link: ['/extensions', 'product-reviews'], }, { label: `#${entity?.id} (${entity?.product.name})`, link: [], }, ], }), // highlight-end ] ``` ## Supporting custom fields From Vendure v2.2, it is possible for your [custom entities to support custom fields](/guides/developer-guide/database-entity/#supporting-custom-fields). If you have set up your entity to support custom fields, and you want custom fields to be available in the Admin UI detail view, you need to add the following to your detail component: ```ts title="src/plugins/reviews/ui/components/review-detail/review-detail.component.ts" // highlight-next-line import { getCustomFieldsDefaults } from '@vendure/admin-ui/core'; @Component({ selector: 'review-detail', templateUrl: './review-detail.component.html', styleUrls: ['./review-detail.component.scss'], changeDetection: ChangeDetectionStrategy.OnPush, standalone: true, imports: [SharedModule], }) export class ReviewDetailComponent extends TypedBaseDetailComponent<typeof getReviewDetailDocument, 'review'> implements OnInit, OnDestroy { // highlight-next-line customFields = this.getCustomFieldConfig('ProductReview'); detailForm = this.formBuilder.group({ title: [''], rating: [1], authorName: [''], // highlight-next-line customFields: this.formBuilder.group(getCustomFieldsDefaults(this.customFields)), }); protected setFormValues(entity: NonNullable<ResultOf<typeof getReviewDetailDocument>['review']>, languageCode: LanguageCode): void { this.detailForm.patchValue({ title: entity.name, rating: entity.rating, authorName: entity.authorName, productId: entity.productId, }); // highlight-start if (this.customFields.length) { this.setCustomFieldFormValues(this.customFields, this.detailForm.get('customFields'), entity); } // highlight-end } } ``` Then add a card for your custom fields to the template: ```html title="src/plugins/reviews/ui/components/review-detail/review-detail.component.html" <form class="form" [formGroup]="detailForm"> <vdr-page-detail-layout> <!-- The sidebar is used for displaying "metadata" type information about the entity --> <vdr-page-detail-sidebar> <vdr-card *ngIf="entity$ | async as entity"> <vdr-page-entity-info [entity]="entity" /> </vdr-card> </vdr-page-detail-sidebar> <!-- The main content area is used for displaying the entity's fields --> <vdr-page-block> <!-- The vdr-card is the container for grouping items together on a page --> <!-- it can also take an optional [title] property to display a title --> <vdr-card> <!-- the form-grid class is used to lay out the form fields --> <div class="form-grid"> <vdr-form-field label="Title" for="title"> <input id="title" type="text" formControlName="title" /> </vdr-form-field> <vdr-form-field label="Rating" for="rating"> <input id="rating" type="number" min="1" max="5" formControlName="rating" /> </vdr-form-field> <!-- etc --> </div> </vdr-card> // highlight-start <vdr-card formGroupName="customFields" *ngIf="customFields.length" [title]="'common.custom-fields' | translate" > <vdr-tabbed-custom-fields entityName="ProductReview" [customFields]="customFields" [customFieldsFormGroup]="detailForm.get('customFields')" ></vdr-tabbed-custom-fields> </vdr-card> // highlight-end </vdr-page-block> </vdr-page-detail-layout> </form> ```
--- title: 'Creating List Views' --- The two most common type of components you'll be creating in your UI extensions are list components and detail components. In Vendure, we have standardized the way you write these components so that your ui extensions can be made to fit seamlessly into the rest of the app. :::note The specific pattern described here is for Angular-based components. It is also possible to create list views using React components, but in that case you won't be able to use the built-in data table & other Angular-specific components. ::: ## Example: Creating a Product Reviews List Let's say you have a plugin which adds a new entity to the database called `ProductReview`. You want to create a new list view in the Admin UI which displays all the reviews submitted. ### Use the PaginatedList interface To use the standardized list component, you need to make sure your plugin exposes this list in the GraphQL API following the [PaginatedList interface](/reference/typescript-api/common/paginated-list/): ```graphql type ProductReview implements Node { id: ID! createdAt: DateTime! updatedAt: DateTime! title: String! rating: Int! text: String! authorName: String! product: Product! productId: ID! } type ProductReviewList implements PaginatedList { items: [ProductReview!]! totalItems: Int! } ``` :::info See the [Paginated Lists guide](/guides/how-to/paginated-list/) for details on how to implement this in your server plugin code. ::: ### Create the list component The list component itself is an Angular component which extends the [BaseListComponent](/reference/admin-ui-api/list-detail-views/base-list-component/) or [TypedBaseListComponent](/reference/admin-ui-api/list-detail-views/typed-base-list-component) class. This example assumes you have set up your project to use code generation as described in the [GraphQL code generation guide](/guides/how-to/codegen/#codegen-for-admin-ui-extensions). ```ts title="src/plugins/reviews/ui/components/review-list/review-list.component.ts" import { ChangeDetectionStrategy, Component } from '@angular/core'; import { TypedBaseListComponent, SharedModule } from '@vendure/admin-ui/core'; // This is the TypedDocumentNode generated by GraphQL Code Generator import { graphql } from '../../gql'; const getReviewListDocument = graphql(` query GetReviewList($options: ReviewListOptions) { reviews(options: $options) { items { id createdAt updatedAt title rating text authorName productId } totalItems } } `); @Component({ selector: 'review-list', templateUrl: './review-list.component.html', styleUrls: ['./review-list.component.scss'], changeDetection: ChangeDetectionStrategy.OnPush, standalone: true, imports: [SharedModule], }) export class ReviewListComponent extends TypedBaseListComponent<typeof getReviewListDocument, 'reviews'> { // Here we set up the filters that will be available // to use in the data table readonly filters = this.createFilterCollection() .addIdFilter() .addDateFilters() .addFilter({ name: 'title', type: {kind: 'text'}, label: 'Title', filterField: 'title', }) .addFilter({ name: 'rating', type: {kind: 'number'}, label: 'Rating', filterField: 'rating', }) .addFilter({ name: 'authorName', type: {kind: 'text'}, label: 'Author', filterField: 'authorName', }) .connectToRoute(this.route); // Here we set up the sorting options that will be available // to use in the data table readonly sorts = this.createSortCollection() .defaultSort('createdAt', 'DESC') .addSort({name: 'createdAt'}) .addSort({name: 'updatedAt'}) .addSort({name: 'title'}) .addSort({name: 'rating'}) .addSort({name: 'authorName'}) .connectToRoute(this.route); constructor() { super(); super.configure({ document: getReviewListDocument, getItems: data => data.reviews, setVariables: (skip, take) => ({ options: { skip, take, filter: { title: { contains: this.searchTermControl.value, }, ...this.filters.createFilterInput(), }, sort: this.sorts.createSortInput(), }, }), refreshListOnChanges: [this.filters.valueChanges, this.sorts.valueChanges], }); } } ``` ### Create the template This is the standard layout for any list view. The main functionality is provided by the [DataTable2Component](/reference/admin-ui-api/components/data-table2component/). ```html title="src/plugins/reviews/ui/components/review-list/review-list.component.html" <!-- optional if you want some buttons at the top --> <vdr-page-block> <vdr-action-bar> <vdr-ab-left></vdr-ab-left> <vdr-ab-right> <a class="btn btn-primary" *vdrIfPermissions="['CreateReview']" [routerLink]="['./', 'create']"> <clr-icon shape="plus"></clr-icon> Create a review </a> </vdr-ab-right> </vdr-action-bar> </vdr-page-block> <!-- The data table --> <vdr-data-table-2 id="review-list" [items]="items$ | async" [itemsPerPage]="itemsPerPage$ | async" [totalItems]="totalItems$ | async" [currentPage]="currentPage$ | async" [filters]="filters" (pageChange)="setPageNumber($event)" (itemsPerPageChange)="setItemsPerPage($event)" > <!-- optional if you want to support bulk actions --> <vdr-bulk-action-menu locationId="review-list" [hostComponent]="this" [selectionManager]="selectionManager" /> <!-- Adds a search bar --> <vdr-dt2-search [searchTermControl]="searchTermControl" searchTermPlaceholder="Filter by title" /> <!-- Here we define all the available columns --> <vdr-dt2-column id="id" [heading]="'common.id' | translate" [hiddenByDefault]="true"> <ng-template let-review="item"> {{ review.id }} </ng-template> </vdr-dt2-column> <vdr-dt2-column id="created-at" [heading]="'common.created-at' | translate" [hiddenByDefault]="true" [sort]="sorts.get('createdAt')" > <ng-template let-review="item"> {{ review.createdAt | localeDate : 'short' }} </ng-template> </vdr-dt2-column> <vdr-dt2-column id="updated-at" [heading]="'common.updated-at' | translate" [hiddenByDefault]="true" [sort]="sorts.get('updatedAt')" > <ng-template let-review="item"> {{ review.updatedAt | localeDate : 'short' }} </ng-template> </vdr-dt2-column> <vdr-dt2-column id="title" heading="Title" [optional]="false" [sort]="sorts.get('title')"> <ng-template let-review="item"> <a class="button-ghost" [routerLink]="['./', review.id]" ><span>{{ review.title }}</span> <clr-icon shape="arrow right"></clr-icon> </a> </ng-template> </vdr-dt2-column> <vdr-dt2-column id="rating" heading="Rating" [sort]="sorts.get('rating')"> <ng-template let-review="item"><my-star-rating-component [rating]="review.rating" /></ng-template> </vdr-dt2-column> <vdr-dt2-column id="author" heading="Author" [sort]="sorts.get('authorName')"> <ng-template let-review="item">{{ review.authorName }}</ng-template> </vdr-dt2-column> </vdr-data-table-2> ``` ### Route config ```ts title="src/plugins/reviews/ui/routes.ts" import { registerRouteComponent } from '@vendure/admin-ui/core'; import { ReviewListComponent } from './components/review-list/review-list.component'; export default [ // highlight-start registerRouteComponent({ path: '', component: ReviewListComponent, breadcrumb: 'Product reviews', }), // highlight-end ] ``` ## Supporting custom fields From Vendure v2.2, it is possible for your [custom entities to support custom fields](/guides/developer-guide/database-entity/#supporting-custom-fields). If you have set up your entity to support custom fields, and you want custom fields to be available in the Admin UI list view, you need to add the following to your list component: ```ts title="src/plugins/reviews/ui/components/review-list/review-list.component.ts" @Component({ selector: 'review-list', templateUrl: './review-list.component.html', styleUrls: ['./review-list.component.scss'], changeDetection: ChangeDetectionStrategy.OnPush, standalone: true, imports: [SharedModule], }) export class ReviewListComponent extends TypedBaseListComponent<typeof getReviewListDocument, 'reviews'> { // highlight-next-line customFields = this.getCustomFieldConfig('ProductReview'); readonly filters = this.createFilterCollection() .addIdFilter() .addDateFilters() .addFilter({ name: 'title', type: {kind: 'text'}, label: 'Title', filterField: 'title', }) .addFilter({ name: 'rating', type: {kind: 'number'}, label: 'Rating', filterField: 'rating', }) .addFilter({ name: 'authorName', type: {kind: 'text'}, label: 'Author', filterField: 'authorName', }) // highlight-next-line .addCustomFieldFilters(this.customFields) .connectToRoute(this.route); readonly sorts = this.createSortCollection() .defaultSort('createdAt', 'DESC') .addSort({name: 'createdAt'}) .addSort({name: 'updatedAt'}) .addSort({name: 'title'}) .addSort({name: 'rating'}) .addSort({name: 'authorName'}) // highlight-next-line .addCustomFieldSorts(this.customFields) .connectToRoute(this.route); // rest of class omitted for brevity } ``` and then add the `vdr-dt2-custom-field-column` component to your data table: ```html title="src/plugins/reviews/ui/components/review-list/review-list.component.html" <vdr-data-table-2 id="review-list" [items]="items$ | async" [itemsPerPage]="itemsPerPage$ | async" [totalItems]="totalItems$ | async" [currentPage]="currentPage$ | async" [filters]="filters" (pageChange)="setPageNumber($event)" (itemsPerPageChange)="setItemsPerPage($event)" > <!-- rest of data table omitted for brevity --> // highlight-start <vdr-dt2-custom-field-column *ngFor="let customField of customFields" [customField]="customField" [sorts]="sorts" /> // highlight-end </vdr-data-table-2> ```
--- title: 'Custom DataTable Components' weight: 6 --- import Tabs from '@theme/Tabs'; import TabItem from '@theme/TabItem'; The Admin UI list views are powered by a data table component which features sorting, advanced filtering, pagination and more. It will also give you the option of displaying any configured [custom fields](/guides/developer-guide/custom-fields/) for the entity in question. With Admin UI extensions, you can specify custom components to use in rendering any column of any data table - both custom fields _and_ built-in fields, using either Angular or React components. Let's say we want to make the product "slug" column link to the matching product detail page in our storefront. ### 1. Define a component First we'll define the component we will use to render the "slug" column: <Tabs groupId="framework"> <TabItem value="angular" label="Angular"> Angular components will receive the value of the current column as the `rowItem` input. In this case, the `rowItem` will be the Product entity, because we will be adding this to the product list data table. ```ts title="src/plugins/slug-link/ui/components/slug-link/slug-link.component.ts" import { Component, Input } from '@angular/core'; import { CustomColumnComponent } from '@vendure/admin-ui/core'; @Component({ selector: 'slug-link', template: ` <a [href]="'https://example.com/products/' + rowItem.slug" target="_blank">{{ rowItem.slug }}</a> `, standalone: true, }) export class SlugLinkComponent implements CustomColumnComponent { @Input() rowItem: { slug: string }; } ``` </TabItem> <TabItem value="react" label="React"> React components will receive the value of the current column as the `rowItem` prop. In this case, the `rowItem` will be the Product entity, because we will be adding this to the product list data table. ```tsx title="src/plugins/slug-link/ui/components/SlugLink.tsx" import { ReactDataTableComponentProps } from '@vendure/admin-ui/react'; import React from 'react'; export function SlugLink({ rowItem }: ReactDataTableComponentProps<{ slug: string }>) { const slug = rowItem.slug; return ( <a href={`https://example.com/category/${slug}`} target="_blank"> {slug} </a> ); } ``` </TabItem> </Tabs> ### 2. Register the component Next we need to register the component in out `providers.ts` file. We need to pass both a `tableId` and a `columnId` to identify the table and column to which the component should be added. The values for these IDs can be found by pressing the `ctrl + u` shortcut when the Admin UI is in dev mode, and then clicking the extension point icon at the top of the column in question: ![Extension locations](./custom-data-table-location.webp) In this case we want to target the `product-list` table and the `slug` column. <Tabs groupId="framework"> <TabItem value="angular" label="Angular"> ```ts title="src/plugins/slug-link/ui/providers.ts" import { registerDataTableComponent } from '@vendure/admin-ui/core'; import { SlugLinkComponent } from './components/slug-link/slug-link.component'; export default [ registerDataTableComponent({ component: SlugWithLinkComponent, tableId: 'product-list', columnId: 'slug', }), ]; ``` </TabItem> <TabItem value="react" label="React"> ```ts title="src/plugins/slug-link/ui/providers.ts" import { registerReactDataTableComponent } from '@vendure/admin-ui/react'; import { SlugLink } from './components/SlugLink'; export default [ registerReactDataTableComponent({ component: SlugWithLink, tableId: 'product-list', columnId: 'slug', props: { // Additional props may be passed to the component foo: 'bar', }, }), ]; ``` </TabItem> </Tabs> When running the Admin UI, the product list slug should now be rendered as a link: ![Product list with slug link](./custom-data-table.webp)
--- title: 'Custom Detail Components' --- import Tabs from '@theme/Tabs'; import TabItem from '@theme/TabItem'; Detail views can be extended with custom Angular or React components using the [`registerCustomDetailComponent`](/reference/admin-ui-api/custom-detail-components/register-custom-detail-component/) and [`registerReactCustomDetailComponent`](/reference/admin-ui-api/react-extensions/register-react-custom-detail-component) functions. Any components registered in this way will appear below the main detail form. :::info The valid locations for embedding custom detail components can be found in the [CustomDetailComponentLocationId docs](/reference/admin-ui-api/custom-detail-components/custom-detail-component-location-id). ::: Let's imagine that your project has an external content management system (CMS) which is used to store additional details about products. You might want to display some of this information in the product detail page. We will demonstrate the same component in both Angular and React. ### 1. Create a component <Tabs groupId="framework"> <TabItem value="Angular" label="Angular" default> ```ts title="src/plugins/cms/ui/components/product-info/product-info.component.ts" import { Component, OnInit } from '@angular/core'; import { Observable, switchMap } from 'rxjs'; import { FormGroup } from '@angular/forms'; import { DataService, CustomDetailComponent, SharedModule } from '@vendure/admin-ui/core'; import { CmsDataService } from '../../providers/cms-data.service'; @Component({ template: ` <vdr-card title="CMS Info"> <pre>{{ extraInfo$ | async | json }}</pre> </vdr-card>`, standalone: true, providers: [CmsDataService], imports: [SharedModule], }) export class ProductInfoComponent implements CustomDetailComponent, OnInit { // These two properties are provided by Vendure and will vary // depending on the particular detail page you are embedding this // component into. In this case, it will be a "product" entity. entity$: Observable<any> detailForm: FormGroup; extraInfo$: Observable<any>; constructor(private cmsDataService: CmsDataService) { } ngOnInit() { this.extraInfo$ = this.entity$.pipe( switchMap(entity => this.cmsDataService.getDataFor(entity.id)) ); } } ``` </TabItem> <TabItem value="React" label="React"> When using React, we can use the [`useDetailComponentData` hook](/reference/admin-ui-api/react-hooks/use-detail-component-data) to access the entity and form data. ```tsx title="src/plugins/cms/ui/components/ProductInfo.tsx" import React, { useEffect, useState } from 'react'; import { Card, useDetailComponentData, useInjector } from '@vendure/admin-ui/react'; import { CmsDataService } from '../providers/cms-data.service'; export function ProductInfo() { // The "entity" will vary depending on which detail page this component // is embedded in. In this case, it will be a "product" entity. const { entity, detailForm } = useDetailComponentData(); const cmsDataService = useInjector(CmsDataService); const [extraInfo, setExtraInfo] = useState<any>(); useEffect(() => { if (!entity?.id) { return; } const subscription = cmsDataService.getDataFor(entity?.id).subscribe(data => { setExtraInfo(data); }); return () => subscription.unsubscribe(); }, [entity?.id]); return ( <Card title="CMS Info"> <pre>{JSON.stringify(extraInfo, null, 2)}</pre> </Card> ); } ``` </TabItem> </Tabs> ### 2. Register the component We can then register the component in our `providers.ts` file: <Tabs groupId="framework"> <TabItem value="Angular" label="Angular" default> ```ts title="src/plugins/cms/ui/providers.ts" import { registerCustomDetailComponent } from '@vendure/admin-ui/core'; import { ProductInfoComponent } from './components/product-info/product-info.component'; export default [ registerCustomDetailComponent({ locationId: 'product-detail', component: ProductInfoComponent, }), ]; ``` </TabItem> <TabItem value="React" label="React"> ```ts title="src/plugins/cms/ui/providers.ts" import { registerReactCustomDetailComponent } from '@vendure/admin-ui/react'; import { ProductInfo } from './components/ProductInfo'; export default [ registerReactCustomDetailComponent({ locationId: 'product-detail', component: ProductInfo, }), ]; ``` </TabItem> </Tabs> When running the Admin UI, the component should now appear in the product detail page: ![Product detail with custom component](./detail-component.webp) ## Manipulating the detail form The `detailForm` property is an instance of the Angular [FormGroup](https://angular.io/api/forms/FormGroup) which can be used to manipulate the form fields, set the validity of the form, mark the form as dirty etc. For example, we could add a button which updates the `description` field of the product: <Tabs groupId="framework"> <TabItem value="Angular" label="Angular" default> ```ts title="src/plugins/cms/ui/components/product-info/product-info.component.ts" import { Component, OnInit } from '@angular/core'; import { FormGroup } from '@angular/forms'; import { CustomDetailComponent } from '@vendure/admin-ui/core'; @Component({ template: `<button class="button secondary" (click)="updateDescription()">Update description</button>`, standalone: true, }) export class ProductInfoComponent implements CustomDetailComponent, OnInit { entity$: Observable<any> detailForm: FormGroup; // highlight-start updateDescription() { const descriptionControl = this.detailForm.get('description'); if (descriptionControl) { descriptionControl.setValue('New description'); descriptionControl.markAsDirty(); } } // highlight-end } ``` </TabItem> <TabItem value="React" label="React"> ```tsx title="src/plugins/cms/ui/components/ProductInfo.tsx" import React from 'react'; import { Card, useDetailComponentData } from '@vendure/admin-ui/react'; export function ProductInfo() { const { detailForm } = useDetailComponentData(); // highlight-start const updateDescription = () => { const descriptionControl = detailForm.get('description'); if (descriptionControl) { descriptionControl.setValue('New description'); descriptionControl.markAsDirty(); } }; // highlight-end return ( <button className="button secondary" onClick={updateDescription}>Update description</button> ); } ``` </TabItem> </Tabs>
--- title: 'Custom Form Inputs' --- import Tabs from '@theme/Tabs'; import TabItem from '@theme/TabItem'; You can define custom Angular or React components which can be used to render [Custom Fields](/guides/developer-guide/custom-fields/) you have defined on your entities as well as [configurable args](/reference/typescript-api/configurable-operation-def/config-args/) used by custom [Configurable Operations](/guides/developer-guide/strategies-configurable-operations/#configurable-operations). ## For Custom Fields Let's say you define a custom "intensity" field on the Product entity: ```ts title="src/vendure-config.ts" import { VendureConfig } from '@vendure/core'; export const config: VendureConfig = { // ... customFields: { Product: [ { name: 'intensity', type: 'int', min: 0, max: 100, defaultValue: 0 }, ], }, } ``` By default, the "intensity" field will be displayed as a number input: ![./ui-extensions-custom-field-default.webp](./ui-extensions-custom-field-default.webp) But let's say we want to display a **range slider** instead. ### 1. Define a component First we need to define a new Angular or React component to render the slider: <Tabs groupId="framework"> <TabItem value="Angular" label="Angular" default> Angular components will have the `readonly`, `config` and `formControl` properties populated automatically. ```ts title="src/plugins/common/ui/components/slider-form-input/slider-form-input.component.ts" import { Component } from '@angular/core'; import { FormControl } from '@angular/forms'; import { IntCustomFieldConfig, SharedModule, FormInputComponent } from '@vendure/admin-ui/core'; @Component({ template: ` <input type="range" [min]="config.min || 0" [max]="config.max || 100" [formControl]="formControl" /> {{ formControl.value }} `, standalone: true, imports: [SharedModule], }) export class SliderControlComponent implements FormInputComponent<IntCustomFieldConfig> { readonly: boolean; config: IntCustomFieldConfig; formControl: FormControl; } ``` </TabItem> <TabItem value="React" label="React"> React components can use the [`useFormControl`](/reference/admin-ui-api/react-hooks/use-form-control) hook to access the form control and set its value. The component will also receive `config` and `readonly` data as props. ```tsx title="src/plugins/common/ui/components/SliderFormInput.tsx" import React from 'react'; import { useFormControl, ReactFormInputOptions, useInjector } from '@vendure/admin-ui/react'; export function SliderFormInput({ readonly, config }: ReactFormInputOptions) { const { value, setFormValue } = useFormControl(); const handleChange = (e: React.ChangeEvent<HTMLInputElement>) => { const val = +e.target.value; setFormValue(val); }; return ( <> <input type="range" readOnly={readonly} min={config.min || 0} max={config.max || 100} value={value} onChange={handleChange} /> {value} </> ); }; ``` </TabItem> </Tabs> ### 2. Register the component Next we will register this component in our `providers.ts` file and give it a unique ID, `'slider-form-input'`: <Tabs groupId="framework"> <TabItem value="Angular" label="Angular" default> ```ts title="src/plugins/common/ui/providers.ts" import { registerFormInputComponent } from '@vendure/admin-ui/core'; import { SliderControlComponent } from './components/slider-form-input/slider-form-input.component'; export default [ registerFormInputComponent('slider-form-input', SliderControlComponent), ]; ``` </TabItem> <TabItem value="React" label="React"> ```ts title="src/plugins/common/ui/providers.ts" import { registerReactFormInputComponent } from '@vendure/admin-ui/react'; import { SliderControl } from './components/SliderFormInput'; export default [ registerReactFormInputComponent('slider-form-input', SliderFormInput), ]; ``` </TabItem> </Tabs> ### 3. Register the providers The `providers.ts` is then passed to the `compileUiExtensions()` function as described in the [UI Extensions Getting Started guide](/guides/extending-the-admin-ui/getting-started/): ```ts title="src/vendure-config.ts" import * as path from 'path'; import { VendureConfig } from '@vendure/core'; import { AdminUiPlugin } from '@vendure/admin-ui-plugin'; import { compileUiExtensions } from '@vendure/ui-devkit/compiler'; export const config: VendureConfig = { // ... plugins: [ AdminUiPlugin.init({ port: 3302, app: compileUiExtensions({ outputPath: path.join(__dirname, '../admin-ui'), extensions: [{ id: 'common', // highlight-start extensionPath: path.join(__dirname, 'plugins/common/ui'), providers: ['providers.ts'], // highlight-end }], }), }), ], }; ``` ### 4. Update the custom field config Once registered, this new slider input can be used in our custom field config: ```ts title="src/vendure-config.ts" customFields: { Product: [ { name: 'intensity', type: 'int', min: 0, max: 100, defaultValue: 0, // highlight-next-line ui: {component: 'slider-form-input'} }, ], } ``` As we can see, adding the `ui` property to the custom field config allows us to specify our custom slider component. The component id _'slider-form-input'_ **must match** the string passed as the first argument to `registerFormInputComponent()`. :::info If we want, we can also pass any other arbitrary data in the `ui` object, which will then be available in our component as `this.config.ui.myField`. Note that only JSON-compatible data types are permitted, so no functions or class instances. ::: Re-compiling the Admin UI will result in our SliderControl now being used for the "intensity" custom field: ![./ui-extensions-custom-field-slider.webp](./ui-extensions-custom-field-slider.webp) ## Custom Field Controls for Relations If you have a custom field of the `relation` type (which allows you to relate entities with one another), you can also define custom field controls for them. The basic mechanism is exactly the same as with primitive custom field types (i.e. `string`, `int` etc.), but there are a couple of important points to know: 1. The value of the `formControl` will be the _related entity object_ rather than an id. The Admin UI will internally take care of converting the entity object into an ID when performing the create/update mutation. 2. Your control will most likely need to fetch data in order to display a list of selections for the user. Here's an example of a custom field control for a `relation` field which relates a Product to a custom `ProductReview` entity: ```ts title="src/plugins/reviews/ui/components/relation-review-input/relation-review-input.component.ts" import { Component, OnInit } from '@angular/core'; import { FormControl } from '@angular/forms'; import { ActivatedRoute } from '@angular/router'; import { RelationCustomFieldConfig } from '@vendure/common/lib/generated-types'; import { FormInputComponent, DataService, SharedModule } from '@vendure/admin-ui/core'; import { Observable } from 'rxjs'; import { switchMap } from 'rxjs/operators'; import { GET_REVIEWS_FOR_PRODUCT } from '../product-reviews-list/product-reviews-list.graphql'; @Component({ selector: 'relation-review-input', template: ` <div *ngIf="formControl.value as review"> <vdr-chip>{{ review.rating }} / 5</vdr-chip> {{ review.summary }} <a [routerLink]="['/extensions', 'product-reviews', review.id]"> <clr-icon shape="link"></clr-icon> </a> </div> <select [formControl]="formControl" [compareWith]="compareFn"> <option [ngValue]="null">Select a review...</option> <option *ngFor="let item of reviews$ | async" [ngValue]="item"> <b>{{ item.summary }}</b> {{ item.rating }} / 5 </option> </select> `, standalone: true, imports: [SharedModule], }) export class RelationReviewInputComponent implements OnInit, FormInputComponent<RelationCustomFieldConfig> { readonly: boolean; formControl: FormControl; config: RelationCustomFieldConfig; reviews$: Observable<any[]>; constructor(private dataService: DataService, private route: ActivatedRoute) {} ngOnInit() { this.reviews$ = this.route.data.pipe( switchMap(data => data.entity), switchMap((product: any) => { return this.dataService .query(GET_REVIEWS_FOR_PRODUCT, { productId: product.id }) .mapSingle(({ product }) => product?.reviews.items ?? []); }), ); } compareFn(item1: { id: string } | null, item2: { id: string } | null) { return item1 && item2 ? item1.id === item2.id : item1 === item2; } } ``` ## For ConfigArgs [ConfigArgs](/reference/typescript-api/configurable-operation-def/config-args/) are used by classes which extend [Configurable Operations](/guides/developer-guide/strategies-configurable-operations/#configurable-operations) (such as ShippingCalculator or PaymentMethodHandler). These ConfigArgs allow user-input values to be passed to the operation's business logic. They are configured in a very similar way to custom fields, and likewise can use custom form inputs by specifying the `ui` property. Here's an example: ```ts title="src/config/order-fixed-discount-action.ts" export const orderFixedDiscount = new PromotionOrderAction({ code: 'order_fixed_discount', args: { discount: { type: 'int', // highlight-start ui: { component: 'currency-form-input', }, // highlight-end }, }, execute(ctx, order, args) { return -args.discount; }, description: [{languageCode: LanguageCode.en, value: 'Discount order by fixed amount'}], }); ```
--- title: 'Custom History Timeline Components' --- The Order & Customer detail pages feature a timeline of history entries. Since v1.9.0 it is possible to define custom history entry types - see the [HistoryService docs](/reference/typescript-api/services/history-service/) for an example. You can also define a custom Angular component to render any timeline entry using the [registerHistoryEntryComponent function](/reference/admin-ui-api/custom-history-entry-components/register-history-entry-component/). ![./timeline-entry.webp](./timeline-entry.webp) :::note Currently it is only possible to define new tabs using Angular components. ::: Following the example used in the HistoryService docs, we can define a component to render the tax ID verification entry in our Customer timeline: ```ts title="src/plugins/tax-id/ui/components/tax-id-history-entry/tax-id-history-entry.component.ts" import { Component } from '@angular/core'; import { CustomerFragment, CustomerHistoryEntryComponent, SharedModule, TimelineDisplayType, TimelineHistoryEntry, } from '@vendure/admin-ui/core'; @Component({ selector: 'tax-id-verification-entry', template: ` <div *ngIf="entry.data.valid"> Tax ID <strong>{{ entry.data.taxId }}</strong> was verified <vdr-history-entry-detail *ngIf="entry.data"> <vdr-object-tree [value]="entry.data"></vdr-object-tree> </vdr-history-entry-detail> </div> <div *ngIf="entry.data.valid">Tax ID {{ entry.data.taxId }} could not be verified</div> `, standalone: true, imports: [SharedModule], }) export class TaxIdHistoryEntryComponent implements CustomerHistoryEntryComponent { entry: TimelineHistoryEntry; customer: CustomerFragment; getDisplayType(entry: TimelineHistoryEntry): TimelineDisplayType { return entry.data.valid ? 'success' : 'error'; } getName(entry: TimelineHistoryEntry): string { return 'Tax ID Verification Plugin'; } isFeatured(entry: TimelineHistoryEntry): boolean { return true; } getIconShape(entry: TimelineHistoryEntry) { return entry.data.valid ? 'check-circle' : 'exclamation-circle'; } } ``` We can then register this component in the `providers.ts` file: ```ts title="src/plugins/tax-id/ui/providers.ts" import { registerHistoryEntryComponent } from '@vendure/admin-ui/core'; import { TaxIdHistoryEntryComponent } from './components/tax-id-history-entry/tax-id-history-entry.component'; export default [ registerHistoryEntryComponent({ type: 'CUSTOMER_TAX_ID_VERIFICATION', component: TaxIdHistoryEntryComponent, }), ]; ``` Then we need to add the `providers.ts` file to the `uiExtensions` array as described in the [UI Extensions Getting Started guide](/guides/extending-the-admin-ui/getting-started/).
--- title: 'Dashboard Widgets' --- Dashboard widgets are components which can be added to the Admin UI dashboard. These widgets are useful for displaying information which is commonly required by administrations, such as sales summaries, lists of incomplete orders, notifications, etc. The Admin UI comes with a handful of widgets, and you can also create your own widgets. ![Dashboard widgets](./dashboard-widgets.webp) :::note Currently it is only possible to define new widgets using Angular components. ::: ## Example: Reviews Widget In this example we will use a hypothetical reviews plugin, which allows customers to write product reviews. These reviews then get approved by an Administrator before being displayed in the storefront. To notify administrators about new reviews that need approval, we'll create a dashboard widget. ### Create the widget A dashboard widget is an Angular component. This example features a simplified UI, just to illustrate the overall structure: ```ts title="src/plugins/reviews/ui/components/reviews-widget/reviews-widget.component.ts" import { Component, OnInit } from '@angular/core'; import { DataService, SharedModule } from '@vendure/admin-ui/core'; import { Observable } from 'rxjs'; @Component({ selector: 'reviews-widget', template: ` <ul> <li *ngFor="let review of pendingReviews$ | async"> <a [routerLink]="['/extensions', 'product-reviews', review.id]">{{ review.summary }}</a> <span class="rating">{{ review.rating }} / 5</span> </li> </ul> `, standalone: true, imports: [SharedModule], }) export class ReviewsWidgetComponent implements OnInit { pendingReviews$: Observable<any[]>; constructor(private dataService: DataService) {} ngOnInit() { this.pendingReviews$ = this.dataService.query(gql` query GetAllReviews($options: ProductReviewListOptions) { productReviews(options: $options) { items { id createdAt authorName summary rating } } }`, { options: { filter: { state: { eq: 'new' } }, take: 10, }, }) .mapStream(data => data.productReviews.items); } } ``` :::note We also need to define an `NgModule` for this component. This is because we will be lazy-loading the component at run-time, and the NgModule is required for us to use shared providers (e.g. `DataService`) and any shared components, directives or pipes defined in the `@vendure/admin-ui/core` package. ::: ### Register the widget Our widget now needs to be registered in our [providers file](/guides/extending-the-admin-ui/getting-started/#providers): ```ts title="src/plugins/reviews/ui/providers.ts" import { registerDashboardWidget } from '@vendure/admin-ui/core'; export default [ // highlight-start registerDashboardWidget('reviews', { title: 'Latest reviews', supportedWidths: [4, 6, 8, 12], requiresPermissions: ['ReadReview'], loadComponent: () => import('./reviews-widget/reviews-widget.component').then( m => m.ReviewsWidgetComponent, ), }), // highlight-end ]; ``` * **`title`** This is the title of the widget that will be displayed in the widget header. * **`supportedWidths`** This indicated which widths are supported by the widget. The number indicates columns in a Bootstrap-style 12-column grid. So `12` would be full-width, `6` half-width, etc. In the UI, the administrator will be able to re-size the widget to one of the supported widths. If not provided, all widths will be allowed. * **`requiresPermissions`** This allows an array of Permissions to be specified which limit the display of the widget to administrators who possess all of those permissions. If not provided, all administrators will be able to use the widget. * **`loadComponent`** This function defines how to load the component. Using the dynamic `import()` syntax will enable the Angular compiler to intelligently generate a lazy-loaded JavaScript bundle just for that component. This means that your widget can, for example, include 3rd-party dependencies (such as a charting library) without increasing the bundle size (and therefore load-times) of the main Admin UI app. The widget-specific code will _only_ be loaded when the widget is rendered on the dashboard. Once registered, the reviews widget will be available to select by administrators with the appropriate permissions. ## Setting the default widget layout While administrators can customize which widgets they want to display on the dashboard, and the layout of those widgets, you can also set a default layout: ```ts title="src/plugins/reviews/ui/providers.ts" import { registerDashboardWidget, setDashboardWidgetLayout } from '@vendure/admin-ui/core'; export default [ registerDashboardWidget('reviews', { // omitted for brevity }), // highlight-start setDashboardWidgetLayout([ { id: 'welcome', width: 12 }, { id: 'orderSummary', width: 4 }, { id: 'latestOrders', width: 8 }, { id: 'reviews', width: 6 }, ]), // highlight-end ]; ``` This defines the order of widgets with their default widths. The actual layout in terms of rows and columns will be calculated at run-time based on what will fit on each row. ## Overriding default widgets The Admin UI comes with a set of default widgets, such as the order summary and latest orders widgets (they can be found in [the default-widgets.ts file](https://github.com/vendure-ecommerce/vendure/blob/master/packages/admin-ui/src/lib/dashboard/src/default-widgets.ts)). Sometimes you may wish to alter the permissions settings of the default widgets to better control which of your Administrators is able to access it. For example, the "order summary" widget has a default permission requirement of "ReadOrder". If you want to limit the availability to e.g. the SuperAdmin role, you can do so by overriding the definition like this: ```ts title="src/plugins/reviews/ui/providers.ts" import { registerDashboardWidget } from '@vendure/admin-ui/core'; import { OrderSummaryWidgetComponent } from '@vendure/admin-ui/dashboard'; export default [ // highlight-start registerDashboardWidget('orderSummary', { title: 'dashboard.orders-summary', loadComponent: () => OrderSummaryWidgetComponent, requiresPermissions: ['SuperAdmin'], }), // highlight-end ]; ```
--- title: 'Defining routes' --- import Tabs from '@theme/Tabs'; import TabItem from '@theme/TabItem'; Routes allow you to mount entirely custom components at a given URL in the Admin UI. New routes will appear in this area of the Admin UI: ![Route area](./route-area.webp) Routes can be defined natively using either **Angular** or **React**. It is also possible to [use other frameworks](/guides/extending-the-admin-ui/using-other-frameworks/) in a more limited capacity. ## Example: Creating a "Greeter" route ### 1. Create the route component First we need to create the component which will be mounted at the route. This component can be either an Angular component or a React component. <Tabs groupId="framework"> <TabItem value="Angular" label="Angular" default> ```ts title="src/plugins/greeter/ui/components/greeter/greeter.component.ts" import { SharedModule } from '@vendure/admin-ui/core'; import { Component } from '@angular/core'; @Component({ selector: 'greeter', template: ` <vdr-page-block> <h2>{{ greeting }}</h2> </vdr-page-block>`, standalone: true, imports: [SharedModule], }) export class GreeterComponent { greeting = 'Hello!'; } ``` </TabItem> <TabItem value="React" label="React"> ```ts title="src/plugins/greeter/ui/components/Greeter.tsx" import React from 'react'; export function Greeter() { const greeting = 'Hello!'; return ( <div className="page-block"> <h2>{greeting}</h2> </div> ); } ``` </TabItem> </Tabs> :::note The `<vdr-page-block>` (Angular) and `<div className="page-block">` (React) is a wrapper that sets the layout and max width of your component to match the rest of the Admin UI. You should usually wrap your component in this element. ::: ### 2. Define the route Next we need to define a route in our `routes.ts` file. Note that this file can have any name, but "routes.ts" is a convention. <Tabs groupId="framework"> <TabItem value="Angular" label="Angular" default> Using [`registerRouteComponent`](/reference/admin-ui-api/routes/register-route-component) you can define a new route based on an Angular component. ```ts title="src/plugins/greeter/ui/routes.ts" import { registerRouteComponent } from '@vendure/admin-ui/core'; import { GreeterComponent } from './components/greeter/greeter.component'; export default [ registerRouteComponent({ component: GreeterComponent, path: '', title: 'Greeter Page', breadcrumb: 'Greeter', }), ]; ``` </TabItem> <TabItem value="React" label="React"> Here's the equivalent example using React and [`registerReactRouteComponent`](/reference/admin-ui-api/react-extensions/register-react-route-component): ```ts title="src/plugins/greeter/ui/routes.ts" import { registerReactRouteComponent } from '@vendure/admin-ui/react'; import { Greeter } from './components/Greeter'; export default [ registerReactRouteComponent({ component: Greeter, path: '', title: 'Greeter Page', breadcrumb: 'Greeter', }), ]; ``` </TabItem> </Tabs> The `path: ''` is actually optional, since `''` is the default value. But this is included here to show that you can mount different components at different paths. See the section on route parameters below. ### 3. Add the route to the extension config Now we need to add this routes file to our extension definition: ```ts title="src/vendure-config.ts" import { VendureConfig } from '@vendure/core'; import { AdminUiPlugin } from '@vendure/admin-ui-plugin'; import { compileUiExtensions } from '@vendure/ui-devkit/compiler'; import * as path from 'path'; export const config: VendureConfig = { // ... plugins: [ AdminUiPlugin.init({ port: 3002, app: compileUiExtensions({ outputPath: path.join(__dirname, '../admin-ui'), extensions: [ { id: 'greeter', extensionPath: path.join(__dirname, 'plugins/greeter/ui'), // highlight-start routes: [{ route: 'greet', filePath: 'routes.ts' }], // highlight-end }, ], }), }), ], }; ``` Note that by specifying `route: 'greet'`, we are "mounting" the routes at the `/extensions/greet` path. :::info The `/extensions/` prefix is used to avoid conflicts with built-in routes. From Vendure v2.2.0 it is possible to customize this prefix using the `prefix` property. See the section on [overriding built-in routes](#overriding-built-in-routes) for more information. ::: The `filePath` property is relative to the directory specified in the `extensionPath` property. In this case, the `routes.ts` file is located at `src/plugins/greeter/ui/routes.ts`. Now go to the Admin UI app in your browser and log in. You should now be able to manually enter the URL `http://localhost:3000/admin/extensions/greet` and you should see the component with the "Hello!" header: ![./ui-extensions-greeter.webp](./ui-extensions-greeter.webp) ## Links To link to other routes, you must use the `routerLink` directive for Angular, or the `Link` component for React: <Tabs groupId="framework"> <TabItem value="Angular" label="Angular" default> ```html <a class="button-ghost" [routerLink]="['/extensions/my-plugin/my-custom-route']"> John Smith </a> ``` </TabItem> <TabItem value="React" label="React"> ```tsx import React from 'react'; import { Link } from '@vendure/admin-ui/react'; export function DemoComponent() { return ( <Link className="button-ghost" href="/extensions/my-plugin/my-custom-route"> John Smith </Link> ); } ``` </TabItem> </Tabs> ## Route parameters The `path` property is used to specify the path to a specific component. This path can contain parameters, which will then be made available to the component. Parameters are defined using the `:` prefix. For example: <Tabs groupId="framework"> <TabItem value="Angular" label="Angular" default> ```ts title="src/plugins/my-plugin/ui/routes.ts" import { registerRouteComponent } from '@vendure/admin-ui/core'; import { TestComponent } from './components/test/test.component'; export default [ registerRouteComponent({ component: TestComponent, // highlight-next-line path: ':id', title: 'Test', breadcrumb: 'Test', }), ]; ``` </TabItem> <TabItem value="React" label="React"> ```ts title="src/plugins/my-plugin/ui/routes.ts" import { registerReactRouteComponent } from '@vendure/admin-ui/react'; import { Test } from './components/Test'; export default [ registerReactRouteComponent({ component: Test, // highlight-next-line path: ':id', title: 'Test', breadcrumb: 'Test', }), ]; ``` </TabItem> </Tabs> The `id` parameter will then be available in the component: <Tabs groupId="framework"> <TabItem value="Angular" label="Angular" default> ```ts title="src/plugins/my-plugin/ui/components/test/test.component.ts" import { SharedModule } from '@vendure/admin-ui/core'; import { Component } from '@angular/core'; import { ActivatedRoute } from '@angular/router'; @Component({ selector: 'test', template: ` <vdr-page-block> // highlight-next-line <p>id: {{ id }}</p> </vdr-page-block>`, standalone: true, imports: [SharedModule], }) export class TestComponent { id: string; constructor(private route: ActivatedRoute) { // highlight-next-line this.id = this.route.snapshot.paramMap.get('id'); } } ``` </TabItem> <TabItem value="React" label="React"> ```tsx title="src/plugins/my-plugin/ui/components/Test.tsx" import React from 'react'; import { useRouteParams } from '@vendure/admin-ui/react'; export function Test() { // highlight-next-line const { params } = useRouteParams(); return ( <div className="page-block"> // highlight-next-line <p>id: {params.id}</p> </div> ); } ``` </TabItem> </Tabs> Loading the route `/extensions/test/123` will then display the id "123". ## Injecting services It is possible to inject services into your components. This includes both the [built-in services](/reference/admin-ui-api/services/) for things like data fetching, notifications and modals, as well as any custom services you have defined in your UI extension. Here's an example of injecting the built-in `NotificationService` into a component to display a toast notification: <Tabs groupId="framework"> <TabItem value="Angular" label="Angular" default> In Angular, we can use either the constructor to inject the service (as shown below), or the `inject()` function. See the [Angular dependency injection guide](https://angular.io/guide/dependency-injection#injecting-a-dependency) for more information. ```ts title="src/plugins/my-plugin/ui/components/test/test.component.ts" import { SharedModule, NotificationService } from '@vendure/admin-ui/core'; import { Component } from '@angular/core'; @Component({ selector: 'test', template: ` <vdr-page-block> <button class="button primary" (click)="showNotification()">Click me</button> </vdr-page-block>`, standalone: true, imports: [SharedModule], }) export class TestComponent { // highlight-next-line constructor(private notificationService: NotificationService) {} showNotification() { // highlight-next-line this.notificationService.success('Hello!'); } } ``` </TabItem> <TabItem value="React" label="React"> In React, we use the [`useInjector()`](/reference/admin-ui-api/react-hooks/use-injector) hook to inject the service: ```tsx title="src/plugins/my-plugin/ui/components/Test.tsx" import { NotificationService } from '@vendure/admin-ui/core'; // highlight-next-line import { useInjector } from '@vendure/admin-ui/react'; import React from 'react'; export function Test() { // highlight-next-line const notificationService = useInjector(NotificationService); function showNotification() { // highlight-next-line notificationService.success('Hello!'); } return ( <div className="page-block"> <button className="button primary" onClick={showNotification}>Click me</button> </div> ); } ``` </TabItem> </Tabs> ## Setting page title The `title` property is used to set the page title. This is displayed in the browser tab as well as in the page header. ### In the route definition The page title can be set in the route definition: <Tabs groupId="framework"> <TabItem value="Angular" label="Angular" default> ```ts title="src/plugins/my-plugin/ui/routes.ts" import { registerRouteComponent } from '@vendure/admin-ui/core'; import { TestComponent } from './components/test/test.component'; export default [ registerRouteComponent({ component: TestComponent, // highlight-next-line title: 'Test', breadcrumb: 'Test', }), ]; ``` </TabItem> <TabItem value="React" label="React"> ```ts title="src/plugins/my-plugin/ui/routes.ts" import { registerReactRouteComponent } from '@vendure/admin-ui/react'; import { Test } from './components/Test'; export default [ registerReactRouteComponent({ component: Test, // highlight-next-line title: 'Test', breadcrumb: 'Test', }), ]; ``` </TabItem> </Tabs> ### Dynamically from the component It is also possible to update the page title dynamically from the route component itself: <Tabs groupId="framework"> <TabItem value="Angular" label="Angular" default> ```ts title="src/plugins/my-plugin/ui/components/test/test.component.ts" import { PageMetadataService, SharedModule } from '@vendure/admin-ui/core'; import { Component } from '@angular/core'; @Component({ selector: 'test', template: ` <vdr-page-block> <vdr-card> // highlight-next-line <button class="button primary" (click)="handleClick()">Update title</button> </vdr-card> </vdr-page-block>`, standalone: true, imports: [SharedModule], }) export class TestComponent { // highlight-next-line constructor(private pageMetadataService: PageMetadataService) {} handleClick() { // highlight-next-line pageMetadataService.setTitle('New title'); } } ``` </TabItem> <TabItem value="React" label="React"> ```tsx title="src/plugins/my-plugin/ui/components/Test.tsx" import { Card, usePageMetadata } from '@vendure/admin-ui/react'; import React from 'react'; export function Test() { // highlight-next-line const { setTitle } = usePageMetadata(); function handleClick() { // highlight-next-line setTitle('New title'); } return ( <div className="page-block"> <Card> <button className="button primary" onClick={handleClick}> Update title </button> </Card> </div> ); } ``` </TabItem> </Tabs> ## Setting breadcrumbs ### In the route definition The page breadcumbs can be set in the route definition in a couple of ways. The simplest is to specify the `breadcumb` property: <Tabs groupId="framework"> <TabItem value="Angular" label="Angular" default> ```ts title="src/plugins/my-plugin/ui/routes.ts" import { registerRouteComponent } from '@vendure/admin-ui/core'; import { TestComponent } from './components/test/test.component'; export default [ registerRouteComponent({ component: TestComponent, title: 'Test', // highlight-next-line breadcrumb: 'Test', }), ]; ``` </TabItem> <TabItem value="React" label="React"> ```ts title="src/plugins/my-plugin/ui/routes.ts" import { registerReactRouteComponent } from '@vendure/admin-ui/react'; import { Test } from './components/Test'; export default [ registerReactRouteComponent({ component: Test, title: 'Test', // highlight-next-line breadcrumb: 'Test', }), ]; ``` </TabItem> </Tabs> This can be a string (as above), a link/label pair, or an array of link/label pairs: ```ts title="src/plugins/my-plugin/ui/routes.ts" import { registerRouteComponent } from '@vendure/admin-ui/core'; import { TestComponent } from './components/test/test.component'; export default [ registerRouteComponent({ component: TestComponent, path: 'test-1', title: 'Test 1', // highlight-start breadcrumb: { label: 'Test', link: '/extensions/test' }, // highlight-end }), registerRouteComponent({ component: TestComponent, path: 'test-2', title: 'Test 2', // highlight-start breadcrumb: [ { label: 'Parent', link: '/extensions/test' }, { label: 'Child', link: '/extensions/test/test-2' }, ], // highlight-end }), ]; ``` A more powerful way to set the breadcrumbs is by using the `getBreadcrumbs` property. This is a function that receives any resolved detail data and returns an array of link/label pairs. An example of its use can be seen in the [Creating detail views guide](/guides/extending-the-admin-ui/creating-detail-views/#route-config). ### Dynamically from the component Similar to setting the title, the breadcrumbs can also be updated dynamically from the route component itself: <Tabs groupId="framework"> <TabItem value="Angular" label="Angular" default> ```ts title="src/plugins/my-plugin/ui/components/test/test.component.ts" import { PageMetadataService, SharedModule } from '@vendure/admin-ui/core'; import { Component } from '@angular/core'; @Component({ selector: 'test', template: ` <vdr-page-block> <vdr-card> // highlight-next-line <button class="button primary" (click)="handleClick()">Update breadcrumb</button> </vdr-card> </vdr-page-block>`, standalone: true, imports: [SharedModule], }) export class TestComponent { // highlight-next-line constructor(private pageMetadataService: PageMetadataService) {} handleClick() { // highlight-next-line pageMetadataService.setBreadcrumb('New breadcrumb'); } } ``` </TabItem> <TabItem value="React" label="React"> ```tsx title="src/plugins/my-plugin/ui/components/Test.tsx" import { Card, usePageMetadata } from '@vendure/admin-ui/react'; import React from 'react'; export function Test() { // highlight-next-line const { setBreadcrumb } = usePageMetadata(); function handleClick() { // highlight-next-line setBreadcrumb('New breadcrumb'); } return ( <div className="page-block"> <Card> <button className="button primary" onClick={handleClick}> Update title </button> </Card> </div> ); } ``` </TabItem> </Tabs> ## Overriding built-in routes From Vendure v2.2.0, it is possible to override any of the built-in Admin UI routes. This is useful if you want to completely replace a built-in route with your own custom component. To do so, you'll need to specify the route `prefix` to be `''`, and then specify a `route` property which matches a built-in route. For example, let's say we want to override the product detail page. The full path of that route is: ``` /catalog/products/:id ``` ```ts title="src/vendure-config.ts" import { VendureConfig } from '@vendure/core'; import { AdminUiPlugin } from '@vendure/admin-ui-plugin'; import { compileUiExtensions } from '@vendure/ui-devkit/compiler'; import * as path from 'path'; export const config: VendureConfig = { // ... plugins: [ AdminUiPlugin.init({ port: 3002, app: compileUiExtensions({ outputPath: path.join(__dirname, '../admin-ui'), extensions: [ { id: 'my-plugin', extensionPath: path.join(__dirname, 'plugins/my-plugin/ui'), routes: [ { // Setting the prefix to '' means that we won't add the // default `/extensions/` prefix to the route prefix: '', // This part matches the built-in route path for the // "catalog" module route: 'catalog', filePath: 'routes.ts', }, ], }, ], }), }), ], }; ``` Then in the `routes.ts` file, you can define a route which matches the built-in route: <Tabs groupId="framework"> <TabItem value="Angular" label="Angular" default> ```ts title="src/plugins/my-plugin/ui/routes.ts" import { GetProductDetailDocument, registerRouteComponent } from '@vendure/admin-ui/core'; import { MyProductDetailComponent } from './components/product-detail/product-detail.component'; export default [ registerRouteComponent({ component: MyProductDetailComponent, // The path must then match the remainder // of the built-in route path path: 'products/:id', // We can re-use the GraphQL query from the core to get // access to the same data in our component query: GetProductDetailDocument, entityKey: 'product', getBreadcrumbs: entity => [ { label: 'breadcrumb.products', link: ['/catalog/products'] }, { label: entity?.name ?? 'catalog.create-new-product', link: ['.'] }, ], }), ]; ``` </TabItem> <TabItem value="React" label="React"> ```ts title="src/plugins/my-plugin/ui/routes.ts" import { GetProductDetailDocument } from '@vendure/admin-ui/core'; import { registerReactRouteComponent } from '@vendure/admin-ui/react'; import { MyProductDetail } from './components/ProductDetail'; export default [ registerReactRouteComponent({ component: MyProductDetail, // The path must then match the remainder // of the built-in route path path: 'products/:id', // We can re-use the GraphQL query from the core to get // access to the same data in our component query: GetProductDetailDocument, entityKey: 'product', getBreadcrumbs: entity => [ { label: 'breadcrumb.products', link: ['/catalog/products'] }, { label: entity?.name ?? 'catalog.create-new-product', link: ['.'] }, ], }), ]; ``` </TabItem> </Tabs> ## Advanced configuration The Admin UI app routing is built on top of the [Angular router](https://angular.io/guide/routing-overview) - a very advanced and robust router. As such, you are able to tap into all the advanced features it provides by using the `routeConfig` property, which takes an Angular [`Route` definition object](https://angular.io/api/router/Route) and passes it directly to the router. ```ts title="src/plugins/my-plugin/ui/routes.ts" import { registerRouteComponent } from '@vendure/admin-ui/core'; import { inject } from '@angular/core'; import { ActivatedRouteSnapshot } from '@angular/router'; import { TestComponent } from './components/test/test.component'; import { PermissionsService } from './services'; export default [ registerRouteComponent({ component: TestComponent, path: ':id', title: 'Test', breadcrumb: 'Test', // highlight-start routeConfig: { pathMatch: 'full', canActivate: [(route: ActivatedRouteSnapshot) => { return inject(PermissionsService).canActivate(route.params.id); }], }, // highlight-end }), ]; ``` This allows you to leverage advanced features such as: - [Route guards](https://angular.io/api/router/CanActivateFn) - [Data resolvers](https://angular.io/api/router/ResolveFn) - [Nested routes](https://angular.io/guide/router#nesting-routes) - [Redirects](https://angular.io/guide/router#setting-up-redirects)
--- title: 'Getting Started' --- import Tabs from '@theme/Tabs'; import TabItem from '@theme/TabItem'; When creating a plugin, you may wish to extend the Admin UI in order to expose a graphical interface to the plugin's functionality, or to add new functionality to the Admin UI itself. The UI can be extended with custom components written in [Angular](https://angular.io/) or [React](https://react.dev/). :::note The APIs described in this section were introduced in Vendure v2.1.0. For the legacy APIs, see the [Legacy API section](#legacy-api--v210). ::: UI extensions fall into two categories: - **Providers**: these are used to add new functionality to the Admin UI, such as adding buttons to pages, adding new nav menu items, or defining custom form inputs. They would typically be defined in a file named `providers.ts`. - **Routes**: these are used to define new pages in the Admin UI, such as a new page for managing a custom entity. They would typically be defined in a file named `routes.ts`. ## Setup :::cli Use `npx vendure add` and select "Set up Admin UI extensions". Then follow the prompts, which will guide you through the process of setting up the necessary files and folders for your UI extensions. ::: ### Manual setup It is recommended to use the `vendure add` command as described above, but if you prefer to set up the Admin UI extensions manually, follow these steps: First, install the [`@vendure/ui-devkit` package](https://www.npmjs.com/package/@vendure/ui-devkit) as a dev dependency: <Tabs> <TabItem value="npm" label="npm" default> ```bash npm install --save-dev @vendure/ui-devkit ``` </TabItem> <TabItem value="yarn" label="yarn"> ```bash yarn add --dev @vendure/ui-devkit ``` </TabItem> </Tabs> You can then create the following folder structure to hold your UI extensions: ``` src ├── vendure-config.ts └── plugins └── my-plugin └── ui ├── routes.ts └── providers.ts ``` Let's add a simple UI extension that adds a new button to the "order list" page. We'll leave the routes file empty for now. ```ts title="src/plugins/my-plugin/ui/providers.ts" import { addActionBarItem } from '@vendure/admin-ui/core'; export default [ addActionBarItem({ id: 'test-button', label: 'Test Button', locationId: 'order-list', }), ]; ``` You can then use the [`compileUiExtensions` function](/reference/admin-ui-api/ui-devkit/compile-ui-extensions/) to compile your UI extensions and add them to the Admin UI app bundle. ```ts title="src/vendure-config.ts" import { VendureConfig } from '@vendure/core'; import { AdminUiPlugin } from '@vendure/admin-ui-plugin'; // highlight-next-line import { compileUiExtensions } from '@vendure/ui-devkit/compiler'; import * as path from 'path'; export const config: VendureConfig = { // ... plugins: [ AdminUiPlugin.init({ port: 3002, // highlight-start app: compileUiExtensions({ outputPath: path.join(__dirname, '../admin-ui'), extensions: [ { id: 'test-extension', extensionPath: path.join(__dirname, 'plugins/my-plugin/ui'), providers: ['providers.ts'], }, ], devMode: true, }), // highlight-end adminUiConfig: { apiPort: 3000, }, }), ], }; ``` Now when you start the server, the following will happen: 1. A new folder called `admin-ui` will be created in the root of your project (as specified by the `outputPath` option). This is a temporary directory (it should not be added to version control) which will contain the source files of your custom Admin UI app. 2. During bootstrap, the `compileUiExtensions` function will be called, which will compile the Admin UI app and serve it in development mode. The dev server will be listening on port `4200` but this port will also be proxied to port `3000` (as specified by `apiOptions.port`). This step can take up to a minute or two, depending on the speed of your machine. :::caution **Note:** the TypeScript source files of your UI extensions **must not** be compiled by your regular TypeScript build task. This is because they will instead be compiled by the Angular compiler when you run `compileUiExtensions()`. You can exclude them in your main `tsconfig.json` by adding a line to the "exclude" array: ```json title="tsconfig.json" { "exclude": [ "node_modules", "migration.ts", // highlight-start "src/plugins/**/ui/*", "admin-ui" // highlight-end ] } ``` ::: :::info **How It Works:** The Admin UI is an Angular application, and to generate a custom UI including your extensions, it is internally using the powerful [Angular CLI](https://angular.io/cli) to compile the app into an optimized bundle, including code-splitting and lazy-loading any routes which you define. ::: ## Providers Your `providers.ts` file exports an array of objects known as "providers" in Angular terminology. These providers are passed to the application on startup to configure new functionality. With providers you can: - Add new buttons to the action bar of existing pages (the top bar containing the primary actions for a page) using [`addActionBarItem`](/reference/admin-ui-api/action-bar/add-action-bar-item). - Add new menu items to the left-hand navigation menu using [`addNavMenuItem`](/reference/admin-ui-api/nav-menu/add-nav-menu-item) and [`addNavMenuSection`](/reference/admin-ui-api/nav-menu/add-nav-menu-section). - Define bulk actions for list views using [`registerBulkAction`](/reference/admin-ui-api/bulk-actions/register-bulk-action). - Define arbitrary components to be rendered in a detail view page using [`registerCustomDetailComponent`](/reference/admin-ui-api/custom-detail-components/register-custom-detail-component) or [`registerReactCustomDetailComponent`](/reference/admin-ui-api/react-extensions/register-react-custom-detail-component) - Add custom widgets to the dashboard using [`registerDashboardWidget`](/reference/admin-ui-api/dashboard-widgets/register-dashboard-widget) - Define custom components for rendering data table cells using [`registerDataTableComponent`](/reference/admin-ui-api/custom-table-components/register-data-table-component) or [`registerReactDataTableComponent`](/reference/admin-ui-api/react-extensions/register-react-data-table-component) - Define custom form input components for custom fields and configurable operation arguments using [`registerFormInputComponent`](/reference/admin-ui-api/custom-input-components/register-form-input-component) or [`registerReactFormInputComponent`](/reference/admin-ui-api/react-extensions/register-react-form-input-component) - Define custom components to render customer/order history timeline entries using [`registerHistoryEntryComponent`](/reference/admin-ui-api/custom-history-entry-components/register-history-entry-component) ### Providers format A providers file should have a **default export** which is an array of providers: ```ts title="src/plugins/my-plugin/ui/providers.ts" import { addActionBarItem } from '@vendure/admin-ui/core'; export default [ addActionBarItem({ id: 'test-button', label: 'Test Button', locationId: 'order-list', }), ]; ``` ### Specifying providers When defining UI extensions in the `compileUiExtensions()` function, you must specify at least one providers file. This is done by passing an array of file paths, where each file path is relative to the directory specified by the `extensionPath` option. ```ts title="src/vendure-config.ts" import { compileUiExtensions } from '@vendure/ui-devkit/compiler'; import * as path from 'path'; // ... omitted for brevity compileUiExtensions({ outputPath: path.join(__dirname, '../admin-ui'), extensions: [ { id: 'test-extension', extensionPath: path.join(__dirname, 'plugins/my-plugin/ui'), // highlight-next-line providers: ['providers.ts'], }, ], devMode: true, }); ``` :::info When running the Admin UI in dev mode, you can use the `ctrl + u` keyboard shortcut to see the location of all UI extension points. Clicking on an extension point will display a code snippet which you can copy and paste into your `providers.ts` file. ![Provider extension points](./provider-extension-points.webp) ::: In addition to the specialized UI extension providers listed above, the providers array can also contain any kind of Angular providers which you want to use inside your custom logic. For example, we can define a custom service, add it to the providers array and then consume it from within another provider: ```ts title="src/plugins/my-plugin/ui/providers.ts" import { Injectable } from '@angular/core'; import { addActionBarItem } from '@vendure/admin-ui/core'; // highlight-start @Injectable() class MyService { greet() { return 'Hello!'; } } // highlight-end export default [ MyService, addActionBarItem({ id: 'print-invoice', label: 'Print invoice', locationId: 'order-detail', onClick: (event, context) => { // highlight-start const myService = context.injector.get(MyService); console.log(myService.greet()); // logs "Hello!" // highlight-end }, }), ]; ``` ## Routes Routes allow you to define completely custom views in the Admin UI. ![Custom route](../defining-routes/route-area.webp) Your `routes.ts` file exports an array of objects which define new routes in the Admin UI. For example, imagine you have created a plugin which implements a simple content management system. You can define a route for the list of articles, and another for the detail view of an article. For a detailed instructions, see the [Defining Routes guide](/guides/extending-the-admin-ui/defining-routes/). ## Dev vs Prod mode When you are developing your Admin UI extension, you can set the `devMode` option to `true` which will compile the Admin UI app in development mode, and recompile and auto-refresh the browser on any changes to your extension source files. ```ts title="src/vendure-config.ts" import { VendureConfig } from '@vendure/core'; import { AdminUiPlugin } from '@vendure/admin-ui-plugin'; import { compileUiExtensions } from '@vendure/ui-devkit/compiler'; import * as path from 'path'; export const config: VendureConfig = { // ... plugins: [ AdminUiPlugin.init({ port: 3002, app: compileUiExtensions({ outputPath: path.join(__dirname, '../admin-ui'), extensions: [ { // ... }, ], devMode: true, }), }), ], }; ``` ## Compiling as a deployment step Although the examples so far all use the `compileUiExtensions` function in conjunction with the AdminUiPlugin, it is also possible to use it on its own: ```ts title="src/compile-admin-ui.ts" import { compileUiExtensions } from '@vendure/ui-devkit/compiler'; import * as path from 'path'; compileUiExtensions({ outputPath: path.join(__dirname, '../admin-ui'), extensions: [ /* ... */ ], }) .compile?.() .then(() => { process.exit(0); }); ``` This can then be run from the command line: <Tabs> <TabItem value="npm" label="npm" default> ```bash npm run ts-node compile-admin-ui.ts ``` </TabItem> <TabItem value="yarn" label="yarn"> ```bash yarn ts-node compile-admin-ui.ts ``` </TabItem> </Tabs> Once complete, the production-ready app bundle will be output to `admin-ui/dist`. This method is suitable for a production setup, so that the Admin UI can be compiled ahead-of-time as part of your deployment process. This ensures that your Vendure server starts up as quickly as possible. In this case, you can pass the path of the compiled app to the AdminUiPlugin: ```ts title="src/vendure-config.ts" import { VendureConfig } from '@vendure/core'; import { AdminUiPlugin } from '@vendure/admin-ui-plugin'; import * as path from 'path'; export const config: VendureConfig = { // ... plugins: [ AdminUiPlugin.init({ port: 3002, app: { path: path.join(__dirname, '../admin-ui/dist'), }, }), ], }; ``` :::info To compile the angular app ahead of time (for production) and copy the dist folder to Vendure's output dist folder, include the following commands in your packages.json scripts: ```json { "scripts": { "copy": "npx copyfiles -u 1 'src/__admin-ui/dist/**/*' dist", "build": "tsc && yarn copy", "build:admin": "rimraf admin-ui && npx ts-node src/compile-admin-ui.ts" } } ``` "build:admin" will remove the admin-ui folder and run the compileUiExtensions function to generate the admin-ui Angular app. Make sure to install copyfiles before running the "copy" command: <Tabs> <TabItem value="npm" label="npm" default> ```bash npm install copyfiles ``` </TabItem> <TabItem value="yarn" label="yarn"> ```bash yarn add copyfiles ``` </TabItem> </Tabs> ::: ## Using other frameworks While the Admin UI natively supports extensions written with Angular or React, it is still possible to create extensions using other front-end frameworks such as Vue or Solid. Note that creating extensions in this way is much more limited, with only the ability to define new routes, and limited access to internal services such as data fetching and notifications. See [UI extensions in other frameworks](/guides/extending-the-admin-ui/using-other-frameworks/). ## IDE Support ### WebStorm If you are using Angular in your UI extensions and WebStorm is not recognizing the Angular templates, you can add an `angular.json` file to the `/src/plugins/<my-plugin>/ui` directory: ```json title="angular.json" { "$schema": "../../../../node_modules/@angular/cli/lib/config/schema.json", "version": 1, "newProjectRoot": "projects", "projects": { "ui-extensions": { "root": "", "sourceRoot": "src", "projectType": "application" } } } ``` This allows WebStorm's built-in Angular support to recognize the Angular templates in your UI extensions. Note that depending on your folder structure, you may need to adjust the path to the schema file in the `$schema` property. ### VS Code If you are using Angular in your UI extensions and VS Code is not recognizing the Angular templates, you can add an empty `tsconfig.json` file to the `/src/plugins/<my-plugin>/ui` directory: ```json title="tsconfig.json" {} ``` This works around the fact that your main `tsconfig.json` file excludes the `src/plugins/**/ui` directory, which would otherwise prevent the Angular Language Service from working correctly. ## Legacy API < v2.1.0 Prior to Vendure v2.1.0, the API for extending the Admin UI was more verbose and less flexible (React components were not supported at all, for instance). This API is still supported, but from v2.1 is marked as deprecated and will be removed in a future major version. This section describes the legacy API. ### Lazy vs Shared Modules Angular uses the concept of modules ([NgModules](https://angular.io/guide/ngmodules)) for organizing related code. These modules can be lazily loaded, which means that the code is not loaded when the app starts, but only later once that code is required. This keeps the main bundle small and improves performance. When creating your UI extensions, you can set your module to be either `lazy` or `shared`. Shared modules are loaded _eagerly_, i.e. their code is bundled up with the main app and loaded as soon as the app loads. As a rule, modules defining new routes should be lazily loaded (so that the code is only loaded once that route is activated), and modules defining [new navigations items](/guides/extending-the-admin-ui/nav-menu/) and [custom form input](/guides/extending-the-admin-ui/custom-form-inputs/) should be set to `shared`. :::info "lazy" modules are equivalent to the new "routes" API, and "shared" modules are equivalent to the new "providers" API. In fact, behind the scenes, the new APIs are automatically creating these modules for you. ::: ### Example lazy module Here's a very simple Angular component which displays a greeting: ```ts title="src/plugins/greeter/ui/components/greeter/greeter.component.ts" import { Component } from '@angular/core'; @Component({ selector: 'greeter', template: `<vdr-page-block><h1>{{ greeting }}</h1></vdr-page-block>`, }) export class GreeterComponent { greeting = 'Hello!'; } ``` Next we need to declare an Angular module to house the component: ```ts title="src/plugins/greeter/ui/greeter.module.ts" import { NgModule } from '@angular/core'; import { RouterModule } from '@angular/router'; import { SharedModule } from '@vendure/admin-ui/core'; import { GreeterComponent } from './greeter.component'; @NgModule({ imports: [ SharedModule, RouterModule.forChild([{ path: '', pathMatch: 'full', component: GreeterComponent, data: { breadcrumb: 'Greeter' }, }]), ], declarations: [GreeterComponent], }) export class GreeterModule {} ``` :::note The `SharedModule` should, in general, always be imported by your extension modules. It provides the basic Angular directives and other common functionality that any extension would require. ::: Now we need to tell the `compileUiExtensions` function where to find the extension, and which file contains the NgModule itself (since a non-trivial UI extension will likely contain multiple files). ```ts title="src/vendure-config.ts" import path from 'path'; import { AdminUiPlugin } from '@vendure/admin-ui-plugin'; import { VendureConfig } from '@vendure/core'; import { compileUiExtensions } from '@vendure/ui-devkit/compiler'; export const config: VendureConfig = { // ... plugins: [ AdminUiPlugin.init({ port: 3002, app: compileUiExtensions({ outputPath: path.join(__dirname, '../admin-ui'), extensions: [{ extensionPath: path.join(__dirname, 'plugins/greeter/ui'), // highlight-start ngModules: [{ type: 'lazy', route: 'greet', ngModuleFileName: 'greeter.module.ts', ngModuleName: 'GreeterModule', }], // highlight-end }], }), }), ], }; ``` ### Example shared module Here's an example of the legacy API for defining a shared module: ```ts title="src/plugins/invoices/ui/invoice-shared.module.ts" import { NgModule } from '@angular/core'; import { SharedModule, addActionBarItem } from '@vendure/admin-ui/core'; @NgModule({ imports: [SharedModule], providers: [ addActionBarItem({ id: 'print-invoice', label: 'Print invoice', locationId: 'order-detail', routerLink: route => { const id = route.snapshot.params.id; return ['./extensions/order-invoices', id]; }, requiresPermission: 'ReadOrder', }), ], }) export class InvoiceSharedModule {} ``` ```ts title="src/vendure-config.ts" import path from 'path'; import { AdminUiPlugin } from '@vendure/admin-ui-plugin'; import { VendureConfig } from '@vendure/core'; import { compileUiExtensions } from '@vendure/ui-devkit/compiler'; export const config: VendureConfig = { // ... plugins: [ AdminUiPlugin.init({ port: 3002, app: compileUiExtensions({ outputPath: path.join(__dirname, '../admin-ui'), extensions: [{ extensionPath: path.join(__dirname, 'plugins/invoices/ui'), // highlight-start ngModules: [{ type: 'shared', ngModuleFileName: 'invoice-shared.module.ts', ngModuleName: 'InvoiceSharedModule', }], // highlight-end }], }), }), ], }; ``` ### Migrating to the new API If you have existing UI extensions written using the legacy API, you can migrate them to the new API as follows: 1. Convert all components to be [standalone components](https://angular.io/guide/standalone-components). Standalone components were introduced in recent versions of Angular and allow components to be defined without the need for a module. To convert an existing component, you need to set `standalone: true` and add an `imports` array containing any components, directives or pipes you are using in that component. Typically, you can import `SharedModule` to get access to all the common Angular directives and pipes, as well as the shared Admin UI components. ```ts import { Component } from '@angular/core'; // highlight-next-line import { SharedModule } from '@vendure/admin-ui/core'; @Component({ selector: 'greeter', template: `<vdr-page-block><h1>{{ greeting }}</h1></vdr-page-block>`, // highlight-start standalone: true, imports: [SharedModule], // highlight-end }) export class GreeterComponent { greeting = 'Hello!'; } ``` 2. In templates for page components, remove the `<vdr-page-header>` and `<vdr-page-body>` components, as they are included by default now when using the `registeRouteComponent()` function: ```html // highlight-start <vdr-page-header> <vdr-page-title></vdr-page-title> </vdr-page-header> <vdr-page-body> // highlight-end <vdr-page-block>This content should remain</vdr-page-block> // highlight-next-line </vdr-page-body> ``` 3. Remove any `NgModule` files, and replace lazy modules with `routes.ts`, and shared modules with `providers.ts` (see above).
--- title: 'Modify the Nav Menu' weight: 5 --- The Nav Menu is the main navigation for the Admin UI, located on the left-hand side when in desktop mode. It is used to provide top-level access to routes in the app, and can be extended and modified by UI extensions. ## Extending the NavMenu Once you have defined some custom routes, you need some way for the administrator to access them. For this you will use the [addNavMenuItem](/reference/admin-ui-api/nav-menu/add-nav-menu-item/) and [addNavMenuSection](/reference/admin-ui-api/nav-menu/add-nav-menu-section) functions. Let's add a new section to the Admin UI main nav bar containing a link to the "greeter" module from the [Getting Started guide](/guides/extending-the-admin-ui/getting-started/#routes) example: ```ts title="src/plugins/greeter/ui/providers.ts" import { addNavMenuSection } from '@vendure/admin-ui/core'; export default [ addNavMenuSection({ id: 'greeter', label: 'My Extensions', items: [{ id: 'greeter', label: 'Greeter', routerLink: ['/extensions/greet'], // Icon can be any of https://core.clarity.design/foundation/icons/shapes/ icon: 'cursor-hand-open', }], }, // Add this section before the "settings" section 'settings'), ]; ``` Now we must also register these providers with the compiler: ```ts title="src/vendure-config.ts" import path from 'path'; import { VendureConfig } from '@vendure/core'; import { AdminUiPlugin } from '@vendure/admin-ui-plugin'; import { compileUiExtensions } from '@vendure/ui-devkit/compiler'; export const config: VendureConfig = { // ... plugins: [ AdminUiPlugin.init({ port: 3002, app: compileUiExtensions({ outputPath: path.join(__dirname, '../admin-ui'), extensions: [ { id: 'greeter', extensionPath: path.join(__dirname, 'plugins/greeter/ui'), routes: [{ route: 'greet', filePath: 'routes.ts' }], // highlight-start providers: ['providers.ts'] // highlight-end }, ], }), }), ], }; ``` Running the server will compile our new shared module into the app, and the result should look like this: ![./ui-extensions-navbar.webp](./ui-extensions-navbar.webp) ## Overriding existing nav items It is also possible to override one of the default (built-in) nav menu sections or items. This can be useful for example if you wish to provide a completely different implementation of the product list view. This is done by setting the `id` property to that of an existing nav menu section or item. The `id` can be found by inspecting the link element in your browser's dev tools for the `data-item-id` attribute: ![Navbar menu id](./nav-menu-id.webp) ## Removing existing nav items If you would like to remove an existing nav item, you can do so by overriding it and setting the `requiresPermission` property to an invalid value: ```ts title="src/plugins/greeter/ui/providers.ts" import { SharedModule, addNavMenuItem} from '@vendure/admin-ui/core'; export default [ addNavMenuItem({ id: 'collections', // <-- we will override the "collections" menu item label: 'Collections', routerLink: ['/catalog', 'collections'], // highlight-start // we use an invalid permission which ensures it is hidden from all users requiresPermission: '__disable__' // highlight-end }, 'catalog'), ]; ```
--- title: 'Page Tabs' weight: 5 --- You can add your own tabs to any of the Admin UI's list or detail pages using the [registerPageTab](/reference/admin-ui-api/tabs/register-page-tab/) function. For example, to add a new tab to the product detail page for displaying product reviews: ```ts title="src/plugins/reviews/ui/providers.ts" import { registerPageTab } from '@vendure/admin-ui/core'; import { ReviewListComponent } from './components/review-list/review-list.component'; export default [ registerPageTab({ location: 'product-detail', tab: 'Reviews', route: 'reviews', tabIcon: 'star', component: ReviewListComponent, }), ]; ``` ![./ui-extensions-tabs.webp](./ui-extensions-tabs.webp) :::note Currently it is only possible to define new tabs using Angular components. :::
--- title: "UI Component Library" --- import Tabs from '@theme/Tabs'; import TabItem from '@theme/TabItem'; The Admin UI is built on a customized version of the [Clarity Design System](https://clarity.design/documentation/get-started). This means that if you are writing Angular-based UI extensions, you can use the same components that are used in the rest of the Admin UI. If you are using React, we are gradually exporting the most-used components for use with React. ## Buttons ![Buttons](./buttons.webp) There are three types of button: - **Regular**: These are general-purpose buttons available in a number of styles. They are used in the action bar and as confirmation buttons for dialogs. - **Ghost**: This style is primarily used to indicate a column in a table which is a link to a detail view. - **Small**: This style is used for secondary actions of less prominence than a standard button, or when the button must fit in a small space. <Tabs groupId="framework"> <TabItem value="Angular" label="Angular" default> ```html <button class="button primary">Primary</button> <button class="button secondary">Secondary</button> <button class="button success">Success</button> <button class="button warning">Warning</button> <button class="button danger">Danger</button> <button class="button-ghost">Ghost</button> <a class="button-ghost" [routerLink]="['/extensions/my-plugin/my-custom-route']"> <clr-icon shape="arrow" dir="right"></clr-icon> John Smith </a> <button class="button-small">Small</button> <button class="button-small"> <clr-icon shape="layers"></clr-icon> Assign to channel </button> ``` </TabItem> <TabItem value="React" label="React"> ```tsx import React from 'react'; import { CdsIcon, Link } from '@vendure/admin-ui/react'; export function DemoComponent() { return ( <> <button className="button primary">Primary</button> <button className="button secondary">Secondary</button> <button className="button success">Success</button> <button className="button warning">Warning</button> <button className="button danger">Danger</button> <button className="button-ghost">Ghost</button> <Link className="button-ghost" href="/extensions/my-plugin/my-custom-route"> <CdsIcon icon={arrowIcon} direction="right" /> John Smith </Link> <button className="button-small">Small</button> <button className="button-small"> <CdsIcon icon={layersIcon} /> Assign to channel </button> </> ); } ``` </TabItem> </Tabs> ## Icons You can use the built-in [Clarity Icons](https://core.clarity.design/foundation/icons/shapes/) for a consistent look-and-feel with the rest of the Admin UI app. ![Icons](./icons.webp) <Tabs groupId="framework"> <TabItem value="Angular" label="Angular" default> ```html <clr-icon shape="star" size="8"></clr-icon> <clr-icon shape="star" size="16"></clr-icon> <clr-icon shape="star" size="24"></clr-icon> <clr-icon shape="star" size="36"></clr-icon> <clr-icon shape="star" size="48"></clr-icon> <clr-icon shape="star" size="56"></clr-icon> <clr-icon shape="user" class="has-badge--success"></clr-icon> <clr-icon shape="user" class="has-alert"></clr-icon> <clr-icon shape="user" class="has-badge--info"></clr-icon> <clr-icon shape="user" class="has-badge--error"></clr-icon> <clr-icon shape="user" class="is-success"></clr-icon> <clr-icon shape="user" class="is-info"></clr-icon> <clr-icon shape="user" class="is-warning"></clr-icon> <clr-icon shape="user" class="is-error"></clr-icon> ``` </TabItem> <TabItem value="React" label="React"> ```tsx import React from 'react'; import { starIcon, userIcon } from '@cds/core/icon'; import { CdsIcon } from '@vendure/admin-ui/react'; export function DemoComponent() { return ( <> <CdsIcon icon={starIcon} size="xs" /> <CdsIcon icon={starIcon} size="sm" /> <CdsIcon icon={starIcon} size="md" /> <CdsIcon icon={starIcon} size="lg" /> <CdsIcon icon={starIcon} size="xl" /> <CdsIcon icon={starIcon} size="xxl" /> <CdsIcon icon={userIcon} badge="success" /> <CdsIcon icon={userIcon} badge="info" /> <CdsIcon icon={userIcon} badge="warning" /> <CdsIcon icon={userIcon} badge="danger" /> <CdsIcon icon={userIcon} status="success" /> <CdsIcon icon={userIcon} status="info" /> <CdsIcon icon={userIcon} status="warning" /> <CdsIcon icon={userIcon} status="danger" /> </> ); } ``` </TabItem> </Tabs> ## Form inputs Form inputs are styled globally, so you don't need to use special components for these. The label & tooltip styling is controlled by the "form field" wrapper component. ![Form input](./form-inputs.webp) <Tabs groupId="framework"> <TabItem value="Angular" label="Angular" default> ```html <div class="form-grid"> <vdr-form-field label="Page title"> <input type="text" /> </vdr-form-field> <vdr-form-field label="Select input"> <select> <option>Option 1</option> <option>Option 2</option> </select> </vdr-form-field> <vdr-form-field label="Checkbox input"> <input type="checkbox" /> </vdr-form-field> <vdr-form-field label="Textarea input"> <textarea></textarea> </vdr-form-field> <vdr-form-field label="With tooltip" tooltip="This is a tooltip for the form input"> <input type="text" /> </vdr-form-field> <vdr-form-field label="Invalid with error"> <input type="text" [formControl]="invalidFormControl" /> </vdr-form-field> </div> ``` </TabItem> <TabItem value="React" label="React"> ```tsx import React from 'react'; import { starIcon, userIcon } from '@cds/core/icon'; import { FormField } from '@vendure/admin-ui/react'; export function DemoComponent() { return ( <div className="form-grid"> <FormField label="Page title"> <input type="text" /> </FormField> <FormField label="Select input"> <select> <option>Option 1</option> <option>Option 2</option> </select> </FormField> <FormField label="Checkbox input"> <input type="checkbox" /> </FormField> <FormField label="Textarea input"> <textarea /> </FormField> <FormField label="With tooltip" tooltip="This is a tooltip for the form input"> <input type="text" /> </FormField> <FormField label="Invalid with error" invalid> <input type="text" /> </FormField> </div> ); } ``` </TabItem> </Tabs> The `form-grid` class is used to lay out the form fields into a 2-column grid on larger screens, and a single column on smaller screens. If you want to force a particular field to always take up the full width (i.e. to span 2 columns at all screen sizes), you can add the `form-grid-span` class to that form field. ```html <div class="form-grid"> // highlight-next-line <vdr-form-field label="Page title" class="form-grid-span"> <input type="text" /> </vdr-form-field> </div> ``` ## Cards Cards are used as a general-purpose container for page content, as a way to visually group related sets of components. ![Card](./card.webp) <Tabs groupId="framework"> <TabItem value="Angular" label="Angular" default> ```html <vdr-card title="Card"> This is a card. On a detail page, content should usually be placed inside a card. </vdr-card> ``` </TabItem> <TabItem value="React" label="React"> ```tsx import React from 'react'; import { Card } from '@vendure/admin-ui/react'; export function DemoComponent() { return ( <Card title="Card"> This is a card. On a detail page, content should usually be placed inside a card. </Card> ); } ``` </TabItem> </Tabs> ## Layout The following layout components are available: - Page block: This is a wrapper which applies consistent margins and max-width to the contents of the page. In general, the contents of a page should always be wrapped in this component except when using the DataTable2 component, which has its own styling for margins and width. - Action bar: This is a wrapper for the top area of the page, just below the header section. This is where the primary action buttons for the page should be located. - Page detail layout: For detail views, this wrapper provides a two-column layout with a main content area and a sidebar. ![Layout](./layout.webp) <Tabs groupId="framework"> <TabItem value="Angular" label="Angular" default> ```html <vdr-page-block> <vdr-action-bar> <vdr-ab-left>Action bar left contents</vdr-ab-left> <vdr-ab-right> <button class="button primary">Primary action</button> </vdr-ab-right> </vdr-action-bar> </vdr-page-block> <vdr-page-detail-layout> <vdr-page-detail-sidebar> <vdr-card>Sidebar content</vdr-card> </vdr-page-detail-sidebar> <vdr-page-block> <vdr-card title="Card"> This is a card. On a detail page, content should usually be placed inside a card. </vdr-card> </vdr-page-block> </vdr-page-detail-layout> ``` </TabItem> <TabItem value="React" label="React"> ```tsx import React from 'react'; import { ActionBar, Card, PageBlock, PageDetailLayout, } from '@vendure/admin-ui/react'; export function DemoComponent() { return ( <> <PageBlock> <ActionBar leftContent={<div>Action bar left contents</div>}> <button className="button primary">Primary action</button> </ActionBar> </PageBlock> <PageDetailLayout sidebar={ <div> <Card>Sidebar content</Card> </div> } > <PageBlock> <Card title="Card"> This is a card. On a detail page, content should usually be placed inside a card. </Card> </PageBlock> </PageDetailLayout> </> ); } ``` </TabItem> </Tabs>
--- title: 'Using Other Frameworks' weight: 1 --- From version 2.1.0, Admin UI extensions can be written in either Angular or React. Prior to v2.1.0, only Angular was natively supported. It is, however, possible to extend the Admin UI using other frameworks such as Vue, Svelte, Solid etc. Note that the extension experience is much more limited than with Angular or React, but depending on your needs it may be sufficient. :::info For working examples of a UI extensions built with **Vue**, see the [real-world-vendure ui extensions](https://github.com/vendure-ecommerce/real-world-vendure/tree/master/src/ui-extensions) ::: There is still a small amount of Angular "glue code" needed to let the compiler know how to integrate your extension, so let's take a look at how this is done. ## 1. Install `@vendure/ui-devkit` To create UI extensions, you'll need to install the `@vendure/ui-devkit` package. This package contains a compiler for building your customized version of the Admin UI, as well as the Angular dependencies you'll need to create your extensions. ```bash yarn add @vendure/ui-devkit # or npm install @vendure/ui-devkit ``` ## 2. Create the folder structure In this example, we will work with the following folder structure, and use Create React App our example. ```text src └─plugins └─ my-plugin └─ ui ├─ routes.ts └─ vue-app └─ (directory created by `vue create`, for example) ``` ## 3. Create an extension module Here's the Angular code needed to tell the compiler where to find your extension: ```ts title="src/plugins/my-plugin/ui/routes.ts" import { hostExternalFrame } from '@vendure/admin-ui/core'; export default [ hostExternalFrame({ path: '', // You can also use parameters which allow the app // to have dynamic routing, e.g. // path: ':slug' // Then you can use the getActivatedRoute() function from the // UiDevkitClient in order to access the value of the "slug" // parameter. breadcrumbLabel: 'Vue App', // This is the URL to the compiled React app index. // The next step will explain the "assets/react-app" path. extensionUrl: './assets/vue-app/index.html', openInNewTab: false, }) ]; ``` ## 4. Define the AdminUiExtension config Next we will define an [AdminUiExtension](/reference/admin-ui-api/ui-devkit/admin-ui-extension/) object which is passed to the `compileUiExtensions()` function in your Vendure config: ```ts title="src/vendure-config.ts" import path from 'path'; import { VendureConfig } from '@vendure/core'; import { AdminUiPlugin } from '@vendure/admin-ui-plugin'; import { compileUiExtensions } from '@vendure/ui-devkit/compiler'; export const config: VendureConfig = { // ... plugins: [ AdminUiPlugin.init({ route: 'admin', port: 3002, app: compileUiExtensions({ outputPath: path.join(__dirname, '../admin-ui'), extensions: [{ // Points to the path containing our Angular "glue code" module extensionPath: path.join(__dirname, 'plugins/my-plugin/ui'), routes: [{ route: 'vue-ui', filePath: 'routes.ts' }], staticAssets: [ // This is where we tell the compiler to copy the compiled Vue app // artifacts over to the Admin UI's `/static` directory. In this case we // also rename "build" to "vue-app". This is why the `extensionUrl` // in the module config points to './assets/vue-app/index.html'. {path: path.join(__dirname, 'plugins/my-plugin/ui/vue-app/dist'), rename: 'vue-app'}, ], }], devMode: true, }), }), ] }; ``` ## 5. Build your extension To ensure things are working we can now build our Vue app by running `yarn build` in the `vue-app` directory. This will build and output the app artifacts to the `vue-app/build` directory - the one we pointed to in the `staticAssets` array above. Once build, we can start the Vendure server. The `compileUiExtensions()` function returns a `compile()` function which will be invoked by the AdminUiPlugin upon server bootstrap. During this compilation process, a new directory will be generated at `/admin-ui` (as specified by the `outputPath` option) which will contains the un-compiled sources of your new Admin UI app. Next, these source files will be run through the Angular compiler, the output of which will be visible in the console. Now go to the Admin UI app in your browser and log in. You should now be able to manually enter the URL `http://localhost:3000/admin/extensions/vue-ui` and you should see the Vue app rendered in the Admin UI. ## Integrate with the Admin UI ### Styling The `@vendure/admin-ui` package (which will be installed alongside the ui-devkit) provides a stylesheet to allow your extension to fit visually with the rest of the Admin UI. If you have a build step, you can import it into your app like this: ```ts import '@vendure/admin-ui/static/theme.min.css'; ``` If your extension does not have a build step, you can still include the theme stylesheet as a local resource: ```HTML <!-- src/ui-extension/plain-js-app/index.html --> <head> <link rel="stylesheet" href="../../theme.min.css" /> </head> ``` ### UiDevkitClient The `@vendure/ui-devkit` package provides a number of helper methods which allow your extension to seamlessly interact with the underlying Admin UI infrastructure, collectively known as the [UiDevkitClient](/reference/admin-ui-api/ui-devkit/ui-devkit-client/). The client allows your extension to: * Make GraphQL queries & mutations, without the need for your own HTTP or GraphQL client, with full integration with the Admin UI client-side GraphQL cache. * Display toast notifications. #### setTargetOrigin The UiDevkitClient uses the browser's [postMessage API](https://developer.mozilla.org/en-US/docs/Web/API/Window/postMessage) to communicate between the Admin UI app and your extension. For security reasons this communication channel is restricted to a specific domain (where your extension app will be running from). To configure this, use the [setTargetOrigin](/reference/admin-ui-api/ui-devkit/ui-devkit-client/#settargetorigin) function: ```ts import { setTargetOrigin } from '@vendure/ui-devkit'; setTargetOrigin('http://my-domain.com'); ``` If this is mis-configured you will see an error along the lines of "Failed to execute 'postMessage' on 'DOMWindow'". For apps with a build step, you can use these functions like this: ```ts import { graphQlMutation, notify } from '@vendure/ui-devkit'; // somewhere in your component const disableProduct = (id: string) => { graphQlMutation(` mutation DisableProduct($id: ID!) { updateProduct(input: { id: $id, enabled: false }) { id enabled } }`, { id }).then(result => { notify({ message: 'Updated Product', }); }) } ``` If your extension does not have a build step, you can still include the UiDevkitClient as a local resource, which will expose a `VendureUiClient` global object: ```html <!-- src/ui-extension/plain-js-app/index.html --> <head> <script src="../devkit/ui-devkit.js"></script> </head> <script> const disableProduct = id => { VendureUiClient.graphQlMutation(` mutation DisableProduct($id: ID!) { updateProduct(input: { id: $id, enabled: false }) { id enabled } }`, { id }).then(result => { VendureUiClient.notify({ message: 'Updated Product', }); }) } </script> ``` ## Next Steps Now you have created your extension, you need a way for your admin to access it. See [Adding Navigation Items](/guides/extending-the-admin-ui/nav-menu/)
--- title: "Installation" sidebar_position: 1 --- import Tabs from '@theme/Tabs'; import TabItem from '@theme/TabItem'; ## Requirements * [Node.js](https://nodejs.org/en/) **v18** or above, with support for **even-numbered Node.js versions**. * The [supported TypeScript version](https://github.com/vendure-ecommerce/vendure/blob/master/packages/create/src/constants.ts#L7) is set upon installation. Upgrading to a newer version of TypeScript might result in compilation errors. * If you want to use MySQL, MariaDB, or Postgres as your data store, then you'll need an instance available locally. However, **if you are just testing out Vendure, we recommend using SQLite**, which has no external requirements. * If you use **Yarn**, from Vendure v2.2.0+, you'll need to use **Yarn 2** (Berry) or above. ## @vendure/create The recommended way to get started with Vendure is by using the [@vendure/create](https://github.com/vendure-ecommerce/vendure/tree/master/packages/create) tool. This is a command-line tool which will scaffold and configure your new Vendure project and install all dependencies. ### 1. Run the command ``` npx @vendure/create my-shop ``` ### 2. Select a database Vendure supports a number of different databases. The `@vendure/create` tool will prompt you to select one. **To quickly test out Vendure, we recommend using SQLite**, which requires no external dependencies. You can always switch to a different database later by changing your configuration file. ![Vendure Create step 1](./create-1.webp) :::tip If you select MySQL, MariaDB or Postgres, you need to make sure you: 1. have the database server running and accessible 2. have created a database for Vendure to use 3. know the username and password for a user with access to that database ::: ### 3. Populate with data The final prompt will ask whether to populate your new Vendure server with some sample product data. **We recommend you do so**, as it will give you a good starting point for exploring the APIs which we will cover in the [Try the API section](/guides/getting-started/try-the-api/), as well as providing some data to use when building your own storefront. ![Vendure Create step 2](./create-2.webp) ### 4. Complete setup Next, a project scaffold will be created and dependencies installed. This may take a few minutes. Once complete, you'll see a message like this: ![Vendure Create step 3](./create-3.webp) ### 5. Start the server Follow the instructions to move into the new directory created for your project, and start the server: ```bash cd my-shop yarn dev # or npm run dev ``` You should now be able to access: * The Vendure Admin GraphQL API: [http://localhost:3000/admin-api](http://localhost:3000/admin-api) * The Vendure Shop GraphQL API: [http://localhost:3000/shop-api](http://localhost:3000/shop-api) * The Vendure Admin UI: [http://localhost:3000/admin](http://localhost:3000/admin) Congratulations! 🥳 You now have a fully-functional Vendure server running locally. Now you can explore Vendure by following our [Try the API guide](/guides/getting-started/try-the-api/) to learn how to interact with the server. If you are new to GraphQL, you should also check out our [Introducing GraphQL guide](/guides/getting-started/graphql-intro/). :::tip Open the Admin UI at [http://localhost:3000/admin](http://localhost:3000/admin) in your browser and log in with the superadmin credentials you specified, which default to: * **username**: superadmin * **password**: superadmin ::: :::cli Use `npx vendure add` to start adding plugins & custom functionality to your Vendure server. ::: ### Troubleshooting If you encounter any issues during installation, you can get a more detailed output by setting the log level to `verbose`: ```sh npx @vendure/create my-shop --log-level verbose ``` ## Set up a storefront Once you have a Vendure server running, you can set up a storefront to interact with it! We have a number of storefront starter kits available for you to use - head over to the [Storefront Starters](/guides/storefront/storefront-starters/) page to learn more. ![Remix storefront](../../storefront/storefront-starters/remix-storefront.webp)
--- title: "GraphQL Code Generation" --- Code generation means the automatic generation of TypeScript types based on your GraphQL schema and your GraphQL operations. This is a very powerful feature that allows you to write your code in a type-safe manner, without you needing to manually write any types for your API calls. To do this, we will use [Graphql Code Generator](https://the-guild.dev/graphql/codegen). :::cli Use `npx vendure add` and select "Set up GraphQL code generation" to quickly set up code generation. ::: :::note This guide is for adding codegen to your Vendure plugins & Admin UI extensions. For a guide on adding codegen to your storefront, see the [Storefront Codegen](/guides/storefront/codegen/) guide. ::: ## Installation It is recommended to use the `vendure add` CLI command as detailed above to set up codegen. If you prefer to set it up manually, follow the steps below. First, install the required dependencies: ```bash npm install -D @graphql-codegen/cli @graphql-codegen/typescript ``` ## Configuration Add a `codegen.ts` file to your project root with the following contents: ```ts title="codegen.ts" import type {CodegenConfig} from '@graphql-codegen/cli'; const config: CodegenConfig = { overwrite: true, // This assumes your server is running on the standard port // and with the default admin API path. Adjust accordingly. schema: 'http://localhost:3000/admin-api', config: { // This tells codegen that the `Money` scalar is a number scalars: { Money: 'number' }, // This ensures generated enums do not conflict with the built-in types. namingConvention: { enumValues: 'keep' }, }, generates: { // The path to the generated type file in your // plugin directory. Adjust accordingly. 'src/plugins/organization/gql/generated.ts': { plugins: ['typescript'], }, }, }; export default config; ``` This assumes that we have an "organization" plugin which adds support for grouping customers into organizations, e.g. for B2B use-cases. ## Running codegen You can now add a script to your package.json to run codegen: ```json title="package.json" { "scripts": { "codegen": "graphql-codegen --config codegen.ts" } } ``` **Ensure your server is running**, then run the codegen script: ```bash npm run codegen ``` This will generate a file at `src/plugins/organization/gql/generated.ts` which contains all the GraphQL types corresponding to your schema. ## Using generated types in resolvers & services You would then use these types in your resolvers and service methods, for example: ```ts title="src/plugins/organization/services/organization.service.ts" import { Args, Mutation, Query, Resolver } from '@nestjs/graphql'; import { Allow, Ctx, PaginatedList, RequestContext, Transaction } from '@vendure/core'; import { organizationPermission } from '../constants'; import { Organization } from '../entities/organization.entity'; import { OrganizationService } from '../services/organization.service'; // highlight-next-line import { QueryOrganizationArgs, MutationCreateOrganizationArgs } from '../gql/generated'; @Resolver() export class AdminResolver { constructor(private organizationService: OrganizationService) {} @Query() @Allow(organizationPermission.Read) // highlight-next-line organization(@Ctx() ctx: RequestContext, @Args() args: QueryOrganizationArgs): Promise<Organization> { return this.organizationService.findOne(ctx, args.id); } @Transaction() @Mutation() @Allow(organizationPermission.Create) createOrganization( @Ctx() ctx: RequestContext, // highlight-next-line @Args() args: MutationCreateOrganizationArgs, ): Promise<Organization> { return this.organizationService.create(ctx, args.input); } // ... etc } ``` In your service methods you can directly use any input types defined in your schema: ```ts title="src/plugins/organization/services/organization.service.ts" import { Injectable } from '@nestjs/common'; import { RequestContext, TransactionalConnection } from '@vendure/core'; import { Organization } from '../entities/organization.entity'; // highlight-next-line import { CreateOrganizationInput, UpdateOrganizationInput } from "../gql/generated"; @Injectable() export class OrganizationService { constructor(private connection: TransactionalConnection) {} // highlight-next-line async create(ctx: RequestContext, input: CreateOrganizationInput): Promise<Organization> { return this.connection.getRepository(ctx, Organization).save(new Organization(input)); } // highlight-next-line async update(ctx: RequestContext, input: UpdateOrganizationInput): Promise<Organization> { const example = await this.connection.getEntityOrThrow(ctx, Organization, input.id); const updated = {...example, ...input}; return this.connection.getRepository(ctx, Organization).save(updated); } } ``` ## Codegen for Admin UI extensions When you create Admin UI extensions, very often those UI components will be making API calls to the Admin API. In this case, you can use codegen to generate the types for those API calls. To do this, we will use the ["client preset" plugin](https://the-guild.dev/graphql/codegen/plugins/presets/preset-client). Assuming you have already completed the setup above, you'll need to install the following additional dependency: ```bash npm install -D @graphql-codegen/client-preset ``` Then add the following to your `codegen.ts` file: ```ts title="codegen.ts" import type { CodegenConfig } from '@graphql-codegen/cli'; const config: CodegenConfig = { overwrite: true, schema: 'http://localhost:3000/admin-api', config: { scalars: { Money: 'number' }, namingConvention: { enumValues: 'keep' }, }, generates: { // highlight-start 'apps/marketplace/src/plugins/marketplace/ui/gql/': { preset: 'client', documents: 'apps/marketplace/src/plugins/marketplace/ui/**/*.ts', // This disables the "fragment masking" feature. Fragment masking // can improve component isolation but introduces some additional // complexity that we will avoid for now. presetConfig: { fragmentMasking: false, }, }, // highlight-end 'apps/marketplace/src/plugins/marketplace/gql/generated.ts': { plugins: ['typescript'], }, }, }; export default config; ``` For the client preset plugin, we need to specify a _directory_ (`.../ui/gql/`) because a number of files will get generated. ### Use the `graphql()` function In your Admin UI components, you can now use the `graphql()` function exported from the generated file to define your GraphQL operations. For example: ```ts title="apps/marketplace/src/plugins/marketplace/ui/components/organization-list/organization-list.component.ts" import { ChangeDetectionStrategy, Component } from '@angular/core'; import { SharedModule, TypedBaseListComponent } from '@vendure/admin-ui/core'; import { graphql } from '../../gql'; // highlight-start const getOrganizationListDocument = graphql(` query GetOrganizationList($options: OrganizationListOptions) { organizations(options: $options) { items { id createdAt updatedAt name invoiceEmailAddresses } totalItems } } `); // highlight-end @Component({ selector: 'organization-list', templateUrl: './organization-list.component.html', styleUrls: ['./organization-list.component.scss'], changeDetection: ChangeDetectionStrategy.OnPush, standalone: true, imports: [SharedModule], }) export class OrganizationListComponent extends TypedBaseListComponent< // highlight-start typeof getOrganizationListDocument, 'organizations' // highlight-end > { // Sort & filter definitions omitted for brevity. // For a complete ListComponent example, see the // "Creating List Views" guide. constructor() { super(); super.configure({ // highlight-next-line document: getOrganizationListDocument, getItems: (data) => data.organizations, setVariables: (skip, take) => ({ options: { skip, take, filter: { name: { contains: this.searchTermControl.value, }, ...this.filters.createFilterInput(), }, sort: this.sorts.createSortInput(), }, }), refreshListOnChanges: [this.filters.valueChanges, this.sorts.valueChanges], }); } } ``` Whenever you write a new GraphQL operation, or change an existing one, you will need to re-run the codegen script to generate the types for that operation. ## Codegen watch mode You can also set up file watching as described in the [Graphql Code Generator watch mode docs](https://the-guild.dev/graphql/codegen/docs/getting-started/development-workflow#watch-mode).
--- title: "Configurable Products" --- A "configurable product" is one where aspects can be configured by the customer, and are unrelated to the product's variants. Examples include: - Engraving text on an item - A gift message inserted with the packaging - An uploaded image to be printed on a t-shirt In Vendure this is done by defining one or more [custom fields](/guides/developer-guide/custom-fields/) on the [OrderLine](/reference/typescript-api/entities/order-line/) entity. ## Defining custom fields Let's take the example of an engraving service. Some products can be engraved, others cannot. We will record this information in a custom field on the [ProductVariant](/reference/typescript-api/entities/product-variant/) entity: ```ts title="src/vendure-config.ts" import { VendureConfig } from '@vendure/core'; export const config: VendureConfig = { // ... customFields: { ProductVariant: [ { name: 'engravable', type: 'boolean', defaultValue: false, label: [ { languageCode: LanguageCode.en, value: 'Engravable' }, ], }, ], }, }; ``` For those variants that _are_ engravable, we need to be able to record the text to be engraved. This is done by defining a custom field on the [OrderLine](/reference/typescript-api/entities/order-line/) entity: ```ts title="src/vendure-config.ts" import { VendureConfig } from '@vendure/core'; export const config: VendureConfig = { // ... customFields: { OrderLine: [ { name: 'engravingText', type: 'string', validate: value => { if (value.length > 100) { return 'Engraving text must be less than 100 characters'; } }, label: [ { languageCode: LanguageCode.en, value: 'Engraving text' }, ], }, ] }, }; ``` ## Setting the custom field value Once the custom fields are defined, the [addItemToOrder mutation](/reference/graphql-api/shop/mutations/#additemtoorder) will have a third argument available, which accepts values for the custom field defined above: ```graphql mutation { addItemToOrder( productVariantId: "42" quantity: 1 // highlight-start customFields: { engravingText: "Thanks for all the fish!" } // highlight-end ) { ...on Order { id lines { id quantity customFields { engravingText } } } } } ``` Your storefront application will need to provide a `<textarea>` for the customer to enter the engraving text, which would be displayed conditionally depending on the value of the `engravable` custom field on the `ProductVariant`. ## Modifying the price The values of these OrderLine custom fields can even be used to modify the price. This is done by defining a custom [OrderItemPriceCalculationStrategy](/reference/typescript-api/orders/order-item-price-calculation-strategy/). Let's say that our engraving service costs and extra $10 on top of the regular price of the product variant. Here's a strategy to implement this: ```ts title="src/engraving-price-calculation-strategy.ts" import { RequestContext, PriceCalculationResult, ProductVariant, OrderItemPriceCalculationStrategy } from '@vendure/core'; export class EngravingPriceStrategy implements OrderItemPriceCalculationStrategy { calculateUnitPrice( ctx: RequestContext, productVariant: ProductVariant, customFields: { engravingText?: string }, ) { let price = productVariant.listPrice; if (customFields.engravingText) { // Add $10 for engraving price += 1000; } return { price, priceIncludesTax: productVariant.listPriceIncludesTax, }; } } ``` This is then added to the config: ```ts title="src/vendure-config.ts" import { VendureConfig } from '@vendure/core'; import { EngravingPriceStrategy } from './engraving-price-calculation-strategy'; export const config: VendureConfig = { // ... orderOptions: { orderItemPriceCalculationStrategy: new EngravingPriceStrategy(), }, }; ```
--- title: "Multi-vendor Marketplaces" --- # Multi-vendor Marketplaces Vendure v2.0 introduced a number of changes and new APIs to enable developers to build multi-vendor marketplace apps. This is a type of application in which multiple sellers are able to list products, and then customers can create orders containing products from one or more of these sellers. Well-known examples include Amazon, Ebay, Etsy and Airbnb. This guide introduces the major concepts & APIs you will need to understand in order to implement your own multi-vendor marketplace application. ## Multi-vendor plugin All the concepts presented here have been implemented in our [example multi-vendor plugin](https://github.com/vendure-ecommerce/vendure/tree/master/packages/dev-server/example-plugins/multivendor-plugin). The guides here will refer to specific parts of this plugin which you should consult to get a full understanding of how an implementation would look. :::caution **Note:** the [example multi-vendor plugin](https://github.com/vendure-ecommerce/vendure/tree/master/packages/dev-server/example-plugins/multivendor-plugin) is for educational purposes only, and for the sake of clarity leaves out several parts that would be required in a production-ready solution, such as email verification and setup of a real payment solution. ::: ![The Admin UI Aggregate Order screen](./aggregate-order.webp) ## Sellers, Channels & Roles The core of Vendure's multi-vendor support is Channels. Read the [Channels guide](/guides/core-concepts/channels/) to get a more detailed understanding of how they work. Each Channel is assigned to a [Seller](/reference/typescript-api/entities/seller/), which is another term for the vendor who is selling things in our marketplace. So the first thing to do is to implement a way to create a new Channel and Seller. In the multi-vendor plugin, we have defined a new mutation in the Shop API which allows a new seller to register on our marketplace: ```graphql title="Shop API" mutation RegisterSeller { registerNewSeller(input: { shopName: "Bob's Parts", seller: { firstName: "Bob" lastName: "Dobalina" emailAddress: "bob@bobs-parts.com" password: "test", } }) { id code token } } ``` Executing the `registerNewSeller` mutation does the following: - Create a new [Seller](/reference/typescript-api/entities/seller/) representing the shop "Bob's Parts" - Create a new [Channel](/reference/typescript-api/entities/channel) and associate it with the new Seller - Create a [Role](/reference/typescript-api/entities/role) & [Administrator](/reference/typescript-api/entities/administrator) for Bob to access his shop admin account - Create a [ShippingMethod](/reference/typescript-api/entities/shipping-method) for Bob's shop - Create a [StockLocation](/reference/typescript-api/entities/stock-location) for Bob's shop Bob can now log in to the Admin UI using the provided credentials and begin creating products to sell! ### Keeping prices synchronized In some marketplaces, the same product may be sold by multiple sellers. When this is the case, the product and its variants will be assigned not only to the default channel, but to multiple other channels as well - see the [Channels, Currencies & Prices section](/guides/core-concepts/channels/#channels-currencies--prices) for a visual explanation of how this works. This means that there will be multiple ProductVariantPrice entities per variant, one for each channel. In order to keep prices synchronized across all channels, the example multi-vendor plugin sets the `syncPricesAcrossChannels` property of the [DefaultProductVariantPriceUpdateStrategy](/reference/typescript-api/configuration/product-variant-price-update-strategy#defaultproductvariantpriceupdatestrategy) to `true`. Your own multi-vendor implementation may require more sophisticated price synchronization logic, in which case you can implement your own custom [ProductVariantPriceUpdateStrategy](/reference/typescript-api/configuration/product-variant-price-update-strategy). ## Assigning OrderLines to the correct Seller In order to correctly split the Order later, we need to assign each added OrderLine to the correct Seller. This is done with the [OrderSellerStrategy](/reference/typescript-api/orders/order-seller-strategy/) API, and specifically the `setOrderLineSellerChannel()` method. The following logic will run any time the `addItemToOrder` mutation is executed from our storefront: ```ts export class MultivendorSellerStrategy implements OrderSellerStrategy { // other properties omitted for brevity async setOrderLineSellerChannel(ctx: RequestContext, orderLine: OrderLine) { await this.entityHydrator.hydrate(ctx, orderLine.productVariant, { relations: ['channels'] }); const defaultChannel = await this.channelService.getDefaultChannel(); // If a ProductVariant is assigned to exactly 2 Channels, then one is the default Channel // and the other is the seller's Channel. if (orderLine.productVariant.channels.length === 2) { const sellerChannel = orderLine.productVariant.channels.find( c => !idsAreEqual(c.id, defaultChannel.id), ); if (sellerChannel) { return sellerChannel; } } } } ``` The end result is that each OrderLine in the Order will have its `sellerChannelId` property set to the correct Channel for the Seller. ## Shipping When it comes time to choose a ShippingMethod for the Order, we need to ensure that the customer can only choose from the ShippingMethods which are supported by the Seller. To do this, we need to implement a [ShippingEligibilityChecker](/reference/typescript-api/shipping/shipping-eligibility-checker/) which will filter the available ShippingMethods based on the `sellerChannelId` properties of the OrderLines. Here's how we do it in the example plugin: ```ts export const multivendorShippingEligibilityChecker = new ShippingEligibilityChecker({ // other properties omitted for brevity check: async (ctx, order, args, method) => { await entityHydrator.hydrate(ctx, method, { relations: ['channels'] }); await entityHydrator.hydrate(ctx, order, { relations: ['lines.sellerChannel'] }); const sellerChannel = method.channels.find(c => c.code !== DEFAULT_CHANNEL_CODE); if (!sellerChannel) { return false; } for (const line of order.lines) { if (idsAreEqual(line.sellerChannelId, sellerChannel.id)) { return true; } } return false; }, }); ``` In the storefront, when it comes time to assign ShippingMethods to the Order, we need to ensure that every OrderLine is covered by a valid ShippingMethod. We pass the ids of the eligible ShippingMethods to the `setOrderShippingMethod` mutation: ```graphql mutation SetShippingMethod($ids: [ID!]!) { setOrderShippingMethod(shippingMethodId: $ids) { ... on Order { id state # ...etc } ... on ErrorResult { errorCode message } } } ``` Now we need a way to assign the correct method to each line in an Order. This is done with the [ShippingLineAssignmentStrategy](/reference/typescript-api/shipping/shipping-line-assignment-strategy/) API. We will again be relying on the `sellerChannelId` property of the OrderLines to determine which ShippingMethod to assign to each line. Here's how we do it in the example plugin: ```ts export class MultivendorShippingLineAssignmentStrategy implements ShippingLineAssignmentStrategy { // other properties omitted for brevity async assignShippingLineToOrderLines(ctx: RequestContext, shippingLine: ShippingLine, order: Order) { // First we need to ensure the required relations are available // to work with. const defaultChannel = await this.channelService.getDefaultChannel(); await this.entityHydrator.hydrate(ctx, shippingLine, { relations: ['shippingMethod.channels'] }); const { channels } = shippingLine.shippingMethod; // We assume that, if a ShippingMethod is assigned to exactly 2 Channels, // then one is the default Channel and the other is the seller's Channel. if (channels.length === 2) { const sellerChannel = channels.find(c => !idsAreEqual(c.id, defaultChannel.id)); if (sellerChannel) { // Once we have established the seller's Channel, we can filter the OrderLines // that belong to that Channel. The `sellerChannelId` was previously established // in the `OrderSellerStrategy.setOrderLineSellerChannel()` method. return order.lines.filter(line => idsAreEqual(line.sellerChannelId, sellerChannel.id)); } } return order.lines; } } ``` ## Splitting orders & payment When it comes to payments, there are many different ways that a multi-vendor marketplace might want to handle this. For example, the marketplace may collect all payments and then later disburse the funds to the Sellers. Or the marketplace may allow each Seller to connect their own payment gateway and collect payments directly. In the example plugin, we have implemented a simplified version of a service like [Stripe Connect](https://stripe.com/connect), whereby each Seller has a `connectedAccountId` (we auto-generate a random string for the example when registering the Seller). When configuring the plugin we also specify a "platform fee" percentage, which is the percentage of the total Order value which the marketplace will collect as a fee. The remaining amount is then split between the Sellers. The [OrderSellerStrategy](/reference/typescript-api/orders/order-seller-strategy/) API contains two methods which are used to first split the Order from a single order into one _Aggregate Order_ and multiple _Seller Orders_, and then to calculate the platform fee for each of the Seller Orders: - `OrderSellerStrategy.splitOrder`: Splits the OrderLines and ShippingLines of the Order into multiple groups, one for each Seller. - `OrderSellerStrategy.afterSellerOrdersCreated`: This method is run on every Seller Order created after the split, and we can use this to assign the platform fees to the Seller Order. ## Custom OrderProcess Finally, we need a custom [OrderProcess](/reference/typescript-api/orders/order-process/) which will help keep the state of the resulting Aggregate Order and its Seller Orders in sync. For example, we want to make sure that the Aggregate Order cannot be transitioned to the `Shipped` state unless all of its Seller Orders are also in the `Shipped` state. Conversely, we can automatically set the state of the Aggregate Order to `Shipped` once all of its Seller Orders are in the `Shipped` state.
--- title: "Order Workflow" showtoc: true --- # Order Workflow An Order is a collection of one or more ProductVariants which can be purchased by a Customer. Orders are represented internally by the [Order entity]({{< relref "order" >}}) and in the GraphQL API by the [Order type]({{< relref "/reference/graphql-api/shop/object-types#order" >}}). ## Order State Every Order has a `state` property of type [`OrderState`]({{< relref "order-process" >}}#orderstate). The following diagram shows the default states and how an Order transitions from one to the next. {{% alert %}} Note that this default workflow can be modified to better fit your business processes. See the [Customizing the Order Process guide]({{< relref "customizing-the-order-process" >}}). {{< /alert >}} ![./order_state_diagram.png](./order_state_diagram.png) ## Structure of an Order In Vendure an [Order]({{< relref "order" >}}) consists of one or more [OrderLines]({{< relref "order-line" >}}) (representing a given quantity of a particular SKU). Here is a simplified diagram illustrating this relationship: ![./order_class_diagram.png](./order_class_diagram.png) ## Shop client order workflow The [GraphQL Shop API Guide]({{< relref "/guides/storefront/shop-api-guide" >}}#order-flow) lists the GraphQL operations you will need to implement this workflow in your storefront client application. In this section, we'll cover some examples of how these operations would look in your storefront. ### Manipulating the Order First, let's define a fragment for our Order that we can re-use in subsequent operations: ```graphql fragment ActiveOrder on Order { id code state couponCodes subTotalWithTax shippingWithTax totalWithTax totalQuantity lines { id productVariant { id name } featuredAsset { id preview } quantity linePriceWithTax } } ``` Then we can add an item to the Order: ```graphql mutation AddItemToOrder($productVariantId: ID! $quantity: Int!){ addItemToOrder(productVariantId: $productVariantId, quantity: $quantity) { ... ActiveOrder ... on ErrorResult { errorCode message } } } ``` To remove an item from the order ```graphql mutation RemoveItemFromOrder($orderLineId: ID!){ removeOrderLine(orderLineId: $orderLineId) { ... ActiveOrder ... on ErrorResult { errorCode message } } } ``` To alter the quantity of an existing OrderLine ```graphql mutation AdjustOrderLine($orderLineId: ID! $quantity: Int!){ adjustOrderLine(orderLineId: $orderLineId, quantity: $quantity) { ... ActiveOrder ... on ErrorResult { errorCode message } } } ``` At any time we can query the contents of the active Order: ```graphql query ActiveOrder { activeOrder { ... ActiveOrder } } ``` ### Checking out During the checkout process, we'll need to make sure a Customer is assigned to the Order. If the Customer is already signed in, then this can be skipped since Vendure will have already assigned them. If not, then you'd execute: ```graphql mutation SetCustomerForOrder($input: CreateCustomerInput!){ setCustomerForOrder(input: $input) { ... ActiveOrder ... on ErrorResult { errorCode message } } } ``` Then we need to set the shipping address: ```graphql mutation SetShippingAddress($input: CreateAddressInput!){ setOrderShippingAddress(input: $input) { ... ActiveOrder ... on ErrorResult { errorCode message } } } ``` Once the shipping address is set, we can find out which ShippingMethods can be used on this Order: ```graphql query GetShippingMethods{ eligibleShippingMethods { id name code description priceWithTax } } ``` The Customer can then choose one of the available ShippingMethods, and we then set it on the Order: ```graphql mutation SetShippingMethod($shippingMethodId: ID!){ setOrderShippingMethod(shippingMethodId: $shippingMethodId) { ... ActiveOrder ... on ErrorResult { errorCode message } } } ``` We can now do the same for PaymentMethods: ```graphql query GetPaymentMethods{ eligiblePaymentMethods { id name code description isEligible eligibilityMessage } } ``` Once the customer is ready to pay, we need to transition the Order to the `ArrangingPayment` state. In this state, no further modifications are permitted. If you _do_ need to modify the Order contents, you can always transition back to the `AddingItems` state: ```graphql mutation TransitionOrder($state: String!){ transitionOrderToState(state: $state) { ... ActiveOrder ... on ErrorResult { errorCode message } } } ``` Finally, add a Payment to the Order: ```graphql mutation AddPayment($input: PaymentInput!){ addPaymentToOrder(input: $input) { ... ActiveOrder ... on ErrorResult { errorCode message } } } ``` If the Payment is successful, the Order will now be complete. You can forward the Customer to a confirmation page using the Order's `code`: ```graphql query OrderByCode($code: String!) { orderByCode(code: $code) { ...ActiveOrder } } ``` ## ActiveOrderStrategy In the above examples, the active Order is always associated with the current session and is therefore implicit - which is why there is no need to pass an ID to each of the above operations. Sometimes you _do_ want to be able to explicitly specify the Order you wish to operate on. In this case, you need to define a custom [ActiveOrderStrategy]({{< relref "active-order-strategy" >}}).
--- title: "Admin UI API" weight: 10 showtoc: false --- # Vendure Admin UI API Docs These APIs are used when building your own custom extensions to the Admin UI provided by the AdminUiPlugin. {{% alert %}} All documentation in this section is auto-generated from the TypeScript & HTML source of the Vendure Admin UI package. {{< /alert >}}
--- title: "ActionBarContext" isDefaultIndex: false generated: true --- <!-- This file was generated from the Vendure source. Do not modify. Instead, re-run the "docs:build" script --> import MemberInfo from '@site/src/components/MemberInfo'; import GenerationInfo from '@site/src/components/GenerationInfo'; import MemberDescription from '@site/src/components/MemberDescription'; ## ActionBarContext <GenerationInfo sourceFile="packages/admin-ui/src/lib/core/src/providers/nav-builder/nav-builder-types.ts" sourceLine="90" packageName="@vendure/admin-ui" /> Providers & data available to the `onClick` & `buttonState` functions of an <a href='/reference/admin-ui-api/action-bar/action-bar-item#actionbaritem'>ActionBarItem</a>, <a href='/reference/admin-ui-api/action-bar/action-bar-dropdown-menu-item#actionbardropdownmenuitem'>ActionBarDropdownMenuItem</a> or <a href='/reference/admin-ui-api/nav-menu/nav-menu-item#navmenuitem'>NavMenuItem</a>. ```ts title="Signature" interface ActionBarContext { route: ActivatedRoute; injector: Injector; dataService: DataService; notificationService: NotificationService; entity$: Observable<Record<string, any> | undefined>; } ``` <div className="members-wrapper"> ### route <MemberInfo kind="property" type={`ActivatedRoute`} /> The router's [ActivatedRoute](https://angular.dev/guide/routing/router-reference#activated-route) object for the current route. This object contains information about the route, its parameters, and additional data associated with the route. ### injector <MemberInfo kind="property" type={`<a href='/reference/typescript-api/common/injector#injector'>Injector</a>`} /> The Angular [Injector](https://angular.dev/api/core/Injector) which can be used to get instances of services and other providers available in the application. ### dataService <MemberInfo kind="property" type={`<a href='/reference/admin-ui-api/services/data-service#dataservice'>DataService</a>`} /> The [DataService](/reference/admin-ui-api/services/data-service), which provides methods for querying the server-side data. ### notificationService <MemberInfo kind="property" type={`<a href='/reference/admin-ui-api/services/notification-service#notificationservice'>NotificationService</a>`} /> The [NotificationService](/reference/admin-ui-api/services/notification-service), which provides methods for displaying notifications to the user. ### entity$ <MemberInfo kind="property" type={`Observable&#60;Record&#60;string, any&#62; | undefined&#62;`} since="2.2.0" /> An observable of the current entity in a detail view. In a list view the observable will not emit any values. *Example* ```ts addActionBarDropdownMenuItem({ id: 'print-invoice', locationId: 'order-detail', label: 'Print Invoice', icon: 'printer', buttonState: context => { // highlight-start return context.entity$.pipe( map((order) => { return order?.state === 'PaymentSettled' ? { disabled: false, visible: true } : { disabled: true, visible: true }; }), ); // highlight-end }, requiresPermission: ['UpdateOrder'], }), ``` </div>
--- title: "ActionBarDropdownMenuItem" isDefaultIndex: false generated: true --- <!-- This file was generated from the Vendure source. Do not modify. Instead, re-run the "docs:build" script --> import MemberInfo from '@site/src/components/MemberInfo'; import GenerationInfo from '@site/src/components/GenerationInfo'; import MemberDescription from '@site/src/components/MemberDescription'; ## ActionBarDropdownMenuItem <GenerationInfo sourceFile="packages/admin-ui/src/lib/core/src/providers/nav-builder/nav-builder-types.ts" sourceLine="227" packageName="@vendure/admin-ui" since="2.2.0" /> A dropdown menu item in the ActionBar area at the top of one of the list or detail views. ```ts title="Signature" interface ActionBarDropdownMenuItem { id: string; label: string; locationId: ActionBarLocationId; hasDivider?: boolean; buttonState?: (context: ActionBarContext) => Observable<ActionBarButtonState | undefined>; onClick?: (event: MouseEvent, context: ActionBarContext) => void; routerLink?: RouterLinkDefinition; icon?: string; requiresPermission?: string | string[]; } ``` <div className="members-wrapper"> ### id <MemberInfo kind="property" type={`string`} /> A unique identifier for the item. ### label <MemberInfo kind="property" type={`string`} /> The label to display for the item. This can also be a translation token, e.g. `invoice-plugin.print-invoice`. ### locationId <MemberInfo kind="property" type={`<a href='/reference/admin-ui-api/action-bar/action-bar-location-id#actionbarlocationid'>ActionBarLocationId</a>`} /> The location in the UI where this menu item should be displayed. ### hasDivider <MemberInfo kind="property" type={`boolean`} /> Whether to render a divider above this item. ### buttonState <MemberInfo kind="property" type={`(context: <a href='/reference/admin-ui-api/action-bar/action-bar-context#actionbarcontext'>ActionBarContext</a>) =&#62; Observable&#60;ActionBarButtonState | undefined&#62;`} /> A function which returns an observable of the button state, allowing you to dynamically enable/disable or show/hide the button. ### onClick <MemberInfo kind="property" type={`(event: MouseEvent, context: <a href='/reference/admin-ui-api/action-bar/action-bar-context#actionbarcontext'>ActionBarContext</a>) =&#62; void`} /> ### routerLink <MemberInfo kind="property" type={`<a href='/reference/admin-ui-api/action-bar/router-link-definition#routerlinkdefinition'>RouterLinkDefinition</a>`} /> ### icon <MemberInfo kind="property" type={`string`} /> An optional icon to display with the item. The icon should be a valid shape name from the [Clarity Icons](https://core.clarity.design/foundation/icons/shapes/) set. ### requiresPermission <MemberInfo kind="property" type={`string | string[]`} /> Control the display of this item based on the user permissions. Note: if you attempt to pass a <a href='/reference/typescript-api/auth/permission-definition#permissiondefinition'>PermissionDefinition</a> object, you will get a compilation error. Instead, pass the plain string version. For example, if the permission is defined as: ```ts export const MyPermission = new PermissionDefinition('ProductReview'); ``` then the generated permission strings will be: - `CreateProductReview` - `ReadProductReview` - `UpdateProductReview` - `DeleteProductReview` </div>
--- title: "ActionBarItem" isDefaultIndex: false generated: true --- <!-- This file was generated from the Vendure source. Do not modify. Instead, re-run the "docs:build" script --> import MemberInfo from '@site/src/components/MemberInfo'; import GenerationInfo from '@site/src/components/GenerationInfo'; import MemberDescription from '@site/src/components/MemberDescription'; ## ActionBarItem <GenerationInfo sourceFile="packages/admin-ui/src/lib/core/src/providers/nav-builder/nav-builder-types.ts" sourceLine="158" packageName="@vendure/admin-ui" /> A button in the ActionBar area at the top of one of the list or detail views. ```ts title="Signature" interface ActionBarItem { id: string; label: string; locationId: ActionBarLocationId; disabled?: Observable<boolean>; buttonState?: (context: ActionBarContext) => Observable<ActionBarButtonState>; onClick?: (event: MouseEvent, context: ActionBarContext) => void; routerLink?: RouterLinkDefinition; buttonColor?: 'primary' | 'success' | 'warning'; buttonStyle?: 'solid' | 'outline' | 'link'; icon?: string; requiresPermission?: string | string[]; } ``` <div className="members-wrapper"> ### id <MemberInfo kind="property" type={`string`} /> A unique identifier for the item. ### label <MemberInfo kind="property" type={`string`} /> The label to display for the item. This can also be a translation token, e.g. `invoice-plugin.print-invoice`. ### locationId <MemberInfo kind="property" type={`<a href='/reference/admin-ui-api/action-bar/action-bar-location-id#actionbarlocationid'>ActionBarLocationId</a>`} /> The location in the UI where this button should be displayed. ### disabled <MemberInfo kind="property" type={`Observable&#60;boolean&#62;`} /> Deprecated since v2.1.0 - use `buttonState` instead. ### buttonState <MemberInfo kind="property" type={`(context: <a href='/reference/admin-ui-api/action-bar/action-bar-context#actionbarcontext'>ActionBarContext</a>) =&#62; Observable&#60;ActionBarButtonState&#62;`} since="2.1.0" /> A function which returns an observable of the button state, allowing you to dynamically enable/disable or show/hide the button. ### onClick <MemberInfo kind="property" type={`(event: MouseEvent, context: <a href='/reference/admin-ui-api/action-bar/action-bar-context#actionbarcontext'>ActionBarContext</a>) =&#62; void`} /> ### routerLink <MemberInfo kind="property" type={`<a href='/reference/admin-ui-api/action-bar/router-link-definition#routerlinkdefinition'>RouterLinkDefinition</a>`} /> ### buttonColor <MemberInfo kind="property" type={`'primary' | 'success' | 'warning'`} /> ### buttonStyle <MemberInfo kind="property" type={`'solid' | 'outline' | 'link'`} /> ### icon <MemberInfo kind="property" type={`string`} /> An optional icon to display in the button. The icon should be a valid shape name from the [Clarity Icons](https://core.clarity.design/foundation/icons/shapes/) set. ### requiresPermission <MemberInfo kind="property" type={`string | string[]`} /> Control the display of this item based on the user permissions. Note: if you attempt to pass a <a href='/reference/typescript-api/auth/permission-definition#permissiondefinition'>PermissionDefinition</a> object, you will get a compilation error. Instead, pass the plain string version. For example, if the permission is defined as: ```ts export const MyPermission = new PermissionDefinition('ProductReview'); ``` then the generated permission strings will be: - `CreateProductReview` - `ReadProductReview` - `UpdateProductReview` - `DeleteProductReview` </div>
--- title: "ActionBarLocationId" isDefaultIndex: false generated: true --- <!-- This file was generated from the Vendure source. Do not modify. Instead, re-run the "docs:build" script --> import MemberInfo from '@site/src/components/MemberInfo'; import GenerationInfo from '@site/src/components/GenerationInfo'; import MemberDescription from '@site/src/components/MemberDescription'; ## ActionBarLocationId <GenerationInfo sourceFile="packages/admin-ui/src/lib/core/src/common/component-registry-types.ts" sourceLine="106" packageName="@vendure/admin-ui" /> The valid locationIds for registering action bar items. For a list of values, see <a href='/reference/admin-ui-api/action-bar/page-location-id#pagelocationid'>PageLocationId</a>. ```ts title="Signature" type ActionBarLocationId = PageLocationId ```
--- title: "AddActionBarDropdownMenuItem" isDefaultIndex: false generated: true --- <!-- This file was generated from the Vendure source. Do not modify. Instead, re-run the "docs:build" script --> import MemberInfo from '@site/src/components/MemberInfo'; import GenerationInfo from '@site/src/components/GenerationInfo'; import MemberDescription from '@site/src/components/MemberDescription'; ## addActionBarDropdownMenuItem <GenerationInfo sourceFile="packages/admin-ui/src/lib/core/src/extension/add-action-bar-dropdown-menu-item.ts" sourceLine="27" packageName="@vendure/admin-ui" since="2.2.0" /> Adds a dropdown menu item to the ActionBar at the top right of each list or detail view. The locationId can be determined by pressing `ctrl + u` when running the Admin UI in dev mode. *Example* ```ts title="providers.ts" import { addActionBarDropdownMenuItem } from '@vendure/admin-ui/core'; export default [ addActionBarDropdownMenuItem({ id: 'print-invoice', label: 'Print Invoice', locationId: 'order-detail', routerLink: ['/extensions/invoicing'], }), ]; ``` ```ts title="Signature" function addActionBarDropdownMenuItem(config: ActionBarDropdownMenuItem): Provider ``` Parameters ### config <MemberInfo kind="parameter" type={`<a href='/reference/admin-ui-api/action-bar/action-bar-dropdown-menu-item#actionbardropdownmenuitem'>ActionBarDropdownMenuItem</a>`} />
--- title: "AddActionBarItem" isDefaultIndex: false generated: true --- <!-- This file was generated from the Vendure source. Do not modify. Instead, re-run the "docs:build" script --> import MemberInfo from '@site/src/components/MemberInfo'; import GenerationInfo from '@site/src/components/GenerationInfo'; import MemberDescription from '@site/src/components/MemberDescription'; ## addActionBarItem <GenerationInfo sourceFile="packages/admin-ui/src/lib/core/src/extension/add-action-bar-item.ts" sourceLine="23" packageName="@vendure/admin-ui" /> Adds a button to the ActionBar at the top right of each list or detail view. The locationId can be determined by pressing `ctrl + u` when running the Admin UI in dev mode. *Example* ```ts title="providers.ts" export default [ addActionBarItem({ id: 'print-invoice', label: 'Print Invoice', locationId: 'order-detail', routerLink: ['/extensions/invoicing'], }), ]; ``` ```ts title="Signature" function addActionBarItem(config: ActionBarItem): Provider ``` Parameters ### config <MemberInfo kind="parameter" type={`<a href='/reference/admin-ui-api/action-bar/action-bar-item#actionbaritem'>ActionBarItem</a>`} />
--- title: "Action Bar" isDefaultIndex: true generated: true --- <!-- This file was generated from the Vendure source. Do not modify. Instead, re-run the "docs:build" script --> import MemberInfo from '@site/src/components/MemberInfo'; import GenerationInfo from '@site/src/components/GenerationInfo'; import MemberDescription from '@site/src/components/MemberDescription'; import DocCardList from '@theme/DocCardList'; <DocCardList />
--- title: "OnClickContext" isDefaultIndex: false generated: true --- <!-- This file was generated from the Vendure source. Do not modify. Instead, re-run the "docs:build" script --> import MemberInfo from '@site/src/components/MemberInfo'; import GenerationInfo from '@site/src/components/GenerationInfo'; import MemberDescription from '@site/src/components/MemberDescription'; ## OnClickContext <GenerationInfo sourceFile="packages/admin-ui/src/lib/core/src/providers/nav-builder/nav-builder-types.ts" sourceLine="77" packageName="@vendure/admin-ui" /> Utilities available to the onClick handler of an ActionBarItem. ```ts title="Signature" interface OnClickContext { route: ActivatedRoute; dataService: DataService; notificationService: NotificationService; } ``` <div className="members-wrapper"> ### route <MemberInfo kind="property" type={`ActivatedRoute`} /> ### dataService <MemberInfo kind="property" type={`<a href='/reference/admin-ui-api/providers/data-service#dataservice'>DataService</a>`} /> ### notificationService <MemberInfo kind="property" type={`<a href='/reference/admin-ui-api/providers/notification-service#notificationservice'>NotificationService</a>`} /> </div>
--- title: "PageLocationId" isDefaultIndex: false generated: true --- <!-- This file was generated from the Vendure source. Do not modify. Instead, re-run the "docs:build" script --> import MemberInfo from '@site/src/components/MemberInfo'; import GenerationInfo from '@site/src/components/GenerationInfo'; import MemberDescription from '@site/src/components/MemberDescription'; ## PageLocationId <GenerationInfo sourceFile="packages/admin-ui/src/lib/core/src/common/component-registry-types.ts" sourceLine="52" packageName="@vendure/admin-ui" /> The valid locationIds for registering action bar items or tabs. ```ts title="Signature" type PageLocationId = | 'administrator-detail' | 'administrator-list' | 'asset-detail' | 'asset-list' | 'channel-detail' | 'channel-list' | 'collection-detail' | 'collection-list' | 'country-detail' | 'country-list' | 'customer-detail' | 'customer-list' | 'customer-group-list' | 'customer-group-detail' | 'draft-order-detail' | 'facet-detail' | 'facet-list' | 'global-setting-detail' | 'system-status' | 'job-list' | 'order-detail' | 'order-list' | 'modify-order' | 'payment-method-detail' | 'payment-method-list' | 'product-detail' | 'product-list' | 'product-variant-detail' | 'profile' | 'promotion-detail' | 'promotion-list' | 'role-detail' | 'role-list' | 'seller-detail' | 'seller-list' | 'shipping-method-detail' | 'shipping-method-list' | 'stock-location-detail' | 'stock-location-list' | 'tax-category-detail' | 'tax-category-list' | 'tax-rate-detail' | 'tax-rate-list' | 'zone-detail' | 'zone-list' ```
--- title: "RouterLinkDefinition" isDefaultIndex: false generated: true --- <!-- This file was generated from the Vendure source. Do not modify. Instead, re-run the "docs:build" script --> import MemberInfo from '@site/src/components/MemberInfo'; import GenerationInfo from '@site/src/components/GenerationInfo'; import MemberDescription from '@site/src/components/MemberDescription'; ## RouterLinkDefinition <GenerationInfo sourceFile="packages/admin-ui/src/lib/core/src/providers/nav-builder/nav-builder-types.ts" sourceLine="289" packageName="@vendure/admin-ui" /> A function which returns the router link for an <a href='/reference/admin-ui-api/action-bar/action-bar-item#actionbaritem'>ActionBarItem</a> or <a href='/reference/admin-ui-api/nav-menu/nav-menu-item#navmenuitem'>NavMenuItem</a>. ```ts title="Signature" type RouterLinkDefinition = ((route: ActivatedRoute, context: ActionBarContext) => any[]) | any[] ```
--- title: "AlertConfig" isDefaultIndex: false generated: true --- <!-- This file was generated from the Vendure source. Do not modify. Instead, re-run the "docs:build" script --> import MemberInfo from '@site/src/components/MemberInfo'; import GenerationInfo from '@site/src/components/GenerationInfo'; import MemberDescription from '@site/src/components/MemberDescription'; ## AlertConfig <GenerationInfo sourceFile="packages/admin-ui/src/lib/core/src/providers/alerts/alerts.service.ts" sourceLine="62" packageName="@vendure/admin-ui" since="2.2.0" /> A configuration object for an Admin UI alert. ```ts title="Signature" interface AlertConfig<T = any> { id: string; check: (context: AlertContext) => T | Promise<T> | Observable<T>; recheck?: (context: AlertContext) => Observable<any>; isAlert: (data: T, context: AlertContext) => boolean; action: (data: T, context: AlertContext) => void; label: ( data: T, context: AlertContext, ) => { text: string; translationVars?: { [key: string]: string | number } }; requiredPermissions?: Permission[]; } ``` <div className="members-wrapper"> ### id <MemberInfo kind="property" type={`string`} /> A unique identifier for the alert. ### check <MemberInfo kind="property" type={`(context: <a href='/reference/admin-ui-api/alerts/alert-context#alertcontext'>AlertContext</a>) =&#62; T | Promise&#60;T&#62; | Observable&#60;T&#62;`} /> A function which is gets the data used to determine whether the alert should be shown. Typically, this function will query the server or some other remote data source. This function will be called once when the Admin UI app bootstraps, and can be also set to run at regular intervals by setting the `recheckIntervalMs` property. ### recheck <MemberInfo kind="property" type={`(context: <a href='/reference/admin-ui-api/alerts/alert-context#alertcontext'>AlertContext</a>) =&#62; Observable&#60;any&#62;`} default="undefined" /> A function which returns an Observable which is used to determine when to re-run the `check` function. Whenever the observable emits, the `check` function will be called again. A basic time-interval-based recheck can be achieved by using the `interval` function from RxJS. *Example* ```ts import { interval } from 'rxjs'; // ... recheck: () => interval(60_000) ``` If this is not set, the `check` function will only be called once when the Admin UI app bootstraps. ### isAlert <MemberInfo kind="property" type={`(data: T, context: <a href='/reference/admin-ui-api/alerts/alert-context#alertcontext'>AlertContext</a>) =&#62; boolean`} /> A function which determines whether the alert should be shown based on the data returned by the `check` function. ### action <MemberInfo kind="property" type={`(data: T, context: <a href='/reference/admin-ui-api/alerts/alert-context#alertcontext'>AlertContext</a>) =&#62; void`} /> A function which is called when the alert is clicked in the Admin UI. ### label <MemberInfo kind="property" type={`( data: T, context: <a href='/reference/admin-ui-api/alerts/alert-context#alertcontext'>AlertContext</a>, ) =&#62; { text: string; translationVars?: { [key: string]: string | number } }`} /> A function which returns the text used in the UI to describe the alert. ### requiredPermissions <MemberInfo kind="property" type={`<a href='/reference/typescript-api/common/permission#permission'>Permission</a>[]`} /> A list of permissions which the current Administrator must have in order. If the current Administrator does not have these permissions, none of the other alert functions will be called. </div>
--- title: "AlertContext" isDefaultIndex: false generated: true --- <!-- This file was generated from the Vendure source. Do not modify. Instead, re-run the "docs:build" script --> import MemberInfo from '@site/src/components/MemberInfo'; import GenerationInfo from '@site/src/components/GenerationInfo'; import MemberDescription from '@site/src/components/MemberDescription'; ## AlertContext <GenerationInfo sourceFile="packages/admin-ui/src/lib/core/src/providers/alerts/alerts.service.ts" sourceLine="28" packageName="@vendure/admin-ui" since="2.2.0" /> The context object which is passed to the `check`, `isAlert`, `label` and `action` functions of an <a href='/reference/admin-ui-api/alerts/alert-config#alertconfig'>AlertConfig</a> object. ```ts title="Signature" interface AlertContext { injector: Injector; dataService: DataService; notificationService: NotificationService; modalService: ModalService; } ``` <div className="members-wrapper"> ### injector <MemberInfo kind="property" type={`<a href='/reference/typescript-api/common/injector#injector'>Injector</a>`} /> The Angular [Injector](https://angular.dev/api/core/Injector) which can be used to get instances of services and other providers available in the application. ### dataService <MemberInfo kind="property" type={`<a href='/reference/admin-ui-api/services/data-service#dataservice'>DataService</a>`} /> The [DataService](/reference/admin-ui-api/services/data-service), which provides methods for querying the server-side data. ### notificationService <MemberInfo kind="property" type={`<a href='/reference/admin-ui-api/services/notification-service#notificationservice'>NotificationService</a>`} /> The [NotificationService](/reference/admin-ui-api/services/notification-service), which provides methods for displaying notifications to the user. ### modalService <MemberInfo kind="property" type={`<a href='/reference/admin-ui-api/services/modal-service#modalservice'>ModalService</a>`} /> The [ModalService](/reference/admin-ui-api/services/modal-service), which provides methods for opening modal dialogs. </div>
--- title: "Alerts" isDefaultIndex: true generated: true --- <!-- This file was generated from the Vendure source. Do not modify. Instead, re-run the "docs:build" script --> import MemberInfo from '@site/src/components/MemberInfo'; import GenerationInfo from '@site/src/components/GenerationInfo'; import MemberDescription from '@site/src/components/MemberDescription'; import DocCardList from '@theme/DocCardList'; <DocCardList />
--- title: "RegisterAlert" isDefaultIndex: false generated: true --- <!-- This file was generated from the Vendure source. Do not modify. Instead, re-run the "docs:build" script --> import MemberInfo from '@site/src/components/MemberInfo'; import GenerationInfo from '@site/src/components/GenerationInfo'; import MemberDescription from '@site/src/components/MemberDescription'; ## registerAlert <GenerationInfo sourceFile="packages/admin-ui/src/lib/core/src/extension/register-alert.ts" sourceLine="12" packageName="@vendure/admin-ui" since="2.2.0" /> Registers an alert which can be displayed in the Admin UI alert dropdown in the top bar. The alert is configured using the <a href='/reference/admin-ui-api/alerts/alert-config#alertconfig'>AlertConfig</a> object. ```ts title="Signature" function registerAlert(config: AlertConfig): FactoryProvider ``` Parameters ### config <MemberInfo kind="parameter" type={`<a href='/reference/admin-ui-api/alerts/alert-config#alertconfig'>AlertConfig</a>`} />
--- title: "BulkAction" isDefaultIndex: false generated: true --- <!-- This file was generated from the Vendure source. Do not modify. Instead, re-run the "docs:build" script --> import MemberInfo from '@site/src/components/MemberInfo'; import GenerationInfo from '@site/src/components/GenerationInfo'; import MemberDescription from '@site/src/components/MemberDescription'; ## BulkAction <GenerationInfo sourceFile="packages/admin-ui/src/lib/core/src/providers/bulk-action-registry/bulk-action-types.ts" sourceLine="99" packageName="@vendure/admin-ui" since="1.8.0" /> Configures a bulk action which can be performed on all selected items in a list view. For a full example, see the <a href='/reference/admin-ui-api/bulk-actions/register-bulk-action#registerbulkaction'>registerBulkAction</a> docs. ```ts title="Signature" interface BulkAction<ItemType = any, ComponentType = any> { location: BulkActionLocationId; label: string; getTranslationVars?: ( context: BulkActionFunctionContext<ItemType, ComponentType>, ) => Record<string, string | number> | Promise<Record<string, string | number>>; icon?: string; iconClass?: string; onClick: (context: BulkActionClickContext<ItemType, ComponentType>) => void; isVisible?: (context: BulkActionFunctionContext<ItemType, ComponentType>) => boolean | Promise<boolean>; requiresPermission?: string | ((userPermissions: string[]) => boolean); } ``` <div className="members-wrapper"> ### location <MemberInfo kind="property" type={`<a href='/reference/admin-ui-api/bulk-actions/bulk-action#bulkactionlocationid'>BulkActionLocationId</a>`} /> ### label <MemberInfo kind="property" type={`string`} /> ### getTranslationVars <MemberInfo kind="property" type={`( context: <a href='/reference/admin-ui-api/bulk-actions/bulk-action#bulkactionfunctioncontext'>BulkActionFunctionContext</a>&#60;ItemType, ComponentType&#62;, ) =&#62; Record&#60;string, string | number&#62; | Promise&#60;Record&#60;string, string | number&#62;&#62;`} /> An optional function that should resolve to a map of translation variables which can be used when translating the `label` string. ### icon <MemberInfo kind="property" type={`string`} /> A valid [Clarity Icons](https://core.clarity.design/foundation/icons/shapes/) icon shape, e.g. "cog", "user", "info-standard". ### iconClass <MemberInfo kind="property" type={`string`} /> A class to be added to the icon element. Examples: - is-success - is-danger - is-warning - is-info - is-highlight ### onClick <MemberInfo kind="property" type={`(context: <a href='/reference/admin-ui-api/bulk-actions/bulk-action#bulkactionclickcontext'>BulkActionClickContext</a>&#60;ItemType, ComponentType&#62;) =&#62; void`} /> Defines the logic that executes when the bulk action button is clicked. ### isVisible <MemberInfo kind="property" type={`(context: <a href='/reference/admin-ui-api/bulk-actions/bulk-action#bulkactionfunctioncontext'>BulkActionFunctionContext</a>&#60;ItemType, ComponentType&#62;) =&#62; boolean | Promise&#60;boolean&#62;`} /> A function that determines whether this bulk action item should be displayed in the menu. If not defined, the item will always be displayed. This function will be invoked each time the selection is changed, so try to avoid expensive code running here. *Example* ```ts import { registerBulkAction, DataService } from '@vendure/admin-ui/core'; registerBulkAction({ location: 'product-list', label: 'Assign to channel', // Only display this action if there are multiple channels isVisible: ({ injector }) => injector.get(DataService).client .userStatus() .mapSingle(({ userStatus }) => 1 < userStatus.channels.length) .toPromise(), // ... }); ``` ### requiresPermission <MemberInfo kind="property" type={`string | ((userPermissions: string[]) =&#62; boolean)`} /> Control the display of this item based on the user permissions. *Example* ```ts registerBulkAction({ // Can be specified as a simple string requiresPermission: Permission.UpdateProduct, // Or as a function that returns a boolean if permissions are satisfied requiresPermission: userPermissions => userPermissions.includes(Permission.UpdateCatalog) || userPermissions.includes(Permission.UpdateProduct), // ... }) ``` </div> ## BulkActionLocationId <GenerationInfo sourceFile="packages/admin-ui/src/lib/core/src/providers/bulk-action-registry/bulk-action-types.ts" sourceLine="12" packageName="@vendure/admin-ui" since="1.8.0" /> A valid location of a list view that supports the bulk actions API. ```ts title="Signature" type BulkActionLocationId = | 'product-list' | 'facet-list' | 'collection-list' | 'customer-list' | 'customer-group-list' | 'customer-group-members-list' | 'customer-group-members-picker-list' | 'promotion-list' | 'seller-list' | 'channel-list' | 'administrator-list' | 'role-list' | 'shipping-method-list' | 'stock-location-list' | 'payment-method-list' | 'tax-category-list' | 'tax-rate-list' | 'zone-list' | 'zone-members-list' | string ``` ## BulkActionFunctionContext <GenerationInfo sourceFile="packages/admin-ui/src/lib/core/src/providers/bulk-action-registry/bulk-action-types.ts" sourceLine="43" packageName="@vendure/admin-ui" since="1.8.0" /> This is the argument which gets passed to the `getTranslationVars` and `isVisible` functions of the BulkAction definition. ```ts title="Signature" interface BulkActionFunctionContext<ItemType, ComponentType> { selection: ItemType[]; hostComponent: ComponentType; injector: Injector; route: ActivatedRoute; } ``` <div className="members-wrapper"> ### selection <MemberInfo kind="property" type={`ItemType[]`} /> An array of the selected items from the list. ### hostComponent <MemberInfo kind="property" type={`ComponentType`} /> The component instance that is hosting the list view. For instance, `ProductListComponent`. This can be used to call methods on the instance, e.g. calling `hostComponent.refresh()` to force a list refresh after deleting the selected items. ### injector <MemberInfo kind="property" type={`<a href='/reference/typescript-api/common/injector#injector'>Injector</a>`} /> The Angular [Injector](https://angular.io/api/core/Injector) which can be used to get service instances which might be needed in the click handler. ### route <MemberInfo kind="property" type={`ActivatedRoute`} /> </div> ## BulkActionClickContext <GenerationInfo sourceFile="packages/admin-ui/src/lib/core/src/providers/bulk-action-registry/bulk-action-types.ts" sourceLine="74" packageName="@vendure/admin-ui" since="1.8.0" /> This is the argument which gets passed to the `onClick` function of a BulkAction. ```ts title="Signature" interface BulkActionClickContext<ItemType, ComponentType> extends BulkActionFunctionContext<ItemType, ComponentType> { clearSelection: () => void; event: MouseEvent; } ``` * Extends: <code><a href='/reference/admin-ui-api/bulk-actions/bulk-action#bulkactionfunctioncontext'>BulkActionFunctionContext</a>&#60;ItemType, ComponentType&#62;</code> <div className="members-wrapper"> ### clearSelection <MemberInfo kind="property" type={`() =&#62; void`} /> Clears the selection in the active list view. ### event <MemberInfo kind="property" type={`MouseEvent`} /> The click event itself. </div>
--- title: "Bulk Actions" isDefaultIndex: true generated: true --- <!-- This file was generated from the Vendure source. Do not modify. Instead, re-run the "docs:build" script --> import MemberInfo from '@site/src/components/MemberInfo'; import GenerationInfo from '@site/src/components/GenerationInfo'; import MemberDescription from '@site/src/components/MemberDescription'; import DocCardList from '@theme/DocCardList'; <DocCardList />
--- title: "RegisterBulkAction" isDefaultIndex: false generated: true --- <!-- This file was generated from the Vendure source. Do not modify. Instead, re-run the "docs:build" script --> import MemberInfo from '@site/src/components/MemberInfo'; import GenerationInfo from '@site/src/components/GenerationInfo'; import MemberDescription from '@site/src/components/MemberDescription'; ## registerBulkAction <GenerationInfo sourceFile="packages/admin-ui/src/lib/core/src/extension/register-bulk-action.ts" sourceLine="52" packageName="@vendure/admin-ui" since="1.8.0" /> Registers a custom <a href='/reference/admin-ui-api/bulk-actions/bulk-action#bulkaction'>BulkAction</a> which can be invoked from the bulk action menu of any supported list view. This allows you to provide custom functionality that can operate on any of the selected items in the list view. In this example, imagine we have an integration with a 3rd-party text translation service. This bulk action allows us to select multiple products from the product list view, and send them for translation via a custom service which integrates with the translation service's API. *Example* ```ts title="providers.ts" import { ModalService, registerBulkAction, SharedModule } from '@vendure/admin-ui/core'; import { ProductDataTranslationService } from './product-data-translation.service'; export default [ ProductDataTranslationService, registerBulkAction({ location: 'product-list', label: 'Send to translation service', icon: 'language', onClick: ({ injector, selection }) => { const modalService = injector.get(ModalService); const translationService = injector.get(ProductDataTranslationService); modalService .dialog({ title: `Send ${selection.length} products for translation?`, buttons: [ { type: 'secondary', label: 'cancel' }, { type: 'primary', label: 'send', returnValue: true }, ], }) .subscribe(response => { if (response) { translationService.sendForTranslation(selection.map(item => item.productId)); } }); }, }), ]; ``` ```ts title="Signature" function registerBulkAction(bulkAction: BulkAction): FactoryProvider ``` Parameters ### bulkAction <MemberInfo kind="parameter" type={`<a href='/reference/admin-ui-api/bulk-actions/bulk-action#bulkaction'>BulkAction</a>`} />
--- title: "AssetPickerDialogComponent" isDefaultIndex: false generated: true --- <!-- This file was generated from the Vendure source. Do not modify. Instead, re-run the "docs:build" script --> import MemberInfo from '@site/src/components/MemberInfo'; import GenerationInfo from '@site/src/components/GenerationInfo'; import MemberDescription from '@site/src/components/MemberDescription'; ## AssetPickerDialogComponent <GenerationInfo sourceFile="packages/admin-ui/src/lib/core/src/shared/components/asset-picker-dialog/asset-picker-dialog.component.ts" sourceLine="52" packageName="@vendure/admin-ui" /> A dialog which allows the creation and selection of assets. *Example* ```ts selectAssets() { this.modalService .fromComponent(AssetPickerDialogComponent, { size: 'xl', }) .subscribe(result => { if (result && result.length) { // ... } }); } ``` ```ts title="Signature" class AssetPickerDialogComponent implements OnInit, AfterViewInit, OnDestroy, Dialog<Asset[]> { assets$: Observable<AssetLike[]>; allTags$: Observable<TagFragment[]>; paginationConfig: PaginationInstance = { currentPage: 1, itemsPerPage: 25, totalItems: 1, }; multiSelect = true; initialTags: string[] = []; resolveWith: (result?: Asset[]) => void; selection: Asset[] = []; searchTerm$ = new BehaviorSubject<string | undefined>(undefined); filterByTags$ = new BehaviorSubject<TagFragment[] | undefined>(undefined); uploading = false; constructor(dataService: DataService, notificationService: NotificationService) ngOnInit() => ; ngAfterViewInit() => ; ngOnDestroy() => void; pageChange(page: number) => ; itemsPerPageChange(itemsPerPage: number) => ; cancel() => ; select() => ; createAssets(files: File[]) => ; } ``` * Implements: <code>OnInit</code>, <code>AfterViewInit</code>, <code>OnDestroy</code>, <code><a href='/reference/admin-ui-api/services/modal-service#dialog'>Dialog</a>&#60;<a href='/reference/typescript-api/entities/asset#asset'>Asset</a>[]&#62;</code> <div className="members-wrapper"> ### assets$ <MemberInfo kind="property" type={`Observable&#60;AssetLike[]&#62;`} /> ### allTags$ <MemberInfo kind="property" type={`Observable&#60;TagFragment[]&#62;`} /> ### paginationConfig <MemberInfo kind="property" type={`PaginationInstance`} /> ### multiSelect <MemberInfo kind="property" type={``} /> ### initialTags <MemberInfo kind="property" type={`string[]`} /> ### resolveWith <MemberInfo kind="property" type={`(result?: <a href='/reference/typescript-api/entities/asset#asset'>Asset</a>[]) =&#62; void`} /> ### selection <MemberInfo kind="property" type={`<a href='/reference/typescript-api/entities/asset#asset'>Asset</a>[]`} /> ### searchTerm$ <MemberInfo kind="property" type={``} /> ### filterByTags$ <MemberInfo kind="property" type={``} /> ### uploading <MemberInfo kind="property" type={``} /> ### constructor <MemberInfo kind="method" type={`(dataService: <a href='/reference/admin-ui-api/services/data-service#dataservice'>DataService</a>, notificationService: <a href='/reference/admin-ui-api/services/notification-service#notificationservice'>NotificationService</a>) => AssetPickerDialogComponent`} /> ### ngOnInit <MemberInfo kind="method" type={`() => `} /> ### ngAfterViewInit <MemberInfo kind="method" type={`() => `} /> ### ngOnDestroy <MemberInfo kind="method" type={`() => void`} /> ### pageChange <MemberInfo kind="method" type={`(page: number) => `} /> ### itemsPerPageChange <MemberInfo kind="method" type={`(itemsPerPage: number) => `} /> ### cancel <MemberInfo kind="method" type={`() => `} /> ### select <MemberInfo kind="method" type={`() => `} /> ### createAssets <MemberInfo kind="method" type={`(files: File[]) => `} /> </div>
--- title: "ChipComponent" isDefaultIndex: false generated: true --- <!-- This file was generated from the Vendure source. Do not modify. Instead, re-run the "docs:build" script --> import MemberInfo from '@site/src/components/MemberInfo'; import GenerationInfo from '@site/src/components/GenerationInfo'; import MemberDescription from '@site/src/components/MemberDescription'; ## ChipComponent <GenerationInfo sourceFile="packages/admin-ui/src/lib/core/src/shared/components/chip/chip.component.ts" sourceLine="16" packageName="@vendure/admin-ui" /> A chip component for displaying a label with an optional action icon. *Example* ```HTML <vdr-chip [colorFrom]="item.value" icon="close" (iconClick)="clear(item)"> {{ item.value }}</vdr-chip> ``` ```ts title="Signature" class ChipComponent { @Input() icon: string; @Input() invert = false; @Input() colorFrom = ''; @Input() colorType: 'error' | 'success' | 'warning'; @Output() iconClick = new EventEmitter<MouseEvent>(); } ``` <div className="members-wrapper"> ### icon <MemberInfo kind="property" type={`string`} /> The icon should be the name of one of the available Clarity icons: https://clarity.design/foundation/icons/shapes/ ### invert <MemberInfo kind="property" type={``} /> ### colorFrom <MemberInfo kind="property" type={``} /> If set, the chip will have an auto-generated background color based on the string value passed in. ### colorType <MemberInfo kind="property" type={`'error' | 'success' | 'warning'`} /> The color of the chip can also be one of the standard status colors. ### iconClick <MemberInfo kind="property" type={``} /> </div>
--- title: "CurrencyInputComponent" isDefaultIndex: false generated: true --- <!-- This file was generated from the Vendure source. Do not modify. Instead, re-run the "docs:build" script --> import MemberInfo from '@site/src/components/MemberInfo'; import GenerationInfo from '@site/src/components/GenerationInfo'; import MemberDescription from '@site/src/components/MemberDescription'; ## CurrencyInputComponent <GenerationInfo sourceFile="packages/admin-ui/src/lib/core/src/shared/components/currency-input/currency-input.component.ts" sourceLine="33" packageName="@vendure/admin-ui" /> A form input control which displays currency in decimal format, whilst working with the integer cent value in the background. *Example* ```HTML <vdr-currency-input [(ngModel)]="entityPrice" [currencyCode]="currencyCode" ></vdr-currency-input> ``` ```ts title="Signature" class CurrencyInputComponent implements ControlValueAccessor, OnInit, OnChanges, OnDestroy { @Input() disabled = false; @Input() readonly = false; @Input() value: number; @Input() currencyCode = ''; @Output() valueChange = new EventEmitter(); prefix$: Observable<string>; suffix$: Observable<string>; hasFractionPart = true; onChange: (val: any) => void; onTouch: () => void; _inputValue: string; readonly precision: number; readonly precisionFactor: number; constructor(dataService: DataService, currencyService: CurrencyService) ngOnInit() => ; ngOnChanges(changes: SimpleChanges) => ; ngOnDestroy() => ; registerOnChange(fn: any) => ; registerOnTouched(fn: any) => ; setDisabledState(isDisabled: boolean) => ; onInput(value: string) => ; onFocus() => ; writeValue(value: any) => void; } ``` * Implements: <code>ControlValueAccessor</code>, <code>OnInit</code>, <code>OnChanges</code>, <code>OnDestroy</code> <div className="members-wrapper"> ### disabled <MemberInfo kind="property" type={``} /> ### readonly <MemberInfo kind="property" type={``} /> ### value <MemberInfo kind="property" type={`number`} /> ### currencyCode <MemberInfo kind="property" type={``} /> ### valueChange <MemberInfo kind="property" type={``} /> ### prefix$ <MemberInfo kind="property" type={`Observable&#60;string&#62;`} /> ### suffix$ <MemberInfo kind="property" type={`Observable&#60;string&#62;`} /> ### hasFractionPart <MemberInfo kind="property" type={``} /> ### onChange <MemberInfo kind="property" type={`(val: any) =&#62; void`} /> ### onTouch <MemberInfo kind="property" type={`() =&#62; void`} /> ### _inputValue <MemberInfo kind="property" type={`string`} /> ### precision <MemberInfo kind="property" type={`number`} /> ### precisionFactor <MemberInfo kind="property" type={`number`} /> ### constructor <MemberInfo kind="method" type={`(dataService: <a href='/reference/admin-ui-api/services/data-service#dataservice'>DataService</a>, currencyService: CurrencyService) => CurrencyInputComponent`} /> ### ngOnInit <MemberInfo kind="method" type={`() => `} /> ### ngOnChanges <MemberInfo kind="method" type={`(changes: SimpleChanges) => `} /> ### ngOnDestroy <MemberInfo kind="method" type={`() => `} /> ### registerOnChange <MemberInfo kind="method" type={`(fn: any) => `} /> ### registerOnTouched <MemberInfo kind="method" type={`(fn: any) => `} /> ### setDisabledState <MemberInfo kind="method" type={`(isDisabled: boolean) => `} /> ### onInput <MemberInfo kind="method" type={`(value: string) => `} /> ### onFocus <MemberInfo kind="method" type={`() => `} /> ### writeValue <MemberInfo kind="method" type={`(value: any) => void`} /> </div>
--- title: "DataTableComponent" isDefaultIndex: false generated: true --- <!-- This file was generated from the Vendure source. Do not modify. Instead, re-run the "docs:build" script --> import MemberInfo from '@site/src/components/MemberInfo'; import GenerationInfo from '@site/src/components/GenerationInfo'; import MemberDescription from '@site/src/components/MemberDescription'; ## DataTableComponent <GenerationInfo sourceFile="packages/admin-ui/src/lib/core/src/shared/components/data-table/data-table.component.ts" sourceLine="86" packageName="@vendure/admin-ui" /> A table for displaying PaginatedList results. It is designed to be used inside components which extend the <a href='/reference/admin-ui-api/list-detail-views/base-list-component#baselistcomponent'>BaseListComponent</a> class. **Deprecated** This component is deprecated. Use the <a href='/reference/admin-ui-api/components/data-table2component#datatable2component'>DataTable2Component</a> instead. *Example* ```HTML <vdr-data-table [items]="items$ | async" [itemsPerPage]="itemsPerPage$ | async" [totalItems]="totalItems$ | async" [currentPage]="currentPage$ | async" (pageChange)="setPageNumber($event)" (itemsPerPageChange)="setItemsPerPage($event)" > <!-- The header columns are defined first --> <vdr-dt-column>{{ 'common.name' | translate }}</vdr-dt-column> <vdr-dt-column></vdr-dt-column> <vdr-dt-column></vdr-dt-column> <!-- Then we define how a row is rendered --> <ng-template let-taxRate="item"> <td class="left align-middle">{{ taxRate.name }}</td> <td class="left align-middle">{{ taxRate.category.name }}</td> <td class="left align-middle">{{ taxRate.zone.name }}</td> <td class="left align-middle">{{ taxRate.value }}%</td> <td class="right align-middle"> <vdr-table-row-action iconShape="edit" [label]="'common.edit' | translate" [linkTo]="['./', taxRate.id]" ></vdr-table-row-action> </td> <td class="right align-middle"> <vdr-dropdown> <button type="button" class="btn btn-link btn-sm" vdrDropdownTrigger> {{ 'common.actions' | translate }} <clr-icon shape="caret down"></clr-icon> </button> <vdr-dropdown-menu vdrPosition="bottom-right"> <button type="button" class="delete-button" (click)="deleteTaxRate(taxRate)" [disabled]="!(['DeleteSettings', 'DeleteTaxRate'] | hasPermission)" vdrDropdownItem > <clr-icon shape="trash" class="is-danger"></clr-icon> {{ 'common.delete' | translate }} </button> </vdr-dropdown-menu> </vdr-dropdown> </td> </ng-template> </vdr-data-table> ``` ```ts title="Signature" class DataTableComponent<T> implements AfterContentInit, OnChanges, OnInit, OnDestroy { @Input() items: T[]; @Input() itemsPerPage: number; @Input() currentPage: number; @Input() totalItems: number; @Input() emptyStateLabel: string; @Input() selectionManager?: SelectionManager<T>; @Output() pageChange = new EventEmitter<number>(); @Output() itemsPerPageChange = new EventEmitter<number>(); @Input() allSelected: boolean; @Input() isRowSelectedFn: ((item: T) => boolean) | undefined; @Output() allSelectChange = new EventEmitter<void>(); @Output() rowSelectChange = new EventEmitter<{ event: MouseEvent; item: T }>(); @ContentChildren(DataTableColumnComponent) columns: QueryList<DataTableColumnComponent>; @ContentChildren(TemplateRef) templateRefs: QueryList<TemplateRef<any>>; rowTemplate: TemplateRef<any>; currentStart: number; currentEnd: number; disableSelect = false; constructor(changeDetectorRef: ChangeDetectorRef) ngOnInit() => ; ngOnChanges(changes: SimpleChanges) => ; ngOnDestroy() => ; ngAfterContentInit() => void; trackByFn(index: number, item: any) => ; onToggleAllClick() => ; onRowClick(item: T, event: MouseEvent) => ; } ``` * Implements: <code>AfterContentInit</code>, <code>OnChanges</code>, <code>OnInit</code>, <code>OnDestroy</code> <div className="members-wrapper"> ### items <MemberInfo kind="property" type={`T[]`} /> ### itemsPerPage <MemberInfo kind="property" type={`number`} /> ### currentPage <MemberInfo kind="property" type={`number`} /> ### totalItems <MemberInfo kind="property" type={`number`} /> ### emptyStateLabel <MemberInfo kind="property" type={`string`} /> ### selectionManager <MemberInfo kind="property" type={`SelectionManager&#60;T&#62;`} /> ### pageChange <MemberInfo kind="property" type={``} /> ### itemsPerPageChange <MemberInfo kind="property" type={``} /> ### allSelected <MemberInfo kind="property" type={`boolean`} /> ### isRowSelectedFn <MemberInfo kind="property" type={`((item: T) =&#62; boolean) | undefined`} /> ### allSelectChange <MemberInfo kind="property" type={``} /> ### rowSelectChange <MemberInfo kind="property" type={``} /> ### columns <MemberInfo kind="property" type={`QueryList&#60;DataTableColumnComponent&#62;`} /> ### templateRefs <MemberInfo kind="property" type={`QueryList&#60;TemplateRef&#60;any&#62;&#62;`} /> ### rowTemplate <MemberInfo kind="property" type={`TemplateRef&#60;any&#62;`} /> ### currentStart <MemberInfo kind="property" type={`number`} /> ### currentEnd <MemberInfo kind="property" type={`number`} /> ### disableSelect <MemberInfo kind="property" type={``} /> ### constructor <MemberInfo kind="method" type={`(changeDetectorRef: ChangeDetectorRef) => DataTableComponent`} /> ### ngOnInit <MemberInfo kind="method" type={`() => `} /> ### ngOnChanges <MemberInfo kind="method" type={`(changes: SimpleChanges) => `} /> ### ngOnDestroy <MemberInfo kind="method" type={`() => `} /> ### ngAfterContentInit <MemberInfo kind="method" type={`() => void`} /> ### trackByFn <MemberInfo kind="method" type={`(index: number, item: any) => `} /> ### onToggleAllClick <MemberInfo kind="method" type={`() => `} /> ### onRowClick <MemberInfo kind="method" type={`(item: T, event: MouseEvent) => `} /> </div>
--- title: "DataTable2Component" isDefaultIndex: false generated: true --- <!-- This file was generated from the Vendure source. Do not modify. Instead, re-run the "docs:build" script --> import MemberInfo from '@site/src/components/MemberInfo'; import GenerationInfo from '@site/src/components/GenerationInfo'; import MemberDescription from '@site/src/components/MemberDescription'; ## DataTable2Component <GenerationInfo sourceFile="packages/admin-ui/src/lib/core/src/shared/components/data-table-2/data-table2.component.ts" sourceLine="101" packageName="@vendure/admin-ui" /> A table for displaying PaginatedList results. It is designed to be used inside components which extend the <a href='/reference/admin-ui-api/list-detail-views/base-list-component#baselistcomponent'>BaseListComponent</a> or <a href='/reference/admin-ui-api/list-detail-views/typed-base-list-component#typedbaselistcomponent'>TypedBaseListComponent</a> class. *Example* ```html <vdr-data-table-2 id="product-review-list" [items]="items$ | async" [itemsPerPage]="itemsPerPage$ | async" [totalItems]="totalItems$ | async" [currentPage]="currentPage$ | async" [filters]="filters" (pageChange)="setPageNumber($event)" (itemsPerPageChange)="setItemsPerPage($event)" > <vdr-bulk-action-menu locationId="product-review-list" [hostComponent]="this" [selectionManager]="selectionManager" /> <vdr-dt2-search [searchTermControl]="searchTermControl" searchTermPlaceholder="Filter by title" /> <vdr-dt2-column [heading]="'common.id' | translate" [hiddenByDefault]="true"> <ng-template let-review="item"> {{ review.id }} </ng-template> </vdr-dt2-column> <vdr-dt2-column [heading]="'common.created-at' | translate" [hiddenByDefault]="true" [sort]="sorts.get('createdAt')" > <ng-template let-review="item"> {{ review.createdAt | localeDate : 'short' }} </ng-template> </vdr-dt2-column> <vdr-dt2-column [heading]="'common.updated-at' | translate" [hiddenByDefault]="true" [sort]="sorts.get('updatedAt')" > <ng-template let-review="item"> {{ review.updatedAt | localeDate : 'short' }} </ng-template> </vdr-dt2-column> <vdr-dt2-column [heading]="'common.name' | translate" [optional]="false" [sort]="sorts.get('name')"> <ng-template let-review="item"> <a class="button-ghost" [routerLink]="['./', review.id]" ><span>{{ review.name }}</span> <clr-icon shape="arrow right"></clr-icon> </a> </ng-template> </vdr-dt2-column> </vdr-data-table-2> ``` ```ts title="Signature" class DataTable2Component<T> implements AfterContentInit, OnChanges, OnDestroy { @Input() id: DataTableLocationId; @Input() items: T[]; @Input() itemsPerPage: number; @Input() currentPage: number; @Input() totalItems: number; @Input() emptyStateLabel: string; @Input() filters: DataTableFilterCollection; @Input() activeIndex = -1; @Output() pageChange = new EventEmitter<number>(); @Output() itemsPerPageChange = new EventEmitter<number>(); @ContentChildren(DataTable2ColumnComponent) columns: QueryList<DataTable2ColumnComponent<T>>; @ContentChildren(DataTableCustomFieldColumnComponent) customFieldColumns: QueryList<DataTableCustomFieldColumnComponent<T>>; @ContentChild(DataTable2SearchComponent) searchComponent: DataTable2SearchComponent; @ContentChild(BulkActionMenuComponent) bulkActionMenuComponent: BulkActionMenuComponent; @ContentChild('vdrDt2CustomSearch') customSearchTemplate: TemplateRef<any>; @ContentChildren(TemplateRef) templateRefs: QueryList<TemplateRef<any>>; injector = inject(Injector); route = inject(ActivatedRoute); filterPresetService = inject(FilterPresetService); dataTableCustomComponentService = inject(DataTableCustomComponentService); protected customComponents = new Map<string, { config: DataTableComponentConfig; injector: Injector }>(); rowTemplate: TemplateRef<any>; currentStart: number; currentEnd: number; disableSelect = false; showSearchFilterRow = false; protected uiLanguage$: Observable<LanguageCode>; protected destroy$ = new Subject<void>(); constructor(changeDetectorRef: ChangeDetectorRef, localStorageService: LocalStorageService, dataService: DataService) selectionManager: void allColumns: void visibleSortedColumns: void sortedColumns: void ngOnChanges(changes: SimpleChanges) => ; ngOnDestroy() => ; ngAfterContentInit() => void; onColumnReorder(event: { column: DataTable2ColumnComponent<any>; newIndex: number }) => ; onColumnsReset() => ; toggleSearchFilterRow() => ; trackByFn(index: number, item: any) => ; onToggleAllClick() => ; onRowClick(item: T, event: MouseEvent) => ; getDataTableConfig() => DataTableConfig; } ``` * Implements: <code>AfterContentInit</code>, <code>OnChanges</code>, <code>OnDestroy</code> <div className="members-wrapper"> ### id <MemberInfo kind="property" type={`DataTableLocationId`} /> ### items <MemberInfo kind="property" type={`T[]`} /> ### itemsPerPage <MemberInfo kind="property" type={`number`} /> ### currentPage <MemberInfo kind="property" type={`number`} /> ### totalItems <MemberInfo kind="property" type={`number`} /> ### emptyStateLabel <MemberInfo kind="property" type={`string`} /> ### filters <MemberInfo kind="property" type={`DataTableFilterCollection`} /> ### activeIndex <MemberInfo kind="property" type={``} /> ### pageChange <MemberInfo kind="property" type={``} /> ### itemsPerPageChange <MemberInfo kind="property" type={``} /> ### columns <MemberInfo kind="property" type={`QueryList&#60;DataTable2ColumnComponent&#60;T&#62;&#62;`} /> ### customFieldColumns <MemberInfo kind="property" type={`QueryList&#60;DataTableCustomFieldColumnComponent&#60;T&#62;&#62;`} /> ### searchComponent <MemberInfo kind="property" type={`DataTable2SearchComponent`} /> ### bulkActionMenuComponent <MemberInfo kind="property" type={`BulkActionMenuComponent`} /> ### customSearchTemplate <MemberInfo kind="property" type={`TemplateRef&#60;any&#62;`} /> ### templateRefs <MemberInfo kind="property" type={`QueryList&#60;TemplateRef&#60;any&#62;&#62;`} /> ### injector <MemberInfo kind="property" type={``} /> ### route <MemberInfo kind="property" type={``} /> ### filterPresetService <MemberInfo kind="property" type={``} /> ### dataTableCustomComponentService <MemberInfo kind="property" type={``} /> ### customComponents <MemberInfo kind="property" type={``} /> ### rowTemplate <MemberInfo kind="property" type={`TemplateRef&#60;any&#62;`} /> ### currentStart <MemberInfo kind="property" type={`number`} /> ### currentEnd <MemberInfo kind="property" type={`number`} /> ### disableSelect <MemberInfo kind="property" type={``} /> ### showSearchFilterRow <MemberInfo kind="property" type={``} /> ### uiLanguage$ <MemberInfo kind="property" type={`Observable&#60;<a href='/reference/typescript-api/common/language-code#languagecode'>LanguageCode</a>&#62;`} /> ### destroy$ <MemberInfo kind="property" type={``} /> ### constructor <MemberInfo kind="method" type={`(changeDetectorRef: ChangeDetectorRef, localStorageService: LocalStorageService, dataService: <a href='/reference/admin-ui-api/services/data-service#dataservice'>DataService</a>) => DataTable2Component`} /> ### selectionManager <MemberInfo kind="property" type={``} /> ### allColumns <MemberInfo kind="property" type={``} /> ### visibleSortedColumns <MemberInfo kind="property" type={``} /> ### sortedColumns <MemberInfo kind="property" type={``} /> ### ngOnChanges <MemberInfo kind="method" type={`(changes: SimpleChanges) => `} /> ### ngOnDestroy <MemberInfo kind="method" type={`() => `} /> ### ngAfterContentInit <MemberInfo kind="method" type={`() => void`} /> ### onColumnReorder <MemberInfo kind="method" type={`(event: { column: DataTable2ColumnComponent&#60;any&#62;; newIndex: number }) => `} /> ### onColumnsReset <MemberInfo kind="method" type={`() => `} /> ### toggleSearchFilterRow <MemberInfo kind="method" type={`() => `} /> ### trackByFn <MemberInfo kind="method" type={`(index: number, item: any) => `} /> ### onToggleAllClick <MemberInfo kind="method" type={`() => `} /> ### onRowClick <MemberInfo kind="method" type={`(item: T, event: MouseEvent) => `} /> ### getDataTableConfig <MemberInfo kind="method" type={`() => DataTableConfig`} /> </div>
--- title: "DatetimePickerComponent" isDefaultIndex: false generated: true --- <!-- This file was generated from the Vendure source. Do not modify. Instead, re-run the "docs:build" script --> import MemberInfo from '@site/src/components/MemberInfo'; import GenerationInfo from '@site/src/components/GenerationInfo'; import MemberDescription from '@site/src/components/MemberDescription'; ## DatetimePickerComponent <GenerationInfo sourceFile="packages/admin-ui/src/lib/core/src/shared/components/datetime-picker/datetime-picker.component.ts" sourceLine="39" packageName="@vendure/admin-ui" /> A form input for selecting datetime values. *Example* ```HTML <vdr-datetime-picker [(ngModel)]="startDate"></vdr-datetime-picker> ``` ```ts title="Signature" class DatetimePickerComponent implements ControlValueAccessor, AfterViewInit, OnInit, OnDestroy { @Input() yearRange; @Input() weekStartDay: DayOfWeek = 'mon'; @Input() timeGranularityInterval = 5; @Input() min: string | null = null; @Input() max: string | null = null; @Input() readonly = false; @ViewChild('dropdownComponent', { static: true }) dropdownComponent: DropdownComponent; @ViewChild('datetimeInput', { static: true }) datetimeInput: ElementRef<HTMLInputElement>; @ViewChild('calendarTable') calendarTable: ElementRef<HTMLTableElement>; disabled = false; calendarView$: Observable<CalendarView>; current$: Observable<CurrentView>; selected$: Observable<Date | null>; selectedHours$: Observable<number | null>; selectedMinutes$: Observable<number | null>; years: number[]; weekdays: string[] = []; hours: number[]; minutes: number[]; constructor(changeDetectorRef: ChangeDetectorRef, datetimePickerService: DatetimePickerService) ngOnInit() => ; ngAfterViewInit() => void; ngOnDestroy() => void; registerOnChange(fn: any) => ; registerOnTouched(fn: any) => ; setDisabledState(isDisabled: boolean) => ; writeValue(value: string | null) => ; prevMonth() => ; nextMonth() => ; selectToday() => ; setYear(event: Event) => ; setMonth(event: Event) => ; selectDay(day: DayCell) => ; clearValue() => ; handleCalendarKeydown(event: KeyboardEvent) => ; setHour(event: Event) => ; setMinute(event: Event) => ; closeDatepicker() => ; } ``` * Implements: <code>ControlValueAccessor</code>, <code>AfterViewInit</code>, <code>OnInit</code>, <code>OnDestroy</code> <div className="members-wrapper"> ### yearRange <MemberInfo kind="property" type={``} /> The range above and below the current year which is selectable from the year select control. If a min or max value is set, these will override the yearRange. ### weekStartDay <MemberInfo kind="property" type={`DayOfWeek`} /> The day that the week should start with in the calendar view. ### timeGranularityInterval <MemberInfo kind="property" type={``} /> The granularity of the minutes time picker ### min <MemberInfo kind="property" type={`string | null`} /> The minimum date as an ISO string ### max <MemberInfo kind="property" type={`string | null`} /> The maximum date as an ISO string ### readonly <MemberInfo kind="property" type={``} /> Sets the readonly state ### dropdownComponent <MemberInfo kind="property" type={`<a href='/reference/admin-ui-api/components/dropdown-component#dropdowncomponent'>DropdownComponent</a>`} /> ### datetimeInput <MemberInfo kind="property" type={`ElementRef&#60;HTMLInputElement&#62;`} /> ### calendarTable <MemberInfo kind="property" type={`ElementRef&#60;HTMLTableElement&#62;`} /> ### disabled <MemberInfo kind="property" type={``} /> ### calendarView$ <MemberInfo kind="property" type={`Observable&#60;CalendarView&#62;`} /> ### current$ <MemberInfo kind="property" type={`Observable&#60;CurrentView&#62;`} /> ### selected$ <MemberInfo kind="property" type={`Observable&#60;Date | null&#62;`} /> ### selectedHours$ <MemberInfo kind="property" type={`Observable&#60;number | null&#62;`} /> ### selectedMinutes$ <MemberInfo kind="property" type={`Observable&#60;number | null&#62;`} /> ### years <MemberInfo kind="property" type={`number[]`} /> ### weekdays <MemberInfo kind="property" type={`string[]`} /> ### hours <MemberInfo kind="property" type={`number[]`} /> ### minutes <MemberInfo kind="property" type={`number[]`} /> ### constructor <MemberInfo kind="method" type={`(changeDetectorRef: ChangeDetectorRef, datetimePickerService: DatetimePickerService) => DatetimePickerComponent`} /> ### ngOnInit <MemberInfo kind="method" type={`() => `} /> ### ngAfterViewInit <MemberInfo kind="method" type={`() => void`} /> ### ngOnDestroy <MemberInfo kind="method" type={`() => void`} /> ### registerOnChange <MemberInfo kind="method" type={`(fn: any) => `} /> ### registerOnTouched <MemberInfo kind="method" type={`(fn: any) => `} /> ### setDisabledState <MemberInfo kind="method" type={`(isDisabled: boolean) => `} /> ### writeValue <MemberInfo kind="method" type={`(value: string | null) => `} /> ### prevMonth <MemberInfo kind="method" type={`() => `} /> ### nextMonth <MemberInfo kind="method" type={`() => `} /> ### selectToday <MemberInfo kind="method" type={`() => `} /> ### setYear <MemberInfo kind="method" type={`(event: Event) => `} /> ### setMonth <MemberInfo kind="method" type={`(event: Event) => `} /> ### selectDay <MemberInfo kind="method" type={`(day: DayCell) => `} /> ### clearValue <MemberInfo kind="method" type={`() => `} /> ### handleCalendarKeydown <MemberInfo kind="method" type={`(event: KeyboardEvent) => `} /> ### setHour <MemberInfo kind="method" type={`(event: Event) => `} /> ### setMinute <MemberInfo kind="method" type={`(event: Event) => `} /> ### closeDatepicker <MemberInfo kind="method" type={`() => `} /> </div>