-
Notifications
You must be signed in to change notification settings - Fork 48
Bugfix/fixed editing existing order, fixed scroll to existing order #3896
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: dev
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||||||
---|---|---|---|---|---|---|---|---|---|---|
|
@@ -187,11 +187,9 @@ export class UBSOrderDetailsComponent extends FormBaseComponent implements OnIni | |||||||||
this.initListeners(); | ||||||||||
}); | ||||||||||
|
||||||||||
this.store.pipe(select(existingOrderInfoSelector), takeUntil(this.$destroy)).subscribe((orderInfo: IUserOrderInfo) => { | ||||||||||
this.store.pipe(select(existingOrderInfoSelector), filter(Boolean), takeUntil(this.$destroy)).subscribe((orderInfo: IUserOrderInfo) => { | ||||||||||
this.existingOrderInfo = orderInfo; | ||||||||||
if (this.orderDetailsForm) { | ||||||||||
this.initExistingOrderValues(); | ||||||||||
} | ||||||||||
this.initExistingOrderValues(); | ||||||||||
}); | ||||||||||
} | ||||||||||
|
||||||||||
|
@@ -205,6 +203,7 @@ export class UBSOrderDetailsComponent extends FormBaseComponent implements OnIni | |||||||||
.subscribe(([locations, orderDetails]: [CourierLocations, OrderDetails]) => { | ||||||||||
if (!this.bags || this.bags[0]?.id !== orderDetails.bags[0].id) { | ||||||||||
this.locations = locations; | ||||||||||
console.error(orderDetails); | ||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Remove the debug console.error statement. The Apply this diff: if (!this.bags || this.bags[0]?.id !== orderDetails.bags[0].id) {
this.locations = locations;
- console.error(orderDetails);
this.bags = orderDetails.bags; 📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents
|
||||||||||
this.bags = orderDetails.bags; | ||||||||||
this.initFormBags(); | ||||||||||
this.dispatchAdditionalOrders(); | ||||||||||
|
@@ -294,9 +293,19 @@ export class UBSOrderDetailsComponent extends FormBaseComponent implements OnIni | |||||||||
initExistingOrderValues(): void { | ||||||||||
if (this.existingOrderInfo) { | ||||||||||
this.orderComment.setValue(this.existingOrderInfo.orderComment); | ||||||||||
if (this.existingOrderInfo.bags?.length > 0) { | ||||||||||
this.existingOrderInfo.bags.forEach((bag) => { | ||||||||||
const bagIndex = this.bags?.findIndex((b) => b.nameEn === bag.serviceEn); | ||||||||||
if (bagIndex !== -1) { | ||||||||||
this.changeQuantity(this.bags[bagIndex].id, bag.count); | ||||||||||
} | ||||||||||
}); | ||||||||||
} | ||||||||||
if (this.existingOrderInfo.additionalOrders?.length > 0) { | ||||||||||
this.additionalOrders.clear(); | ||||||||||
this.existingOrderInfo.additionalOrders.forEach((order) => this.addOrder(order)); | ||||||||||
this.existingOrderInfo.additionalOrders.forEach((order) => { | ||||||||||
this.addOrder(order); | ||||||||||
}); | ||||||||||
} | ||||||||||
} | ||||||||||
} | ||||||||||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove the debug console.log statement.
The
console.log
statement appears to be debug code left in by mistake. It should be removed before merging.Apply this diff:
ngOnInit(): void { this.store.dispatch(GetUserBonuses()); - console.log(this.orderDetails); this.initForm();
📝 Committable suggestion
🤖 Prompt for AI Agents