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

Enable creation of empty seedlots #5159

Draft
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

afpowell
Copy link
Contributor

@afpowell afpowell commented Oct 21, 2024

Description

This PR allows users to create empty seedlots as placeholders (i.e., seedlots with no/zero seed weight values or seed count values), as this seems desirable for certain users.

Closes #5157

Checklist

  • Refactoring only
  • Documentation only
  • Fixture update only
  • Bug fix
    • The relevant issue has been closed.
    • Further work is required.
  • New feature
    • Relevant tests have been created and run.
    • Data was added to the fixture
      • Data was added via a patch in /t/data/fixture/patches/.
    • User-Facing Change
      • The user manual in /docs has been updated.
    • Any new Perl has been documented using perldoc.
    • Any new JavaScript has been documented using JSDoc.
    • Any new legacy JavaScript has been moved from /js to /js/source/legacy.

@alockrow
Copy link
Contributor

Would it be better to require a weight or count but allow 0s? That way no one accidentally skips those fields without meaning to and there's still a value in one at least one of them.

Or, alternatively, you could give a warning message so that users have to confirm that they want to create a seedlot with no weight and no count.

@ryan-preble
Copy link
Contributor

Would it be better to require a weight or count but allow 0s? That way no one accidentally skips those fields without meaning to and there's still a value in one at least one of them.

Or, alternatively, you could give a warning message so that users have to confirm that they want to create a seedlot with no weight and no count.

I'd say warning message makes the most sense to me. Without knowing who requested this feature I speculate that they want to be able to make a bunch of seedlot entries all at once in anticipation of seed collection and then go back and edit the data once they actually have the seeds collected. Giving a warning popup handles both this case and the case where someone just forgot to enter the data and needs to go back.

@alockrow
Copy link
Contributor

Would it be better to require a weight or count but allow 0s? That way no one accidentally skips those fields without meaning to and there's still a value in one at least one of them.
Or, alternatively, you could give a warning message so that users have to confirm that they want to create a seedlot with no weight and no count.

I'd say warning message makes the most sense to me. Without knowing who requested this feature I speculate that they want to be able to make a bunch of seedlot entries all at once in anticipation of seed collection and then go back and edit the data once they actually have the seeds collected. Giving a warning popup handles both this case and the case where someone just forgot to enter the data and needs to go back.

Sounds good to me!

Copy link
Member

@lukasmueller lukasmueller left a comment

Choose a reason for hiding this comment

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

is the check that the value be numeric still there?

@afpowell
Copy link
Contributor Author

Yes, the check that a value be numeric should still be there

Copy link
Member

@lukasmueller lukasmueller left a comment

Choose a reason for hiding this comment

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

:-)

Copy link
Member

@lukasmueller lukasmueller left a comment

Choose a reason for hiding this comment

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

Actually, I found an issue: when I added 0 as the count, it appeared as NA in the seedlot later. Shouldn't it appear as 0? May be due to the fact that 0 is also false in Perl...

Copy link
Contributor

@alockrow alockrow left a comment

Choose a reason for hiding this comment

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

Add a warning if the user chooses to make both count and weight empty to make sure that was on purpose.

@alockrow
Copy link
Contributor

There are a couple of issues I'm seeing:

  1. If you just put in a space in the count and/or weight fields it will accept it and not throw an error and show up as an NA value in the seedlot. I think we should reject it and give the "a seedlot must have a count or weight" error.
  2. As Lukas mentioned above if you put in a 0 it shows up as "NA". I think we want it to show up as a numeric 0.

@afpowell
Copy link
Contributor Author

afpowell commented Oct 24, 2024

Thanks, Amber - I'll check about the spaces and update this PR.

On your other point, after some discussion, we are just going to use this PR to allow the user to create an empty seedlot by using zero values in either the amount or weight fields. Leaving both fields blank is not an option going forward. This will be followed by another ticket/PR that implements the user having to commit to one or the other, and will address the issue of the 0 values actually appearing as 0 values.

@afpowell afpowell marked this pull request as draft October 24, 2024 19:58
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.

Enable creation of empty seedlots
4 participants