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(DEV-13054): add create counterparts from payables and approval policies #576

Merged
merged 15 commits into from
Feb 27, 2025

Conversation

ayubova
Copy link
Collaborator

@ayubova ayubova commented Feb 11, 2025

No description provided.

Copy link

changeset-bot bot commented Feb 11, 2025

⚠️ No Changeset found

Latest commit: 349a505

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@marcperezmonite marcperezmonite changed the title Feat DEV-13054 add create counterparts from payables and approval policies fix(DEV-13054): add create counterparts from payables and approval policies Feb 13, 2025
Copy link
Collaborator

@costa-monite costa-monite left a comment

Choose a reason for hiding this comment

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

Nice work, thanks. The code changes are well-structured, and the introduction of the CounterpartAutocompleteWithCreate component promotes reusability.

But I have some additions that could be addressed.
Stylistic ones are conveyed as separate comments.
And more logical ones, I will write them here:

– There's considerable duplication of autocomplete logic in AutocompleteCounterparts and CounterpartAutocompleteWithCreate. May be we can do something about it now, or we can create a task for addressing it later
– ApprovalPolicyForm useEffect that sets initial form values is getting a bit long and complex, especially with the conditional logic for different trigger types. Consider breaking this down into smaller, more focused useEffect hooks, or extracting some of the logic into helper functions to improve readability

@ayubova
Copy link
Collaborator Author

ayubova commented Feb 15, 2025

@costa-monite Thanks for the feedback! I really appreciate it.

You were absolutely right about the duplication in AutocompleteCounterparts and CounterpartAutocompleteWithCreate—I’ve refactored it to make it more reusable.

As for the useEffect in ApprovalPolicyForm, I agree it could be improved, but the logic is quite complex and wasn’t written by me. I’m a bit worried about breaking something, so I’d prefer to leave it as is for now. Maybe we can create a separate task for it later.

Let me know what you think! 😊

@costa-monite
Copy link
Collaborator

@ayubova Thank you for the clarification and for your work! Regarding the useEffect logic, I agree that in this case, it’s best to leave it as is for now. Thanks for pointing that out

Copy link
Collaborator

@costa-monite costa-monite left a comment

Choose a reason for hiding this comment

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

Thanks for the updates

@marcperezmonite marcperezmonite merged commit a14cb67 into main Feb 27, 2025
14 of 17 checks passed
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