Skip to content

797 dataset type selection step v2#955

Open
jp-tosca wants to merge 41 commits into
developfrom
797-dataset-type-selection-step-v2
Open

797 dataset type selection step v2#955
jp-tosca wants to merge 41 commits into
developfrom
797-dataset-type-selection-step-v2

Conversation

@jp-tosca

@jp-tosca jp-tosca commented Apr 11, 2026

Copy link
Copy Markdown
Contributor

What this PR does / why we need it:

Following up on @pdurbin's work in #845, this PR updates how users select the dataset type in the dataset creation flow.

For now, we’ve hardcoded the dataset type descriptions (“dataset” and “review”) as a temporary solution until the new field is added. Update: this was fixed in 7c355f4.

This is the first step toward supporting dataset types in the SPA, more enhancements coming soon.

Storybook links:

Which issue(s) this PR closes:

Depends on

This PR depends on the following backend PR:

Special notes for your reviewer:

Suggestions on how to test this:

You can go your own way to test this, but I have tried to make it easier for you and created a script that will set up and configure this for you.

If you decide to use this script there is a section that requires that you have NODE installed, if that is not the case you need to comment this section and create and publish the collections by yourself.

I will explain to you what this script does so you can decide what steps, if any, you will want to go your own way.

Please copy and create this script in a file in the scripts folder of the project (this is required for step 4), also remember to set permissions #chmod +x ./config.sh

  1. Provide the API token on line 5.
  2. Download files with the review type, metadata block, and a collection json.
  3. Upload the metadata block for reviews
  4. Solar update
  5. Dataset type upload
  6. We create, publish, and configure 4 collections:
  • "VANILLA" collection will have no configuration
  • "MIX" Will have datasets and reviews configured as allowed dataset types
  • "DATASETS" Will only allow datasets of type "dataset" to be created
  • "REVIEWS" Will only allow datasets of type "review" to be created

#!/usr/bin/env bash
#chmod +x ./config.sh

#UPDATE WITH YOUR API TOKEN
API_TOKEN="DEFINE YOUR TOKEN HERE"

#COLLECTION, TYPE AND METADATA BLOCK DOWNLOAD
curl -fL "https://raw.githubusercontent.com/IQSS/dataverse/master/scripts/api/data/metadatablocks/review.tsv" -o "review.tsv"
curl -fL "https://guides.dataverse.org/en/latest/_downloads/c2a076bba578dc93b3582f41d6fba594/review.json" -o "review.json"
curl -fL "https://guides.dataverse.org/en/latest/_downloads/78ade9231d6876a7c9fa1ff095c446bd/dataverse-complete.json" -o "collection.json"

#METADATA BLOCK UPLOAD
curl "http://localhost:8080/api/admin/datasetfield/load" -H "Content-type: text/tab-separated-values" -X POST --upload-file "review.tsv"

#SOLR UPDATE
curl -fS "http://localhost:8080/api/admin/index/solr/schema" | docker run -i --rm \
  -v "$(pwd)/dev-env/docker-dev-volumes/solr/data:/var/solr" \
  gdcc/configbaker:unstable \
  update-fields.sh /var/solr/data/collection1/conf/schema.xml -
curl -fS "http://localhost:8983/solr/admin/cores?action=RELOAD&core=collection1&wt=json"


#DATASET TYPE UPLOAD
curl -H "X-Dataverse-key:$API_TOKEN" -H "Content-Type: application/json" "http://localhost:8080/api/datasets/datasetTypes" -X POST --upload-file review.json

#COLLECTION CREATION AND PUBLISHING (NODE REQUIRED)
#REVIEWS COLLECTION
node -e 'const fs = require("fs"); const collection = JSON.parse(fs.readFileSync("collection.json", "utf8")); collection.name = "REVIEWS"; collection.alias = "REVIEWS"; fs.writeFileSync("collection.json", JSON.stringify(collection, null, 2) + "\n");'
curl -H "X-Dataverse-key:$API_TOKEN" -X POST "http://localhost:8080/api/dataverses/root" --upload-file collection.json
curl -H "X-Dataverse-key:$API_TOKEN" -X POST "http://localhost:8080/api/dataverses/REVIEWS/actions/:publish"
curl -X PUT -H "X-Dataverse-key:$API_TOKEN" "http://localhost:8080/api/dataverses/REVIEWS/attribute/allowedDatasetTypes?value=review"
#DATASETS COLLECTION
node -e 'const fs = require("fs"); const collection = JSON.parse(fs.readFileSync("collection.json", "utf8")); collection.name = "DATASETS"; collection.alias = "DATASETS"; fs.writeFileSync("collection.json", JSON.stringify(collection, null, 2) + "\n");'
curl -H "X-Dataverse-key:$API_TOKEN" -X POST "http://localhost:8080/api/dataverses/root" --upload-file collection.json
curl -H "X-Dataverse-key:$API_TOKEN" -X POST "http://localhost:8080/api/dataverses/DATASETS/actions/:publish"
curl -X PUT -H "X-Dataverse-key:$API_TOKEN" "http://localhost:8080/api/dataverses/DATASETS/attribute/allowedDatasetTypes?value=dataset"
#MIX COLLECTION
node -e 'const fs = require("fs"); const collection = JSON.parse(fs.readFileSync("collection.json", "utf8")); collection.name = "MIX"; collection.alias = "MIX"; fs.writeFileSync("collection.json", JSON.stringify(collection, null, 2) + "\n");'
curl -H "X-Dataverse-key:$API_TOKEN" -X POST "http://localhost:8080/api/dataverses/root" --upload-file collection.json
curl -H "X-Dataverse-key:$API_TOKEN" -X POST "http://localhost:8080/api/dataverses/MIX/actions/:publish"
curl -X PUT -H "X-Dataverse-key:$API_TOKEN" "http://localhost:8080/api/dataverses/MIX/attribute/allowedDatasetTypes?value=review,dataset"
#VANILLA COLLECTION
node -e 'const fs = require("fs"); const collection = JSON.parse(fs.readFileSync("collection.json", "utf8")); collection.name = "VANILLA"; collection.alias = "VANILLA"; fs.writeFileSync("collection.json", JSON.stringify(collection, null, 2) + "\n");'
curl -H "X-Dataverse-key:$API_TOKEN" -X POST "http://localhost:8080/api/dataverses/root" --upload-file collection.json
curl -H "X-Dataverse-key:$API_TOKEN" -X POST "http://localhost:8080/api/dataverses/VANILLA/actions/:publish"


With this in mind, you can check the JSON for each collection:

With this you should be able to verify the following use cases:

  • When there is no configured allowed dataset types the creation screen should look like it does before this patch (no changes)
  • When there is one single type a new display will tell the user the type of dataset that they are creating.
  • When there are multiple types it should show a selection field to allow the user to select the type of the dataset from the allowed list for this collection.

Pre-requisites for testing this.

As mentioned in IQSS/dataverse#11753:

Do all the setup at https://dataverse-guide--11753.org.readthedocs.build/en/11753/admin/dataverses-datasets.html#review-datasets-setup
  1. Login within the SPA and navigate to the Create Dataset page.
  2. By default only one dataset type exists('dataset' type) so you won't see a Dataset Type selector.
  3. Add a new dataset type with:
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"]}'
  1. Navigate again to the Create Dataset Page and now you will see a Dataset Type selector.
  2. Select "Review" and create the dataset.
  3. Go to edit the recently created dataset and you will se a Dataset Type readonly field with the value of "Review".

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

Yes.

The "Create Dataset" page now has a Dataset Type dropdown. See the latest screenshots here: #876 (comment)

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

Not for now, might be good to add it after work related to dataset types is done.

Additional documentation:

@coveralls

coveralls commented Apr 11, 2026

Copy link
Copy Markdown

Coverage Status

coverage: 97.83% (+0.5%) from 97.343% — 797-dataset-type-selection-step-v2 into develop

@cmbz cmbz added this to the 6.11 milestone Jun 1, 2026
@jp-tosca jp-tosca marked this pull request as ready for review June 9, 2026 18:29
@jp-tosca jp-tosca moved this to Ready for Review ⏩ in IQSS Dataverse Project Jun 9, 2026
@jp-tosca jp-tosca force-pushed the 797-dataset-type-selection-step-v2 branch from d7c181b to 6d1914e Compare June 18, 2026 16:19
jp-tosca and others added 5 commits June 18, 2026 12:35
- Add missing Form and Col imports to EditDatasetMetadata
- Extract datasetRepository from context hook in CreateDataset
- Move datasetRepository prop to RepositoriesStoryProvider in stories
- Add eslint disable comments for necessary any types
- Rename unused collectionId variable to follow eslint pattern
- Fix formatting issues

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…ect.tsx

Co-authored-by: Ellen Kraffmiller <ekraffmiller@hmdc.harvard.edu>
…ect.tsx

Co-authored-by: Ellen Kraffmiller <ekraffmiller@hmdc.harvard.edu>
Co-authored-by: Ellen Kraffmiller <ekraffmiller@hmdc.harvard.edu>
@cmbz cmbz added the FY26 Sprint 26 FY26 Sprint 26 (2026-06-17 - 2026-07-01) label Jun 18, 2026
@jp-tosca jp-tosca removed their assignment Jun 26, 2026
@cmbz cmbz added the FY27 Sprint 1 FY27 Sprint 1 (2026-07-01 - 2026-07-15) label Jul 1, 2026

@ekraffmiller ekraffmiller left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

looks good, approved

@github-project-automation github-project-automation Bot moved this from In Review 🔎 to Ready for QA ⏩ in IQSS Dataverse Project Jul 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

FY26 Sprint 20 FY26 Sprint 20 (2026-03-26 - 2026-04-08) FY26 Sprint 21 FY26 Sprint 21 (2026-04-08 - 2026-04-22) FY26 Sprint 22 FY26 Sprint 22 (2026-04-22 - 2026-05-06) FY26 Sprint 23 FY26 Sprint 23 (2026-05-06 - 2026-05-20) FY26 Sprint 24 FY26 Sprint 24 (2026-05-20 - 2026-06-03) FY26 Sprint 25 FY26 Sprint 25 (2026-06-03 - 2026-06-17) FY26 Sprint 26 FY26 Sprint 26 (2026-06-17 - 2026-07-01) FY27 Sprint 1 FY27 Sprint 1 (2026-07-01 - 2026-07-15) Project: Trusted Data Size: 210 A percentage of a sprint. 147 hours. SPA

Projects

Status: Ready for QA ⏩

Development

Successfully merging this pull request may close these issues.

Dataset Type facet doesn't work, no matches Allow for the creation of various dataset types

5 participants