Skip to content

Conversation

@pdurbin
Copy link
Member

@pdurbin pdurbin commented Sep 8, 2025

What this PR does / why we need it:

For an upcoming Trusted Data demo, we need to show a "New Review" button. This PR includes a couple booleans that can be flipped to true to show the button and conduct the demo.

Longer term, instead of hard-coding "review", we should be querying https://demo.dataverse.org/api/datasets/datasetTypes (on the target server, of course) to decide which extra dataset types to offer the user. Perhaps that will be in scope for a larger, related issue:

Which issue(s) this PR closes:

-related #797

Special notes for your reviewer:

This PR depends on the following js-dataverse PR:

I tried to add a variable to the .env file but I couldn't get this working. I think this would be preferable to having hard-coded booleans. I added some TODOs to this part of the code.

Suggestions on how to test this:

  • Flip the reviewCreationEnabled boolean to true
  • Build and deploy as normal
  • On the backend, create a dataset type of "review". See https://guides.dataverse.org/en/6.7.1/api/native-api.html#add-dataset-type
  • Click "New Review" and observe that the datasetType is passed as a query parameter
  • Save the review and observe that Dataset Type facet is incremented for the "review" type.

Does this PR introduce a user interface change? If mockups are available, please link/include them here:

Yes, when the creation of reviews are enabled, you'll see a "New Review" button:

Screenshot 2025-09-08 at 3 52 48 PM Screenshot 2025-09-08 at 3 52 54 PM

Clicking this button will add datasetType=review as a query parameter for the "create dataset" page:

Screenshot 2025-09-08 at 3 53 19 PM

Once you click save, you will see the "Dataset Type" facet incremented by the type you chose (note that if you have all one type, the facet is not shown):

Screenshot 2025-09-08 at 3 54 00 PM

There is a related issue about how this Dataset Type facet doesn't work (which might be a backend problem):

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

Yes, something like this:

"Experimental support for creating a review as a type of dataset has been added."

Additional documentation:

None.

@pdurbin pdurbin changed the title Show "New Review" button, when enabled #821 Show "New Review" button, when enabled Sep 8, 2025
@pdurbin pdurbin moved this to Ready for Review ⏩ in IQSS Dataverse Project Sep 8, 2025
const createCollectionRoute = RouteWithParams.CREATE_COLLECTION(collectionId)
const createDatasetRoute = RouteWithParams.CREATE_DATASET(collectionId)
// TODO: Enable/disable review creation based on config setting. See also LoggedInHeaderActions.tsx
// TODO: Longer term, query /api/datasets/datasetTypes and show those
Copy link
Member Author

Choose a reason for hiding this comment

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

I created this PR to query /api/datasets/datasetTypes

@g-saracca
Copy link
Contributor

@pdurbin Quick scope check: do we need this on develop now, or is it just for the demo? I thought the plan was to let users pick the dataset type on the Create Dataset page. If we add separate entries to Add data dropdown, the menu might get crowded (e.g., New Collection / New Dataset / New Review / New [DatasetType]). Could we keep a single “Create Dataset” entry and handle type selection in the flow, just an idea for a future iteration.

Also test are failing due to I believe Keycloak configs, please see this commit and replace with those two files there, that should fix things.

@pdurbin
Copy link
Member Author

pdurbin commented Sep 9, 2025

@g-saracca hi! No, we don't need this in develop any time soon. It's just for the demo. I took it off the board. I'm still learning. 😅

As I mentioned at #797 (comment) the plan for the demo is to add separate entries to the "add data" dropdown. You're right, this could get crowded! Keeping type selection in the flow is exactly what Zenodo and OSF do (see the screenshots in #797). So yeah, eventually, post-demo, maybe we'll go that way too.

Thanks for the heads up about the failures due to Keycloak. Hopefully, those fixes will be merged soon!

@g-saracca
Copy link
Contributor

That's ok!
If you or JP need help with any change or tests, storybook stories, etc. later post-demo let me know and I can help.

@coveralls
Copy link

Coverage Status

coverage: 97.492% (-0.6%) from 98.052%
when pulling d87bd6b on 821-review
into ca0c27f on develop.

@pdurbin
Copy link
Member Author

pdurbin commented Oct 1, 2025

I'm closing this PR in favor of this new one that does more:

@pdurbin pdurbin closed this Oct 1, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

GREI Re-arch GREI re-architecture-related

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants