Add server-side logging when not existing components are required and fix code style issues
refs #4456
This commit is contained in:
parent
889abf55eb
commit
7353797147
|
@ -30,6 +30,7 @@
|
||||||
use \Zend_Controller_Action_Exception as ActionException;
|
use \Zend_Controller_Action_Exception as ActionException;
|
||||||
use \Icinga\Web\Controller\ActionController;
|
use \Icinga\Web\Controller\ActionController;
|
||||||
use \Icinga\Application\Icinga;
|
use \Icinga\Application\Icinga;
|
||||||
|
use \Icinga\Application\Logger;
|
||||||
|
|
||||||
class StaticController extends ActionController
|
class StaticController extends ActionController
|
||||||
{
|
{
|
||||||
|
@ -124,6 +125,9 @@ class StaticController extends ActionController
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!file_exists($filePath)) {
|
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 **/';
|
echo '/** Module has no js files **/';
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
|
@ -74,7 +74,6 @@ describe('Component loader',function(){
|
||||||
addComponent('app/component1');
|
addComponent('app/component1');
|
||||||
|
|
||||||
component.load(function() {
|
component.load(function() {
|
||||||
// loading complete
|
|
||||||
var cmpNode = $('#icinga-component-0');
|
var cmpNode = $('#icinga-component-0');
|
||||||
cmpNode.length.should.equal(1);
|
cmpNode.length.should.equal(1);
|
||||||
cmpNode[0].test.should.equal('changed-by-component-1');
|
cmpNode[0].test.should.equal('changed-by-component-1');
|
||||||
|
@ -87,7 +86,6 @@ describe('Component loader',function(){
|
||||||
addComponent('app/component2','some-id');
|
addComponent('app/component2','some-id');
|
||||||
|
|
||||||
component.load(function() {
|
component.load(function() {
|
||||||
// loading complete
|
|
||||||
var cmpNode = $('#some-id');
|
var cmpNode = $('#some-id');
|
||||||
cmpNode.length.should.equal(1);
|
cmpNode.length.should.equal(1);
|
||||||
cmpNode[0].test.should.equal('changed-by-component-2');
|
cmpNode[0].test.should.equal('changed-by-component-2');
|
||||||
|
@ -103,7 +101,6 @@ describe('Component loader',function(){
|
||||||
addComponent('module/component3');
|
addComponent('module/component3');
|
||||||
|
|
||||||
component.load(function() {
|
component.load(function() {
|
||||||
// loading complete
|
|
||||||
var components = component.getComponents();
|
var components = component.getComponents();
|
||||||
components.length.should.equal(4);
|
components.length.should.equal(4);
|
||||||
$('body').empty();
|
$('body').empty();
|
||||||
|
|
Loading…
Reference in New Issue