* Update synchronous actions in patchRules
This method was typed to accept actions, but it was not doing anything
with them. This was mainly a "bug by omission" so I'm simply adding
unit tests for regression purposes.
* Allow synchronous actions to be patched either individually or in bulk
Now that patchRules uses this field, we simply need to pass it.
Co-authored-by: Garrett Spong <spong@users.noreply.github.com>
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
LogPositionState doesn't always reevaluate the value of `endTimestamp`
when live stream is on. The [dependencies][1] for it to change rely on the
scroll position to update. If there's less than one scroll page or the
previous API call didn't return any entries, the `endTimestamp` would
not update.
We force `Date.now()` as an `endTimestamp` on the API call to ensure it
always gets the latest entries possible, regardless of the state. This
introduces some inconsistency that will be fixed once work beings on #65493.
[1]: fe4c164681/x-pack/plugins/infra/public/containers/logs/log_position/log_position_state.ts (L160-L173)
## Summary
Fixes a bug in timeline-based views, (e.g. the Host Events table), where a column would revert back to it's original position after being dragged and dropped to a new position.
Only timeline-based views were effected, not the timeline itself.
To reproduce:
1) On the SIEM Overview page, click the `View events` button
2) Drag and drop any column in the Events table to a new position
**Expected Result**
- The column is relocated to the position where it was dropped
**Actual Result**
- The column reverts to it's original position
## Testing
- This PR adds a Cypress test for this scenario
- The new test was successfully run (at least) 10 times via `node x-pack/plugins/siem/scripts/loop_cypress_tests.js`
- This fix was desk tested in:
- Chrome `83.0.4103.61`
- Firefox `76.0.1`
- Safari `13.1`
* [Maps] fix mapbox glyphs error when EMS access is turned off
* santize range parameter
* add api test
* clean up mapbox view
* add jest test for getGlyphsUrl
* add license file
* remove unneeded font files
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
Update the x-pack `createJestConfig` function to take the `rootDir` as an argument, which allows for easier overriding of the Jest configuration for a specific directory.
Previously we would run Jest in development from the x-pack directory by running something like:
```
node scripts/jest.js --testPathPattern=plugins/apm --watch
```
Currently (for me anyway) this is failing with:
```
Error: EMFILE: too many open files, watch
at FSEvent.FSWatcher._handle.onchange (internal/fs/watchers.js:123:28)
```
and it would sometimes not correctly test only the changed files when a change in APM was made. It was also difficult to configure correctly with the [VSCode Jest extension](https://marketplace.visualstudio.com/items?itemName=Orta.vscode-jest).
Add a jest.config.js for APM. This makes running with `--watch` better about which files it chooses to re-run and makes the VSCode extension work (including coverage mapping) with minimal configuration.
* [Lens] Warn if leaving with unsaved visualization
* Made confirmation logic more robust and add title
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
### Summary
- Updates exception list hooks to include filtering options and updates corresponding unit tests.
- Adds refreshList callback to hook that fetches the list and its items
- Updates hooks tests to test onError callback
- Updates tests to use type checking more effectively per feedback from @FrankHassanabad (thanks!)
* [Lens] Allow visualizations to provide a dimension editor
* Update to tab style
* Remove table update
* Update class name
* typecheck fix
* Add test
* Require each dimension group to enable editor
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
Co-authored-by: Marta Bondyra <marta.bondyra@elastic.co>
* call getArchiveInfo once first, pass paths to template
* pass paths to installPreBuiltTemplates
* pass paths to installILMPolicy
* pass paths to ingest pipeline creation
* use correct package key for cache
* pass paths to kibana assets
* cache other installed packages
* create function for ensuring packages are cached
* remove unused imports
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
* modifies 'Creates and activates a new custom rule' test to cover 'import query from saved timeline' functionality
* adds missing files
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
* WIP: Move routes to new API, license and other checks inbound
* Move license checks over to np licensing observable
* Fix license checks + remove older modules
* Fixing check_license tests, move to TS/Jest
* Fix licensing setup for mocks
* Move job.test.ts over to np
* WIP: move user checks to higher-order func
* Move more handler logic over to Response factory vs Boom
* Major refactor to consolidate types, remove facades, and udpate helpers
* Fix validation for dates in immediate exports
* Linter fix on check license test
* Fix job generation tests
* Move deps => setupDeps
* fix api test
* fix jobs test
* authorized_user_pre_routing and tests
* Fixing duplicate identifiers
* Fix licensing implementation changes
* WIP: Moving license over to async/observables
* Fix disabled-security case
* finish auth_user_pre_routing cleanup - no more license check
* WIP: Fixing final api tests
* Trying to get schema differences in alignment
* Reverting back to previous generation handler
* Fix final API tests
* Final API test fixes, few more hardening tests and better error messages
* Simplify lower-level module implementation (core only interface) + test updates
* Push some core logic into plugin
* Move some core logic up to plugin
* Marking private setupDeps + downstream fixes
* revert logger as a param
Co-authored-by: Timothy Sullivan <tsullivan@elastic.co>