Bug 27594: Add access to public download link for publicly-accessible uploads
authorOwen Leonard <oleonard@myacpl.org>
Tue, 2 Feb 2021 14:10:49 +0000 (14:10 +0000)
committerAndrew Fuerste-Henry <andrew@bywatersolutions.com>
Tue, 25 May 2021 12:08:56 +0000 (12:08 +0000)
commiteec56d63bd369fee0f71bd0b037e158fa831f95d
treee645d41fd5094d223c2294ae3ade840a7f0b4de2
parent81b5ec7f254040ee3d3291f4803dc47efe905bd4
Bug 27594: Add access to public download link for publicly-accessible uploads

This patch adds a link to the display of publicly-accessible uploads so
that the user can copy the public link. This will hopefully lead to
easier use of sound file uploads in the Audio Alerts system.

To test, apply the patch and go to Tools -> Upload.

- If necessary, upload a file with the "Allow public downloads"
  checkbox checked.
- Upon upload you should be shown the results of your upload in a table
  with the file details.
- In the "Public" column you should see that "Yes" is a link.
  - When you hover your mouse over the link you should see a tooltip,
    "Copy link to this file."
  - When you click the link the tooltip should say "Link copied to the
    clipboard."
  - Verify that the correct link has been copied.
- Test uploading a file which is not publicly-accessible.
  - Confirm that the information in the "Public" column says "No" and is
    not a link.

Signed-off-by: David Nind <david@davidnind.com>
Bug 27594: (QA follow-up): Use clipboard API

While the Clipboard API doesn't
have 100% coverage (https://www.caniuse.com/?search=clipboard), it has
enough coverage for the "copy" operation that it can be counted on for
use in the staff interface.

This patch removes the global copyToClipboard function and replaces it
with a call to ndavigator.clipboard.writeText() in the template.

To test, follow the previous test plan and confirm that the public
download link is still copied correctly to the clipboard.

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit cb8f254ebc3b3ed392483cd4008b7b9573c2f832)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 0f6dedf864028cc72e3b678d694707052e7d1e0a)

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
koha-tmpl/intranet-tmpl/prog/en/modules/tools/upload.tt