From 98ec0451be1d1ddd76b53195c96a545239e24da1 Mon Sep 17 00:00:00 2001 From: Vincent Petry Date: Wed, 19 Nov 2014 17:42:57 +0100 Subject: Remove delete button in shared with others list Whenever a file is shared with others or with link, a delete button used to be visible that triggered a direct deletion. This button has been removed to avoid accidental deletion from people who might believe it was an unshare button. Unsharing is still possible inside the share dropdown. --- apps/files_sharing/tests/js/sharedfilelistSpec.js | 26 +++++++++++++++-------- 1 file changed, 17 insertions(+), 9 deletions(-) (limited to 'apps/files_sharing/tests/js') diff --git a/apps/files_sharing/tests/js/sharedfilelistSpec.js b/apps/files_sharing/tests/js/sharedfilelistSpec.js index 812f30d75db..61302ae2c1d 100644 --- a/apps/files_sharing/tests/js/sharedfilelistSpec.js +++ b/apps/files_sharing/tests/js/sharedfilelistSpec.js @@ -91,7 +91,7 @@ describe('OCA.Sharing.FileList tests', function() { file_source: 49, file_target: '/local path/local name.txt', path: 'files/something shared.txt', - permissions: 31, + permissions: OC.PERMISSION_ALL, stime: 11111, share_type: OC.Share.SHARE_TYPE_USER, share_with: 'user1', @@ -127,7 +127,8 @@ describe('OCA.Sharing.FileList tests', function() { expect($tr.attr('data-file')).toEqual('local name.txt'); expect($tr.attr('data-path')).toEqual('/local path'); expect($tr.attr('data-size')).not.toBeDefined(); - expect($tr.attr('data-permissions')).toEqual('31'); // read and delete + expect(parseInt($tr.attr('data-permissions'), 10)) + .toEqual(OC.PERMISSION_ALL); // read and delete expect($tr.attr('data-mime')).toEqual('text/plain'); expect($tr.attr('data-mtime')).toEqual('11111000'); expect($tr.attr('data-share-owner')).toEqual('User Two'); @@ -169,7 +170,8 @@ describe('OCA.Sharing.FileList tests', function() { expect($tr.attr('data-file')).toEqual('local name'); expect($tr.attr('data-path')).toEqual('/local path'); expect($tr.attr('data-size')).not.toBeDefined(); - expect($tr.attr('data-permissions')).toEqual('31'); // read and delete + expect(parseInt($tr.attr('data-permissions'), 10)) + .toEqual(OC.PERMISSION_ALL); // read and delete expect($tr.attr('data-mime')).toEqual('httpd/unix-directory'); expect($tr.attr('data-mtime')).toEqual('11111000'); expect($tr.attr('data-share-owner')).toEqual('User Two'); @@ -244,7 +246,8 @@ describe('OCA.Sharing.FileList tests', function() { expect($tr.attr('data-file')).toEqual('local name.txt'); expect($tr.attr('data-path')).toEqual('/local path'); expect($tr.attr('data-size')).not.toBeDefined(); - expect($tr.attr('data-permissions')).toEqual('31'); // read and delete + expect(parseInt($tr.attr('data-permissions'), 10)) + .toEqual(OC.PERMISSION_ALL - OC.PERMISSION_DELETE); // read expect($tr.attr('data-mime')).toEqual('text/plain'); expect($tr.attr('data-mtime')).toEqual('11111000'); expect($tr.attr('data-share-owner')).not.toBeDefined(); @@ -285,7 +288,8 @@ describe('OCA.Sharing.FileList tests', function() { expect($tr.attr('data-file')).toEqual('local name'); expect($tr.attr('data-path')).toEqual('/local path'); expect($tr.attr('data-size')).not.toBeDefined(); - expect($tr.attr('data-permissions')).toEqual('31'); // read and delete + expect(parseInt($tr.attr('data-permissions'), 10)) + .toEqual(OC.PERMISSION_ALL - OC.PERMISSION_DELETE); // read expect($tr.attr('data-mime')).toEqual('httpd/unix-directory'); expect($tr.attr('data-mtime')).toEqual('11111000'); expect($tr.attr('data-share-owner')).not.toBeDefined(); @@ -336,7 +340,8 @@ describe('OCA.Sharing.FileList tests', function() { expect($tr.attr('data-file')).toEqual('local name.txt'); expect($tr.attr('data-path')).toEqual('/local path'); expect($tr.attr('data-size')).not.toBeDefined(); - expect($tr.attr('data-permissions')).toEqual('31'); // read and delete + expect(parseInt($tr.attr('data-permissions'), 10)) + .toEqual(OC.PERMISSION_ALL - OC.PERMISSION_DELETE); // read expect($tr.attr('data-mime')).toEqual('text/plain'); expect($tr.attr('data-mtime')).toEqual('11111000'); expect($tr.attr('data-share-owner')).not.toBeDefined(); @@ -404,7 +409,8 @@ describe('OCA.Sharing.FileList tests', function() { expect($tr.attr('data-file')).toEqual('local name.txt'); expect($tr.attr('data-path')).toEqual('/local path'); expect($tr.attr('data-size')).not.toBeDefined(); - expect($tr.attr('data-permissions')).toEqual('31'); // read and delete + expect(parseInt($tr.attr('data-permissions'), 10)) + .toEqual(OC.PERMISSION_ALL - OC.PERMISSION_DELETE); // read expect($tr.attr('data-mime')).toEqual('text/plain'); // always use the most recent stime expect($tr.attr('data-mtime')).toEqual('22222000'); @@ -496,7 +502,8 @@ describe('OCA.Sharing.FileList tests', function() { expect($tr.attr('data-file')).toEqual('local name.txt'); expect($tr.attr('data-path')).toEqual('/local path'); expect($tr.attr('data-size')).not.toBeDefined(); - expect($tr.attr('data-permissions')).toEqual('31'); // read and delete + expect(parseInt($tr.attr('data-permissions'), 10)) + .toEqual(OC.PERMISSION_ALL - OC.PERMISSION_DELETE); // read expect($tr.attr('data-mime')).toEqual('text/plain'); expect($tr.attr('data-mtime')).toEqual('11111000'); expect($tr.attr('data-share-recipients')).not.toBeDefined(); @@ -537,7 +544,8 @@ describe('OCA.Sharing.FileList tests', function() { expect($tr.attr('data-file')).toEqual('local name.txt'); expect($tr.attr('data-path')).toEqual('/local path'); expect($tr.attr('data-size')).not.toBeDefined(); - expect($tr.attr('data-permissions')).toEqual('31'); // read and delete + expect(parseInt($tr.attr('data-permissions'), 10)) + .toEqual(OC.PERMISSION_ALL - OC.PERMISSION_DELETE); // read expect($tr.attr('data-mime')).toEqual('text/plain'); expect($tr.attr('data-mtime')).toEqual('11111000'); expect($tr.attr('data-share-recipients')).not.toBeDefined(); -- cgit v1.2.3