Add StorageDriver select component to CollectionForm.tsx#997
Draft
ekraffmiller wants to merge 6 commits into
Draft
Add StorageDriver select component to CollectionForm.tsx#997ekraffmiller wants to merge 6 commits into
ekraffmiller wants to merge 6 commits into
Conversation
Contributor
There was a problem hiding this comment.
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)) |
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>
…SS/dataverse-frontend into 929-collection-storage-driver
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What this PR does / why we need it:
Which issue(s) this PR closes:
Special notes for your reviewer:
Suggestions on how to test this:
Does this PR introduce a user interface change? If mockups are available, please link/include them here:
Is there a release notes or changelog update needed for this change?:
Additional documentation: