diff options
Diffstat (limited to 'apps')
-rw-r--r-- | apps/files/js/filelist.js | 5 | ||||
-rw-r--r-- | apps/files/tests/js/filelistSpec.js | 26 |
2 files changed, 30 insertions, 1 deletions
diff --git a/apps/files/js/filelist.js b/apps/files/js/filelist.js index 217a2f14896..0add41d6419 100644 --- a/apps/files/js/filelist.js +++ b/apps/files/js/filelist.js @@ -1156,7 +1156,10 @@ if (type === 'dir') { mime = mime || 'httpd/unix-directory'; - if (fileData.mountType && fileData.mountType.indexOf('external') === 0) { + if (fileData.isEncrypted) { + icon = OC.MimeType.getIconUrl('dir-encrypted'); + dataIcon = icon; + } else if (fileData.mountType && fileData.mountType.indexOf('external') === 0) { icon = OC.MimeType.getIconUrl('dir-external'); dataIcon = icon; } diff --git a/apps/files/tests/js/filelistSpec.js b/apps/files/tests/js/filelistSpec.js index e3b5eba3ecb..83926b24fee 100644 --- a/apps/files/tests/js/filelistSpec.js +++ b/apps/files/tests/js/filelistSpec.js @@ -1455,6 +1455,32 @@ describe('OCA.Files.FileList tests', function() { expect(OC.TestUtil.getImageUrl($td.find('.thumbnail'))).toEqual(OC.webroot + '/core/img/filetypes/folder.svg'); expect(previewLoadStub.notCalled).toEqual(true); }); + it('render encrypted folder icon for encrypted root', function() { + var fileData = { + type: 'dir', + mimetype: 'httpd/unix-directory', + name: 'test dir', + isEncrypted: true + }; + var $tr = fileList.add(fileData); + var $td = $tr.find('td.filename'); + expect(OC.TestUtil.getImageUrl($td.find('.thumbnail'))).toEqual(OC.webroot + '/core/img/filetypes/folder-encrypted.svg'); + expect(previewLoadStub.notCalled).toEqual(true); + }); + it('render encrypted folder icon for encrypted subdir', function() { + var fileData = { + type: 'dir', + mimetype: 'httpd/unix-directory', + name: 'test dir', + isEncrypted: true + }; + var $tr = fileList.add(fileData); + var $td = $tr.find('td.filename'); + expect(OC.TestUtil.getImageUrl($td.find('.thumbnail'))).toEqual(OC.webroot + '/core/img/filetypes/folder-encrypted.svg'); + expect(previewLoadStub.notCalled).toEqual(true); + // default icon override + expect($tr.attr('data-icon')).toEqual(OC.webroot + '/core/img/filetypes/folder-encrypted.svg'); + }); it('render external storage icon for external storage root', function() { var fileData = { type: 'dir', |