diff --git a/core/js/setupchecks.js b/core/js/setupchecks.js index 35f24b188f..bf8dba78c4 100644 --- a/core/js/setupchecks.js +++ b/core/js/setupchecks.js @@ -10,6 +10,12 @@ (function() { OC.SetupChecks = { + + /* Message types */ + MESSAGE_TYPE_INFO:0, + MESSAGE_TYPE_WARNING:1, + MESSAGE_TYPE_ERROR:2, + /** * Check whether the WebDAV connection works. * @@ -60,9 +66,10 @@ ); } if(!data.isMemcacheConfigured) { - messages.push( - 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 documentation.', {docLink: data.memcacheDocs}) - ); + 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 documentation.', {docLink: data.memcacheDocs}), + type: OC.SetupChecks.MESSAGE_TYPE_TIP + }); } if(!data.isUrandomAvailable) { messages.push( diff --git a/core/js/tests/specs/setupchecksSpec.js b/core/js/tests/specs/setupchecksSpec.js index ec8a732b4a..2bf8129fd5 100644 --- a/core/js/tests/specs/setupchecksSpec.js +++ b/core/js/tests/specs/setupchecksSpec.js @@ -70,7 +70,13 @@ describe('OC.SetupChecks tests', function() { ); async.done(function( data, s, x ){ - expect(data).toEqual(['This server has no working Internet connection. 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.', 'Your data directory and your files are probably accessible from the Internet. The .htaccess file is not working. We strongly suggest that you configure your web server in a way that the data directory is no longer accessible or you move the data directory outside the web server document root.', 'No memory cache has been configured. To enhance your performance please configure a memcache if available. Further information can be found in our documentation.']); + expect(data).toEqual([ + 'This server has no working Internet connection. 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.', + 'Your data directory and your files are probably accessible from the Internet. The .htaccess file is not working. We strongly suggest that you configure your web server in a way that the data directory is no longer accessible or you move the data directory outside the web server document root.', + { + msg: 'No memory cache has been configured. To enhance your performance please configure a memcache if available. Further information can be found in our documentation.', + type: OC.SetupChecks.MESSAGE_TYPE_INFO + }]); done(); }); }); @@ -87,7 +93,13 @@ describe('OC.SetupChecks tests', function() { ); async.done(function( data, s, x ){ - expect(data).toEqual(['This server has no working Internet connection. 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.', 'Your data directory and your files are probably accessible from the Internet. The .htaccess file is not working. We strongly suggest that you configure your web server in a way that the data directory is no longer accessible or you move the data directory outside the web server document root.', 'No memory cache has been configured. To enhance your performance please configure a memcache if available. Further information can be found in our documentation.']); + expect(data).toEqual([ + 'This server has no working Internet connection. 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.', + 'Your data directory and your files are probably accessible from the Internet. The .htaccess file is not working. We strongly suggest that you configure your web server in a way that the data directory is no longer accessible or you move the data directory outside the web server document root.', + { + msg: 'No memory cache has been configured. To enhance your performance please configure a memcache if available. Further information can be found in our documentation.', + type: OC.SetupChecks.MESSAGE_TYPE_TIP + }]); done(); }); }); diff --git a/settings/js/admin.js b/settings/js/admin.js index 8f705b9048..752ab44534 100644 --- a/settings/js/admin.js +++ b/settings/js/admin.js @@ -166,17 +166,40 @@ $(document).ready(function(){ OC.SetupChecks.checkSetup(), OC.SetupChecks.checkGeneric() ).then(function(check1, check2, check3) { - var errors = [].concat(check1, check2, check3); + var messages = [].concat(check1, check2, check3); var $el = $('#postsetupchecks'); - var $errorsEl; $el.find('.loading').addClass('hidden'); - if (errors.length === 0) { + if (messages.length === 0) { } else { - $errorsEl = $el.find('.errors'); - for (var i = 0; i < errors.length; i++ ) { - $errorsEl.append('