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

[Not-urgent] LF-4380 - address comments and improvement suggestions #3510

Open
wants to merge 9 commits into
base: integration
Choose a base branch
from

Conversation

Duncan-Brain
Copy link
Collaborator

@Duncan-Brain Duncan-Brain commented Oct 22, 2024

Description

  • simplify setFalsyValuesToNull

Jira link: LF-4380

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

How Has This Been Tested?

Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration

  • Passes test case
  • UI components visually reviewed on desktop view
  • UI components visually reviewed on mobile view
  • Other (please explain)

Checklist:

  • I have commented my code, particularly in hard-to-understand areas
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • The precommit and linting ran successfully
  • I have added or updated language tags for text that's part of the UI
  • I have added "MISSING" for all new language tags to languages I don't speak
  • I have added the GNU General Public License to all new files

@Duncan-Brain Duncan-Brain self-assigned this Oct 25, 2024
@Duncan-Brain Duncan-Brain marked this pull request as ready for review November 29, 2024 16:00
@Duncan-Brain Duncan-Brain requested review from a team as code owners November 29, 2024 16:00
@Duncan-Brain Duncan-Brain requested review from antsgar and SayakaOno and removed request for a team November 29, 2024 16:00
@Duncan-Brain Duncan-Brain changed the title LF-4380 - address comments and improvement suggestions [Not-urgent] LF-4380 - address comments and improvement suggestions Nov 29, 2024
Copy link
Collaborator

@SayakaOno SayakaOno left a comment

Choose a reason for hiding this comment

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

The updated code is much more readable and easier to follow! 👏
I left a few comments on places where I got confused.

);
const isCreatingWithBreed =
creating && someTruthy([default_breed_id, custom_breed_id, breed_name]);
// Do checks on breed unless removing breed from existing record or
Copy link
Collaborator

Choose a reason for hiding this comment

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

"Do checks on breed unless removing breed from existing record" - it seems to me that the next line can simply be if(someTruthy([default_breed_id, custom_breed_id, breed_name]).
I got confused here and I may have misunderstood something.

);
}
// Check if custom breed or new type is present
// Skip checks in some cases where new custom type or breed is added
if ((custom_breed_id && !type_name) || ((default_type_id || custom_type_id) && !breed_name)) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

The combination of breed ID and type_name is wrong... isn't it already handled earlier? I'm wondering if it can be if (custom_breed_id || ((default_type_id || custom_type_id) && !breed_name))

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.

2 participants