Skip to content
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

Merged
merged 1 commit into from
Dec 15, 2023

Conversation

PC-11-00
Copy link
Collaborator

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

Screenshot 2023-12-14 at 10 49 34 PM

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.

@@ -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;
Copy link
Collaborator

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;
Copy link
Collaborator

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?

Copy link
Collaborator Author

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.

Copy link
Collaborator Author

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'

Copy link
Collaborator Author

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

Copy link
Collaborator

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... :/

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the latter

Copy link
Collaborator Author

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

Copy link
Collaborator

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.

Copy link
Collaborator Author

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

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Test_Standing.mov

@PC-11-00 PC-11-00 requested a review from adamsaghy December 15, 2023 13:23
Copy link
Collaborator

@adamsaghy adamsaghy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@adamsaghy adamsaghy merged commit 11098c6 into openMF:master Dec 15, 2023
@PC-11-00 PC-11-00 deleted the i1932 branch December 15, 2023 14:21
@PC-11-00 PC-11-00 restored the i1932 branch December 15, 2023 15:09
@PC-11-00 PC-11-00 deleted the i1932 branch January 4, 2024 03:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants