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

Add series data entry feature #4804

Draft
wants to merge 19 commits into
base: production
Choose a base branch
from
Draft

Add series data entry feature #4804

wants to merge 19 commits into from

Conversation

CarolineDenis
Copy link
Contributor

Fixes #545

Checklist

  • Self-review the PR after opening it to make sure the changes look good
    and self-explanatory (or properly documented)
  • Add automated tests
  • Add relevant issue to release milestone

Testing instructions

@CarolineDenis CarolineDenis changed the title Issue 545 Add series data entry feature Apr 17, 2024
@CarolineDenis CarolineDenis added this to the 7.9.x milestone May 20, 2024
Copy link
Contributor

@sharadsw sharadsw left a comment

Choose a reason for hiding this comment

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

Looks good to me! Only making some optional suggestions

specifyweb/frontend/js_src/lib/components/Forms/Save.tsx Outdated Show resolved Hide resolved
specifyweb/frontend/js_src/lib/components/Forms/Save.tsx Outdated Show resolved Hide resolved
specifyweb/frontend/js_src/lib/components/Forms/Save.tsx Outdated Show resolved Hide resolved
@CarolineDenis CarolineDenis modified the milestones: 7.9.x, 7.9.7 May 23, 2024
@CarolineDenis CarolineDenis requested a review from a team May 23, 2024 20:05
{resource.specifyTable.name === 'CollectionObject' &&
!isInRecordSet &&
showBulkCarryInput ? (
<Label.Inline>
Copy link
Member

Choose a reason for hiding this comment

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

should this be in a dialog?
otherwise, you would need to add aria-controls and forward focus from the button to input on button click

if (originalResourceId !== undefined) {
ids.push(originalResourceId);
}
if (Array.isArray(result)) {
Copy link
Member

Choose a reason for hiding this comment

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

change the signature of handleAdd() to make it be callable with an array of resources rather than one resource
and use that to simplify the code here
that would also shift the responsibility to the consumer of Save for deciding how it wants to handle or not to handle the case of more than one resource being present (i.e imagine that some code right now does a redirect on handleAdd() - by calling handleAdd multiples times here, that code is now potentially broken; where as by changing handleAdd signature to include array, that place would now be forced to consider how the array case needs to be handled)

Copy link
Member

Choose a reason for hiding this comment

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

and once handleAdd() is being called with an array, there won't be need for handleCarryBulk() anymore as it can be combined

Comment on lines +318 to +321
const startingResource = fetchResource('CollectionObject', ids[0]);
const endingResource = fetchResource('CollectionObject', ids.at(-1)!);
const startingResourceCatNumber = (await startingResource).catalogNumber;
const endingResourceCatNumber = (await endingResource).catalogNumber;
Copy link
Member

Choose a reason for hiding this comment

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

once you change the code to remove handleCarryBulk and make handleAdd receive an array of resources, you won't need to do re-fetching of resources manually here as handleAdd is already being called with fetched resource

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Dev Attention Needed
Development

Successfully merging this pull request may close these issues.

Series data entry
3 participants