-
Notifications
You must be signed in to change notification settings - Fork 76
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
fix: datamodels with hyphens in name #14455
Conversation
📝 WalkthroughWalkthroughThe pull request focuses on modifying the data model handling logic in the UX editor package. The changes primarily involve updating the Changes
Possibly related PRs
Suggested Labels
Suggested Reviewers
📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (4)
💤 Files with no reviewable changes (1)
🚧 Files skipped from review as they are similar to previous changes (3)
⏰ Context from checks skipped due to timeout of 90000ms (2)
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
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: 1
🧹 Nitpick comments (1)
frontend/packages/ux-editor/src/utils/dataModelUtils.ts (1)
144-152
: LGTM! Clean refactoring of getDataModel function.The refactoring improves the handling of data models with hyphens by removing the metadata dependency. The logic is now more straightforward and robust.
Consider adding JSDoc comments to document the parameters and return value:
+/** + * Gets the appropriate data model based on validation state and defaults + * @param isDataModelValid - Whether the current data model is valid + * @param defaultDataModelName - The fallback data model name + * @param currentDataModel - The currently selected data model + * @returns The resolved data model name + */ export const getDataModel = ( isDataModelValid: boolean, defaultDataModelName: string, currentDataModel?: string, ): string => {
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (4)
frontend/packages/ux-editor/src/hooks/useValidDataModels.test.ts
(0 hunks)frontend/packages/ux-editor/src/hooks/useValidDataModels.ts
(1 hunks)frontend/packages/ux-editor/src/utils/dataModelUtils.test.ts
(1 hunks)frontend/packages/ux-editor/src/utils/dataModelUtils.ts
(1 hunks)
💤 Files with no reviewable changes (1)
- frontend/packages/ux-editor/src/hooks/useValidDataModels.test.ts
⏰ Context from checks skipped due to timeout of 90000ms (3)
- GitHub Check: Build environment and run e2e test
- GitHub Check: CodeQL
- GitHub Check: Testing
🔇 Additional comments (1)
frontend/packages/ux-editor/src/hooks/useValidDataModels.ts (1)
38-38
: Verify error handling for undefined dataModel.The change correctly removes the metadata dependency, but we should ensure proper error handling when
dataModel
is undefined.Run this script to check for potential undefined dataModel scenarios:
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #14455 +/- ##
=======================================
Coverage 95.69% 95.69%
=======================================
Files 1889 1889
Lines 24573 24573
Branches 2822 2822
=======================================
Hits 23515 23515
Misses 799 799
Partials 259 259 ☔ View full report in Codecov by Sentry. |
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.
Nice 💪 One comment.
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.
🚀
d148615
to
4674647
Compare
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.
Tested OK in dev! 🚀
Description
Refactoring
useValidDataModels
slightly to not use metadata to select datamodel.Related Issue(s)
Verification
Documentation
Summary by CodeRabbit
Release Notes
Refactor
Tests
These changes enhance the efficiency of data model selection and validation, ensuring a more reliable user experience.