Commit Graph

593 Commits

Author SHA1 Message Date
Ł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
8a5653e930 Merge pull request #172 from cloudflare/jest-coverage
Exclude jquery.typing from coverage reports in jest
2017-08-15 17:10:01 -07:00
Łukasz Mierzwa
11e661dd5b Exclude jquery.testing from coverage reports in jest 2017-08-15 09:59:53 -07:00
Łukasz Mierzwa
d80ea11d57 Merge pull request #174 from cloudflare/navbar-icons
Tweak history UI
2017-08-15 09:50:59 -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
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
71b686b05f Merge pull request #175 from cloudflare/history-filters
Don't reload filters until entire applyFilterList() block was completed
2017-08-15 09:46:37 -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
f7462b8892 Merge pull request #173 from cloudflare/npm-updates
Update eslint & webpack
2017-08-14 11:56:34 -07:00
Łukasz Mierzwa
4fa2959d7c Update eslint & webpack
Those are important so let's upgrade those early
2017-08-14 11:46:54 -07:00
Łukasz Mierzwa
070a95d3ff Merge pull request #158 from cloudflare/history
Save filters usage history to local storage and provide a dropdown me…
2017-08-14 11:44:26 -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
53f4168891 Merge pull request #171 from cloudflare/include-labels
Implement KEEP_LABELS option
2017-08-11 12:33:38 -07:00
Łukasz Mierzwa
3608ccba21 Strip labels in dedup, not on pull
Strippling labels should be done after alerts are deduplicated, when user requests some alerts with a filter, not during data collection from Alertmanager. When labels are stripped before dedup then they are merged into one, because labels are needed to calculate uniqueness, which means we will return wrong data
2017-08-11 12:28:02 -07:00
Łukasz Mierzwa
d1d4a85409 Add a test for total number of alerts we get from mock, should be 24 2017-08-11 12:28:02 -07:00
Łukasz Mierzwa
549ff9eefd Add KEEP_LABELS option for whitelisting labels
This allows to provide a list of labels that are the only labels allowed in the UI, reversing the logic of STRIP_LABELS.
Fixes #170
2017-08-11 12:28:02 -07:00
Łukasz Mierzwa
067bd2e645 Merge pull request #157 from cloudflare/fix-ac-ccs
Fix autocomplete dropdown selection color
2017-08-11 12:24:50 -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
add00dab12 Merge pull request #168 from cloudflare/fix-docker-hub
Docker Hub doesn't support build stages yet
2017-08-10 15:18:09 -07:00
Łukasz Mierzwa
98c0c8706a Docker Hub doesn't support multi-stage builds yet
https://github.com/docker/hub-feedback/issues/1039
2017-08-09 12:13:02 -07:00
Łukasz Mierzwa
f3f13bac89 Merge pull request #166 from cloudflare/fix-docker
Fix failing docker builds
2017-08-09 11:34:05 -07:00
Łukasz Mierzwa
fe29b4b28b Update docs to remove go install instructions 2017-08-09 11:24:08 -07:00
Łukasz Mierzwa
971d48f3d7 Use make targets in the dockerfile
By dropping vendor & bindata.go from git unsee is no longer go installable, and realistically it won't be, because the build pipeline is big and involves multiple tools.
Let's just use make targets we use for development when building docker image.
2017-08-09 11:24:08 -07:00
Łukasz Mierzwa
016f54e63c Merge pull request #163 from cloudflare/npm-install-linux
Drop fsevents from package-lock.json
2017-08-09 11:15:59 -07:00
Łukasz Mierzwa
036cb7e500 Drop fsevents from package-lock.json
This dependency was added to package-lock.json because npm install was initially run on MacOS and that package only works there. It spams CI jobs with warnings and keeps changing package-lock.json when developing on linux, MacOS builds should be fixed not to add it
2017-08-09 09:42:43 -07:00
Łukasz Mierzwa
a181807822 Merge pull request #165 from cloudflare/source-maps
Enable source map generation in UglifyJsPlugin
2017-08-08 14:20:13 -07:00
Łukasz Mierzwa
d5a5425dc5 Enable source map generation in UglifyJsPlugin
Looks like it was disabled at some point and depending on the version of webpack it's enabled by default or not:
https://github.com/webpack/webpack/issues/2704#issuecomment-228860162

So it was working with 3.3.0 but now fails with 3.4.1, this PR fixes it
2017-08-08 14:05:32 -07:00
Łukasz Mierzwa
e440af8070 Merge pull request #164 from cloudflare/ignore-bindata
Remove bindata_assetfs.go from git
2017-08-08 14:00:05 -07:00
Łukasz Mierzwa
d8ce9f9710 Remove bindata_assetfs.go from git
Maintaining this file as part of git tree isn't great, it's not really possible to review changes to it, let's just build it locally, especially that we've added webpack that also builds all assets and it's the files generated by webpack that we now compile into bindata_assetfs.go
2017-08-08 12:19:01 -07:00
Łukasz Mierzwa
31feb0c3d7 Merge pull request #159 from cloudflare/jquery-typing
Jquery typing update
2017-08-08 12:06:48 -07:00
Łukasz Mierzwa
1b657c42ce Update git ignore file 2017-08-08 12:03:33 -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
4c5fc4870f Merge pull request #162 from cloudflare/gzip
Use gzip middlerware to compress responses if client can accept compr…
2017-08-08 11:31:47 -07:00
Łukasz Mierzwa
38339c887e Use gzip middlerware to compress responses if client can accept compressed content
Some alert.json responses are going to be big, compress it to save bandwidth
2017-08-08 11:28:17 -07:00
Łukasz Mierzwa
7d1f40ef44 Merge pull request #161 from cloudflare/js-source-maps
Enable source map generation in webpack
2017-08-08 11:26:54 -07:00
Łukasz Mierzwa
404cc47f5f Enable source map generation in webpack
JS files are minified, enabling source map generation will help with debugging. Sentry can also use source maps for better exceptions.
2017-08-08 11:22:30 -07:00
Łukasz Mierzwa
987013d4ca Merge pull request #160 from cloudflare/webpack-prod
Automatically disable webpack production mode when NODE_ENV=test is set
2017-08-08 11:21:02 -07:00
Łukasz Mierzwa
c5bff9d062 Automatically disable webpack production mode when NODE_ENV=test is set
This will speed up local development and CI runs (5s vs 30s)
2017-08-08 11:16:07 -07:00
Łukasz Mierzwa
b0b7e94e86 Merge pull request #155 from cloudflare/cache-vendor
Stop committing vendor dir to git
2017-08-08 11:14:16 -07:00
Łukasz Mierzwa
558cbc737b Cache vendor dir on travis
This will avoid slow clones on CI
2017-08-08 11:01:29 -07:00