[WEB-3396] chore: work items parent select improvement#6608
[WEB-3396] chore: work items parent select improvement#6608sriramveeraghanta merged 2 commits intopreviewfrom
Conversation
WalkthroughThis pull request introduces a new React component, IssueParentSelectRoot, and updates export statements to include the new module in both the CE and EE directories. The old IssueParentSelect component’s internal logic is replaced by external asynchronous handlers for managing parent selection and sub-issue removal. Additionally, component imports and type declarations have been updated across multiple files, with some import formatting changes made for clarity. The modifications affect various parts of the issues module without altering the fundamental structure of the existing components. Changes
Sequence Diagram(s)sequenceDiagram
participant User as User
participant Root as IssueParentSelectRoot
participant Handler as External Handler
participant Data as Data Layer/API
User->>Root: Triggers parent issue selection
Root->>Handler: Call handleParentIssue(newParentId)
Handler->>Data: Update parent issue and fetch sub-issues
Data-->>Handler: Return update result
Handler-->>Root: Notify completion
Root->>User: Render updated parent issue link
User->>Root: Triggers removal of sub-issue
Root->>Handler: Call handleRemoveSubIssue(workspaceSlug, projectId, parentIssueId, issueId)
Handler->>Data: Remove sub-issue and fetch updates
Data-->>Handler: Return updated sub-issues
Handler-->>Root: Notify completion
Root->>User: Render updated sub-issues list
Possibly related PRs
Suggested labels
Suggested reviewers
Poem
✨ Finishing Touches
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: 1
🧹 Nitpick comments (2)
web/core/components/issues/issue-detail/parent-select.tsx (1)
27-34: Consider documenting these new handler props.
It’s great that the component now delegates parent issue handling and sub-issue removal to external functions. As a future enhancement, consider adding brief doc comments to clarify usage and outline any error-handling expectations for these asynchronous methods.web/ce/components/issues/issue-details/parent-select-root.tsx (1)
57-60: Consider using a try-finally block for loader state.The loader state might not be reset if an error occurs, as it's set after the async operations.
Apply this diff to ensure the loader state is always reset:
try { setSubIssueHelpers(parentIssueId, "issue_loader", issueId); await removeSubIssue(workspaceSlug, projectId, parentIssueId, issueId); await fetchSubIssues(workspaceSlug, projectId, parentIssueId); - setSubIssueHelpers(parentIssueId, "issue_loader", issueId); + } finally { + setSubIssueHelpers(parentIssueId, "issue_loader", issueId); }
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (8)
web/ce/components/issues/issue-details/index.ts(1 hunks)web/ce/components/issues/issue-details/parent-select-root.tsx(1 hunks)web/core/components/issues/issue-detail/parent-select.tsx(3 hunks)web/core/components/issues/issue-detail/root.tsx(1 hunks)web/core/components/issues/issue-detail/sidebar.tsx(3 hunks)web/core/components/issues/peek-overview/properties.tsx(2 hunks)web/ee/components/issues/issue-details/index.ts(1 hunks)web/ee/components/issues/issue-details/parent-select-root.tsx(1 hunks)
✅ Files skipped from review due to trivial changes (2)
- web/ee/components/issues/issue-details/parent-select-root.tsx
- web/core/components/issues/issue-detail/root.tsx
🔇 Additional comments (8)
web/core/components/issues/issue-detail/parent-select.tsx (4)
9-9: No concerns with the new Tooltip import.
Looks good and aligns well with existing patterns.
38-47: Destructuring of props looks clean.
All defaults are appropriately assigned where needed, and the naming conventions are consistent.
54-54: Modal state derivation is straightforward.
No issues with retrieving modal state from the store.
92-92: Verify link safety.
SinceworkItemLinkis used in a new tab, ensure that it’s valid and non-empty to avoid unexpected redirects or 404 pages. Great job includingrel="noopener noreferrer".web/ce/components/issues/issue-details/index.ts (1)
5-5: New export statement confirmed.
Exportingparent-select-rootextends modular reuse. No concerns here.web/ee/components/issues/issue-details/index.ts (1)
5-5: Export statement addition looks consistent.
Mirrors the CE implementation and maintains parity between editions.web/core/components/issues/peek-overview/properties.tsx (1)
266-273: LGTM! Clean implementation of the new IssueParentSelectRoot component.The component replacement is properly implemented with all required props passed correctly.
web/core/components/issues/issue-detail/sidebar.tsx (1)
264-271: LGTM! Consistent implementation across components.The IssueParentSelectRoot component is properly integrated with the same props pattern as in other files.
* chore: work items parent select improvements * chore: code refactor
Description
This PR includes following changes:
Type of Change
References
[WEB-3396]
Summary by CodeRabbit
New Features
Refactor