Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/server.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'apps/files_sharing/js/app.js')
-rw-r--r--apps/files_sharing/js/app.js23
1 files changed, 21 insertions, 2 deletions
diff --git a/apps/files_sharing/js/app.js b/apps/files_sharing/js/app.js
index 713560e556b..89f72ee8209 100644
--- a/apps/files_sharing/js/app.js
+++ b/apps/files_sharing/js/app.js
@@ -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(),
@@ -296,7 +298,11 @@ OCA.Sharing.App = {
type: OCA.Files.FileActions.TYPE_INLINE,
actionHandler(fileName, context) {
const shareId = context.$file.data('shareId')
- $.post(OC.linkToOCS('apps/files_sharing/api/v1/shares/pending', 2) + shareId)
+ let shareBase = 'shares/pending'
+ if (context.$file.attr('data-remote-id')) {
+ shareBase = 'remote_shares/pending'
+ }
+ $.post(OC.linkToOCS('apps/files_sharing/api/v1/' + shareBase, 2) + shareId)
.success(function(result) {
context.fileList.remove(context.fileInfoModel.attributes.name)
}).fail(function() {
@@ -311,10 +317,23 @@ OCA.Sharing.App = {
permissions: OC.PERMISSION_ALL,
iconClass: 'icon-close',
type: OCA.Files.FileActions.TYPE_INLINE,
+ shouldRender(context) {
+ // 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
+ },
actionHandler(fileName, context) {
const shareId = context.$file.data('shareId')
+ let shareBase = 'shares'
+ if (context.$file.attr('data-remote-id')) {
+ shareBase = 'remote_shares/pending'
+ }
+
$.ajax({
- url: OC.linkToOCS('apps/files_sharing/api/v1/shares', 2) + shareId,
+ url: OC.linkToOCS('apps/files_sharing/api/v1/' + shareBase, 2) + shareId,
type: 'DELETE',
}).success(function(result) {
context.fileList.remove(context.fileInfoModel.attributes.name)