Skip to content
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

Improvements to "Copy to Clipboard" wrapper #18846

Merged
merged 11 commits into from
Jan 31, 2025

Conversation

eduardomozart
Copy link
Contributor

@eduardomozart eduardomozart commented Jan 30, 2025

Checklist before requesting a review

Please delete options that are not relevant.

  • I have read the CONTRIBUTING document.
  • I have performed a self-review of my code.
  • I have added tests that prove my fix is effective or that my feature works.
  • This change requires a documentation update.

URL: https://glpi.example.com/front/user.form.php?id=1

Before this PR:

SCR-20250129-qjwz

After this PR:

SCR-20250129-thfr

This PR uses the input-group class of bootstrap as used on Data Picker inputs to position the "Copy to clipboard" button, as it seems a little misaligned. It works exactly as it is today, allowing copy by clicking into the input or copy button.

This PR keeps the current behavior/compatibility to plug-ins that may use the <div class="copy_to_clipboard_wrapper"></div> as it is today.

It adds a change effect similar to the "Copy to clipboard" on Debug, which changes the icon from "check" to the copy button again to user know it can copy the same information more than once if wanted.

Description

  • It fixes # (issue number, if applicable)
  • Here is a brief description of what this PR does

Screenshots (if appropriate):

Copy link
Contributor

@orthagh orthagh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Work great so far.
A few places where the new wrapper can also be applied:

  • My settings (from top right menu)
  • Setup > general > Api (token)

@eduardomozart
Copy link
Contributor Author

eduardomozart commented Jan 30, 2025

Hello @orthagh,
Thank you for your suggestions. I added the wrapper on the fields you suggested, tested it (also in other screen resolutions) and it's working as expected.
image

Copy link
Contributor

@orthagh orthagh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@trasher trasher merged commit de43fac into glpi-project:10.0/bugfixes Jan 31, 2025
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants