Disable default actions in pending file list

Signed-off-by: Vincent Petry <vincent@nextcloud.com>
This commit is contained in:
Vincent Petry 2021-07-05 12:13:53 +02:00
parent f3f2faa815
commit c1563215e6
No known key found for this signature in database
GPG key ID: E055D6A4D513575C
3 changed files with 11 additions and 0 deletions

View file

@ -29,6 +29,11 @@
if (this.disallowedLists.indexOf(fileList.id) !== -1) {
return;
}
// lists where the "Open" default action is disabled should
// also have the goto action disabled
if (fileList._defaultFileActionsDisabled) {
return
}
var fileActions = fileList.fileActions;
fileActions.registerAction({

View file

@ -141,6 +141,8 @@ OCA.Sharing.App = {
{
id: 'shares.pending',
showPending: true,
detailsViewEnabled: false,
defaultFileActionsDisabled: true,
sharedWithUser: true,
fileActions: this._acceptShareAction(),
config: OCA.Files.App.getFilesConfig(),

View file

@ -232,6 +232,10 @@ import escapeHTML from 'escape-html'
},
type: OCA.Files.FileActions.TYPE_INLINE,
actionHandler: function(fileName, context) {
// details view disabled in some share lists
if (!fileList._detailsView) {
return
}
// do not open sidebar if permission is set and equal to 0
var permissions = parseInt(context.$file.data('share-permissions'), 10)
if (isNaN(permissions) || permissions > 0) {