-
-
Notifications
You must be signed in to change notification settings - Fork 2.7k
Single click copy button for code snippets #20915
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
Conversation
plugins/TagManager
Outdated
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.
This needs to be reverted, before merging the PR. Targeting a branch for a submodule can break the checkout when the branch in the submodule gets deleted. This should only be commited if it's required for tests to pass.
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.
Unfortunately it is required for the tests, even though the UI test screenshots are not under the TagManager plugin. Thanks for the reminder to revert the submodule reference back to 4.x-dev once the TagManager PR has been merged, easy to miss 👍
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.
We can't do it that way. If we merge the PR in core having the submodule pointing to the TagManager branch, this would break the checkout of submodules if the TagManager branch gets deleted. We can then for sure simply update it to 4.x-dev again, but that still means that we have a reference in the history that isn't valid anymore.
The changes in this PR should actually not require a submodule update. If some UI tests in core needs to updated when the TagManager changes, we should either investigate if it makes more sense to move that specific test to the TagManager, or keep the old results and update them together with the submodule once the TagManager PR has been merged.
Co-authored-by: Stefan Giehl <stefan@matomo.org>
Description:
This is backport of #20876
It adds a single click copy-to-clipboard button to the following code snippets:
/index.php?module=Morpheus&action=demo
A new Vue directive
CopyToClipboard
adds the button to any<pre>
element wrapped in blank div and decorated with<pre v-copy-to-clipboard>
. For this 4.x PR an angular adapter is included (matomo-copy-to-clipboard
) and is used in a few places for older templates which have been replaced with Vue components in 5.xReview