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

Browse/Search facets section #466

Merged
merged 30 commits into from
Sep 11, 2024
Merged

Conversation

g-saracca
Copy link
Contributor

@g-saracca g-saracca commented Aug 23, 2024

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.

Screenshot 2024-08-23 at 15 30 22 Screenshot 2024-08-23 at 08 43 20

Is there a release notes update needed for this change?:

No.

@g-saracca g-saracca added Size: 3 A percentage of a sprint. 2.1 hours. integration Tasks involving the connection and interaction of UI features with the Dataverse API GREI Re-arch GREI re-architecture-related SPA: New Collection Page FY25 Sprint 4 FY25 Sprint 4 labels Aug 23, 2024
@g-saracca g-saracca self-assigned this Aug 23, 2024
@coveralls
Copy link

coveralls commented Aug 23, 2024

Coverage Status

coverage: 97.383% (-0.06%) from 97.44%
when pulling e4280a5 on feat/460-browse-search-facets-section
into dc857c3 on develop.

@g-saracca g-saracca removed their assignment Aug 23, 2024
@cmbz cmbz added the FY25 Sprint 5 FY25 sprint 5 label Aug 28, 2024
@ekraffmiller ekraffmiller self-assigned this Sep 9, 2024
Copy link
Contributor

@ekraffmiller ekraffmiller 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! 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.

err instanceof Error && err.message
? err.message
: 'Something went wrong getting all the facetable metadata fields. Try again later.'
setError(errorMessage)
Copy link
Contributor

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?

Copy link
Contributor Author

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.

@g-saracca
Copy link
Contributor Author

g-saracca commented Sep 10, 2024

@ekraffmiller , can you take a look now?
I have added error handling to show any erro, unit test for that and an e2e test for facets selection.

@g-saracca g-saracca removed their assignment Sep 10, 2024
Copy link
Contributor

@ekraffmiller ekraffmiller 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, approved!

Copy link
Contributor

@GPortas GPortas left a 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

Copy link
Contributor

@GPortas GPortas left a comment

Choose a reason for hiding this comment

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

I just retested it after rebuilding the design system package and works great,

Screenshot 2024-09-11 at 12 59 59

Merging

@GPortas GPortas merged commit 4c8c659 into develop Sep 11, 2024
10 of 14 checks passed
@GPortas GPortas deleted the feat/460-browse-search-facets-section branch September 11, 2024 12:01
@GPortas GPortas added SPA.Q3.4 Create Collection page (Full version) Original size: 3 labels Sep 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
FY25 Sprint 4 FY25 Sprint 4 FY25 Sprint 5 FY25 sprint 5 GREI Re-arch GREI re-architecture-related integration Tasks involving the connection and interaction of UI features with the Dataverse API Original size: 3 Size: 3 A percentage of a sprint. 2.1 hours. SPA: New Collection Page SPA.Q3.4 Create Collection page (Full version)
Projects
Status: Done 🧹
Development

Successfully merging this pull request may close these issues.

Browse/Search Facets section on Create Collection page
5 participants