Browse Source

Merge branch 'master' into minor

Michael Bromley 3 years ago
parent
commit
518ca108c3

+ 9 - 0
CHANGELOG.md

@@ -1,3 +1,12 @@
+## <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>
 
 

+ 1 - 1
lerna.json

@@ -2,7 +2,7 @@
   "packages": [
     "packages/*"
   ],
-  "version": "1.7.2",
+  "version": "1.7.3",
   "npmClient": "yarn",
   "useWorkspaces": true,
   "command": {

+ 3 - 3
packages/admin-ui-plugin/package.json

@@ -1,6 +1,6 @@
 {
   "name": "@vendure/admin-ui-plugin",
-  "version": "1.7.2",
+  "version": "1.7.3",
   "main": "lib/index.js",
   "types": "lib/index.d.ts",
   "files": [
@@ -21,8 +21,8 @@
   "devDependencies": {
     "@types/express": "^4.17.8",
     "@types/fs-extra": "^9.0.1",
-    "@vendure/common": "^1.7.2",
-    "@vendure/core": "^1.7.2",
+    "@vendure/common": "^1.7.3",
+    "@vendure/core": "^1.7.3",
     "express": "^4.17.1",
     "rimraf": "^3.0.2",
     "typescript": "4.3.5"

+ 2 - 2
packages/admin-ui/package.json

@@ -1,6 +1,6 @@
 {
   "name": "@vendure/admin-ui",
-  "version": "1.7.2",
+  "version": "1.7.3",
   "license": "MIT",
   "scripts": {
     "ng": "ng",
@@ -39,7 +39,7 @@
     "@ng-select/ng-select": "^7.2.0",
     "@ngx-translate/core": "^13.0.0",
     "@ngx-translate/http-loader": "^6.0.0",
-    "@vendure/common": "^1.7.2",
+    "@vendure/common": "^1.7.3",
     "@webcomponents/custom-elements": "^1.4.3",
     "apollo-angular": "^2.6.0",
     "apollo-upload-client": "^16.0.0",

+ 1 - 1
packages/admin-ui/src/lib/core/src/common/utilities/configurable-operation-utils.ts

@@ -72,7 +72,7 @@ export function toConfigurableOperationInput(
         code: operation.code,
         arguments: operation.args.map(({ name, value }, j) => {
             const formValue = argsArray?.find(arg => arg.name === name)?.value ?? argsMap?.[name];
-            if (!formValue) {
+            if (formValue == null) {
                 throw new Error(`Cannot find an argument value for the key "${name}"`);
             }
             return {

+ 1 - 1
packages/admin-ui/src/lib/core/src/common/version.ts

@@ -1,2 +1,2 @@
 // Auto-generated by the set-version.js script.
-export const ADMIN_UI_VERSION = '1.7.2';
+export const ADMIN_UI_VERSION = '1.7.3';

+ 2 - 0
packages/admin-ui/src/lib/settings/src/components/shipping-method-detail/shipping-method-detail.component.ts

@@ -241,6 +241,8 @@ export class ShippingMethodDetailComponent
                     this.changeDetector.markForCheck();
                 },
                 err => {
+                    // tslint:disable-next-line:no-console
+                    console.error(err);
                     this.notificationService.error(_('common.notify-update-error'), {
                         entity: 'ShippingMethod',
                     });

+ 3 - 3
packages/asset-server-plugin/package.json

@@ -1,6 +1,6 @@
 {
   "name": "@vendure/asset-server-plugin",
-  "version": "1.7.2",
+  "version": "1.7.3",
   "main": "lib/index.js",
   "types": "lib/index.d.ts",
   "files": [
@@ -24,8 +24,8 @@
     "@types/fs-extra": "^9.0.8",
     "@types/node-fetch": "^2.5.8",
     "@types/sharp": "^0.30.4",
-    "@vendure/common": "^1.7.2",
-    "@vendure/core": "^1.7.2",
+    "@vendure/common": "^1.7.3",
+    "@vendure/core": "^1.7.3",
     "aws-sdk": "^2.856.0",
     "express": "^4.17.1",
     "node-fetch": "^2.6.1",

+ 1 - 1
packages/common/package.json

@@ -1,6 +1,6 @@
 {
   "name": "@vendure/common",
-  "version": "1.7.2",
+  "version": "1.7.3",
   "main": "index.js",
   "license": "MIT",
   "scripts": {

+ 2 - 2
packages/core/package.json

@@ -1,6 +1,6 @@
 {
   "name": "@vendure/core",
-  "version": "1.7.2",
+  "version": "1.7.3",
   "description": "A modern, headless ecommerce framework",
   "repository": {
     "type": "git",
@@ -49,7 +49,7 @@
     "@nestjs/testing": "7.6.17",
     "@nestjs/typeorm": "7.1.5",
     "@types/fs-extra": "^9.0.1",
-    "@vendure/common": "^1.7.2",
+    "@vendure/common": "^1.7.3",
     "apollo-server-express": "2.24.1",
     "bcrypt": "^5.0.0",
     "body-parser": "^1.19.0",

+ 3 - 3
packages/core/src/entity/order/order.entity.ts

@@ -167,7 +167,7 @@ export class Order extends VendureEntity implements ChannelAware, HasCustomField
     get discounts(): Discount[] {
         this.throwIfLinesNotJoined('discounts');
         const groupedAdjustments = new Map<string, Discount>();
-        for (const line of this.lines) {
+        for (const line of this.lines ?? []) {
             for (const discount of line.discounts) {
                 const adjustment = groupedAdjustments.get(discount.adjustmentSource);
                 if (adjustment) {
@@ -178,7 +178,7 @@ export class Order extends VendureEntity implements ChannelAware, HasCustomField
                 }
             }
         }
-        for (const shippingLine of this.shippingLines) {
+        for (const shippingLine of this.shippingLines ?? []) {
             for (const discount of shippingLine.discounts) {
                 const adjustment = groupedAdjustments.get(discount.adjustmentSource);
                 if (adjustment) {
@@ -276,7 +276,7 @@ export class Order extends VendureEntity implements ChannelAware, HasCustomField
             { rate: number; base: number; tax: number; description: string }
         >();
         const taxId = (taxLine: TaxLine): string => `${taxLine.description}:${taxLine.taxRate}`;
-        const taxableLines = [...this.lines, ...this.shippingLines];
+        const taxableLines = [...(this.lines ?? []), ...(this.shippingLines ?? [])];
         for (const line of taxableLines) {
             const taxRateTotal = summate(line.taxLines, 'taxRate');
             for (const taxLine of line.taxLines) {

+ 1 - 1
packages/core/src/plugin/default-search-plugin/search-strategy/mysql-search-strategy.ts

@@ -46,7 +46,7 @@ export class MysqlSearchStrategy implements SearchStrategy {
 
         this.applyTermAndFilters(ctx, facetValuesQb, { ...input, groupByProduct: true });
         if (!input.groupByProduct) {
-            facetValuesQb.groupBy('productVariantId');
+            facetValuesQb.groupBy('si.productVariantId');
         }
         if (enabledOnly) {
             facetValuesQb.andWhere('si.enabled = :enabled', { enabled: true });

+ 3 - 3
packages/create/package.json

@@ -1,6 +1,6 @@
 {
   "name": "@vendure/create",
-  "version": "1.7.2",
+  "version": "1.7.3",
   "license": "MIT",
   "bin": {
     "create": "./index.js"
@@ -28,13 +28,13 @@
     "@types/handlebars": "^4.1.0",
     "@types/listr": "^0.14.2",
     "@types/semver": "^6.2.2",
-    "@vendure/core": "^1.7.2",
+    "@vendure/core": "^1.7.3",
     "rimraf": "^3.0.2",
     "ts-node": "^10.2.1",
     "typescript": "4.3.5"
   },
   "dependencies": {
-    "@vendure/common": "^1.7.2",
+    "@vendure/common": "^1.7.3",
     "chalk": "^4.1.0",
     "commander": "^7.1.0",
     "cross-spawn": "^7.0.3",

+ 9 - 9
packages/dev-server/package.json

@@ -1,6 +1,6 @@
 {
   "name": "dev-server",
-  "version": "1.7.2",
+  "version": "1.7.3",
   "main": "index.js",
   "license": "MIT",
   "private": true,
@@ -14,18 +14,18 @@
     "load-test:100k": "node -r ts-node/register load-testing/run-load-test.ts 100000"
   },
   "dependencies": {
-    "@vendure/admin-ui-plugin": "^1.7.2",
-    "@vendure/asset-server-plugin": "^1.7.2",
-    "@vendure/common": "^1.7.2",
-    "@vendure/core": "^1.7.2",
-    "@vendure/elasticsearch-plugin": "^1.7.2",
-    "@vendure/email-plugin": "^1.7.2",
+    "@vendure/admin-ui-plugin": "^1.7.3",
+    "@vendure/asset-server-plugin": "^1.7.3",
+    "@vendure/common": "^1.7.3",
+    "@vendure/core": "^1.7.3",
+    "@vendure/elasticsearch-plugin": "^1.7.3",
+    "@vendure/email-plugin": "^1.7.3",
     "typescript": "4.3.5"
   },
   "devDependencies": {
     "@types/csv-stringify": "^3.1.0",
-    "@vendure/testing": "^1.7.2",
-    "@vendure/ui-devkit": "^1.7.2",
+    "@vendure/testing": "^1.7.3",
+    "@vendure/ui-devkit": "^1.7.3",
     "commander": "^7.1.0",
     "concurrently": "^5.0.0",
     "csv-stringify": "^5.3.3",

+ 3 - 3
packages/elasticsearch-plugin/package.json

@@ -1,6 +1,6 @@
 {
   "name": "@vendure/elasticsearch-plugin",
-  "version": "1.7.2",
+  "version": "1.7.3",
   "license": "MIT",
   "main": "lib/index.js",
   "types": "lib/index.d.ts",
@@ -25,8 +25,8 @@
     "fast-deep-equal": "^3.1.3"
   },
   "devDependencies": {
-    "@vendure/common": "^1.7.2",
-    "@vendure/core": "^1.7.2",
+    "@vendure/common": "^1.7.3",
+    "@vendure/core": "^1.7.3",
     "rimraf": "^3.0.2",
     "typescript": "4.3.5"
   }

+ 3 - 3
packages/email-plugin/package.json

@@ -1,6 +1,6 @@
 {
   "name": "@vendure/email-plugin",
-  "version": "1.7.2",
+  "version": "1.7.3",
   "license": "MIT",
   "main": "lib/index.js",
   "types": "lib/index.d.ts",
@@ -35,8 +35,8 @@
     "@types/fs-extra": "^9.0.1",
     "@types/handlebars": "^4.1.0",
     "@types/mjml": "^4.0.4",
-    "@vendure/common": "^1.7.2",
-    "@vendure/core": "^1.7.2",
+    "@vendure/common": "^1.7.3",
+    "@vendure/core": "^1.7.3",
     "rimraf": "^3.0.2",
     "typescript": "4.3.5"
   }

+ 3 - 3
packages/job-queue-plugin/package.json

@@ -1,6 +1,6 @@
 {
   "name": "@vendure/job-queue-plugin",
-  "version": "1.7.2",
+  "version": "1.7.3",
   "license": "MIT",
   "main": "package/index.js",
   "types": "package/index.d.ts",
@@ -24,8 +24,8 @@
   "devDependencies": {
     "@google-cloud/pubsub": "^2.8.0",
     "@types/ioredis": "^4.28.10",
-    "@vendure/common": "^1.7.2",
-    "@vendure/core": "^1.7.2",
+    "@vendure/common": "^1.7.3",
+    "@vendure/core": "^1.7.3",
     "bullmq": "^1.86.7",
     "rimraf": "^3.0.2",
     "typescript": "4.3.5"

+ 4 - 4
packages/payments-plugin/package.json

@@ -1,6 +1,6 @@
 {
     "name": "@vendure/payments-plugin",
-    "version": "1.7.2",
+    "version": "1.7.3",
     "license": "MIT",
     "main": "package/index.js",
     "types": "package/index.d.ts",
@@ -28,9 +28,9 @@
     "devDependencies": {
         "@mollie/api-client": "^3.6.0",
         "@types/braintree": "^2.22.15",
-        "@vendure/common": "^1.7.2",
-        "@vendure/core": "^1.7.2",
-        "@vendure/testing": "^1.7.2",
+        "@vendure/common": "^1.7.3",
+        "@vendure/core": "^1.7.3",
+        "@vendure/testing": "^1.7.3",
         "braintree": "^3.0.0",
         "nock": "^13.1.4",
         "rimraf": "^3.0.2",

+ 3 - 3
packages/testing/package.json

@@ -1,6 +1,6 @@
 {
   "name": "@vendure/testing",
-  "version": "1.7.2",
+  "version": "1.7.3",
   "description": "End-to-end testing tools for Vendure projects",
   "keywords": [
     "vendure",
@@ -34,7 +34,7 @@
   },
   "dependencies": {
     "@types/node-fetch": "^2.5.4",
-    "@vendure/common": "^1.7.2",
+    "@vendure/common": "^1.7.3",
     "faker": "^4.1.0",
     "form-data": "^3.0.0",
     "graphql": "15.5.1",
@@ -45,7 +45,7 @@
   "devDependencies": {
     "@types/mysql": "^2.15.15",
     "@types/pg": "^7.14.5",
-    "@vendure/core": "^1.7.2",
+    "@vendure/core": "^1.7.3",
     "mysql": "^2.18.1",
     "pg": "^8.4.0",
     "rimraf": "^3.0.0",

+ 4 - 4
packages/ui-devkit/package.json

@@ -1,6 +1,6 @@
 {
   "name": "@vendure/ui-devkit",
-  "version": "1.7.2",
+  "version": "1.7.3",
   "description": "A library for authoring Vendure Admin UI extensions",
   "keywords": [
     "vendure",
@@ -40,8 +40,8 @@
     "@angular/cli": "12.2.16",
     "@angular/compiler": "12.2.16",
     "@angular/compiler-cli": "12.2.16",
-    "@vendure/admin-ui": "^1.7.2",
-    "@vendure/common": "^1.7.2",
+    "@vendure/admin-ui": "^1.7.3",
+    "@vendure/common": "^1.7.3",
     "chalk": "^4.1.0",
     "chokidar": "^3.5.1",
     "fs-extra": "^10.0.0",
@@ -52,7 +52,7 @@
     "@rollup/plugin-node-resolve": "^11.2.0",
     "@types/fs-extra": "^9.0.8",
     "@types/glob": "^7.1.3",
-    "@vendure/core": "^1.7.2",
+    "@vendure/core": "^1.7.3",
     "rimraf": "^3.0.2",
     "rollup": "^2.40.0",
     "rollup-plugin-terser": "^7.0.2",