Commit Graph

166 Commits

Author SHA1 Message Date
Łukasz Mierzwa
a8c158963d Trim very long history menu items
If there's a very long menu item entry we should trim it
2017-09-07 12:22:41 -07:00
Łukasz Mierzwa
5d0366a743 Redraw alert grid after annotations visibility toggle
Alert group needs more space after expanding, so we need to redraw everything.
2017-09-07 12:15:32 -07:00
Łukasz Mierzwa
843eb80060 Add button to toggle annotation visibility
If user make annotation hidden by default, then render a button that allows to show it per label
2017-09-07 12:15:32 -07:00
Łukasz Mierzwa
c7442c3adf Linkify URLs in the annotation
use linkifyjs to make all URLs in the annotation clickable, but since it requires us to stop escaping html when rendering annotation object let's first manually escape it to prevent rogue alerts with malicious annotations from executing <scripts> and other ugly things in user browsers
2017-08-18 12:09:35 -07:00
Łukasz Mierzwa
3124049c5a Fix wrong status in error
Doesn't matter for test result, but should be error since we return 500
2017-08-17 19:42:08 -07:00
Łukasz Mierzwa
f96cafca7b Test creating silences 2017-08-17 19:42:08 -07:00
Łukasz Mierzwa
ac8b3391d7 Re-use ajax mocks instead of creating one per response 2017-08-15 20:22:57 -07:00
Łukasz Mierzwa
866797cc42 Add more silence.js tests 2017-08-15 20:20:35 -07:00
Łukasz Mierzwa
431540c05e Add a test case for error handling when unsilence request fails 2017-08-15 19:53:26 -07:00
Łukasz Mierzwa
77ec8d9a8b Use correct icon
Tests are failing because we're not cleaning icons properly
2017-08-15 19:45:00 -07:00
Łukasz Mierzwa
ecf14e7633 Add a test for unsilence button 2017-08-15 19:43:49 -07:00
Łukasz Mierzwa
c6e91c658e Update test snapshots
Rendered HTML changed, so tests need updating
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
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
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