-
-
Notifications
You must be signed in to change notification settings - Fork 279
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
Use window object to generate copy URLs for tasks and organizations #5720
Conversation
Using window object from the browser instead of the location object from react router to generate URLs for tasks. The values of the location object must have changed making the origin variable undefined when we migrated to React Router from Reach Router
@ramyaragupathy, I could use some help with testing the functionality of copying the intended URL to the clipboard. We don't currently have code coverage for this feature, and we've been using @lokibai/react-use-copy-clipboard to achieve the copy-to-clipboard functionality. However, I've encountered issues simulating the |
@HelNershingThapa - do we know what altered the expected behaviour? |
Yes, we do. When we switched from Reach Router to React Router, the value of the object we use to build these links changed, which is why. |
Remove outdated dependency due to deprecated function usage and lack of recent commits (last commit over 3 years ago).
Also adds text case to check if the writeText function for clipboard API has been called with the expected text
Kudos, SonarCloud Quality Gate passed!
|
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.
The functionality works and the tests are good. LGTM
This PR does the following:
@lokibai/react-use-copy-clipboard
previously used for copying text to the clipboard. This is due to deprecated usage of the document.execCommand function and lack of recent commits (last commit over 3 years ago). Instead, thenavigator.clipboard.writeText
function has been implemented to achieve the desired copy-to-clipboard functionality.