-
Notifications
You must be signed in to change notification settings - Fork 61
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
feat(web): Latest generic list items - Item count is now editable in the CMS #17128
Conversation
WalkthroughThe pull request modifies the Changes
Possibly related PRs
Suggested reviewers
Warning There were issues while running some tools. Please review the errors and either fix the tool’s configuration or disable the tool if it’s a critical failure. 🔧 eslint
warning [email protected]: This version is no longer supported. Please see https://eslint.org/version-support for other options. 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
Documentation and Community
|
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: 0
🧹 Outside diff range and nitpick comments (2)
libs/cms/src/lib/models/latestGenericListItems.model.ts (2)
83-83
: Consider adding validation for itemCountWhile the implementation correctly makes the item count editable with a safe fallback, consider adding validation to ensure
itemCount
is a positive number.- size: fields.itemCount ?? 2, + size: Math.max(1, fields.itemCount ?? 2),
Line range hint
27-28
: Add JSDoc documentation for itemCount behaviorSince this field now supports dynamic count configuration, please add JSDoc documentation explaining:
- The purpose of itemCount
- The default value behavior
- Any constraints on valid values
@CacheField(() => GenericListItemResponse, { nullable: true }) + /** + * Response containing generic list items. + * The number of items is controlled by fields.itemCount (defaults to 2 if not specified) + */ itemResponse?: GetGenericListItemsInput | null
📜 Review details
Configuration used: .coderabbit.yaml
Review profile: CHILL
⛔ Files ignored due to path filters (1)
libs/cms/src/lib/generated/contentfulTypes.d.ts
is excluded by!**/generated/**
📒 Files selected for processing (1)
libs/cms/src/lib/models/latestGenericListItems.model.ts
(1 hunks)
🧰 Additional context used
📓 Path-based instructions (1)
libs/cms/src/lib/models/latestGenericListItems.model.ts (1)
Pattern libs/**/*
: "Confirm that the code adheres to the following:
- Reusability of components and hooks across different NextJS apps.
- TypeScript usage for defining props and exporting types.
- Effective tree-shaking and bundling practices."
🔇 Additional comments (2)
libs/cms/src/lib/models/latestGenericListItems.model.ts (2)
Line range hint 16-31
: LGTM! Well-structured type definitions
The class follows TypeScript and GraphQL best practices with proper type exports and null handling.
Line range hint 1-15
: LGTM! Follows reusability guidelines
The implementation is properly structured for reuse across different NextJS apps with:
- Clear type exports
- Generic implementation
- Proper separation of concerns
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #17128 +/- ##
==========================================
- Coverage 35.72% 35.71% -0.01%
==========================================
Files 6920 6920
Lines 147500 147500
Branches 42002 42003 +1
==========================================
- Hits 52688 52685 -3
- Misses 94812 94815 +3
Flags with carried forward coverage won't be shown. Click here to find out more.
... and 2 files with indirect coverage changes Continue to review full report in Codecov by Sentry.
|
Datadog ReportAll test runs ✅ 11 Total Test Services: 0 Failed, 10 Passed Test ServicesThis report shows up to 10 services
|
Latest generic list items - Item count is now editable in the CMS
What
Checklist:
Summary by CodeRabbit
New Features
Bug Fixes
itemResponse
field to indicate it can be null, improving data integrity.