-
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-2145] chore: added copy button for intake issues #5455
Conversation
WalkthroughThe changes enhance the Changes
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
Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files selected for processing (1)
- web/core/components/inbox/content/inbox-issue-header.tsx (4 hunks)
Additional comments not posted (4)
web/core/components/inbox/content/inbox-issue-header.tsx (4)
16-16
: New import added forCopy
icon.The
Copy
icon fromlucide-react
library is imported correctly.The code changes are approved.
97-97
: New variableintakeIssueLink
created.The variable
intakeIssueLink
is correctly constructed to store the path to the intake issue.The code changes are approved.
171-178
: New functionhandleCopyIntakeIssueLink
added.The function
handleCopyIntakeIssueLink
is correctly implemented to handle the copy-to-clipboard action and display a success toast notification.The code changes are approved.
376-381
: New menu item added toCustomMenu
.The new menu item is correctly added to trigger the
handleCopyIntakeIssueLink
function.The code changes are approved.
@@ -166,6 +168,15 @@ export const InboxIssueActionsHeader: FC<TInboxIssueActionsHeader> = observer((p | |||
}) | |||
); | |||
|
|||
const handleCopyIntakeIssueLink = () => |
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.
Can we reuse the handleCopyIssueLink
function here by passing an argument to specify whether to copy the intake path or the issue path?
@@ -362,6 +373,12 @@ export const InboxIssueActionsHeader: FC<TInboxIssueActionsHeader> = observer((p | |||
</div> | |||
</CustomMenu.MenuItem> | |||
)} | |||
<CustomMenu.MenuItem onClick={handleCopyIntakeIssueLink}> |
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.
Update the UX to 'Copy issue link' and position it above the 'Delete' option.
Updated button UX and handleCopyIssue function
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: 1
Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files selected for processing (1)
- web/core/components/inbox/content/inbox-issue-header.tsx (7 hunks)
Additional comments not posted (4)
web/core/components/inbox/content/inbox-issue-header.tsx (4)
16-16
: LGTM!The import statement for the
Copy
icon is correct and necessary for the new functionality.
97-97
: LGTM!The
intakeIssueLink
variable is correctly constructed using the provided parameters.
162-163
: LGTM!The
handleCopyIssueLink
function is correctly implemented and enhances the functionality by making it reusable for different paths.
368-373
: LGTM!The new menu item for copying the
intakeIssueLink
is correctly implemented and enhances the user interface by providing an additional option to copy the intake issue link.
// const handleCopyIntakeIssueLink = () => | ||
// copyUrlToClipboard(intakeIssueLink).then(() => | ||
// setToast({ | ||
// type: TOAST_TYPE.SUCCESS, | ||
// title: "Link copied", | ||
// message: "Issue link copied to clipboard", | ||
// }) | ||
// ); | ||
|
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.
Remove commented-out code.
The handleCopyIntakeIssueLink
function is commented out and should be removed to maintain code cleanliness.
Apply this diff to remove the commented-out code:
- // const handleCopyIntakeIssueLink = () =>
- // copyUrlToClipboard(intakeIssueLink).then(() =>
- // setToast({
- // type: TOAST_TYPE.SUCCESS,
- // title: "Link copied",
- // message: "Issue link copied to clipboard",
- // })
- // );
Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
// const handleCopyIntakeIssueLink = () => | |
// copyUrlToClipboard(intakeIssueLink).then(() => | |
// setToast({ | |
// type: TOAST_TYPE.SUCCESS, | |
// title: "Link copied", | |
// message: "Issue link copied to clipboard", | |
// }) | |
// ); |
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
Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files selected for processing (1)
- web/core/components/inbox/content/inbox-issue-header.tsx (7 hunks)
Files skipped from review as they are similar to previous changes (1)
- web/core/components/inbox/content/inbox-issue-header.tsx
Changes
No 'copy link' option was available for issues in intake like in other features.
Implementation
References
[WEB-2145]
Summary by CodeRabbit
These enhancements improve user interaction and streamline workflows related to inbox issues.