Razwa/import study - #946
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (3)
💤 Files with no reviewable changes (2)
📝 WalkthroughWalkthroughChangesThe PR adds study ZIP archive import. A validated dialog submits archive metadata and the selected file to the explore service. Writable directories expose the action in developer mode, with English and French translations. Study archive import
Suggested reviewers: Sequence Diagram(s)sequenceDiagram
participant DirectoryTreeContextualMenu
participant ImportStudyDialog
participant importStudy
participant explore-service
DirectoryTreeContextualMenu->>ImportStudyDialog: open for selected writable directory
ImportStudyDialog->>ImportStudyDialog: validate name and ZIP archive
ImportStudyDialog->>importStudy: submit metadata and archive
importStudy->>explore-service: POST multipart import request
explore-service-->>ImportStudyDialog: return import result or error
ImportStudyDialog-->>DirectoryTreeContextualMenu: close after successful import
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@src/components/dialogs/import-study-dialog.tsx`:
- Around line 139-146: Enable the description input by removing the disabled
styling from the Grid wrapping DescriptionField, including pointerEvents: 'none'
and the related reduced opacity, so users can edit and submit a non-empty
description.
- Around line 56-60: Update the import dialog’s file validation to accept .zip
instead of .gz, and apply the same extension consistently to the filename
prefill and file picker configuration. Use the existing symbols around the
fileType validator and the related name/accept settings, preserving the
localized validation message and rejecting other extensions.
🪄 Autofix
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro Plus
Run ID: 67b9b4bc-eaa0-415c-9905-20c84315932a
📒 Files selected for processing (7)
src/components/dialogs/import-study-dialog.tsxsrc/components/menus/content-contextual-menu.tsxsrc/components/menus/directory-tree-contextual-menu.tsxsrc/translations/en.jsonsrc/translations/fr.jsonsrc/utils/UIconstants.tssrc/utils/rest-api.ts
There was a problem hiding this comment.
♻️ Duplicate comments (1)
src/components/dialogs/import-study-dialog.tsx (1)
56-60: 🎯 Functional Correctness | 🟡 Minor | ⚡ Quick winMake ZIP validation case-insensitive.
Line 59 uses a case-sensitive suffix check, while Line 90 removes the suffix case-insensitively. Any file named
study.ZIPthat reaches this validator is rejected inconsistently. Normalize the filename before checking the suffix.Proposed fix
- return file.name.endsWith('.zip'); + return file.name.toLowerCase().endsWith('.zip');🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@src/components/dialogs/import-study-dialog.tsx` around lines 56 - 60, Update the fileType validator in the import-study dialog to normalize the selected file’s name before checking its ZIP suffix, so uppercase and mixed-case extensions such as .ZIP are accepted consistently with the existing case-insensitive suffix removal.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Duplicate comments:
In `@src/components/dialogs/import-study-dialog.tsx`:
- Around line 56-60: Update the fileType validator in the import-study dialog to
normalize the selected file’s name before checking its ZIP suffix, so uppercase
and mixed-case extensions such as .ZIP are accepted consistently with the
existing case-insensitive suffix removal.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro Plus
Run ID: 5b0d5368-af4a-4254-8f4e-6b940c1aa239
📒 Files selected for processing (1)
src/components/dialogs/import-study-dialog.tsx
|



PR Summary
Add import a study from a previously exported archive (related to the study export feature), then submit it to explore-server.
studyName/description/parentDirectoryUuid query params.