Add server-side logging when not existing components are required and fix code style issues

refs #4456
This commit is contained in:
Matthias Jentsch 2013-08-20 19:31:29 +02:00 committed by Marius Hein
parent 889abf55eb
commit 7353797147
5 changed files with 46 additions and 45 deletions

View File

@ -30,6 +30,7 @@
use \Zend_Controller_Action_Exception as ActionException;
use \Icinga\Web\Controller\ActionController;
use \Icinga\Application\Icinga;
use \Icinga\Application\Logger;
class StaticController extends ActionController
{
@ -124,6 +125,9 @@ class StaticController extends ActionController
}
if (!file_exists($filePath)) {
Logger::error(
'Non-existing frontend component "' . $module . '/' . $file
. '" was requested, which would resolve to the the path: ' . $filePath);
echo '/** Module has no js files **/';
return;
}

View File

@ -74,7 +74,6 @@ describe('Component loader',function(){
addComponent('app/component1');
component.load(function() {
// loading complete
var cmpNode = $('#icinga-component-0');
cmpNode.length.should.equal(1);
cmpNode[0].test.should.equal('changed-by-component-1');
@ -87,7 +86,6 @@ describe('Component loader',function(){
addComponent('app/component2','some-id');
component.load(function() {
// loading complete
var cmpNode = $('#some-id');
cmpNode.length.should.equal(1);
cmpNode[0].test.should.equal('changed-by-component-2');
@ -103,7 +101,6 @@ describe('Component loader',function(){
addComponent('module/component3');
component.load(function() {
// loading complete
var components = component.getComponents();
components.length.should.equal(4);
$('body').empty();