Refactoring and save manifest metadata as fields / not file#28
Refactoring and save manifest metadata as fields / not file#28
Conversation
…_URL for API requests
…nfig - Updated various dependencies in package.json to their latest versions, including React, Bootstrap, Storybook, and TypeScript. - Removed the tailwindcss plugin from the Vite configuration as it is no longer needed.
Refactor .gitignore to improve file exclusions and organization
Node versions update
Refactor NavigationBar and useLoginCustomForm to utilize dynamic BASE…
Adds toastify and make changes required to work with this library
…mline context values; update image handling in EditImageForm and useEditImageForm for better state management; enhance useMarketplaceApiRepo with improved error handling and toast notifications.
Fixes issues with rendering.
Round icons and view button changes
Clarify API key handling message in InstallExToolFrame
…marketplace into manifest_changes
…ra formatting tweaks
Logo change
There was a problem hiding this comment.
Pull Request Overview
This PR refactors how manifest metadata is stored and managed, consolidating version and manifest models, and replacing file-based uploads with structured form fields. It also enhances dynamic input handling, image state management, and UI theme persistence.
- Store manifest metadata as individual fields and merge with version object
- Introduce
MultiInputGroupfor dynamic list inputs and newEditManifestFormmodal - Update image and tool creation forms to handle state immutably and integrate manifest data
- Add theme switcher enhancements and new
MarketplaceLinkCardvariant
Reviewed Changes
Copilot reviewed 111 out of 111 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| useEditManifestForm.tsx | New hook to manage manifest form state and JSON uploads |
| MultiInputGroup.tsx | Component to add/remove dynamic string, keyValue, and object arrays |
| EditVersionForm.tsx & EditVersionCard.tsx | Replace manifest file inputs with structured edit modal |
| useEditImageForm.ts | Fix image list state handling |
| EditImageForm.tsx | Update image upload UI to use state array from hook |
| useAddExternalTool.ts & AddExtToolForm.tsx | Integrate manifest modal into add tool flow and build multipart form |
| UserContextProvider.tsx, useThemeSwitcher.ts, ThemeSwitcher.tsx | Persist theme choice in context and local storage |
| MarketplaceCard.tsx | Add MarketplaceLinkCard variant and style updates |
| FormInputFields.tsx | Consolidate form input components and nested change handler |
Comments suppressed due to low confidence (2)
dv-marketplace/src/components/forms/AddExternalToolForm/useAddExternalTool.ts:30
- The field
versioneNoteappears to be a typo; rename toversionNotefor consistency with other form fields.
versioneNote: form.versioneNote.value,
dv-marketplace/src/components/UI/MarketplaceCard.tsx:14
- Missing import of
Linkfromreact-router-dom; addimport { Link } from 'react-router-dom';at the top.
export const MarketplaceLinkCard = ({ header, imageId, text, link, children }: CardDeckProps) => {
| for (const item of data) { | ||
| tool?.images.push(item); | ||
| images.push(item); | ||
| } | ||
| } else { | ||
| tool?.images.push(data); | ||
| images.push(data); |
There was a problem hiding this comment.
Avoid directly mutating the images array; use setImages(prev => [...prev, item]) to update state immutably so React re-renders correctly.
| const handleManifestChange = createFormChangeHandler(setFormManifest); | ||
|
|
||
|
|
||
| const BASE_URL = 'http://localhost:8081'; |
There was a problem hiding this comment.
[nitpick] Hardcoding BASE_URL reduces flexibility; consider injecting it via environment variables or using a shared API hook.
| const BASE_URL = 'http://localhost:8081'; | |
| const BASE_URL = process.env.REACT_APP_BASE_URL || 'http://localhost:8081'; |
| : undefined; | ||
|
|
||
| return ( | ||
| <Form.Group key={index} controlId={`${namePrefix}-${index}`}> |
There was a problem hiding this comment.
[nitpick] Using index as a React key can lead to rendering issues; if possible, provide a stable unique identifier for each item instead.
| <Form.Group key={index} controlId={`${namePrefix}-${index}`}> | |
| <Form.Group key={uniqueKey} controlId={`${namePrefix}-${index}`}> |
This PR refactors the code base:
• clean up db structure
• merges version and manifest class objects so that the manifest metadata is (effectively 1-1) with the version
• stores manifest metadata as individual fields, not as a file
• allows for multiple content types, then creates individual manifests for downloads
• adds several cancel buttons in the UI
Closes #16
Closes #30