-
Notifications
You must be signed in to change notification settings - Fork 16
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
Browse/Search facets section #466
Conversation
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! Some minor comments below. Also, I think it would be good to update the e2e-integration tests to cover the new functionality, either in CreateCollection.spec.tsx or CollectionJSDataverseRepository.spec.ts.
src/metadata-block-info/domain/repositories/MetadataBlockInfoRepository.ts
Show resolved
Hide resolved
err instanceof Error && err.message | ||
? err.message | ||
: 'Something went wrong getting all the facetable metadata fields. Try again later.' | ||
setError(errorMessage) |
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.
CreateCollection.tsx, which is using this hook, doesn't read the error field. So if an error occurs, it looks like the page will be stuck in loading mode, without any feedback about the error. Could we print the error message to the console, so that the error message can be seen by developers? Or will the error property be handled in a future code change that includes more general error handling?
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.
I made an error handling logic to show any error related to data loading.
@ekraffmiller , can you take a look now? |
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, approved!
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.
Overall, this looks good!
I think we should keep the transfer list component disabled until the user unchecks the 'use from root' checkbox. Alternatively, it could be automatically unchecked once the default values of the transfer list component are modified. Currently, the checkbox remains checked even when we have changed the default values.
useroot_notmark.mov
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.
What this PR does / why we need it:
Adds the Browse/Search facets section of the Create Collection Page.
Integrates 3 new use cases from js-dataverse:
getCollectionFacets
getAllFacetableMetadataFields
getAllMetadataBlocks
Also we are now handling correctly the conditionally required input level fields from the Metadata Fields section.
Which issue(s) this PR closes:
Suggestions on how to test this:
Create a collection by selecting different facetable fields, sort them as well.
Navigate to that collection and click on Add Data => New Collection, check that the facetable fields from the parent collection are correctly set in the transfer list in the correct order also.
Does this PR introduce a user interface change? If mockups are available, please link/include them here:
Yes.
Is there a release notes update needed for this change?:
No.