Skip to content

Add StorageDriver select component to CollectionForm.tsx - #997

Merged
pdurbin merged 15 commits into
developfrom
929-collection-storage-driver
Nov 13, 2026
Merged

pdurbin merged 15 commits into
developfrom
929-collection-storage-driver

Conversation

@ekraffmiller

@ekraffmiller ekraffmiller commented May 29, 2026 •

Copy link
Copy Markdown
Contributor

What this PR does / why we need it: Implements the feature of selecting a storage drivers from a list of available storage drivers to the Create and Edit Collection page

Which issue(s) this PR closes:

Special notes for your reviewer:

To test this locally, update the docker-compose-dev.yml with additional JVM arguments, for example:
-Ddataverse.files.file1.type=file
-Ddataverse.files.file1.label=FileSystem
-Ddataverse.files.file1.storage-location=/dv/files/file1

Suggestions on how to test this:

Create and Edit collections for superuser and non-superuser. This is a superuser only function. Non-superusers should not see the select dropdown

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

no

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

Additional documentation:

@coveralls

coveralls commented May 29, 2026 •

Copy link
Copy Markdown

Coverage Status

coverage: 97.429% (+0.05%) from 97.379% — 929-collection-storage-driver into develop

Copilot AI 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.

Pull request overview

Adds superuser-only collection storage driver selection to the create/edit collection form, backed by new collection repository methods and js-dataverse-client support.

Changes:

  • Adds storage driver domain models, use cases, hooks, repository methods, and form UI.
  • Persists selected storage driver after create/edit submissions when changed by a superuser.
  • Updates tests, Storybook mock data, package version, and dev environment storage configuration.

Reviewed changes

Copilot reviewed 20 out of 21 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
tests/component/sections/shared/edit-create-collection-form/EditCreateCollectionForm.spec.tsx Adds component coverage for storage field visibility/options and submit behavior.
src/stories/create-collection/CreateCollection.stories.tsx Adds a superuser story with selectable storage drivers.
src/stories/collection/CollectionMockRepository.ts Adds mock storage-driver repository methods.
src/shared/hooks/useGetCollectionStorageDriver.ts Adds hook to fetch current/effective storage driver.
src/shared/hooks/useGetCollectionAllowedStorageDrivers.ts Adds hook to fetch allowed storage drivers.
src/sections/shared/form/EditCreateCollectionForm/types.ts Changes form storage value type to string.
src/sections/shared/form/EditCreateCollectionForm/EditCreateCollectionForm.tsx Loads storage-driver data and passes it into the form.
src/sections/shared/form/EditCreateCollectionForm/collection-form/useSubmitCollection.ts Sets selected storage driver after collection create/edit.
src/sections/shared/form/EditCreateCollectionForm/collection-form/top-fields-section/TopFieldsSection.tsx Replaces disabled storage placeholder with conditional storage field.
src/sections/shared/form/EditCreateCollectionForm/collection-form/top-fields-section/StorageField.tsx Adds storage driver select field component.
src/sections/shared/form/EditCreateCollectionForm/collection-form/CollectionForm.tsx Wires storage props and submit behavior through the form.
src/collection/infrastructure/repositories/CollectionJSDataverseRepository.ts Implements storage-driver calls through js-dataverse-client.
src/collection/domain/useCases/setCollectionDriver.ts Adds use case to set collection storage driver.
src/collection/domain/useCases/getCollectionStorageDriver.ts Adds use case to get collection storage driver.
src/collection/domain/useCases/getCollectionAllowedStorageDrivers.ts Adds use case to get allowed storage drivers.
src/collection/domain/repositories/CollectionRepository.ts Extends repository interface with storage-driver operations.
src/collection/domain/models/StorageDriver.ts Adds storage driver model.
src/collection/domain/models/AllowedStorageDrivers.ts Adds allowed storage drivers map type.
package.json Updates js-dataverse-client dependency version.
package-lock.json Locks updated js-dataverse-client dependency.
dev-env/docker-compose-dev.yml Adds local filesystem storage driver configuration.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

newOrUpdatedCollection,
collectionIdOrParentCollectionId
)
.then((newCollectionIdentifier) => setSelectedStorageDriver(newCollectionIdentifier))
})
} else {
editCollection(collectionRepository, newOrUpdatedCollection, collectionIdOrParentCollectionId)
.then(() => setSelectedStorageDriver(collectionIdOrParentCollectionId))
ekraffmiller and others added 5 commits May 29, 2026 11:47
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
@ekraffmiller ekraffmiller linked an issue Jun 1, 2026 that may be closed by this pull request
@ekraffmiller
ekraffmiller marked this pull request as ready for review June 3, 2026 12:03
@ekraffmiller ekraffmiller moved this to Ready for Review ⏩ in IQSS Dataverse Project Jun 3, 2026
@ekraffmiller ekraffmiller added Size: 3 A percentage of a sprint. 2.1 hours. GREI Re-arch GREI re-architecture-related FY26 Sprint 24 FY26 Sprint 24 (2026-05-20 - 2026-06-03) labels Jun 3, 2026
@cmbz cmbz added the FY26 Sprint 25 FY26 Sprint 25 (2026-06-03 - 2026-06-17) label Jun 3, 2026
@ChengShi-1 ChengShi-1 self-assigned this Jun 10, 2026
@ChengShi-1
ChengShi-1 self-requested a review June 10, 2026 15:57
@ChengShi-1 ChengShi-1 moved this from Ready for Review ⏩ to In Review 🔎 in IQSS Dataverse Project Jun 10, 2026

@ChengShi-1 ChengShi-1 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 really good, just two comments.

While checking JSF, I noticed that there are two S3 options available. I'm not sure why there are two options. Are they the same, or do they serve different purposes?
Image

Comment thread package.json Outdated
"@dnd-kit/utilities": "3.2.2",
"@faker-js/faker": "7.6.0",
"@iqss/dataverse-client-javascript": "2.1.0-alpha.4",
"@iqss/dataverse-client-javascript": "2.2.0-alpha.4",

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.

Could you update to 2.2.0-alpha.9 as our latest js-dataverse alpha ver.?

collectionRepository.create = cy.stub().resolves(1)
collectionRepository.edit = cy.stub().resolves({})
collectionRepository.getFacets = cy.stub().resolves(collectionFacets)
collectionRepository.getAllowedStorageDrivers = cy.stub().resolves(allowedStorageDrivers)

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.

Could you also write unit tests for these two hooks (useGetCollectionAllowedStorageDrivers.ts, and
useGetCollectionStorageDriver.ts), to help improve the overall test coverage?

@cmbz cmbz added the FY26 Sprint 26 FY26 Sprint 26 (2026-06-17 - 2026-07-01) label Jun 18, 2026
@ekraffmiller ekraffmiller removed their assignment Jun 25, 2026

@ChengShi-1 ChengShi-1 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.

Thanks for the changes! Approving

@github-project-automation github-project-automation Bot moved this from In Review 🔎 to Ready for QA ⏩ in IQSS Dataverse Project Jun 25, 2026
@ChengShi-1 ChengShi-1 removed their assignment Jun 25, 2026
@cmbz cmbz added the FY27 Sprint 1 FY27 Sprint 1 (2026-07-01 - 2026-07-15) label Jul 1, 2026
@ChengShi-1 ChengShi-1 added the SPA label Jul 9, 2026
@cmbz cmbz added the FY27 Sprint 2 FY27 Sprint 2 (2026-07-15 - 2026-07-29) label Jul 15, 2026
@cmbz cmbz added the FY27 Sprint 3 FY27 Sprint 3 (2026-07-29 - 2026-08-12) label Jul 29, 2026
@cmbz cmbz added the FY27 Sprint 4 FY27 Sprint 4 (2026-08-12 - 2026-08-26) label Aug 12, 2026
@cmbz cmbz added the FY27 Sprint 5 FY27 Sprint 5 (2026-08-26 - 2026-09-09) label Aug 26, 2026
@cmbz cmbz added the FY27 Sprint 6 FY27 Sprint 6 (2026-09-09 - 2026-09-23) label Sep 9, 2026
@cmbz cmbz added the FY27 Sprint 7 FY27 Sprint 7 (2026-09-23 - 2026-10-07) label Sep 23, 2026
@pdurbin pdurbin assigned pdurbin and unassigned pdurbin Sep 29, 2026
@cmbz cmbz added the FY27 Sprint 8 FY27 Sprint 8 (2026-10-07 - 2026-10-21) label Oct 7, 2026
@ChengShi-1 ChengShi-1 added this to the 0.3.4 milestone Oct 7, 2026
@ChengShi-1 ChengShi-1 moved this from Ready for QA ⏩ to QA ✅ in IQSS Dataverse Project Nov 12, 2026
@pdurbin

pdurbin commented Nov 12, 2026

Copy link
Copy Markdown
Member

The functionality seems to work fine:

Screenshot 2026-11-12 at 3 22 29 PM Screenshot 2026-11-12 at 3 22 38 PM

@pdurbin

pdurbin commented Nov 12, 2026

Copy link
Copy Markdown
Member

I had to resolve conflicts in CHANGELOG.md but if the tests continue to pass, as before, I'll merge this.

@pdurbin
pdurbin merged commit 2de7776 into develop Nov 13, 2026
15 of 18 checks passed
@github-project-automation github-project-automation Bot moved this from QA ✅ to Merged 🚀 in IQSS Dataverse Project Nov 13, 2026
@pdurbin pdurbin removed their assignment Nov 13, 2026
@pdurbin
pdurbin deleted the 929-collection-storage-driver branch November 13, 2026 20:34
@pdurbin pdurbin moved this from Merged 🚀 to Done 🧹 in IQSS Dataverse Project Nov 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

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) FY27 Sprint 2 FY27 Sprint 2 (2026-07-15 - 2026-07-29) FY27 Sprint 3 FY27 Sprint 3 (2026-07-29 - 2026-08-12) FY27 Sprint 4 FY27 Sprint 4 (2026-08-12 - 2026-08-26) FY27 Sprint 5 FY27 Sprint 5 (2026-08-26 - 2026-09-09) FY27 Sprint 6 FY27 Sprint 6 (2026-09-09 - 2026-09-23) FY27 Sprint 7 FY27 Sprint 7 (2026-09-23 - 2026-10-07) FY27 Sprint 8 FY27 Sprint 8 (2026-10-07 - 2026-10-21) GREI Re-arch GREI re-architecture-related Size: 3 A percentage of a sprint. 2.1 hours. SPA

Projects

Status: Done 🧹

Development

Successfully merging this pull request may close these issues.

Create/Edit Collection: Add StorageDriver input

6 participants