Skip to content

Commit

Permalink
Set default rapido pickup location (#8)
Browse files Browse the repository at this point in the history
Forces the pickup location to be null by default when making a
Rapido physical request.
  • Loading branch information
gpeterso authored Apr 16, 2024
1 parent 59c16d7 commit 184e0d9
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -64,4 +64,9 @@ describe("prmGetItRequestAfterComponent", () => {
expect(parentCtrl.noteField.mandatory).toBeFalse();
expect(parentCtrl.noteField.label).toEqual("nui.ngrs.request.note");
});

it("sets the parent controller's default location to null", () => {
ctrl.$onInit();
expect(parentCtrl.getDefaultValue()).toBeNull();
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ export class PrmGetItRequestAfterController implements ng.IController {
}

$onInit(): void {
this.overrideDefaultLocation();
this.locationField.events = {
onChange: () => this.setMandatoryFields(),
};
Expand Down Expand Up @@ -59,6 +60,10 @@ export class PrmGetItRequestAfterController implements ng.IController {
return this.parentCtrl.formData.myLocation === option.value;
}

private overrideDefaultLocation(): void {
this.parentCtrl.getDefaultValue = (): void => null;
}

get locationField(): FormField {
return this.parentCtrl.locationField;
}
Expand Down

0 comments on commit 184e0d9

Please sign in to comment.