|
|
@@ -74,7 +74,7 @@ export class OrderDetailComponent extends BaseDetailComponent<OrderDetail.Fragme
|
|
|
createdAt: SortOrder.DESC,
|
|
|
},
|
|
|
})
|
|
|
- .mapStream(data => data.order?.history.items);
|
|
|
+ .mapStream((data) => data.order?.history.items);
|
|
|
}),
|
|
|
);
|
|
|
}
|
|
|
@@ -88,7 +88,7 @@ export class OrderDetailComponent extends BaseDetailComponent<OrderDetail.Fragme
|
|
|
}
|
|
|
|
|
|
getLinePromotions(line: OrderDetail.Lines) {
|
|
|
- return line.adjustments.filter(a => a.type === AdjustmentType.PROMOTION);
|
|
|
+ return line.adjustments.filter((a) => a.type === AdjustmentType.PROMOTION);
|
|
|
}
|
|
|
|
|
|
getPromotionLink(promotion: OrderDetail.Adjustments): any[] {
|
|
|
@@ -101,19 +101,19 @@ export class OrderDetailComponent extends BaseDetailComponent<OrderDetail.Fragme
|
|
|
promotionAdjustment: OrderDetail.Adjustments,
|
|
|
): string | undefined {
|
|
|
const id = promotionAdjustment.adjustmentSource.split(':')[1];
|
|
|
- const promotion = order.promotions.find(p => p.id === id);
|
|
|
+ const promotion = order.promotions.find((p) => p.id === id);
|
|
|
if (promotion) {
|
|
|
return promotion.couponCode || undefined;
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- getShippingAddressLines(shippingAddress?: { [key: string]: string }): string[] {
|
|
|
- if (!shippingAddress) {
|
|
|
+ getOrderAddressLines(orderAddress?: { [key: string]: string }): string[] {
|
|
|
+ if (!orderAddress) {
|
|
|
return [];
|
|
|
}
|
|
|
- return Object.values(shippingAddress)
|
|
|
- .filter(val => val !== 'OrderAddress')
|
|
|
- .filter(line => !!line);
|
|
|
+ return Object.values(orderAddress)
|
|
|
+ .filter((val) => val !== 'OrderAddress')
|
|
|
+ .filter((line) => !!line);
|
|
|
}
|
|
|
|
|
|
settlePayment(payment: OrderDetail.Payments) {
|
|
|
@@ -134,7 +134,7 @@ export class OrderDetailComponent extends BaseDetailComponent<OrderDetail.Fragme
|
|
|
this.entity$
|
|
|
.pipe(
|
|
|
take(1),
|
|
|
- switchMap(order => {
|
|
|
+ switchMap((order) => {
|
|
|
return this.modalService.fromComponent(FulfillOrderDialogComponent, {
|
|
|
size: 'xl',
|
|
|
locals: {
|
|
|
@@ -142,16 +142,16 @@ export class OrderDetailComponent extends BaseDetailComponent<OrderDetail.Fragme
|
|
|
},
|
|
|
});
|
|
|
}),
|
|
|
- switchMap(input => {
|
|
|
+ switchMap((input) => {
|
|
|
if (input) {
|
|
|
return this.dataService.order.createFullfillment(input);
|
|
|
} else {
|
|
|
return of(undefined);
|
|
|
}
|
|
|
}),
|
|
|
- switchMap(result => this.refetchOrder(result)),
|
|
|
+ switchMap((result) => this.refetchOrder(result)),
|
|
|
)
|
|
|
- .subscribe(result => {
|
|
|
+ .subscribe((result) => {
|
|
|
if (result) {
|
|
|
this.notificationService.success(_('order.create-fulfillment-success'));
|
|
|
}
|
|
|
@@ -175,7 +175,7 @@ export class OrderDetailComponent extends BaseDetailComponent<OrderDetail.Fragme
|
|
|
},
|
|
|
})
|
|
|
.pipe(
|
|
|
- switchMap(transactionId => {
|
|
|
+ switchMap((transactionId) => {
|
|
|
if (transactionId) {
|
|
|
return this.dataService.order.settleRefund(
|
|
|
{
|
|
|
@@ -190,7 +190,7 @@ export class OrderDetailComponent extends BaseDetailComponent<OrderDetail.Fragme
|
|
|
}),
|
|
|
// switchMap(result => this.refetchOrder(result)),
|
|
|
)
|
|
|
- .subscribe(result => {
|
|
|
+ .subscribe((result) => {
|
|
|
if (result) {
|
|
|
this.notificationService.success(_('order.settle-refund-success'));
|
|
|
}
|
|
|
@@ -205,8 +205,8 @@ export class OrderDetailComponent extends BaseDetailComponent<OrderDetail.Fragme
|
|
|
note,
|
|
|
isPublic,
|
|
|
})
|
|
|
- .pipe(switchMap(result => this.refetchOrder(result)))
|
|
|
- .subscribe(result => {
|
|
|
+ .pipe(switchMap((result) => this.refetchOrder(result)))
|
|
|
+ .subscribe((result) => {
|
|
|
this.notificationService.success(_('common.notify-create-success'), {
|
|
|
entity: 'Note',
|
|
|
});
|
|
|
@@ -224,7 +224,7 @@ export class OrderDetailComponent extends BaseDetailComponent<OrderDetail.Fragme
|
|
|
},
|
|
|
})
|
|
|
.pipe(
|
|
|
- switchMap(result => {
|
|
|
+ switchMap((result) => {
|
|
|
if (result) {
|
|
|
return this.dataService.order.updateOrderNote({
|
|
|
noteId: entry.id,
|
|
|
@@ -236,7 +236,7 @@ export class OrderDetailComponent extends BaseDetailComponent<OrderDetail.Fragme
|
|
|
}
|
|
|
}),
|
|
|
)
|
|
|
- .subscribe(result => {
|
|
|
+ .subscribe((result) => {
|
|
|
this.fetchHistory.next();
|
|
|
this.notificationService.success(_('common.notify-update-success'), {
|
|
|
entity: 'Note',
|
|
|
@@ -254,7 +254,7 @@ export class OrderDetailComponent extends BaseDetailComponent<OrderDetail.Fragme
|
|
|
{ type: 'danger', label: _('common.delete'), returnValue: true },
|
|
|
],
|
|
|
})
|
|
|
- .pipe(switchMap(res => (res ? this.dataService.order.deleteOrderNote(entry.id) : EMPTY)))
|
|
|
+ .pipe(switchMap((res) => (res ? this.dataService.order.deleteOrderNote(entry.id) : EMPTY)))
|
|
|
.subscribe(() => {
|
|
|
this.fetchHistory.next();
|
|
|
this.notificationService.success(_('common.notify-delete-success'), {
|
|
|
@@ -272,16 +272,16 @@ export class OrderDetailComponent extends BaseDetailComponent<OrderDetail.Fragme
|
|
|
},
|
|
|
})
|
|
|
.pipe(
|
|
|
- switchMap(input => {
|
|
|
+ switchMap((input) => {
|
|
|
if (input) {
|
|
|
return this.dataService.order.cancelOrder(input);
|
|
|
} else {
|
|
|
return of(undefined);
|
|
|
}
|
|
|
}),
|
|
|
- switchMap(result => this.refetchOrder(result)),
|
|
|
+ switchMap((result) => this.refetchOrder(result)),
|
|
|
)
|
|
|
- .subscribe(result => {
|
|
|
+ .subscribe((result) => {
|
|
|
if (result) {
|
|
|
this.notificationService.success(_('order.cancelled-order-success'));
|
|
|
}
|
|
|
@@ -297,10 +297,10 @@ export class OrderDetailComponent extends BaseDetailComponent<OrderDetail.Fragme
|
|
|
},
|
|
|
})
|
|
|
.pipe(
|
|
|
- switchMap(input => {
|
|
|
+ switchMap((input) => {
|
|
|
if (input) {
|
|
|
return this.dataService.order.refundOrder(omit(input, ['cancel'])).pipe(
|
|
|
- switchMap(result => {
|
|
|
+ switchMap((result) => {
|
|
|
if (input.cancel.length) {
|
|
|
return this.dataService.order.cancelOrder({
|
|
|
orderId: this.id,
|
|
|
@@ -316,9 +316,9 @@ export class OrderDetailComponent extends BaseDetailComponent<OrderDetail.Fragme
|
|
|
return of(undefined);
|
|
|
}
|
|
|
}),
|
|
|
- switchMap(result => this.refetchOrder(result)),
|
|
|
+ switchMap((result) => this.refetchOrder(result)),
|
|
|
)
|
|
|
- .subscribe(result => {
|
|
|
+ .subscribe((result) => {
|
|
|
if (result) {
|
|
|
this.notificationService.success(_('order.refund-order-success'));
|
|
|
}
|