-
Notifications
You must be signed in to change notification settings - Fork 16
Add group to export #1141
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
Add group to export #1141
Conversation
|
""" WalkthroughA new constant, Changes
Sequence Diagram(s)sequenceDiagram
participant User
participant WebApp
participant API
participant Schemas
User->>WebApp: Start session
WebApp->>Schemas: Import DEFAULT_GROUP_NAME
WebApp->>API: Send session start with group name (uses DEFAULT_GROUP_NAME if needed)
API->>Schemas: Import DEFAULT_GROUP_NAME and InstrumentRecordsExport
API->>API: Export records with groupId (from subject's groupIds or DEFAULT_GROUP_NAME)
API->>User: Return export data with groupId
Poem
Note ⚡️ AI Code Reviews for VS Code, Cursor, WindsurfCodeRabbit now has a plugin for VS Code, Cursor and Windsurf. This brings AI code reviews directly in the code editor. Each commit is reviewed immediately, finding bugs before the PR is raised. Seamless context handoff to your AI code agent ensures that you can easily incorporate review feedback. Note ⚡️ Faster reviews with cachingCodeRabbit now supports caching for code and dependencies, helping speed up reviews. This means quicker feedback, reduced wait times, and a smoother review experience overall. Cached data is encrypted and stored securely. This feature will be automatically enabled for all accounts on May 30th. To opt out, configure 📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
✨ Finishing Touches
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. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
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.
Actionable comments posted: 2
♻️ Duplicate comments (1)
apps/api/src/instrument-records/instrument-records.service.ts (1)
7-8: Barrel export again
Same note as earlier—ensure the constant is re-exported from the core package root.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
Cache: Disabled due to data retention organization setting
Knowledge Base: Disabled due to data retention organization setting
📒 Files selected for processing (4)
apps/api/src/instrument-records/instrument-records.service.ts(2 hunks)apps/web/src/features/session/components/StartSessionForm/StartSessionForm.tsx(2 hunks)packages/schemas/src/core/core.ts(1 hunks)packages/schemas/src/instrument-records/instrument-records.ts(1 hunks)
🧰 Additional context used
🧬 Code Graph Analysis (2)
apps/web/src/features/session/components/StartSessionForm/StartSessionForm.tsx (1)
packages/schemas/src/core/core.ts (1)
DEFAULT_GROUP_NAME(9-9)
apps/api/src/instrument-records/instrument-records.service.ts (1)
packages/schemas/src/core/core.ts (1)
DEFAULT_GROUP_NAME(9-9)
🔇 Additional comments (3)
packages/schemas/src/core/core.ts (1)
9-10: Confirm barrel export & addas const
Great to see a single-source default. Please double-check thatpackages/schemas/src/core/index.ts(or whatever the barrel file is for@opendatacapture/schemas/core) re-exportsDEFAULT_GROUP_NAME; otherwise the two new imports in the API & Web will fail.
You can also lock the literal type with a const-assertion for extra safety:-export const DEFAULT_GROUP_NAME = 'root'; +/** Fallback group name when the subject is not linked to any group */ +export const DEFAULT_GROUP_NAME = 'root' as const;apps/web/src/features/session/components/StartSessionForm/StartSessionForm.tsx (2)
6-7: Import path relies on barrel export
This path compiles only if the barrel in@opendatacapture/schemas/corere-exports the constant (see previous comment). If the CI complains about a missing export, expose it from the barrel rather than switching to a deep import.
256-258: Consistent fallback applied – LGTM
Replacing the magic string withDEFAULT_GROUP_NAMEkeeps the frontend aligned with the schema. Nice cleanup.
Works on issue #1005
Summary by CodeRabbit