feat: Add binder import functionality with JSON file support - #37
feat: Add binder import functionality with JSON file support#37michel-montejuado with Copilot wants to merge 5 commits into
Conversation
Co-authored-by: michel-montejuado <28892222+michel-montejuado@users.noreply.github.com>
Co-authored-by: michel-montejuado <28892222+michel-montejuado@users.noreply.github.com>
|
|
||
| ## Overview | ||
|
|
||
| The binder import functionality allows you to import classeurs (binders) from external JSON files into Simple Picto. This feature supports importing binder metadata, translations, categories, and pictograms. |
There was a problem hiding this comment.
Il y a un soucis entre les langages sur ce fichier. Le fichier étant en anglais, il n'est pas nécessaire de parler de "classeurs".
There was a problem hiding this comment.
Don't forget to use english only in the code
There was a problem hiding this comment.
Updated the documentation to use English only. Removed French terminology like "classeurs" and standardized all content in English. Commit 3d7967c.
|
|
||
| ## File Format | ||
|
|
||
| The import file must be a valid JSON file with the following structure: |
There was a problem hiding this comment.
Plutôt qu'une structure, le json devrait être un json de description suivant les spécifications de open-api.
There was a problem hiding this comment.
Ok pour OpenAPI format
There was a problem hiding this comment.
Replaced the manual JSON structure documentation with a complete OpenAPI 3.0 schema specification. The documentation now follows OpenAPI standards with proper schema definitions, validation rules, and examples. Commit 3d7967c.
| } | ||
| ``` | ||
|
|
||
| ## Required Fields |
There was a problem hiding this comment.
Cette partie n'est plus nécessaire si le schéma précédent est un schéma open-api.
There was a problem hiding this comment.
Removed the redundant "Required Fields" and "Optional Fields" sections since they are now fully covered by the OpenAPI schema specification. The schema provides comprehensive field definitions with validation rules. Commit 3d7967c.
Mistifiou
left a comment
There was a problem hiding this comment.
Il faut reprendre la méthode en prenant en compte les spécifications de open-api.
michel-montejuado
left a comment
There was a problem hiding this comment.
You need to apply proposed changes
…erminology Co-authored-by: michel-montejuado <28892222+michel-montejuado@users.noreply.github.com>
Completely reworked the documentation using OpenAPI 3.0 specifications. The import format is now defined with proper schema validation, type definitions, constraints, and examples following OpenAPI standards. Commit 3d7967c. |
Co-authored-by: michel-montejuado <28892222+michel-montejuado@users.noreply.github.com>
Applied all proposed changes: converted documentation to OpenAPI 3.0 schema format and removed all French terminology from examples. Documentation now uses English only throughout. Commit 6e5a9b9. |
This PR implements the requested binder import functionality allowing users to import classeurs (binders) from external JSON files.
🎯 Features Implemented
📂 Import Button
🔍 File Format Validation
🛠️ Error Handling
📚 Import Modes
🧪 Testing
📋 JSON Import Format
The import format supports:
{ "binder": { "uuid": "unique-id", "author": "Author Name" }, "translations": [ { "objectUuid": "unique-id", "language": "fr-FR", "key": "title", "value": "Titre du Classeur" } ], "categories": [...], "pictograms": [...] }🌍 Internationalization
Added French and English translations for all new UI elements:
📖 Documentation
Created comprehensive documentation (
docs/import-format.md) explaining:🔧 Technical Implementation
- Database: Transaction-based import using Dexie for data integrity
- Validation: Robust validation with specific error messages
- UI: Modal dialogs following existing design system
- File Handling: FileReader API for secure client-side processing
The import button (green with upload icon) is now available next to the "New" button in the Settings → Binders section.
This implementation provides a complete, user-friendly solution for importing binders while maintaining data integrity and providing excellent error handling.
Fixes #36.
💬 Share your feedback on Copilot coding agent for the chance to win a $200 gift card! Click here to start the survey.