diff options
Diffstat (limited to 'core/js')
-rw-r--r-- | core/js/js.js | 2 | ||||
-rw-r--r-- | core/js/setupchecks.js | 18 | ||||
-rw-r--r-- | core/js/share.js | 39 | ||||
-rw-r--r-- | core/js/tests/specs/coreSpec.js | 4 | ||||
-rw-r--r-- | core/js/tests/specs/files/clientSpec.js | 2 | ||||
-rw-r--r-- | core/js/tests/specs/jquery.avatarSpec.js | 4 | ||||
-rw-r--r-- | core/js/tests/specs/mimeTypeSpec.js | 10 | ||||
-rw-r--r-- | core/js/tests/specs/setupchecksSpec.js | 22 | ||||
-rw-r--r-- | core/js/tests/specs/shareSpec.js | 63 | ||||
-rw-r--r-- | core/js/tests/specs/sharedialoglinkshareview.js | 1 | ||||
-rw-r--r-- | core/js/tests/specs/sharedialogshareelistview.js | 15 | ||||
-rw-r--r-- | core/js/tests/specs/sharedialogviewSpec.js | 1 |
12 files changed, 83 insertions, 98 deletions
diff --git a/core/js/js.js b/core/js/js.js index c02ef5c7920..1f84b40a35a 100644 --- a/core/js/js.js +++ b/core/js/js.js @@ -1512,7 +1512,7 @@ function initCore() { var resizeMenu = function() { var appList = $('#appmenu li'); - var headerWidth = $('.header-left').width() - $('#nextcloud').width() + var headerWidth = $('.header-left').width() - $('#nextcloud').width(); var usePercentualAppMenuLimit = 0.33; var minAppsDesktop = 8; var availableWidth = headerWidth - $(appList).width(); diff --git a/core/js/setupchecks.js b/core/js/setupchecks.js index 5e8ef9e6961..99e3c72d2d4 100644 --- a/core/js/setupchecks.js +++ b/core/js/setupchecks.js @@ -66,7 +66,7 @@ if (xhr.status !== 207) { var docUrl = placeholderUrl.replace('PLACEHOLDER', 'admin-setup-well-known-URL'); messages.push({ - msg: t('core', 'Your web server is not set up properly to resolve "{url}". Further information can be found in our <a target="_blank" rel="noreferrer" href="{docLink}">documentation</a>.', { docLink: docUrl, url: url }), + msg: t('core', 'Your web server is not set up properly to resolve "{url}". Further information can be found in our <a target="_blank" rel="noreferrer noopener" href="{docLink}">documentation</a>.', { docLink: docUrl, url: url }), type: OC.SetupChecks.MESSAGE_TYPE_INFO }); } @@ -100,13 +100,13 @@ } if(!data.isMemcacheConfigured) { messages.push({ - msg: t('core', 'No memory cache has been configured. To enhance your performance please configure a memcache if available. Further information can be found in our <a target="_blank" rel="noreferrer" href="{docLink}">documentation</a>.', {docLink: data.memcacheDocs}), + msg: t('core', 'No memory cache has been configured. To enhance your performance please configure a memcache if available. Further information can be found in our <a target="_blank" rel="noreferrer noopener" href="{docLink}">documentation</a>.', {docLink: data.memcacheDocs}), type: OC.SetupChecks.MESSAGE_TYPE_INFO }); } if(!data.isUrandomAvailable) { messages.push({ - msg: t('core', '/dev/urandom is not readable by PHP which is highly discouraged for security reasons. Further information can be found in our <a target="_blank" rel="noreferrer" href="{docLink}">documentation</a>.', {docLink: data.securityDocs}), + msg: t('core', '/dev/urandom is not readable by PHP which is highly discouraged for security reasons. Further information can be found in our <a target="_blank" rel="noreferrer noopener" href="{docLink}">documentation</a>.', {docLink: data.securityDocs}), type: OC.SetupChecks.MESSAGE_TYPE_WARNING }); } @@ -118,19 +118,19 @@ } if(data.phpSupported && data.phpSupported.eol) { messages.push({ - msg: t('core', 'You are currently running PHP {version}. We encourage you to upgrade your PHP version to take advantage of <a target="_blank" rel="noreferrer" href="{phpLink}">performance and security updates provided by the PHP Group</a> as soon as your distribution supports it.', {version: data.phpSupported.version, phpLink: 'https://secure.php.net/supported-versions.php'}), + msg: t('core', 'You are currently running PHP {version}. We encourage you to upgrade your PHP version to take advantage of <a target="_blank" rel="noreferrer noopener" href="{phpLink}">performance and security updates provided by the PHP Group</a> as soon as your distribution supports it.', {version: data.phpSupported.version, phpLink: 'https://secure.php.net/supported-versions.php'}), type: OC.SetupChecks.MESSAGE_TYPE_INFO }); } if(!data.forwardedForHeadersWorking) { messages.push({ - msg: t('core', 'The reverse proxy headers configuration is incorrect, or you are accessing Nextcloud from a trusted proxy. If you are not accessing Nextcloud from a trusted proxy, this is a security issue and can allow an attacker to spoof their IP address as visible to Nextcloud. Further information can be found in our <a target="_blank" rel="noreferrer" href="{docLink}">documentation</a>.', {docLink: data.reverseProxyDocs}), + msg: t('core', 'The reverse proxy headers configuration is incorrect, or you are accessing Nextcloud from a trusted proxy. If you are not accessing Nextcloud from a trusted proxy, this is a security issue and can allow an attacker to spoof their IP address as visible to Nextcloud. Further information can be found in our <a target="_blank" rel="noreferrer noopener" href="{docLink}">documentation</a>.', {docLink: data.reverseProxyDocs}), type: OC.SetupChecks.MESSAGE_TYPE_WARNING }); } if(!data.isCorrectMemcachedPHPModuleInstalled) { messages.push({ - msg: t('core', 'Memcached is configured as distributed cache, but the wrong PHP module "memcache" is installed. \\OC\\Memcache\\Memcached only supports "memcached" and not "memcache". See the <a target="_blank" rel="noreferrer" href="{wikiLink}">memcached wiki about both modules</a>.', {wikiLink: 'https://code.google.com/p/memcached/wiki/PHPClientComparison'}), + msg: t('core', 'Memcached is configured as distributed cache, but the wrong PHP module "memcache" is installed. \\OC\\Memcache\\Memcached only supports "memcached" and not "memcache". See the <a target="_blank" rel="noreferrer noopener" href="{wikiLink}">memcached wiki about both modules</a>.', {wikiLink: 'https://code.google.com/p/memcached/wiki/PHPClientComparison'}), type: OC.SetupChecks.MESSAGE_TYPE_WARNING }); } @@ -138,7 +138,7 @@ messages.push({ msg: t( 'core', - 'Some files have not passed the integrity check. Further information on how to resolve this issue can be found in our <a target="_blank" rel="noreferrer" href="{docLink}">documentation</a>. (<a href="{codeIntegrityDownloadEndpoint}">List of invalid files…</a> / <a href="{rescanEndpoint}">Rescan…</a>)', + 'Some files have not passed the integrity check. Further information on how to resolve this issue can be found in our <a target="_blank" rel="noreferrer noopener" href="{docLink}">documentation</a>. (<a href="{codeIntegrityDownloadEndpoint}">List of invalid files…</a> / <a href="{rescanEndpoint}">Rescan…</a>)', { docLink: data.codeIntegrityCheckerDocumentation, codeIntegrityDownloadEndpoint: OC.generateUrl('/settings/integrity/failed'), @@ -152,7 +152,7 @@ messages.push({ msg: t( 'core', - 'The PHP OPcache is not properly configured. <a target="_blank" rel="noreferrer" href="{docLink}">For better performance we recommend</a> to use following settings in the <code>php.ini</code>:', + 'The PHP OPcache is not properly configured. <a target="_blank" rel="noreferrer noopener" href="{docLink}">For better performance we recommend</a> to use following settings in the <code>php.ini</code>:', { docLink: data.phpOpcacheDocumentation, } @@ -300,7 +300,7 @@ var minimumSeconds = 15552000; if(isNaN(transportSecurityValidity) || transportSecurityValidity <= (minimumSeconds - 1)) { messages.push({ - msg: t('core', 'The "Strict-Transport-Security" HTTP header is not configured to at least "{seconds}" seconds. For enhanced security we recommend enabling HSTS as described in our <a href="{docUrl}" rel="noreferrer">security tips</a>.', {'seconds': minimumSeconds, docUrl: tipsUrl}), + msg: t('core', 'The "Strict-Transport-Security" HTTP header is not configured to at least "{seconds}" seconds. For enhanced security we recommend enabling HSTS as described in our <a href="{docUrl}" rel="noreferrer noopener">security tips</a>.', {'seconds': minimumSeconds, docUrl: tipsUrl}), type: OC.SetupChecks.MESSAGE_TYPE_WARNING }); } diff --git a/core/js/share.js b/core/js/share.js index 659d719788d..25d59b46fb4 100644 --- a/core/js/share.js +++ b/core/js/share.js @@ -203,18 +203,19 @@ OC.Share = _.extend(OC.Share || {}, { * @param {String} remoteAddress full remote share * @return {String} HTML code to display */ - _formatRemoteShare: function(remoteAddress) { + _formatRemoteShare: function(remoteAddress, message) { var parts = this._REMOTE_OWNER_REGEXP.exec(remoteAddress); if (!parts) { - // display as is, most likely to be a simple owner name - return escapeHTML(remoteAddress); + // display avatar of the user + var avatar = '<span class="avatar" data-userName="' + escapeHTML(remoteAddress) + '" title="' + message + " " + escapeHTML(remoteAddress) + '"></span>'; + var hidden = '<span class="hidden-visually">' + message + ' ' + escapeHTML(remoteAddress) + '</span> '; + return avatar + hidden; } var userName = parts[1]; var userDomain = parts[3]; var server = parts[4]; - var dir = parts[6]; - var tooltip = userName; + var tooltip = message + ' ' + userName; if (userDomain) { tooltip += '@' + userDomain; } @@ -230,7 +231,7 @@ OC.Share = _.extend(OC.Share || {}, { if (userDomain) { html += '<span class="userDomain">@' + escapeHTML(userDomain) + '</span>'; } - html += '</span>'; + html += '</span> '; return html; }, /** @@ -243,7 +244,7 @@ OC.Share = _.extend(OC.Share || {}, { _formatShareList: function(recipients) { var _parent = this; return $.map(recipients, function(recipient) { - recipient = _parent._formatRemoteShare(recipient); + recipient = _parent._formatRemoteShare(recipient, t('core', 'Shared with')); return recipient; }); }, @@ -259,8 +260,7 @@ OC.Share = _.extend(OC.Share || {}, { var action = $tr.find('.fileactions .action[data-action="Share"]'); var type = $tr.data('type'); var icon = action.find('.icon'); - var message; - var recipients; + var message, recipients, avatars; var owner = $tr.attr('data-share-owner'); var shareFolderIcon; var iconClass = 'icon-shared'; @@ -294,20 +294,23 @@ OC.Share = _.extend(OC.Share || {}, { recipients = $tr.attr('data-share-recipients'); action.addClass('shared-style'); - message = t('core', 'Shared'); + avatars = '<span>' + t('core', 'Shared') + '</span>'; // even if reshared, only show "Shared by" if (owner) { - message = this._formatRemoteShare(owner); + message = t('core', 'Shared by'); + avatars = this._formatRemoteShare(owner, message); + } else if (recipients) { + avatars = this._formatShareList(recipients.split(', ')).join(''); } - else if (recipients) { - message = t('core', 'Shared with {recipients}', {recipients: this._formatShareList(recipients.split(", ")).join(", ")}, 0, {escape: false}); - } - action.html('<span> ' + message + '</span>').prepend(icon); + action.html(avatars).prepend(icon); + if (owner || recipients) { - action.find('.remoteAddress').tooltip({placement: 'top'}); + var avatarElement = action.find('.avatar'); + avatarElement.avatar(avatarElement.data('username'), 32); + + action.find('.icon-shared + span').tooltip({placement: 'top'}); } - } - else { + } else { action.html('<span class="hidden-visually">' + t('core', 'Shared') + '</span>').prepend(icon); } if (hasLink) { diff --git a/core/js/tests/specs/coreSpec.js b/core/js/tests/specs/coreSpec.js index dd13cba8e2b..9848fb46ffc 100644 --- a/core/js/tests/specs/coreSpec.js +++ b/core/js/tests/specs/coreSpec.js @@ -256,10 +256,10 @@ describe('Core base tests', function() { describe('filePath', function() { beforeEach(function() { OC.webroot = 'http://localhost'; - OC.appswebroots['files'] = OC.webroot + '/apps3/files'; + OC.appswebroots.files = OC.webroot + '/apps3/files'; }); afterEach(function() { - delete OC.appswebroots['files']; + delete OC.appswebroots.files; }); it('Uses a direct link for css and images,' , function() { diff --git a/core/js/tests/specs/files/clientSpec.js b/core/js/tests/specs/files/clientSpec.js index f75998029a9..d66c209bca5 100644 --- a/core/js/tests/specs/files/clientSpec.js +++ b/core/js/tests/specs/files/clientSpec.js @@ -448,7 +448,7 @@ describe('OC.Files.Client tests', function() { expect(info.id).toEqual(11); // file entry - var info = response[1]; + info = response[1]; expect(info instanceof OC.Files.FileInfo).toEqual(true); expect(info.id).toEqual(51); diff --git a/core/js/tests/specs/jquery.avatarSpec.js b/core/js/tests/specs/jquery.avatarSpec.js index d7305736690..b9351d2a8a0 100644 --- a/core/js/tests/specs/jquery.avatarSpec.js +++ b/core/js/tests/specs/jquery.avatarSpec.js @@ -11,7 +11,7 @@ describe('jquery.avatar tests', function() { var $div; - var devicePixelRatio + var devicePixelRatio; beforeEach(function() { $('#testArea').append($('<div id="avatardiv">')); @@ -24,7 +24,7 @@ describe('jquery.avatar tests', function() { afterEach(function() { $div.remove(); - window.devicePixelRatio = devicePixelRatio + window.devicePixelRatio = devicePixelRatio; }); describe('size', function() { diff --git a/core/js/tests/specs/mimeTypeSpec.js b/core/js/tests/specs/mimeTypeSpec.js index 182941de1a9..8ad0300a0a7 100644 --- a/core/js/tests/specs/mimeTypeSpec.js +++ b/core/js/tests/specs/mimeTypeSpec.js @@ -26,17 +26,17 @@ describe('MimeType tests', function() { beforeEach(function() { _files = OC.MimeTypeList.files; _aliases = OC.MimeTypeList.aliases; - _theme = OC.MimeTypeList.themes['abc']; + _theme = OC.MimeTypeList.themes.abc; OC.MimeTypeList.files = ['folder', 'folder-shared', 'folder-external', 'foo-bar', 'foo', 'file']; OC.MimeTypeList.aliases = {'app/foobar': 'foo/bar'}; - OC.MimeTypeList.themes['abc'] = ['folder']; + OC.MimeTypeList.themes.abc = ['folder']; }); afterEach(function() { OC.MimeTypeList.files = _files; OC.MimeTypeList.aliases = _aliases; - OC.MimeTypeList.themes['abc'] = _theme; + OC.MimeTypeList.themes.abc = _theme; }); describe('_getFile', function() { @@ -109,9 +109,9 @@ describe('MimeType tests', function() { var res = OC.MimeType.getIconUrl('dir'); expect(Object.keys(OC.MimeType._mimeTypeIcons).length).toEqual(1); - expect(OC.MimeType._mimeTypeIcons['dir']).toEqual(res); + expect(OC.MimeType._mimeTypeIcons.dir).toEqual(res); - var res = OC.MimeType.getIconUrl('dir-shared'); + res = OC.MimeType.getIconUrl('dir-shared'); expect(Object.keys(OC.MimeType._mimeTypeIcons).length).toEqual(2); expect(OC.MimeType._mimeTypeIcons['dir-shared']).toEqual(res); }); diff --git a/core/js/tests/specs/setupchecksSpec.js b/core/js/tests/specs/setupchecksSpec.js index 35279f3501e..3df676099b7 100644 --- a/core/js/tests/specs/setupchecksSpec.js +++ b/core/js/tests/specs/setupchecksSpec.js @@ -68,7 +68,7 @@ describe('OC.SetupChecks tests', function() { async.done(function( data, s, x ){ expect(data).toEqual([{ - msg: 'Your web server is not set up properly to resolve "/.well-known/caldav/". Further information can be found in our <a href="http://example.org/admin-setup-well-known-URL" rel="noreferrer">documentation</a>.', + msg: 'Your web server is not set up properly to resolve "/.well-known/caldav/". Further information can be found in our <a href="http://example.org/admin-setup-well-known-URL" rel="noreferrer noopener">documentation</a>.', type: OC.SetupChecks.MESSAGE_TYPE_INFO }]); done(); @@ -166,7 +166,7 @@ describe('OC.SetupChecks tests', function() { msg: 'This server has no working Internet connection: Multiple endpoints could not be reached. This means that some of the features like mounting external storage, notifications about updates or installation of third-party apps will not work. Accessing files remotely and sending of notification emails might not work, either. We suggest to enable Internet connection for this server if you want to have all features.', type: OC.SetupChecks.MESSAGE_TYPE_WARNING }, { - msg: 'No memory cache has been configured. To enhance your performance please configure a memcache if available. Further information can be found in our <a href="https://docs.nextcloud.com/server/go.php?to=admin-performance" rel="noreferrer">documentation</a>.', + msg: 'No memory cache has been configured. To enhance your performance please configure a memcache if available. Further information can be found in our <a href="https://docs.nextcloud.com/server/go.php?to=admin-performance" rel="noreferrer noopener">documentation</a>.', type: OC.SetupChecks.MESSAGE_TYPE_INFO }]); done(); @@ -200,7 +200,7 @@ describe('OC.SetupChecks tests', function() { type: OC.SetupChecks.MESSAGE_TYPE_WARNING }, { - msg: 'No memory cache has been configured. To enhance your performance please configure a memcache if available. Further information can be found in our <a href="https://docs.nextcloud.com/server/go.php?to=admin-performance" rel="noreferrer">documentation</a>.', + msg: 'No memory cache has been configured. To enhance your performance please configure a memcache if available. Further information can be found in our <a href="https://docs.nextcloud.com/server/go.php?to=admin-performance" rel="noreferrer noopener">documentation</a>.', type: OC.SetupChecks.MESSAGE_TYPE_INFO }]); done(); @@ -261,7 +261,7 @@ describe('OC.SetupChecks tests', function() { async.done(function( data, s, x ){ expect(data).toEqual([{ - msg: '/dev/urandom is not readable by PHP which is highly discouraged for security reasons. Further information can be found in our <a href="https://docs.owncloud.org/myDocs.html" rel="noreferrer">documentation</a>.', + msg: '/dev/urandom is not readable by PHP which is highly discouraged for security reasons. Further information can be found in our <a href="https://docs.owncloud.org/myDocs.html" rel="noreferrer noopener">documentation</a>.', type: OC.SetupChecks.MESSAGE_TYPE_WARNING }]); done(); @@ -291,7 +291,7 @@ describe('OC.SetupChecks tests', function() { async.done(function( data, s, x ){ expect(data).toEqual([{ - msg: 'Memcached is configured as distributed cache, but the wrong PHP module "memcache" is installed. \\OC\\Memcache\\Memcached only supports "memcached" and not "memcache". See the <a href="https://code.google.com/p/memcached/wiki/PHPClientComparison" rel="noreferrer">memcached wiki about both modules</a>.', + msg: 'Memcached is configured as distributed cache, but the wrong PHP module "memcache" is installed. \\OC\\Memcache\\Memcached only supports "memcached" and not "memcache". See the <a href="https://code.google.com/p/memcached/wiki/PHPClientComparison" rel="noreferrer noopener">memcached wiki about both modules</a>.', type: OC.SetupChecks.MESSAGE_TYPE_WARNING }]); done(); @@ -321,7 +321,7 @@ describe('OC.SetupChecks tests', function() { async.done(function( data, s, x ){ expect(data).toEqual([{ - msg: 'The reverse proxy headers configuration is incorrect, or you are accessing Nextcloud from a trusted proxy. If you are not accessing Nextcloud from a trusted proxy, this is a security issue and can allow an attacker to spoof their IP address as visible to Nextcloud. Further information can be found in our <a href="https://docs.owncloud.org/foo/bar.html" rel="noreferrer">documentation</a>.', + msg: 'The reverse proxy headers configuration is incorrect, or you are accessing Nextcloud from a trusted proxy. If you are not accessing Nextcloud from a trusted proxy, this is a security issue and can allow an attacker to spoof their IP address as visible to Nextcloud. Further information can be found in our <a href="https://docs.owncloud.org/foo/bar.html" rel="noreferrer noopener">documentation</a>.', type: OC.SetupChecks.MESSAGE_TYPE_WARNING }]); done(); @@ -402,7 +402,7 @@ describe('OC.SetupChecks tests', function() { async.done(function( data, s, x ){ expect(data).toEqual([{ - msg: 'You are currently running PHP 5.4.0. We encourage you to upgrade your PHP version to take advantage of <a href="https://secure.php.net/supported-versions.php" rel="noreferrer">performance and security updates provided by the PHP Group</a> as soon as your distribution supports it.', + msg: 'You are currently running PHP 5.4.0. We encourage you to upgrade your PHP version to take advantage of <a href="https://secure.php.net/supported-versions.php" rel="noreferrer noopener">performance and security updates provided by the PHP Group</a> as soon as your distribution supports it.', type: OC.SetupChecks.MESSAGE_TYPE_INFO }]); done(); @@ -433,7 +433,7 @@ describe('OC.SetupChecks tests', function() { async.done(function( data, s, x ){ expect(data).toEqual([{ - msg: 'The PHP OPcache is not properly configured. <a href="https://example.org/link/to/doc" rel="noreferrer">For better performance we recommend</a> to use following settings in the <code>php.ini</code>:' + "<pre><code>opcache.enable=1\nopcache.enable_cli=1\nopcache.interned_strings_buffer=8\nopcache.max_accelerated_files=10000\nopcache.memory_consumption=128\nopcache.save_comments=1\nopcache.revalidate_freq=1</code></pre>", + msg: 'The PHP OPcache is not properly configured. <a href="https://example.org/link/to/doc" rel="noreferrer noopener">For better performance we recommend</a> to use following settings in the <code>php.ini</code>:' + "<pre><code>opcache.enable=1\nopcache.enable_cli=1\nopcache.interned_strings_buffer=8\nopcache.max_accelerated_files=10000\nopcache.memory_consumption=128\nopcache.save_comments=1\nopcache.revalidate_freq=1</code></pre>", type: OC.SetupChecks.MESSAGE_TYPE_INFO }]); done(); @@ -617,7 +617,7 @@ describe('OC.SetupChecks tests', function() { async.done(function( data, s, x ){ expect(data).toEqual([{ - msg: 'The "Strict-Transport-Security" HTTP header is not configured to at least "15552000" seconds. For enhanced security we recommend enabling HSTS as described in our <a rel="noreferrer" href="http://localhost/index.php/settings/admin/tips-tricks">security tips</a>.', + msg: 'The "Strict-Transport-Security" HTTP header is not configured to at least "15552000" seconds. For enhanced security we recommend enabling HSTS as described in our <a rel="noreferrer noopener" href="http://localhost/index.php/settings/admin/tips-tricks">security tips</a>.', type: OC.SetupChecks.MESSAGE_TYPE_WARNING }]); done(); @@ -642,7 +642,7 @@ describe('OC.SetupChecks tests', function() { async.done(function( data, s, x ){ expect(data).toEqual([{ - msg: 'The "Strict-Transport-Security" HTTP header is not configured to at least "15552000" seconds. For enhanced security we recommend enabling HSTS as described in our <a rel="noreferrer" href="http://localhost/index.php/settings/admin/tips-tricks">security tips</a>.', + msg: 'The "Strict-Transport-Security" HTTP header is not configured to at least "15552000" seconds. For enhanced security we recommend enabling HSTS as described in our <a rel="noreferrer noopener" href="http://localhost/index.php/settings/admin/tips-tricks">security tips</a>.', type: OC.SetupChecks.MESSAGE_TYPE_WARNING }]); done(); @@ -667,7 +667,7 @@ describe('OC.SetupChecks tests', function() { async.done(function( data, s, x ){ expect(data).toEqual([{ - msg: 'The "Strict-Transport-Security" HTTP header is not configured to at least "15552000" seconds. For enhanced security we recommend enabling HSTS as described in our <a rel="noreferrer" href="http://localhost/index.php/settings/admin/tips-tricks">security tips</a>.', + msg: 'The "Strict-Transport-Security" HTTP header is not configured to at least "15552000" seconds. For enhanced security we recommend enabling HSTS as described in our <a rel="noreferrer noopener" href="http://localhost/index.php/settings/admin/tips-tricks">security tips</a>.', type: OC.SetupChecks.MESSAGE_TYPE_WARNING }]); done(); diff --git a/core/js/tests/specs/shareSpec.js b/core/js/tests/specs/shareSpec.js index fbf6eecc8df..70c698c99a2 100644 --- a/core/js/tests/specs/shareSpec.js +++ b/core/js/tests/specs/shareSpec.js @@ -47,7 +47,7 @@ describe('OC.Share tests', function() { $file.attr('data-share-owner', input); OC.Share.markFileAsShared($file); - $action = $file.find('.action-share>span'); + $action = $file.find('.action-share>span').parent(); expect($action.text().trim()).toEqual(output); if (_.isString(title)) { expect($action.find('.remoteAddress').attr('title')).toEqual(title); @@ -58,41 +58,41 @@ describe('OC.Share tests', function() { tooltipStub.reset(); } - it('displays the local share owner as is', function() { - checkOwner('User One', 'User One', null); + it('displays the local share owner with "Shared by" prefix', function() { + checkOwner('User One', 'Shared by User One', null); }); it('displays the user name part of a remote share owner', function() { checkOwner( 'User One@someserver.com', 'User One@…', - 'User One@someserver.com' + 'Shared by User One@someserver.com' ); checkOwner( 'User One@someserver.com/', 'User One@…', - 'User One@someserver.com' + 'Shared by User One@someserver.com' ); checkOwner( 'User One@someserver.com/root/of/owncloud', 'User One@…', - 'User One@someserver.com' + 'Shared by User One@someserver.com' ); }); it('displays the user name part with domain of a remote share owner', function() { checkOwner( 'User One@example.com@someserver.com', 'User One@example.com', - 'User One@example.com@someserver.com' + 'Shared by User One@example.com@someserver.com' ); checkOwner( 'User One@example.com@someserver.com/', 'User One@example.com', - 'User One@example.com@someserver.com' + 'Shared by User One@example.com@someserver.com' ); checkOwner( 'User One@example.com@someserver.com/root/of/owncloud', 'User One@example.com', - 'User One@example.com@someserver.com' + 'Shared by User One@example.com@someserver.com' ); }); }); @@ -151,14 +151,14 @@ describe('OC.Share tests', function() { }); }); - describe('displaying the recipoients', function() { + describe('displaying the recipients', function() { function checkRecipients(input, output, title) { var $action; $file.attr('data-share-recipients', input); OC.Share.markFileAsShared($file, true); - $action = $file.find('.action-share>span'); + $action = $file.find('.action-share>span').parent(); expect($action.text().trim()).toEqual(output); if (_.isString(title)) { expect($action.find('.remoteAddress').attr('title')).toEqual(title); @@ -182,62 +182,61 @@ describe('OC.Share tests', function() { it('displays the user name part of a remote recipient', function() { checkRecipients( 'User One@someserver.com', - 'Shared with User One@…', - 'User One@someserver.com' + 'User One@…', + 'Shared with User One@someserver.com' ); checkRecipients( 'User One@someserver.com/', - 'Shared with User One@…', - 'User One@someserver.com' + 'User One@…', + 'Shared with User One@someserver.com' ); checkRecipients( 'User One@someserver.com/root/of/owncloud', - 'Shared with User One@…', - 'User One@someserver.com' + 'User One@…', + 'Shared with User One@someserver.com' ); }); it('displays the user name part with domain of a remote share owner', function() { checkRecipients( 'User One@example.com@someserver.com', - 'Shared with User One@example.com', - 'User One@example.com@someserver.com' + 'User One@example.com', + 'Shared with User One@example.com@someserver.com' ); checkRecipients( 'User One@example.com@someserver.com/', - 'Shared with User One@example.com', - 'User One@example.com@someserver.com' + 'User One@example.com', + 'Shared with User One@example.com@someserver.com' ); checkRecipients( 'User One@example.com@someserver.com/root/of/owncloud', - 'Shared with User One@example.com', - 'User One@example.com@someserver.com' + 'User One@example.com', + 'Shared with User One@example.com@someserver.com' ); }); it('display multiple remote recipients', function() { checkRecipients( 'One@someserver.com, two@otherserver.com', - 'Shared with One@…, two@…', - ['One@someserver.com', 'two@otherserver.com'] + 'One@… two@…', + ['Shared with One@someserver.com', 'Shared with two@otherserver.com'] ); checkRecipients( 'One@someserver.com/, two@otherserver.com', - 'Shared with One@…, two@…', - ['One@someserver.com', 'two@otherserver.com'] + 'One@… two@…', + ['Shared with One@someserver.com', 'Shared with two@otherserver.com'] ); checkRecipients( 'One@someserver.com/root/of/owncloud, two@otherserver.com', - 'Shared with One@…, two@…', - ['One@someserver.com', 'two@otherserver.com'] + 'One@… two@…', + ['Shared with One@someserver.com', 'Shared with two@otherserver.com'] ); }); it('display mixed recipients', function() { checkRecipients( 'One, two@otherserver.com', - 'Shared with One, two@…', - ['two@otherserver.com'] + 'Shared with One two@…', + ['Shared with two@otherserver.com'] ); }); }); }); }); - diff --git a/core/js/tests/specs/sharedialoglinkshareview.js b/core/js/tests/specs/sharedialoglinkshareview.js index 811919b5603..12f5e762cee 100644 --- a/core/js/tests/specs/sharedialoglinkshareview.js +++ b/core/js/tests/specs/sharedialoglinkshareview.js @@ -48,7 +48,6 @@ describe('OC.Share.ShareDialogLinkShareView', function () { configModel = new OC.Share.ShareConfigModel({ enforcePasswordForPublicLink: false, isResharingAllowed: true, - enforcePasswordForPublicLink: false, isDefaultExpireDateEnabled: false, isDefaultExpireDateEnforced: false, defaultExpireDate: 7 diff --git a/core/js/tests/specs/sharedialogshareelistview.js b/core/js/tests/specs/sharedialogshareelistview.js index bcc596a1386..8ee2c48fe39 100644 --- a/core/js/tests/specs/sharedialogshareelistview.js +++ b/core/js/tests/specs/sharedialogshareelistview.js @@ -59,7 +59,6 @@ describe('OC.Share.ShareDialogShareeListView', function () { configModel = new OC.Share.ShareConfigModel({ enforcePasswordForPublicLink: false, isResharingAllowed: true, - enforcePasswordForPublicLink: false, isDefaultExpireDateEnabled: false, isDefaultExpireDateEnforced: false, defaultExpireDate: 7 @@ -123,20 +122,6 @@ describe('OC.Share.ShareDialogShareeListView', function () { expect(listView.$el.find("input[name='edit']").is(':checked')).toEqual(true); expect(updateShareStub.calledOnce).toEqual(true); }); - - it('shows cruds checkboxes when toggled', function () { - shareModel.set('shares', [{ - id: 100, - item_source: 123, - permissions: 1, - share_type: OC.Share.SHARE_TYPE_USER, - share_with: 'user1', - share_with_displayname: 'User One' - }]); - listView.render(); - listView.$el.find('a.showCruds').click(); - expect(listView.$el.find('li.cruds').hasClass('hidden')).toEqual(false); - }); }); }); diff --git a/core/js/tests/specs/sharedialogviewSpec.js b/core/js/tests/specs/sharedialogviewSpec.js index 95349bc4875..c6d5793623c 100644 --- a/core/js/tests/specs/sharedialogviewSpec.js +++ b/core/js/tests/specs/sharedialogviewSpec.js @@ -67,7 +67,6 @@ describe('OC.Share.ShareDialogView', function() { configModel = new OC.Share.ShareConfigModel({ enforcePasswordForPublicLink: false, isResharingAllowed: true, - enforcePasswordForPublicLink: false, isDefaultExpireDateEnabled: false, isDefaultExpireDateEnforced: false, defaultExpireDate: 7 |