[WEB-3218] fix: redirection for cross projects issue relations#6457
[WEB-3218] fix: redirection for cross projects issue relations#6457sriramveeraghanta merged 2 commits intopreviewfrom
Conversation
WalkthroughThe pull request focuses on removing the Changes
Possibly related PRs
Suggested Labels
Suggested Reviewers
Poem
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
🧹 Nitpick comments (1)
web/core/components/issues/issue-detail-widgets/relations/content.tsx (1)
150-163: Use optional chaining and remove redundant double-negation.
Streamline the logic by leveraging optional chaining and removing the!!in the ternary expression, as suggested by static analysis.Apply this diff:
- if ( - issueCrudState.delete.issue && - issueCrudState.delete.issue.id && - issueCrudState.delete.issue.project_id - ) { - const deleteOperation = !!issueCrudState.delete.issue?.is_epic - ? epicOperations.remove - : issueOperations.remove; - await deleteOperation( - workspaceSlug, - issueCrudState.delete.issue?.project_id, - issueCrudState?.delete?.issue?.id as string - ); - } + if (issueCrudState.delete.issue?.id && issueCrudState.delete.issue?.project_id) { + const deleteOperation = issueCrudState.delete.issue?.is_epic + ? epicOperations.remove + : issueOperations.remove; + await deleteOperation( + workspaceSlug, + issueCrudState.delete.issue.project_id, + issueCrudState.delete.issue.id + ); + }🧰 Tools
🪛 Biome (1.9.4)
[error] 151-152: Change to an optional chain.
Unsafe fix: Change to an optional chain.
(lint/complexity/useOptionalChain)
[error] 155-155: Avoid redundant double-negation.
It is not necessary to use double-negation when a value will already be coerced to a boolean.
Unsafe fix: Remove redundant double-negation(lint/complexity/noExtraBooleanCast)
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (5)
web/core/components/issues/issue-detail-widgets/issue-detail-widget-collapsibles.tsx(1 hunks)web/core/components/issues/issue-detail-widgets/relations/content.tsx(4 hunks)web/core/components/issues/issue-detail-widgets/relations/root.tsx(1 hunks)web/core/components/issues/relations/issue-list-item.tsx(1 hunks)web/core/components/issues/relations/issue-list.tsx(0 hunks)
💤 Files with no reviewable changes (1)
- web/core/components/issues/relations/issue-list.tsx
🧰 Additional context used
🪛 Biome (1.9.4)
web/core/components/issues/issue-detail-widgets/relations/content.tsx
[error] 151-152: Change to an optional chain.
Unsafe fix: Change to an optional chain.
(lint/complexity/useOptionalChain)
[error] 155-155: Avoid redundant double-negation.
It is not necessary to use double-negation when a value will already be coerced to a boolean.
Unsafe fix: Remove redundant double-negation
(lint/complexity/noExtraBooleanCast)
⏰ Context from checks skipped due to timeout of 90000ms (2)
- GitHub Check: Analyze (javascript)
- GitHub Check: Analyze (python)
🔇 Additional comments (6)
web/core/components/issues/issue-detail-widgets/relations/root.tsx (1)
20-20: Removal ofprojectIdprop looks good.
The updated destructuring correctly removes the unusedprojectIdprop, simplifying the component's interface without introducing any functional issues.web/core/components/issues/issue-detail-widgets/issue-detail-widget-collapsibles.tsx (1)
58-58: Prop removal aligns with the new interface.
Passing onlyworkspaceSlug,issueId, anddisabledtoRelationsCollapsibleis consistent with the removal ofprojectIdfrom the component.web/core/components/issues/issue-detail-widgets/relations/content.tsx (1)
39-39: No issues in the updated prop destructuring.
The removal ofprojectIdreduces complexity; this line properly defaultsdisabledandissueServiceType.web/core/components/issues/relations/issue-list-item.tsx (3)
58-58: Proper derivation ofprojectIdfromissue.
Removing the dedicatedprojectIdprop and retrieving it fromissuedirectly is a clean approach, ensuring data consistency.
62-62: Short-circuiting whenissueorprojectIdis missing.
Returning an empty fragment is a sensible fallback for invalid issue states.
67-67: Handling epics in a new tab is logical.
This distinct flow for epics versus issues aligns with the removedissueServiceTypecheck, simplifying the logic and continuing to handle epic redirection properly.
Description
Type of Change
Screenshots and Media (if applicable)
Test Scenarios
References
Summary by CodeRabbit
Refactor
projectIdBug Fixes
The changes focus on simplifying the data flow and prop management in the issue relations components, making the code more concise and direct.