apluslms / mooc-jutut

Course feedback gathering and management tool. Used with A+ learning management system.
1 stars 12 forks source link

Change button for link to conversation to copy #113

Closed etanttila closed 3 months ago

etanttila commented 3 months ago

Description

What?

Change the button for the link to a conversation (feedback responses to exercise by specific student) so that it copies the link to the clipboard rather than redirecting to said page. Change tooltip text respectively.

If copying the text to clipboard works (secure connection and permission to write to clipboard), there is a popover open for ~2 seconds: Screenshot from 2024-07-26 14-30-23

If copying didn't work, there is a popover open for ~5 seconds, which notifies that it didn't work and provides the link text (so it can be copied manually): Screenshot from 2024-07-26 14-29-52

Why?

Because typically the teacher doesn't actually want to go to the page displaying just that conversation, only copy the link so they can send it to another teacher or save it for themselves.

How?

Changing the "button" from a link to an actual button (to reflect behavior) and adding an onclick handler that copies the link text to the clipboard.

Fixes #62

Testing

Remember to add or update unit tests for new features and changes.

What type of test did you run?

I tested that without a secure connection (e.g. with the domain being something like 172.18.0.4) clicking on the button works as it should (popover indicates copying didn't work, provides text, stays open for ~5 seconds). When running on a secure connection (localhost), the button works as it should, the link is copied to the clipboard, and there is a popover notifying that the link was copied to the clipboard (stays open for ~2 seconds).

Did you test the changes in

Think of what is affected by these changes and could become broken

Translation

Programming style

Have you updated the README or other relevant documentation?

Is it Done?

Clean up your git commit history before submitting the pull request!