add use cases for creating datasets based on dataset type including linked metadata blocks
What this PR does / why we need it:
- create a dataset based on a dataset type (only "review" is supported, for now)
- when creating dataset or editing dataset metadata, show additional displayOnCreate fields based on the dataset type
Which issue(s) this PR closes:
- Closes #821
Special notes for your reviewer:
In the dropdown menus I think we should make the list dynamic, based on available dataset types (I added a TODO).
Suggestions on how to test this:
I was testing the review type by adding it and linking it to the citation metadata block:
curl -H "X-Dataverse-key:$API_TOKEN" -H "Content-Type: application/json" "http://localhost:8080/api/datasets/datasetTypes" -X POST -d '{"name":"review","linkedMetadataBlocks":["geospatial"]}'
However, not that the geospatial block doesn't have any displayOnCreate fields, so you won't see them on create.
Does this PR introduce a user interface change? If mockups are available, please link/include them here:
Yes, when enabled, you'll see "New Review" in the header and "add data" dropdowns:
Is there a release notes or changelog update needed for this change?:
If we enable it, yes. See TODO above
Additional documentation:
None.
coverage: 97.223% (+0.07%) from 97.156% when pulling 574f01e51908baccc4beadbd596113bd5a8b8743 on 821-datasetTypes into 905d6107bfb2253cf5ec74e12486c799e91cfaa2 on develop.
Hi Phil, thanks for adding this use case!
Could you solve the conflicts and fix and add some tests to the features, logs here, you made changes on JSDatasetMapper.ts, so mock data should include a dataType, then you could add test on it as well.
You could run cypress locally npm run cy:open-e2e or npm run cy:open-unit, more details in development guide. After running it, the cypress will open its own dashboard and a browser, you could navigate to the file in its dashboard. I always make sure all test cases pass locally, and for every file I changed, I search for the test file to check if all test pass there.
@pdurbin might be good to update this branch with develop, after doing that I recommend deleting the node_modules folder both in the root project and design system and then running the npm i command again.
In this PR we update node version to 22 and lot of other deps so it might be good to do a fresh install deleting node_modules folder.
We discussed this PR at the frontend meeting today. @g-saracca volunteered to make a pull request with an alternate approach that doesn't involve adding dataset types to the "Add Data" dropdown. Please see details here: https://github.com/IQSS/dataverse-frontend/issues/797#issuecomment-3411660616