Commit Graph

443 Commits

Author SHA1 Message Date
Jannis Moßhammer 04511121b1 Remove moved files
the 'behaviour' namespace in javascript has been renamed to
module

refs #4092
2013-06-25 09:53:21 +02:00
Jannis Moßhammer de34c2729f Add clearstatcache and tests for ModuleManager
Added the clearstatcache call before enabling or disabling modules,
as this prevents a 'File exists' error that occurs sometimes on
symlink creation (even when the folder is empty). Also added tests
for teh moduleManager

refs #4092
2013-06-25 09:53:21 +02:00
Jannis Moßhammer 04a23f0096 Move ModuleController from incubator
The Notification dependency is removed and uses exceptions now,
otherwise it's mostly the same like in the incubator

refs #4092
2013-06-25 09:53:21 +02:00
Jannis Moßhammer 81e27689bb Add rule for 'body' container and QLink property 'target'
QLinks can now define the target for their link. Additionally, the
targte 'body' is now always the <body> tag. This allows the
modulemanager to reload the whole page (with the navigation bar).

refs #4092
2013-06-25 09:53:21 +02:00
Jannis Moßhammer 0f8648dcb1 Add SystemPermissionException
This exception should be fired when the OS restricts the web user
from executing certain actions. Also the template for errors has
been modified so it displays the action and the target that
was prevented.

refs #4092
2013-06-25 09:53:21 +02:00
Marius Hein 8d1038e622 Refactor and test \Icinga\Web\Form
Fix inspection issues, added some other code for testing to
have more coverage, fix test for QLink view helper.

refs #4302
refs #4341
2013-06-25 09:43:55 +02:00
Jannis Moßhammer 5cddbd1162 Add Form\Builder
The builder class allows to create forms and bind them to
models. The tests are currently failing because of the zend
pluginloader, this must be evaluated

refs #4302
2013-06-24 18:48:32 +02:00
Jannis Moßhammer 35c43446d8 Add support for lazy module loading
When the X-Icinga-Module-Enable header is send, the
modulemanager automatically tries to load javascript files for
that module. This is realized by adding the 'registerHeaderListener'
method to the async manager, which allows to listen to specific headers
and firing callbacks if a response with the specified header is retrieved.

Also the tests have changed a bit, requireNow should be used when using
the requiremock, so a require always loads files new.

refs #4092
refs #3753
2013-06-21 15:33:06 +02:00
Jannis Moßhammer 36c8e0df4a Fix test for new module route
The js base route is now js/modules/%modulename%/%file%. This
commit reflects these changes in the testcases

refs #4092
refs #3735
2013-06-21 11:41:58 +02:00
Jannis Moßhammer e759911b09 Add javascript autoloading
the js/modules/%modulename%/%file% is now mapped to the module
path (if existing). To prevent name clashing, the modules folder
has been renamed to components.
2013-06-21 11:36:12 +02:00
Jannis Moßhammer c40c1dabc7 Remove moved files
the 'behaviour' namespace in javascript has been renamed to
module

refs #4092
2013-06-21 09:54:56 +02:00
Jannis Moßhammer c72fa101ed Add clearstatcache and tests for ModuleManager
Added the clearstatcache call before enabling or disabling modules,
as this prevents a 'File exists' error that occurs sometimes on
symlink creation (even when the folder is empty). Also added tests
for teh moduleManager

refs #4092
2013-06-21 09:54:56 +02:00
Jannis Moßhammer fd489484e1 Move ModuleController from incubator
The Notification dependency is removed and uses exceptions now,
otherwise it's mostly the same like in the incubator

refs #4092
2013-06-21 09:54:55 +02:00
Jannis Moßhammer 076b8a9af9 Add rule for 'body' container and QLink property 'target'
QLinks can now define the target for their link. Additionally, the
targte 'body' is now always the <body> tag. This allows the
modulemanager to reload the whole page (with the navigation bar).

refs #4092
2013-06-21 09:54:55 +02:00
Jannis Moßhammer c155a8330c Add SystemPermissionException
This exception should be fired when the OS restricts the web user
from executing certain actions. Also the template for errors has
been modified so it displays the action and the target that
was prevented.

refs #4092
2013-06-20 13:50:07 +02:00
Jannis Moßhammer 6f6478b819 Rename require reference to requirejs
Require is a reserverd word for phantomjs

refs #4315
refs #4303
2013-06-19 13:22:02 +02:00
Jannis Moßhammer fa5c499733 Allow container-based url in history api
When a url is now loaded for an non-main container, the url for the
container is appended to the GET part of the URL

refs #4303
2013-06-19 13:22:02 +02:00
Jannis Moßhammer e8d7971531 Add History Api test
Add CasperJS Tests for History API (~80%). Also provides a few
resources like the generic.html site that can be used for more
setups

refs #4303
refs #4315
2013-06-19 13:22:02 +02:00
Jannis Moßhammer c126374807 Add 'public' symlink creation to runtests
Runtest now creates a symlink to the public folder when it doesn't
exist, allowing the built-in server to access the js files
without too much hassle

refs #4303
refs #4315
2013-06-19 13:22:02 +02:00
Jannis Moßhammer fc4b42e3e0 Add history api and modify js for tests
All JS Files now call 'requirejs' instead of 'require', also
the holder.js reference is removed and the history api added.
Tests are following in the next commit

refs #4303
refs #4315
2013-06-19 13:22:01 +02:00
Jannis Moßhammer ef505ed949 Remove behaviour files
These files are not required anymore as they are
now renamed to 'modules' and may affect testting

refs #3753
refs #4303
2013-06-19 13:22:01 +02:00
Jannis Moßhammer 990bc77d81 Add temporary http server for casperjs tests
Added a static folder and spawn a small HTTP server on runtests.
This is not really the best solution, as it uses pythons
simpleHTTPServer, but it works for now

refs #4315
2013-06-19 13:22:01 +02:00
Marius Hein c58e32c365 Merge branch 'feature/jsmodules-3753'
fixes #3753
2013-06-17 11:43:02 +02:00
Jannis Moßhammer 0d0db281f7 Test and icinga.js module setup procedure
Behaviours are now modules and icinga.js automatically
requests module/list (which should be served by the application
and is non static) and retrieves a list of modules to request and
enable.

refs #3753
2013-06-17 11:22:53 +02:00
Jannis Moßhammer 63f7b8016e Add tests for javascript module implementation
This commit adds tests for the module loader and registry of
icinga2-web. It mainly registers event handlers and calls
custom enable/disable functions

refs #3753
2013-06-17 11:22:53 +02:00
Jannis Moßhammer 95e4ebb76a Add javascript files (all untested)
This commit just adds the javascript files from the incubator,
even if not fully functional.

refs #3753
2013-06-17 11:22:53 +02:00
Eric Lippmann 6de8dd91fe Remove trash-containing StatusCircle.js
refs #4249
2013-06-17 10:54:08 +02:00
Marius Hein 1f0e07cb36 Test and move bootstrapping/web code to source tree
Add simple test to use zend controller test.

refs #4249
2013-06-17 08:49:27 +02:00
Marius Hein c905b1f490 Test and move bootstrapping/web code to source tree
Move code from incubator to web. Only files needed to show
welcome moved.

refs #4249
2013-06-17 08:49:27 +02:00
Johannes Meyer 60836aace3 Merge branch 'bugfix/require-mock-4308
fixes #4308
2013-06-14 10:26:42 +02:00
Jannis Moßhammer 21e4ec1727 Fix wrong variable name in requiremock's getDefine
The getDefine method check's for existence of the 'arg' variable,
which was renamed to 'name', causing the typeof arg === "undefined"
to always return true

refs #4308
2013-06-14 09:50:06 +02:00
Jannis Moßhammer 9563541814 Fix ManagerTest's invaldi @expectedException annotation
The annotation catched the generic \Exception, which PHPunit
forbids. Now the tests directly catches and asserts this
exception

refs #4310
2013-06-14 09:39:34 +02:00
Jannis Moßhammer 780ea68f2f Remove abandoned files from tests
The deleted files were incomplete tests for non-existing files,
so they don't affect the build process

refs #4310
2013-06-14 09:38:11 +02:00
Jannis Moßhammer d2cd52218a Add mockup for requirejs
Tests can now call require('requiremock') to bootstrap an alternative
requirejs implementation and use the resulting object for defining
dependencies and mocks

refs #4308
2013-06-13 17:29:38 +02:00
Marius Hein 5e14f828ba Evaluate, Test and Move the items und library/Icinga/Web to the source tree
Fix PSR compliance.

refs #4256
2013-06-13 11:59:48 +02:00
Marius Hein 56844306c3 Evaluate, Test and Move the items und library/Icinga/Web to the source tree
Add test for Icinga_Web_Paginator_ScrollingStyle_SlidingWithBorder

refs #4256
2013-06-13 11:59:48 +02:00
Marius Hein 9657ba565e Evaluate, Test and Move the items und library/Icinga/Web to the source tree
Add test for paginator/QueryAdapter

refs #4256
2013-06-13 11:59:48 +02:00
Marius Hein f19934ef39 Evaluate, Test and Move the items und library/Icinga/Web to the source tree
Drop cookie class because implemented in auth

refs #4256
2013-06-13 11:59:48 +02:00
Marius Hein ee6d95b496 Evaluate, Test and Move the items und library/Icinga/Web to the source tree
Drop class Cookie because no implementation is made

refs #4256
2013-06-13 11:59:48 +02:00
Marius Hein c13208a0f8 Evaluate, Test and Move the items und library/Icinga/Web to the source tree
Add AbstractWidgetTest

refs #4256
2013-06-13 11:59:47 +02:00
Marius Hein c98be3ef73 Evaluate, Test and Move the items und library/Icinga/Web to the source tree
Add test for Widget.

refs #4256
2013-06-13 11:59:47 +02:00
Marius Hein ccd5564a37 Evaluate, Test and Move the items und library/Icinga/Web to the source tree
Modify test for hook, add test for notification

refs #4256
2013-06-13 11:59:47 +02:00
Eric Lippmann 09302f6fb9 Merge branch 'bugfix/unified-test-and-style-scripts-4244' 2013-06-11 18:27:03 +02:00
Marius Hein 45262d4e50 Unify test runners options, args and output
Test commit

refs #4244
2013-06-11 18:25:21 +02:00
Marius Hein 2909605f96 Unify test runners options, args and output
Fix runtests and checkswag

refs #4244
2013-06-11 18:25:21 +02:00
Johannes Meyer 5119e71d41 Add make call to ensure that bin/extcmd_test exists.
refs #4258
2013-06-11 18:25:21 +02:00
Johannes Meyer 7e14a2077d Add include and exclude handling to the js style-checker.
--include and --exclude now accept unix shell-style patterns.

refs #4244
2013-06-11 18:25:21 +02:00
Johannes Meyer 7c779bc525 Improve path handling of the js style-checker. 2013-06-11 18:25:21 +02:00
Johannes Meyer 5e70dfb87e Rewrite javascript style-checker.
--include and --exclude are not working yet.

refs #4244
2013-06-11 18:25:21 +02:00
Johannes Meyer 10c1b1a548 Rewrite javascript test-runner.
refs #4244
2013-06-11 18:25:21 +02:00