diff options
author | Julius Härtl <jus@bitgrid.net> | 2020-01-07 12:57:57 +0100 |
---|---|---|
committer | Roeland Jago Douma <roeland@famdouma.nl> | 2020-01-07 19:35:45 +0100 |
commit | 445274cf93dbae31c6995008dcc0f9834c05d9ca (patch) | |
tree | 5f33fb92ff778f2a7effd66a3bd92e345d4c1bc6 /apps/files_sharing/js/sharedfilelist.js | |
parent | fbed6a3416dd96e3698575f67dc57fc861c2ed46 (diff) | |
download | nextcloud-server-445274cf93dbae31c6995008dcc0f9834c05d9ca.tar.gz nextcloud-server-445274cf93dbae31c6995008dcc0f9834c05d9ca.zip |
Add pending share list to frontend
Signed-off-by: Julius Härtl <jus@bitgrid.net>
Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
Diffstat (limited to 'apps/files_sharing/js/sharedfilelist.js')
-rw-r--r-- | apps/files_sharing/js/sharedfilelist.js | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/apps/files_sharing/js/sharedfilelist.js b/apps/files_sharing/js/sharedfilelist.js index 5b198300589..f40a1f1a853 100644 --- a/apps/files_sharing/js/sharedfilelist.js +++ b/apps/files_sharing/js/sharedfilelist.js @@ -39,6 +39,7 @@ _sharedWithUser: false, _linksOnly: false, _showDeleted: false, + _showPending: false, _clientSideSort: true, _allowSelection: false, _isOverview: false, @@ -62,6 +63,9 @@ if (options && options.showDeleted) { this._showDeleted = true } + if (options && options.showPending) { + this._showPending = true + } if (options && options.isOverview) { this._isOverview = true } @@ -87,7 +91,7 @@ var permission = parseInt($tr.attr('data-permissions')) | OC.PERMISSION_DELETE $tr.attr('data-permissions', permission) } - if (this._showDeleted) { + if (this._showDeleted || this._showPending) { var permission = fileData.permissions $tr.attr('data-share-permissions', permission) } @@ -196,6 +200,18 @@ } } + var pendingShares = { + url: OC.linkToOCS('apps/files_sharing/api/v1/shares', 2) + 'pending', + /* jshint camelcase: false */ + data: { + format: 'json' + }, + type: 'GET', + beforeSend: function(xhr) { + xhr.setRequestHeader('OCS-APIREQUEST', 'true') + } + } + var shares = { url: OC.linkToOCS('apps/files_sharing/api/v1') + 'shares', /* jshint camelcase: false */ @@ -227,6 +243,8 @@ // and make sure we have 2 promises if (this._showDeleted) { promises.push($.ajax(deletedShares)) + } else if (this._showPending) { + promises.push($.ajax(pendingShares)) } else { promises.push($.ajax(shares)) |