files_lock icon indicating copy to clipboard operation
files_lock copied to clipboard

no lock icon shown in publicly shared folders

Open DanScharon opened this issue 5 years ago • 3 comments

The lock icon is not shown on locked files within a publicly shared folder. When a user tries to edit/save that locked file s/he isn't even given a hint beforehand and because of #20 still doesn't know why the save/edit fails.

DanScharon avatar May 20 '20 13:05 DanScharon

Seems to be a conflict between this app and the public share file list is overwriting createRow.

This patch would make it work for files_sharing but wondering if there might be a cleaner way:

diff --git a/apps/files_sharing/js/public.js b/apps/files_sharing/js/public.js
index 6b063896b7..1995b93a79 100644
--- a/apps/files_sharing/js/public.js
+++ b/apps/files_sharing/js/public.js
@@ -209,8 +209,9 @@ OCA.Sharing.PublicApp = {
                                return OC.generateUrl('/s/' + token + '/download') + '?' + OC.buildQueryString(params);
                        };

+                       oldCreateRow = this.fileList._createRow
                        this.fileList._createRow = function(fileData) {
-                               var $tr = OCA.Files.FileList.prototype._createRow.apply(this, arguments);
+                               var $tr = oldCreateRow.apply(this, arguments);
                                if (hideDownload === 'true') {
                                        this.fileActions.currentFile = $tr.find('td');

juliusknorr avatar Mar 24 '22 10:03 juliusknorr

The approach in https://github.com/nextcloud/files_lock/pull/59 was not feasible.

We should approach this through the new file actions api once the public file list is also migrated to vue for 28

juliusknorr avatar Sep 11 '23 13:09 juliusknorr

With #177 being done, this should be do-able.

Other relevant bits:

  • nextcloud-libraries/nextcloud-files#964
  • nextcloud/server#42968 + nextcloud/server#45652

joshtrichards avatar May 12 '25 21:05 joshtrichards