Skip to content

Refactoring and save manifest metadata as fields / not file#28

Merged
jp-tosca merged 93 commits intomainfrom
manifest_changes
May 23, 2025
Merged

Refactoring and save manifest metadata as fields / not file#28
jp-tosca merged 93 commits intomainfrom
manifest_changes

Conversation

@scolapasta
Copy link
Contributor

@scolapasta scolapasta commented May 16, 2025

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

  • adds delete tool

Closes #16
Closes #30

jp-tosca and others added 30 commits May 13, 2025 11:39
…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
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.
@cmbz cmbz added the FY25 Sprint 23 FY25 Sprint 23 (2025-05-07 - 2025-05-21) label May 20, 2025
@cmbz cmbz added the FY25 Sprint 24 FY25 Sprint 24 (2025-05-21 - 2025-06-04) label May 22, 2025
@jp-tosca jp-tosca requested review from Copilot and jp-tosca May 23, 2025 15:09
@github-project-automation github-project-automation bot moved this from In Progress 💻 to Ready for QA ⏩ in IQSS Dataverse Project May 23, 2025
@jp-tosca jp-tosca merged commit cd627ba into main May 23, 2025
1 check passed
@github-project-automation github-project-automation bot moved this from Ready for QA ⏩ to Merged 🚀 in IQSS Dataverse Project May 23, 2025
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

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 MultiInputGroup for dynamic list inputs and new EditManifestForm modal
  • Update image and tool creation forms to handle state immutably and integrate manifest data
  • Add theme switcher enhancements and new MarketplaceLinkCard variant

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 versioneNote appears to be a typo; rename to versionNote for consistency with other form fields.
versioneNote: form.versioneNote.value,

dv-marketplace/src/components/UI/MarketplaceCard.tsx:14

  • Missing import of Link from react-router-dom; add import { Link } from 'react-router-dom'; at the top.
export const MarketplaceLinkCard = ({ header, imageId, text, link, children }: CardDeckProps) => {

Comment on lines 29 to +33
for (const item of data) {
tool?.images.push(item);
images.push(item);
}
} else {
tool?.images.push(data);
images.push(data);
Copy link

Copilot AI May 23, 2025

Choose a reason for hiding this comment

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

Avoid directly mutating the images array; use setImages(prev => [...prev, item]) to update state immutably so React re-renders correctly.

Copilot uses AI. Check for mistakes.
const handleManifestChange = createFormChangeHandler(setFormManifest);


const BASE_URL = 'http://localhost:8081';
Copy link

Copilot AI May 23, 2025

Choose a reason for hiding this comment

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

[nitpick] Hardcoding BASE_URL reduces flexibility; consider injecting it via environment variables or using a shared API hook.

Suggested change
const BASE_URL = 'http://localhost:8081';
const BASE_URL = process.env.REACT_APP_BASE_URL || 'http://localhost:8081';

Copilot uses AI. Check for mistakes.
: undefined;

return (
<Form.Group key={index} controlId={`${namePrefix}-${index}`}>
Copy link

Copilot AI May 23, 2025

Choose a reason for hiding this comment

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

[nitpick] Using index as a React key can lead to rendering issues; if possible, provide a stable unique identifier for each item instead.

Suggested change
<Form.Group key={index} controlId={`${namePrefix}-${index}`}>
<Form.Group key={uniqueKey} controlId={`${namePrefix}-${index}`}>

Copilot uses AI. Check for mistakes.
@pdurbin pdurbin moved this from Merged 🚀 to Done 🧹 in IQSS Dataverse Project May 27, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

FY25 Sprint 23 FY25 Sprint 23 (2025-05-07 - 2025-05-21) FY25 Sprint 24 FY25 Sprint 24 (2025-05-21 - 2025-06-04) Marketplace Tracking label for marketplace related issues Size: 30

Projects

Status: Done 🧹

Development

Successfully merging this pull request may close these issues.

Add API / UI to delete a tool Store manifest metadata (rather than manifest directly)

4 participants