Skip to content

Commit

Permalink
fix(admin-ui): Shipping method validators fix
Browse files Browse the repository at this point in the history
  • Loading branch information
chladog authored Jan 5, 2021
1 parent 3e46640 commit bbdd5be
Showing 1 changed file with 8 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -80,10 +80,10 @@ export class ShippingMethodDetailComponent

ngOnInit() {
this.init();
combineLatest(
combineLatest([
this.dataService.shippingMethod.getShippingMethodOperations().single$,
this.entity$.pipe(take(1)),
).subscribe(([data, entity]) => {
]).subscribe(([data, entity]) => {
this.checkers = data.shippingEligibilityCheckers;
this.calculators = data.shippingCalculators;
this.fulfillmentHandlers = data.fulfillmentHandlers;
Expand Down Expand Up @@ -150,6 +150,8 @@ export class ShippingMethodDetailComponent
this.selectedChecker = configurableDefinitionToInstance(checker);
const formControl = this.detailForm.get('checker');
if (formControl) {
formControl.clearValidators();
formControl.updateValueAndValidity({ onlySelf: true });
formControl.patchValue(this.selectedChecker);
}
this.detailForm.markAsDirty();
Expand All @@ -160,6 +162,8 @@ export class ShippingMethodDetailComponent
this.selectedCalculator = configurableDefinitionToInstance(calculator);
const formControl = this.detailForm.get('calculator');
if (formControl) {
formControl.clearValidators();
formControl.updateValueAndValidity({ onlySelf: true });
formControl.patchValue(this.selectedCalculator);
}
this.detailForm.markAsDirty();
Expand All @@ -171,7 +175,7 @@ export class ShippingMethodDetailComponent
if (!selectedChecker || !selectedCalculator) {
return;
}
combineLatest(this.entity$, this.languageCode$)
combineLatest([this.entity$, this.languageCode$])
.pipe(
take(1),
mergeMap(([shippingMethod, languageCode]) => {
Expand Down Expand Up @@ -211,7 +215,7 @@ export class ShippingMethodDetailComponent
if (!selectedChecker || !selectedCalculator) {
return;
}
combineLatest(this.entity$, this.languageCode$)
combineLatest([this.entity$, this.languageCode$])
.pipe(
take(1),
mergeMap(([shippingMethod, languageCode]) => {
Expand Down

0 comments on commit bbdd5be

Please sign in to comment.