@vendure/admin-ui 1.6.3 → 1.6.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bundles/vendure-admin-ui-core.umd.js +18 -5
- package/bundles/vendure-admin-ui-core.umd.js.map +1 -1
- package/bundles/vendure-admin-ui-order.umd.js +38 -18
- package/bundles/vendure-admin-ui-order.umd.js.map +1 -1
- package/core/common/generated-types.d.ts +2 -0
- package/core/common/version.d.ts +1 -1
- package/core/shared/components/facet-value-selector/facet-value-selector.component.d.ts +2 -1
- package/core/shared/dynamic-form-inputs/facet-value-form-input/facet-value-form-input.component.d.ts +2 -0
- package/core/vendure-admin-ui-core.metadata.json +1 -1
- package/esm2015/core/common/generated-types.js +1 -1
- package/esm2015/core/common/introspection-result.js +1 -1
- package/esm2015/core/common/utilities/configurable-operation-utils.js +3 -3
- package/esm2015/core/common/version.js +2 -2
- package/esm2015/core/shared/components/facet-value-selector/facet-value-selector.component.js +5 -2
- package/esm2015/core/shared/dynamic-form-inputs/facet-value-form-input/facet-value-form-input.component.js +11 -2
- package/esm2015/order/components/order-detail/order-detail.component.js +31 -19
- package/esm2015/order/components/order-table/order-table.component.js +10 -2
- package/fesm2015/vendure-admin-ui-core.js +17 -5
- package/fesm2015/vendure-admin-ui-core.js.map +1 -1
- package/fesm2015/vendure-admin-ui-order.js +39 -19
- package/fesm2015/vendure-admin-ui-order.js.map +1 -1
- package/order/components/order-table/order-table.component.d.ts +1 -0
- package/order/vendure-admin-ui-order.metadata.json +1 -1
- package/package.json +2 -2
|
@@ -1806,26 +1806,43 @@
|
|
|
1806
1806
|
if (!input) {
|
|
1807
1807
|
return rxjs.of(undefined);
|
|
1808
1808
|
}
|
|
1809
|
-
|
|
1809
|
+
if ((_a = input.cancel.lines) === null || _a === void 0 ? void 0 : _a.length) {
|
|
1810
|
+
return _this.dataService.order.cancelOrder(input.cancel).pipe(operators.map(function (res) {
|
|
1811
|
+
var result = res.cancelOrder;
|
|
1812
|
+
switch (result.__typename) {
|
|
1813
|
+
case 'Order':
|
|
1814
|
+
_this.refetchOrder(result).subscribe();
|
|
1815
|
+
_this.notificationService.success(ngxTranslateExtractMarker.marker('order.cancelled-order-success'));
|
|
1816
|
+
return input;
|
|
1817
|
+
case 'CancelActiveOrderError':
|
|
1818
|
+
case 'QuantityTooGreatError':
|
|
1819
|
+
case 'MultipleOrderError':
|
|
1820
|
+
case 'OrderStateTransitionError':
|
|
1821
|
+
case 'EmptyOrderLineSelectionError':
|
|
1822
|
+
_this.notificationService.error(result.message);
|
|
1823
|
+
return undefined;
|
|
1824
|
+
}
|
|
1825
|
+
}));
|
|
1826
|
+
}
|
|
1827
|
+
else {
|
|
1828
|
+
return [input];
|
|
1829
|
+
}
|
|
1830
|
+
}), operators.switchMap(function (input) {
|
|
1831
|
+
if (!input) {
|
|
1832
|
+
return rxjs.of(undefined);
|
|
1833
|
+
}
|
|
1810
1834
|
if (input.refund.lines.length) {
|
|
1811
|
-
|
|
1835
|
+
return _this.dataService.order
|
|
1812
1836
|
.refundOrder(input.refund)
|
|
1813
|
-
.pipe(operators.map(function (res) { return res.refundOrder; }))
|
|
1837
|
+
.pipe(operators.map(function (res) { return res.refundOrder; }));
|
|
1814
1838
|
}
|
|
1815
|
-
|
|
1816
|
-
|
|
1817
|
-
.cancelOrder(input.cancel)
|
|
1818
|
-
.pipe(operators.map(function (res) { return res.cancelOrder; })));
|
|
1839
|
+
else {
|
|
1840
|
+
return [undefined];
|
|
1819
1841
|
}
|
|
1820
|
-
return rxjs.merge.apply(void 0, __spreadArray([], __read(operations)));
|
|
1821
1842
|
}))
|
|
1822
1843
|
.subscribe(function (result) {
|
|
1823
1844
|
if (result) {
|
|
1824
1845
|
switch (result.__typename) {
|
|
1825
|
-
case 'Order':
|
|
1826
|
-
_this.refetchOrder(result).subscribe();
|
|
1827
|
-
_this.notificationService.success(ngxTranslateExtractMarker.marker('order.cancelled-order-success'));
|
|
1828
|
-
break;
|
|
1829
1846
|
case 'Refund':
|
|
1830
1847
|
_this.refetchOrder(result).subscribe();
|
|
1831
1848
|
if (result.state === 'Failed') {
|
|
@@ -1835,11 +1852,6 @@
|
|
|
1835
1852
|
_this.notificationService.success(ngxTranslateExtractMarker.marker('order.refund-order-success'));
|
|
1836
1853
|
}
|
|
1837
1854
|
break;
|
|
1838
|
-
case 'QuantityTooGreatError':
|
|
1839
|
-
case 'MultipleOrderError':
|
|
1840
|
-
case 'OrderStateTransitionError':
|
|
1841
|
-
case 'CancelActiveOrderError':
|
|
1842
|
-
case 'EmptyOrderLineSelectionError':
|
|
1843
1855
|
case 'AlreadyRefundedError':
|
|
1844
1856
|
case 'NothingToRefundError':
|
|
1845
1857
|
case 'PaymentOrderMismatchError':
|
|
@@ -3098,12 +3110,20 @@
|
|
|
3098
3110
|
return promotion.couponCode || undefined;
|
|
3099
3111
|
}
|
|
3100
3112
|
};
|
|
3113
|
+
OrderTableComponent.prototype.getShippingNames = function (order) {
|
|
3114
|
+
if (order.shippingLines.length) {
|
|
3115
|
+
return order.shippingLines.map(function (shippingLine) { return shippingLine.shippingMethod.name; }).join(', ');
|
|
3116
|
+
}
|
|
3117
|
+
else {
|
|
3118
|
+
return '';
|
|
3119
|
+
}
|
|
3120
|
+
};
|
|
3101
3121
|
return OrderTableComponent;
|
|
3102
3122
|
}());
|
|
3103
3123
|
OrderTableComponent.decorators = [
|
|
3104
3124
|
{ type: i0.Component, args: [{
|
|
3105
3125
|
selector: 'vdr-order-table',
|
|
3106
|
-
template: "<table class=\"order-table table\">\r\n <thead>\r\n <tr>\r\n <th></th>\r\n <th>{{ 'order.product-name' | translate }}</th>\r\n <th>{{ 'order.product-sku' | translate }}</th>\r\n <th>{{ 'order.unit-price' | translate }}</th>\r\n <th>{{ 'order.quantity' | translate }}</th>\r\n <th>{{ 'order.total' | translate }}</th>\r\n </tr>\r\n </thead>\r\n <tbody>\r\n <ng-container *ngFor=\"let line of order.lines\">\r\n <tr class=\"order-line\" [class.is-cancelled]=\"line.quantity === 0\">\r\n <td class=\"align-middle thumb\">\r\n <img *ngIf=\"line.featuredAsset\" [src]=\"line.featuredAsset | assetPreview: 'tiny'\" />\r\n </td>\r\n <td class=\"align-middle name\">{{ line.productVariant.name }}</td>\r\n <td class=\"align-middle sku\">{{ line.productVariant.sku }}</td>\r\n <td class=\"align-middle unit-price\">\r\n {{ line.unitPriceWithTax | localeCurrency: order.currencyCode }}\r\n <div class=\"net-price\" [title]=\"'order.net-price' | translate\">\r\n {{ line.unitPrice | localeCurrency: order.currencyCode }}\r\n </div>\r\n </td>\r\n <td class=\"align-middle quantity\">\r\n {{ line.quantity }}\r\n <vdr-line-refunds [line]=\"line\" [payments]=\"order.payments\"></vdr-line-refunds>\r\n <vdr-line-fulfillment [line]=\"line\" [orderState]=\"order.state\"></vdr-line-fulfillment>\r\n </td>\r\n <td class=\"align-middle total\">\r\n {{ line.linePriceWithTax | localeCurrency: order.currencyCode }}\r\n <div class=\"net-price\" [title]=\"'order.net-price' | translate\">\r\n {{ line.linePrice | localeCurrency: order.currencyCode }}\r\n </div>\r\n\r\n <ng-container *ngIf=\"getLineDiscounts(line) as discounts\">\r\n <vdr-dropdown *ngIf=\"discounts.length\">\r\n <div class=\"promotions-label\" vdrDropdownTrigger>\r\n {{ 'order.promotions-applied' | translate }}\r\n </div>\r\n <vdr-dropdown-menu>\r\n <div class=\"line-promotion\" *ngFor=\"let discount of discounts\">\r\n <a class=\"promotion-name\" [routerLink]=\"getPromotionLink(discount)\">{{\r\n discount.description\r\n }}</a>\r\n <div class=\"promotion-amount\">\r\n {{ discount.amountWithTax | localeCurrency: order.currencyCode }}\r\n <div class=\"net-price\" [title]=\"'order.net-price' | translate\">\r\n {{ discount.amount | localeCurrency: order.currencyCode }}\r\n </div>\r\n </div>\r\n </div>\r\n </vdr-dropdown-menu>\r\n </vdr-dropdown>\r\n </ng-container>\r\n </td>\r\n </tr>\r\n <ng-container *ngIf=\"customFieldsForLine[line.id] as customFields\">\r\n <tr *ngIf=\"customFields.length\">\r\n <td colspan=\"6\" class=\"custom-fields-row\">\r\n <div class=\"order-line-custom-fields\">\r\n <div class=\"custom-field\" *ngFor=\"let field of customFields\">\r\n <vdr-custom-field-control\r\n [compact]=\"true\"\r\n [readonly]=\"true\"\r\n [customField]=\"field.config\"\r\n [customFieldsFormGroup]=\"field.formGroup\"\r\n ></vdr-custom-field-control>\r\n </div>\r\n </div>\r\n </td>\r\n </tr>\r\n </ng-container>\r\n </ng-container>\r\n <tr class=\"surcharge\" *ngFor=\"let surcharge of order.surcharges\">\r\n <td class=\"align-middle name left\" colspan=\"2\">{{ surcharge.description }}</td>\r\n <td class=\"align-middle sku\">{{ surcharge.sku }}</td>\r\n <td class=\"align-middle\" colspan=\"2\"></td>\r\n <td class=\"align-middle total\">\r\n {{ surcharge.priceWithTax | localeCurrency: order.currencyCode }}\r\n <div class=\"net-price\" [title]=\"'order.net-price' | translate\">\r\n {{ surcharge.price | localeCurrency: order.currencyCode }}\r\n </div>\r\n </td>\r\n </tr>\r\n <ng-container *ngFor=\"let discount of order.discounts\">\r\n <tr class=\"order-adjustment\" *ngIf=\"discount.type !== 'OTHER'\">\r\n <td colspan=\"5\" class=\"left clr-align-middle\">\r\n <a [routerLink]=\"getPromotionLink(discount)\">{{ discount.description }}</a>\r\n <vdr-chip *ngIf=\"getCouponCodeForAdjustment(order, discount) as couponCode\">{{\r\n couponCode\r\n }}</vdr-chip>\r\n </td>\r\n <td class=\"clr-align-middle\">\r\n {{ discount.amountWithTax | localeCurrency: order.currencyCode }}\r\n <div class=\"net-price\" [title]=\"'order.net-price' | translate\">\r\n {{ discount.amount | localeCurrency: order.currencyCode }}\r\n </div>\r\n </td>\r\n </tr>\r\n </ng-container>\r\n <tr class=\"sub-total\">\r\n <td class=\"left clr-align-middle\">{{ 'order.sub-total' | translate }}</td>\r\n <td colspan=\"4\"></td>\r\n <td class=\"clr-align-middle\">\r\n {{ order.subTotalWithTax | localeCurrency: order.currencyCode }}\r\n <div class=\"net-price\" [title]=\"'order.net-price' | translate\">\r\n {{ order.subTotal | localeCurrency: order.currencyCode }}\r\n </div>\r\n </td>\r\n </tr>\r\n <tr class=\"shipping\">\r\n <td class=\"left clr-align-middle\">{{ 'order.shipping' | translate }}</td>\r\n <td class=\"clr-align-middle\">{{ order
|
|
3126
|
+
template: "<table class=\"order-table table\">\r\n <thead>\r\n <tr>\r\n <th></th>\r\n <th>{{ 'order.product-name' | translate }}</th>\r\n <th>{{ 'order.product-sku' | translate }}</th>\r\n <th>{{ 'order.unit-price' | translate }}</th>\r\n <th>{{ 'order.quantity' | translate }}</th>\r\n <th>{{ 'order.total' | translate }}</th>\r\n </tr>\r\n </thead>\r\n <tbody>\r\n <ng-container *ngFor=\"let line of order.lines\">\r\n <tr class=\"order-line\" [class.is-cancelled]=\"line.quantity === 0\">\r\n <td class=\"align-middle thumb\">\r\n <img *ngIf=\"line.featuredAsset\" [src]=\"line.featuredAsset | assetPreview: 'tiny'\" />\r\n </td>\r\n <td class=\"align-middle name\">{{ line.productVariant.name }}</td>\r\n <td class=\"align-middle sku\">{{ line.productVariant.sku }}</td>\r\n <td class=\"align-middle unit-price\">\r\n {{ line.unitPriceWithTax | localeCurrency: order.currencyCode }}\r\n <div class=\"net-price\" [title]=\"'order.net-price' | translate\">\r\n {{ line.unitPrice | localeCurrency: order.currencyCode }}\r\n </div>\r\n </td>\r\n <td class=\"align-middle quantity\">\r\n {{ line.quantity }}\r\n <vdr-line-refunds [line]=\"line\" [payments]=\"order.payments\"></vdr-line-refunds>\r\n <vdr-line-fulfillment [line]=\"line\" [orderState]=\"order.state\"></vdr-line-fulfillment>\r\n </td>\r\n <td class=\"align-middle total\">\r\n {{ line.linePriceWithTax | localeCurrency: order.currencyCode }}\r\n <div class=\"net-price\" [title]=\"'order.net-price' | translate\">\r\n {{ line.linePrice | localeCurrency: order.currencyCode }}\r\n </div>\r\n\r\n <ng-container *ngIf=\"getLineDiscounts(line) as discounts\">\r\n <vdr-dropdown *ngIf=\"discounts.length\">\r\n <div class=\"promotions-label\" vdrDropdownTrigger>\r\n {{ 'order.promotions-applied' | translate }}\r\n </div>\r\n <vdr-dropdown-menu>\r\n <div class=\"line-promotion\" *ngFor=\"let discount of discounts\">\r\n <a class=\"promotion-name\" [routerLink]=\"getPromotionLink(discount)\">{{\r\n discount.description\r\n }}</a>\r\n <div class=\"promotion-amount\">\r\n {{ discount.amountWithTax | localeCurrency: order.currencyCode }}\r\n <div class=\"net-price\" [title]=\"'order.net-price' | translate\">\r\n {{ discount.amount | localeCurrency: order.currencyCode }}\r\n </div>\r\n </div>\r\n </div>\r\n </vdr-dropdown-menu>\r\n </vdr-dropdown>\r\n </ng-container>\r\n </td>\r\n </tr>\r\n <ng-container *ngIf=\"customFieldsForLine[line.id] as customFields\">\r\n <tr *ngIf=\"customFields.length\">\r\n <td colspan=\"6\" class=\"custom-fields-row\">\r\n <div class=\"order-line-custom-fields\">\r\n <div class=\"custom-field\" *ngFor=\"let field of customFields\">\r\n <vdr-custom-field-control\r\n [compact]=\"true\"\r\n [readonly]=\"true\"\r\n [customField]=\"field.config\"\r\n [customFieldsFormGroup]=\"field.formGroup\"\r\n ></vdr-custom-field-control>\r\n </div>\r\n </div>\r\n </td>\r\n </tr>\r\n </ng-container>\r\n </ng-container>\r\n <tr class=\"surcharge\" *ngFor=\"let surcharge of order.surcharges\">\r\n <td class=\"align-middle name left\" colspan=\"2\">{{ surcharge.description }}</td>\r\n <td class=\"align-middle sku\">{{ surcharge.sku }}</td>\r\n <td class=\"align-middle\" colspan=\"2\"></td>\r\n <td class=\"align-middle total\">\r\n {{ surcharge.priceWithTax | localeCurrency: order.currencyCode }}\r\n <div class=\"net-price\" [title]=\"'order.net-price' | translate\">\r\n {{ surcharge.price | localeCurrency: order.currencyCode }}\r\n </div>\r\n </td>\r\n </tr>\r\n <ng-container *ngFor=\"let discount of order.discounts\">\r\n <tr class=\"order-adjustment\" *ngIf=\"discount.type !== 'OTHER'\">\r\n <td colspan=\"5\" class=\"left clr-align-middle\">\r\n <a [routerLink]=\"getPromotionLink(discount)\">{{ discount.description }}</a>\r\n <vdr-chip *ngIf=\"getCouponCodeForAdjustment(order, discount) as couponCode\">{{\r\n couponCode\r\n }}</vdr-chip>\r\n </td>\r\n <td class=\"clr-align-middle\">\r\n {{ discount.amountWithTax | localeCurrency: order.currencyCode }}\r\n <div class=\"net-price\" [title]=\"'order.net-price' | translate\">\r\n {{ discount.amount | localeCurrency: order.currencyCode }}\r\n </div>\r\n </td>\r\n </tr>\r\n </ng-container>\r\n <tr class=\"sub-total\">\r\n <td class=\"left clr-align-middle\">{{ 'order.sub-total' | translate }}</td>\r\n <td colspan=\"4\"></td>\r\n <td class=\"clr-align-middle\">\r\n {{ order.subTotalWithTax | localeCurrency: order.currencyCode }}\r\n <div class=\"net-price\" [title]=\"'order.net-price' | translate\">\r\n {{ order.subTotal | localeCurrency: order.currencyCode }}\r\n </div>\r\n </td>\r\n </tr>\r\n <tr class=\"shipping\">\r\n <td class=\"left clr-align-middle\">{{ 'order.shipping' | translate }}</td>\r\n <td class=\"clr-align-middle\">{{ getShippingNames(order) }}</td>\r\n <td colspan=\"3\"></td>\r\n <td class=\"clr-align-middle\">\r\n {{ order.shippingWithTax | localeCurrency: order.currencyCode }}\r\n <div class=\"net-price\" [title]=\"'order.net-price' | translate\">\r\n {{ order.shipping | localeCurrency: order.currencyCode }}\r\n </div>\r\n </td>\r\n </tr>\r\n <tr class=\"total\">\r\n <td class=\"left clr-align-middle\">{{ 'order.total' | translate }}</td>\r\n <td colspan=\"4\"></td>\r\n <td class=\"clr-align-middle\">\r\n {{ order.totalWithTax | localeCurrency: order.currencyCode }}\r\n <div class=\"net-price\" [title]=\"'order.net-price' | translate\">\r\n {{ order.total | localeCurrency: order.currencyCode }}\r\n </div>\r\n </td>\r\n </tr>\r\n </tbody>\r\n</table>\r\n",
|
|
3107
3127
|
changeDetection: i0.ChangeDetectionStrategy.OnPush,
|
|
3108
3128
|
styles: [".order-table .is-cancelled td{text-decoration:line-through;background-color:var(--color-component-bg-200)}.order-table .sub-total td{border-top:1px dashed var(--color-component-border-200)}.order-table .total td{font-weight:bold;border-top:1px dashed var(--color-component-border-200)}.order-table td.custom-fields-row{border-top-style:dashed;border-top-color:var(--color-grey-200)}.order-table .order-line-custom-fields{display:flex;flex-wrap:wrap}.order-table .order-line-custom-fields .custom-field{text-align:start;max-width:200px;overflow:hidden;text-overflow:ellipsis;margin-bottom:6px;margin-right:18px}.order-table .order-line-custom-field{background-color:var(--color-component-bg-100)}.order-table .order-line-custom-field .custom-field-ellipsis{color:var(--color-text-300)}.order-table .net-price{font-size:11px;color:var(--color-text-300)}.order-table .promotions-label{-webkit-text-decoration:underline dotted var(--color-text-200);text-decoration:underline dotted var(--color-text-200);font-size:11px;margin-top:6px;cursor:pointer;text-transform:lowercase}.order-table .thumb img{width:50px;height:50px}::ng-deep .line-promotion{display:flex;justify-content:space-between;padding:6px 12px}::ng-deep .line-promotion .promotion-amount{margin-left:12px}::ng-deep .line-promotion .net-price{font-size:11px;color:var(--color-text-300)}\n"]
|
|
3109
3129
|
},] }
|