-
Notifications
You must be signed in to change notification settings - Fork 4
feat: store and retrive gc1 type dpp #796
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this 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 implements a Digital Product Passport (DPP) feature for products, including form creation, data storage, and display functionality. The implementation adds a comprehensive GC1-type DPP schema with multiple sections for product information, environmental data, and lifecycle tracking.
Key Changes:
- Integrated a new DPP step in the project creation flow with collapsible sections for various product attributes
- Added file upload capabilities to DPP with signature-based authentication
- Implemented GC1DPP component for viewing stored passport data with file attachments
- Updated dependencies (zenroom, react-hook-form, TypeScript) to support new cryptographic operations
Reviewed changes
Copilot reviewed 43 out of 46 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| package.json | Updated zenroom to 5.26.1, react-hook-form to 7.66.0, moved TypeScript to devDependencies v5.9.3 |
| next.config.js | Extended webpack loader to handle .zen, .lua, and .json files |
| lib/resourceImages.ts | Fixed Blob constructor to properly handle base64 Buffer conversion |
| lib/licenses/utils.ts | Added optional chaining for license array mapping |
| lib/fileUpload.ts | Added DPP file upload with signature authentication and hex conversion utilities |
| hooks/useSignedPost.ts | Added Content-Type header to signed requests |
| hooks/useProjectCRUD.ts | Added optional dppUlid parameter to project creation flow |
| components/partials/project/projectSections.tsx | Added DPP section, made location optional for products |
| components/partials/project/[id]/ProjectTabs.tsx | Reorganized tabs, added GC1DPP display tab |
| components/partials/project/[id]/ProjectDpp.tsx | Fixed array index access for DPP trace data |
| components/partials/project/[id]/GC1DPP.tsx | New comprehensive component for displaying GC1 DPP data with file attachments |
| components/partials/create/project/steps/LocationStep.tsx | Commented out location requirement for products |
| components/partials/create/project/steps/DPPStep/* | New DPP form implementation with schema, types, sections, and components |
| components/partials/create/project/CreateProjectForm.tsx | Integrated DPP processing, file uploads, and submission to DPP service |
| components/GeneralCard.tsx | Fixed React key prop to use index instead of stat value |
| .vscode/settings.json | Updated code actions to use explicit values |
| .gitmodules | Added interfacer-dpp submodule |
| .env.example | Added NEXT_PUBLIC_DPP_URL environment variable |
Files not reviewed (1)
- pnpm-lock.yaml: Language not supported
Comments suppressed due to low confidence (5)
package.json:1
- The zenroom version 5.26.1 does not appear to exist. The latest stable version of zenroom is in the 2.x or 3.x range. This may cause installation failures.
lib/fileUpload.ts:1 - React hooks cannot be imported at module level for use in regular functions. The
useStoragehook is called inSignMessage(line 146) andUploadFileOnDPP(line 160), but these are async functions, not React components. Hooks can only be called from React components or custom hooks.
lib/fileUpload.ts:1 - Corrected spelling of 'retrive' to 'retrieve' in the PR title.
components/partials/project/[id]/GC1DPP.tsx:1 - Remove debug console.log statements from production code.
components/partials/project/[id]/GC1DPP.tsx:1 - Remove debug console.log statements from production code.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| if (Array.isArray(obj)) { | ||
| return Promise.all(obj.map(item => processDppValues(item))); | ||
| } | ||
| if (typeof obj === 'object') { |
Copilot
AI
Nov 24, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The type check typeof obj === 'object' will match arrays and null. Since arrays are already handled above, explicitly check obj !== null && !Array.isArray(obj) to avoid redundant processing or unintended behavior.
| if (typeof obj === 'object') { | |
| if (obj !== null && !Array.isArray(obj) && typeof obj === 'object') { |
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
close: Remove Graph (rename from DPP) from Services and Designs #790