-
Notifications
You must be signed in to change notification settings - Fork 38
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
base: production
Are you sure you want to change the base?
Conversation
Triggered by 0680b87 on branch refs/heads/issue-545
ffa931c
to
5cf1c90
Compare
There was a problem hiding this 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
{resource.specifyTable.name === 'CollectionObject' && | ||
!isInRecordSet && | ||
showBulkCarryInput ? ( | ||
<Label.Inline> |
There was a problem hiding this comment.
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)) { |
There was a problem hiding this comment.
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)
There was a problem hiding this comment.
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
const startingResource = fetchResource('CollectionObject', ids[0]); | ||
const endingResource = fetchResource('CollectionObject', ids.at(-1)!); | ||
const startingResourceCatNumber = (await startingResource).catalogNumber; | ||
const endingResourceCatNumber = (await endingResource).catalogNumber; |
There was a problem hiding this comment.
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
Fixes #545
Checklist
and self-explanatory (or properly documented)
Testing instructions