diff options
author | Vincent Petry <vincent@nextcloud.com> | 2021-07-02 18:16:34 +0200 |
---|---|---|
committer | Vincent Petry <vincent@nextcloud.com> | 2021-07-27 12:19:25 +0200 |
commit | f3f2faa815207b12172cefadcbebe68ab8bffcb3 (patch) | |
tree | b5092333027461811e476c003fec262cea238815 | |
parent | 4b5bb4d9cfda9a080861a192524500edfe634ca2 (diff) | |
download | nextcloud-server-f3f2faa815207b12172cefadcbebe68ab8bffcb3.tar.gz nextcloud-server-f3f2faa815207b12172cefadcbebe68ab8bffcb3.zip |
Pending remote group share fixes
Only remove reject share for remote group shares
Also fix share indicator to appear for remote group shares as well.
Fix pending remote share icon to be the one of a share.
Signed-off-by: Vincent Petry <vincent@nextcloud.com>
-rw-r--r-- | apps/files_sharing/js/app.js | 4 | ||||
-rw-r--r-- | apps/files_sharing/js/sharedfilelist.js | 8 | ||||
-rw-r--r-- | apps/files_sharing/src/share.js | 2 |
3 files changed, 12 insertions, 2 deletions
diff --git a/apps/files_sharing/js/app.js b/apps/files_sharing/js/app.js index 8fb5cb02e56..1c01c880a6d 100644 --- a/apps/files_sharing/js/app.js +++ b/apps/files_sharing/js/app.js @@ -316,7 +316,9 @@ OCA.Sharing.App = { iconClass: 'icon-close', type: OCA.Files.FileActions.TYPE_INLINE, shouldRender(context) { - if (context.$file.attr('data-remote-id')) { + // disable rejecting group shares from the pending list because they anyway + // land back into that same list + if (context.$file.attr('data-remote-id') && parseInt(context.$file.attr('data-share-type'), 10) === OC.Share.SHARE_TYPE_REMOTE_GROUP) { return false } return true diff --git a/apps/files_sharing/js/sharedfilelist.js b/apps/files_sharing/js/sharedfilelist.js index 2afd8a21b31..bd3de5031ab 100644 --- a/apps/files_sharing/js/sharedfilelist.js +++ b/apps/files_sharing/js/sharedfilelist.js @@ -100,6 +100,10 @@ $tr.attr('data-remote-id', fileData.remoteId) } + if (fileData.shareType) { + $tr.attr('data-share-type', fileData.shareType) + } + // add row with expiration date for link only shares - influenced by _createRow of filelist if (this._linksOnly) { var expirationTimestamp = 0 @@ -333,6 +337,8 @@ mtime: share.mtime * 1000, mimetype: share.mimetype, type: share.type, + // remote share types are different and need to be mapped + shareType: (parseInt(share.share_type, 10) === 1) ? OC.Share.SHARE_TYPE_REMOTE_GROUP : OC.Share.SHARE_TYPE_REMOTE, id: share.file_id, path: OC.dirname(share.mountpoint), permissions: share.permissions, @@ -351,7 +357,7 @@ if (!file.type) { // pending shares usually have no type, so default to showing a directory icon - file.mimetype = 'httpd/unix-directory' + file.mimetype = 'dir-shared' } file.shares = [{ diff --git a/apps/files_sharing/src/share.js b/apps/files_sharing/src/share.js index 385d42eaaea..bb160f8715d 100644 --- a/apps/files_sharing/src/share.js +++ b/apps/files_sharing/src/share.js @@ -181,6 +181,8 @@ import escapeHTML from 'escape-html' hasShares = true } else if (shareType === OC.Share.SHARE_TYPE_REMOTE) { hasShares = true + } else if (shareType === OC.Share.SHARE_TYPE_REMOTE_GROUP) { + hasShares = true } else if (shareType === OC.Share.SHARE_TYPE_CIRCLE) { hasShares = true } else if (shareType === OC.Share.SHARE_TYPE_ROOM) { |