[WEB-2749] fix: display property intake#5993
Conversation
WalkthroughThe changes in the Changes
Possibly related PRs
Suggested labels
Suggested reviewers
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.
Actionable comments posted: 0
🧹 Outside diff range and nitpick comments (1)
web/core/components/issues/peek-overview/properties.tsx (1)
138-144: Extract hardcoded string and consolidate duplicate logicThe current implementation has a few potential improvements:
- The "-intake" string is hardcoded and used multiple times
- The same check is duplicated in two places
Consider refactoring to:
+ // Add at the top of the file with other constants + const INTAKE_SUFFIX = "-intake"; + + // Add near other helper functions + const isIntakeUser = (displayName?: string) => displayName?.includes(INTAKE_SUFFIX); // In the component - userIds={createdByDetails?.display_name.includes("-intake") ? null : createdByDetails?.id} + userIds={isIntakeUser(createdByDetails?.display_name) ? null : createdByDetails?.id} - {createdByDetails?.display_name.includes("-intake") ? "Plane" : createdByDetails?.display_name} + {isIntakeUser(createdByDetails?.display_name) ? "Plane" : createdByDetails?.display_name}This improves maintainability and reduces the risk of typos.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
📒 Files selected for processing (1)
web/core/components/issues/peek-overview/properties.tsx(1 hunks)
🔇 Additional comments (1)
web/core/components/issues/peek-overview/properties.tsx (1)
138-141: Verify ButtonAvatars null handling
The code now passes null to ButtonAvatars when the user is from intake. Let's verify that ButtonAvatars properly handles null values.
Summary
This pr fixes display property in intake
Summary by CodeRabbit