Commit Graph

201 Commits

Author SHA1 Message Date
Łukasz Mierzwa
c6e91c658e Update test snapshots
Rendered HTML changed, so tests need updating
2017-08-15 09:46:58 -07:00
Łukasz Mierzwa
15b3072a33 Render search history and default/saved filter separator only if needed
If there are no recorded search filters than we don't need any separator
2017-08-15 09:46:58 -07:00
Łukasz Mierzwa
536379434d Enable tooltips for history dropdown
It's a dropdown so data-toggle is already used for the menu
2017-08-15 09:46:58 -07:00
Łukasz Mierzwa
d92e08f3f6 Don't reload filters until entire applyFilterList() block was completed
setFilters() will trigger fetch of the new alerts with updated filter, it's being called after each filter is added to the filter bar, so each added filter ends up with AJAX call to /alerts.json, this means that when someone clicks on a history entry with complex rule it will trigger multiple subsequent requests. What's worse first request will have bigger response body (since it filters less) so it's likely that it will finish after the next request, leaving invalid alerts on the grid. This disable setFilters() if we apply filters in batch mode.
2017-08-14 20:10:44 -07:00
Łukasz Mierzwa
c7b18f314d Add applyFilterList() function and move logic there 2017-08-13 19:25:55 -07:00
Łukasz Mierzwa
9ba23d1658 Tweak history menu UI
Show search icon for search history elements and provide a separate entries for the default and saved filter.
Default & saved filter are always rendered on the bottom, if they are non-empty.
2017-08-13 16:55:51 -07:00
Łukasz Mierzwa
256453ccaf Add snapshot tests for history dropdown 2017-08-12 21:21:25 -07:00
Łukasz Mierzwa
9645287d88 Use a Set() instead of array
We only want unique values, Set is better for this
2017-08-12 19:57:30 -07:00
Łukasz Mierzwa
f0dc85ad0b Pass storage implementation as an argument
Instead of assuming that window.localStorage is always used pass it via arguments
2017-08-11 16:40:29 -07:00
Łukasz Mierzwa
6809733346 Add history tests 2017-08-11 16:40:29 -07:00
Łukasz Mierzwa
4bb14312ff Mock local storage when running tests 2017-08-11 16:40:29 -07:00
Łukasz Mierzwa
ea62db3c2f Save filters usage history to local storage and provide a dropdown menu to access it
This allows to quickly select recently used filters from a dropdown. It also shows default (configured by unsee admin) filter and the saved one (saved by the user to a cookie)
2017-08-11 16:40:27 -07:00
Łukasz Mierzwa
d8efb97f97 Provide .less style for bootstrap-tagsinput
We use flatly theme for bootstrap while bootstrap-tagsinput bundles a css file that follow vanilla style, create a less version and use it instead of the css one bundles with bootstrap-tagsinput.
typeahead.js allows to customize class names used for UI elements, but bootstrap-tagsinput doesn't support passing that and is no longer maintained, so we need to follow default typeahead.js classes.
2017-08-10 16:53:30 -07:00
Łukasz Mierzwa
55c722773a Resume auto-refresh on backspace
Right now if user starts typing & then starts pressing backspace we pause but never resume, because stopping pressing backspace is ignored when resuming.
2017-08-08 12:03:33 -07:00
Łukasz Mierzwa
937f12e5e0 Update jquery.typing to 0.3.2 2017-08-08 11:57:38 -07:00
Łukasz Mierzwa
bea01196b3 Add more watchdog tests 2017-08-02 20:58:05 -07:00
Łukasz Mierzwa
ae5f0e39ae remove dead code from templates.test.js 2017-08-02 20:57:24 -07:00
Łukasz Mierzwa
90646a3727 Fix is-in-viewport mock to return true 2017-08-02 20:11:32 -07:00
Łukasz Mierzwa
eb21642103 Add reload tests 2017-07-30 21:35:01 -07:00
Łukasz Mierzwa
b6d5a5614e Run end-to-end tests for unsee.js
This will allow to test entire alerts flow - get alerts.json response (via mocks) and render alerts
2017-07-30 21:08:11 -07:00
Łukasz Mierzwa
2020099987 Mock templates so we actually load and parse all of them 2017-07-30 20:18:32 -07:00
Łukasz Mierzwa
bd249e4c02 Proper behaviour tests for ui.js
Checks whenever code does what it suppose to, not only if it runs
2017-07-30 17:25:10 -07:00
Łukasz Mierzwa
558ace10fc More coverage in the ui.js module tests 2017-07-30 15:53:28 -07:00
Łukasz Mierzwa
f6078d9f1f Add proper counter.js tests 2017-07-29 23:14:42 -07:00
Łukasz Mierzwa
3eb1e0cafd Test color.merge() 2017-07-29 16:57:36 -07:00
Łukasz Mierzwa
89223e8fbd Move all imports to head to avoid unstyled html on load 2017-07-29 16:26:28 -07:00
Łukasz Mierzwa
f202232be8 Version all bundles
This will tell webpack to add a hash to all bundles filenames, we generate script tags for loading those and inject them as templates. No more forced cache bypassing
2017-07-29 16:19:48 -07:00
Łukasz Mierzwa
91b55faf90 Drop old assets Makefile
No longer needed since webpack handles it now
2017-07-29 14:56:07 -07:00
Łukasz Mierzwa
566de0c347 Fix nprogress usage and styling 2017-07-29 14:43:51 -07:00
Łukasz Mierzwa
557c55dc64 Add a bundle for /help page 2017-07-29 14:22:55 -07:00
Łukasz Mierzwa
a694add079 Fix css selectors not firing with webpack 2017-07-29 13:54:14 -07:00
Łukasz Mierzwa
ca1081f461 Correctly bundle favicon.ico file 2017-07-29 13:52:55 -07:00
Łukasz Mierzwa
8f5c246297 Move to fully webpack managed assets 2017-07-29 13:52:07 -07:00
Łukasz Mierzwa
6105ae87d2 Get rid of last managed assets, everything is in webpack now 2017-07-29 13:51:29 -07:00
Łukasz Mierzwa
b08d203a04 Make is-in-viewport work with webpack 2017-07-29 13:50:55 -07:00
Łukasz Mierzwa
70296853c5 Add missing css imports 2017-07-29 13:50:18 -07:00
Łukasz Mierzwa
7f4ec13956 disable eslint check on circular function, for now 2017-07-29 13:49:46 -07:00
Łukasz Mierzwa
f8a60936a7 lru is now managed via npm 2017-07-29 13:49:43 -07:00
Łukasz Mierzwa
685c14303d Drop old managed js files 2017-07-29 13:49:03 -07:00
Łukasz Mierzwa
8fa80a944f update templates 2017-07-29 13:49:01 -07:00
Łukasz Mierzwa
5ec0340f1c Strict mode for js files, fix minor typos 2017-07-29 13:48:36 -07:00
Łukasz Mierzwa
fc0cc1c337 Fix remaining requires 2017-07-29 13:48:35 -07:00
Łukasz Mierzwa
17f1e2c811 Fix watchdog requires 2017-07-29 13:48:35 -07:00
Łukasz Mierzwa
e963a3fd6c Rewrite unsee.js as CommonJS, add basic test 2017-07-29 13:48:35 -07:00
Łukasz Mierzwa
15227f4256 Add missing require, add basic test 2017-07-29 13:48:35 -07:00
Łukasz Mierzwa
ccba7f66eb Rewrite silence.js as CommonJS, add basic test 2017-07-29 13:48:33 -07:00
Łukasz Mierzwa
2f4cd1bc9a Rewrite config.js as CommonJS and split options to dedicated file, add basic tests 2017-07-29 13:47:08 -07:00
Łukasz Mierzwa
0db288e5bf Rewrite alerts.js as CommonJS, add tests 2017-07-29 13:47:06 -07:00
Łukasz Mierzwa
b2f99902f7 Fix tests 2017-07-29 13:45:33 -07:00
Łukasz Mierzwa
3dd04eb5f2 Rewrire ui.js as CommonJS, add tests 2017-07-29 13:45:33 -07:00