summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDaniel Calviño Sánchez <danxuliu@gmail.com>2018-06-30 13:45:23 +0200
committerDaniel Calviño Sánchez <danxuliu@gmail.com>2018-08-08 14:25:43 +0200
commit523fdb612c26281873d0dad6e193630de468b154 (patch)
tree2e53fa46f075fd6e2f23a488f951df143bacea28
parent1ccc99ed8349a3318b799b485e80140643dfbe0c (diff)
downloadnextcloud-server-523fdb612c26281873d0dad6e193630de468b154.tar.gz
nextcloud-server-523fdb612c26281873d0dad6e193630de468b154.zip
Add room shares to DAV and recent files "share-types" property
Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
-rw-r--r--apps/dav/lib/Connector/Sabre/SharesPlugin.php1
-rw-r--r--apps/dav/tests/unit/Connector/Sabre/SharesPluginTest.php1
-rw-r--r--apps/files/lib/Controller/ApiController.php3
-rw-r--r--apps/files_sharing/js/share.js2
-rw-r--r--apps/files_sharing/tests/js/shareSpec.js20
5 files changed, 26 insertions, 1 deletions
diff --git a/apps/dav/lib/Connector/Sabre/SharesPlugin.php b/apps/dav/lib/Connector/Sabre/SharesPlugin.php
index 825b9821a2a..990cc4a808f 100644
--- a/apps/dav/lib/Connector/Sabre/SharesPlugin.php
+++ b/apps/dav/lib/Connector/Sabre/SharesPlugin.php
@@ -124,6 +124,7 @@ class SharesPlugin extends \Sabre\DAV\ServerPlugin {
\OCP\Share::SHARE_TYPE_LINK,
\OCP\Share::SHARE_TYPE_REMOTE,
\OCP\Share::SHARE_TYPE_EMAIL,
+ \OCP\Share::SHARE_TYPE_ROOM,
];
foreach ($requestedShareTypes as $requestedShareType) {
// one of each type is enough to find out about the types
diff --git a/apps/dav/tests/unit/Connector/Sabre/SharesPluginTest.php b/apps/dav/tests/unit/Connector/Sabre/SharesPluginTest.php
index 63b84eb5c6c..d4dd3b49f34 100644
--- a/apps/dav/tests/unit/Connector/Sabre/SharesPluginTest.php
+++ b/apps/dav/tests/unit/Connector/Sabre/SharesPluginTest.php
@@ -298,6 +298,7 @@ class SharesPluginTest extends \Test\TestCase {
[[\OCP\Share::SHARE_TYPE_GROUP]],
[[\OCP\Share::SHARE_TYPE_LINK]],
[[\OCP\Share::SHARE_TYPE_REMOTE]],
+ [[\OCP\Share::SHARE_TYPE_ROOM]],
[[\OCP\Share::SHARE_TYPE_USER, \OCP\Share::SHARE_TYPE_GROUP]],
[[\OCP\Share::SHARE_TYPE_USER, \OCP\Share::SHARE_TYPE_GROUP, \OCP\Share::SHARE_TYPE_LINK]],
[[\OCP\Share::SHARE_TYPE_USER, \OCP\Share::SHARE_TYPE_LINK]],
diff --git a/apps/files/lib/Controller/ApiController.php b/apps/files/lib/Controller/ApiController.php
index d71b998ffb1..9443b9776ae 100644
--- a/apps/files/lib/Controller/ApiController.php
+++ b/apps/files/lib/Controller/ApiController.php
@@ -214,7 +214,8 @@ class ApiController extends Controller {
\OCP\Share::SHARE_TYPE_GROUP,
\OCP\Share::SHARE_TYPE_LINK,
\OCP\Share::SHARE_TYPE_REMOTE,
- \OCP\Share::SHARE_TYPE_EMAIL
+ \OCP\Share::SHARE_TYPE_EMAIL,
+ \OCP\Share::SHARE_TYPE_ROOM
];
foreach ($requestedShareTypes as $requestedShareType) {
// one of each type is enough to find out about the types
diff --git a/apps/files_sharing/js/share.js b/apps/files_sharing/js/share.js
index a925920f3bc..0f8dc58a85e 100644
--- a/apps/files_sharing/js/share.js
+++ b/apps/files_sharing/js/share.js
@@ -144,6 +144,8 @@
hasShares = true;
} else if (shareType === OC.Share.SHARE_TYPE_CIRCLE) {
hasShares = true;
+ } else if (shareType === OC.Share.SHARE_TYPE_ROOM) {
+ hasShares = true;
}
});
OCA.Sharing.Util._updateFileActionIcon($tr, hasShares, hasLink);
diff --git a/apps/files_sharing/tests/js/shareSpec.js b/apps/files_sharing/tests/js/shareSpec.js
index 91060f6a735..554a3a82b34 100644
--- a/apps/files_sharing/tests/js/shareSpec.js
+++ b/apps/files_sharing/tests/js/shareSpec.js
@@ -108,6 +108,26 @@ describe('OCA.Sharing.Util tests', function() {
expect($action.find('.icon').hasClass('icon-public')).toEqual(false);
expect(OC.basename(getImageUrl($tr.find('.filename .thumbnail')))).toEqual('folder-shared.svg');
});
+ it('shows simple share text with share icon when shared to a room', function() {
+ var $action, $tr;
+ fileList.setFiles([{
+ id: 1,
+ type: 'dir',
+ name: 'One',
+ path: '/subdir',
+ mimetype: 'text/plain',
+ size: 12,
+ permissions: OC.PERMISSION_ALL,
+ etag: 'abc',
+ shareTypes: [OC.Share.SHARE_TYPE_ROOM]
+ }]);
+ $tr = fileList.$el.find('tbody tr:first');
+ $action = $tr.find('.action-share');
+ expect($action.find('>span').text().trim()).toEqual('Shared');
+ expect($action.find('.icon').hasClass('icon-shared')).toEqual(true);
+ expect($action.find('.icon').hasClass('icon-public')).toEqual(false);
+ expect(OC.basename(getImageUrl($tr.find('.filename .thumbnail')))).toEqual('folder-shared.svg');
+ });
it('shows simple share text with public icon when shared with link', function() {
var $action, $tr;
OC.Share.statuses = {1: {link: true, path: '/subdir'}};