aboutsummaryrefslogtreecommitdiffstats
path: root/apps/files_sharing
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 /apps/files_sharing
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>
Diffstat (limited to 'apps/files_sharing')
-rw-r--r--apps/files_sharing/js/share.js2
-rw-r--r--apps/files_sharing/tests/js/shareSpec.js20
2 files changed, 22 insertions, 0 deletions
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'}};