matomo-org / tag-manager

Free Open Source Matomo Tag Manager - A simple way to manage and maintain all of your (third-party) tags on your website.
https://matomo.org
GNU General Public License v3.0
168 stars 57 forks source link

Add copy button in install code screen, #PG-3520 #814

Open AltamashShaikh opened 4 days ago

AltamashShaikh commented 4 days ago

Description:

Add copy button in install code screen Fixes: #812 & #PG-3520 Require: https://github.com/matomo-org/matomo/pull/22366

Review

AltamashShaikh commented 4 days ago

I added a test for Clipboard copy, but facing same as what we are facing in CrashAnalytics so removed the test.

sgiehl commented 4 days ago

@AltamashShaikh Weren't the changes in https://github.com/matomo-org/matomo/pull/22332 meant for making that possible?

AltamashShaikh commented 4 days ago

@AltamashShaikh Weren't the changes in matomo-org/matomo#22366 meant for making that possible?

@sgiehl If you checkout this PR and click Install Code under TagManager menu and try to copy the MTM code by clicking copy button, it will not copy anything. On debugging I found out that we need to set focus to allow it to copy.

Screenshot from 2024-07-03 13-35-08

So the changes in matomo-org/matomo#22366 adds only the focus to make copy work in modal. Puppeter issue is different.

snake14 commented 3 days ago

@sgiehl Sadly, https://github.com/matomo-org/matomo/pull/22332 didn't solve the Puppeteer issue as I had hoped, either.