-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
[WEB-3218] fix: redirection for cross projects issue relations #6457
base: preview
Are you sure you want to change the base?
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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 ofprojectId
prop looks good.
The updated destructuring correctly removes the unusedprojectId
prop, 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
, anddisabled
toRelationsCollapsible
is consistent with the removal ofprojectId
from the component.web/core/components/issues/issue-detail-widgets/relations/content.tsx (1)
39-39
: No issues in the updated prop destructuring.
The removal ofprojectId
reduces complexity; this line properly defaultsdisabled
andissueServiceType
.web/core/components/issues/relations/issue-list-item.tsx (3)
58-58
: Proper derivation ofprojectId
fromissue
.
Removing the dedicatedprojectId
prop and retrieving it fromissue
directly is a clean approach, ensuring data consistency.
62-62
: Short-circuiting whenissue
orprojectId
is 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 removedissueServiceType
check, 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
projectId
Bug Fixes
The changes focus on simplifying the data flow and prop management in the issue relations components, making the code more concise and direct.