-
Notifications
You must be signed in to change notification settings - Fork 597
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
fix: now we can create standing instruction by using both destinantion #1936
Conversation
@@ -58,6 +58,10 @@ export class CreateStandingInstructionsComponent implements OnInit { | |||
accountTypeId: any; | |||
/** Office Id */ | |||
officeId: any; | |||
/** ToOffice Id Boolean for disabling the officeId formControl */ | |||
ToOfficeId: any; |
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.
I dont really understand what is the purpose of these fields.
this.createStandingInstructionsForm.controls['toOfficeId'].disable(); | ||
this.createStandingInstructionsForm.controls['toClientId'].disable(); | ||
this.ToOfficeId = true; | ||
this.ToClientId = true; |
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.
So it is disabled anyway?
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.
Actually, disable() method, it not only prevents the user from interacting with form but also excludes it from the form values when the form is submitted.
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.
The request going to the backend did not include the values for 'ToOfficeID' and 'toClientId'
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.
When a client selects destination: own account, then we need to disable TofficeId and Benefeciary and it should inherit the office and same client details in the API and from UI
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.
i dont really understand how it is doing this... :/
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.
the latter
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.
Actually @adamsaghy we didn't want to exclude the toOfficeId and toClientId, we just wanted to grey out those filling in the form.
disable() method in .ts grey. out the filling and also exclude those keys from the form, that's why I removed the .diable() method
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.
so it is always greyed out?
if i understand correctly at init it is marked as disabled and i dont see any logic which would change it.
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.
No not always greyed out, it is only gryed out after we select destination as it own account
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.
Test_Standing.mov
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.
LGTM
Description
now we can create standing instruction by using both destinations, previously
this.createStandingInstructionsForm.controls['toOfficeId'].disable();
diable() was excluding the form values too, therefore it was not woking
Related issues and discussion
#1932
Screenshots, if any
Checklist
Please make sure these boxes are checked before submitting your pull request - thanks!
If you have multiple commits please combine them into one commit by squashing them.
Read and understood the contribution guidelines at
web-app/.github/CONTRIBUTING.md
.