* Updated test to use no hard coded waits which could be contributing to CI failures. Expect functions should be in the test file itself so I changed the page objects for page actions and extracted out the expect calls to the test files.
* Added retry within the test file to retry the assertion if it doesn't pass on the first attempt. Simplified the toggle function to just click the toggle.
* Fixed type check issue.
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
* Stub kpi component
* search strategy scheleton timeline KPI
* search strategy scheleton timeline KPI
* Add timeline kpis component and search strategy container
* Use getEmptyValue in timeline kpis
* Prevent request from being made for blank timeline properly
* Add kpi search strategy api integration test
* Add jest tests for timeline kpis
* Clear mocks in afterAll
* Decouple some tests from EUI structure
* Combine some selector calls, change types to be more appropriate
* Simplify hook logic
* Set loading and response on blank timeline
* Only render kpi component when query is active tab
* Use TimelineTabs enum for query tab string
Co-authored-by: Xavier Mouligneau <189600+XavierM@users.noreply.github.com>
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
* [Maps] migrate mvt routes to use data.search service instead of directly calling elasticsearch
* pass search session id to mvt requests
* move grid tile tests to integration tests
* replace getTile unit test with integration test
* add comment about request param
* revert total meta change
* tslint fixes
* update jest tests
## Summary
Adds e2e and unit tests for PR:
https://github.com/elastic/kibana/pull/89947
* Adds e2e tests for create_index
* Adds e2e tests for get_privileges
* Adds unit test for use_privilege_user
* Adds exhaustive switch for the roles in the e2e tests
* Adds some typescript barrel rolls for the .json scripts to make TypeScript a bit more readable when doing imports
* Fixes some of the types that were not matched up with the recent privilege endpoint
### Checklist
- [x] [Unit or functional tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html) were updated or added to match the most common scenarios
* Toast should only show once
* Handle any errors here gracefully
* Set this early to avoid failing test
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
* remove allow_no_indices param, adds a check if response has empty indices property then write error status with index patterns provided to rule
* fix tests
* fix tests and update with comments
* update integration tests
* adds integration test for when an index pattern doesn't exist the rule should fail and when one index pattern does exist but another does not, the rule should succeed
* Add API integration tests for data streams list, including one that is expected to fail due to reliance on number of backing indices
* Use ES data streams API as source of truth for list of data streams, and only query against backing indices afterwards
* Get package name from data stream meta info
* Increate retry timeout
* Move initial info requests inside Promise.all
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
* Add encodePathParam helper + update components that need it
- Primarily document URLs & analytics queries (which uses generateEnginePath)
* Add useDecodedParams helper + update components that need it
- Documents titles & Analytics queries
* [Misc] Change popout icon to eye
- Feedback from Davey - the pages don't open in a new window, so shouldn't use the popout icon
- Not strictly related but since we're touching these links anyway, I'm shoving it in (sorry)
* Remove document detail decode test
- now handled/tested by useDecodedParams helper
* Add new generateEncodedPath helper
- Should be used in place of generatePath
* Update all instances of generatePath to generateEncodedPath
for consistency across the App Search codebase
* Fix failing tests due to extra encodeURI() done by generatePath
* Add missing branch test for analytics query titles
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
* migrate file_upload plugin to maps_file_upload
* update plugins list
* migrate ml import endpoint
* migrate ml telemetry to file_upload plugin
* add fileUpload plugin to ml
* add TS project
* update ML to use file_upload endpoint
* move types to file_upload plugin
* ignore error
* clean up
* i18n clean-up
* remove schemas from ml
* remove usageCollection from ml
* node scripts/build_plugin_list_docs
* update telemety collector
* revert changes to ingestPipeline schema
* change name of TELEMETRY_DOC_ID to unique value
* remove ImportFile from ml/server/routes/apidoc.json
* fix typo in x=pack/tsconfig.json
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
When getting the start and end times, use the d3 time scale `ticks` function to round the start and end times.
Example from a query:
Before:
```json
{
"range": {
"@timestamp": {
"gte": 1611262874814,
"lte": 1611263774814,
"format": "epoch_millis"
}
}
},
```
After:
```json
{
"range": {
"@timestamp": {
"gte": 1611263040000,
"lte": 1611263880000,
"format": "epoch_millis"
}
}
},
```
The `ticks` function makes it so the amount of rounding is proportional to the size of the time range, so shorter time ranges will be rounded less.
Also fix a bug where invalid ranges in the query string were not handled correctly.
Fixes#84530.
* Adding dropdown for selecting different connector of same type
* Updating design
* Cleanup and i18n
* Adding functiional test
* Fixing unit test
* Fixing functional test
* Updating design
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
* chore(NA): allow yarn dependencies to be installed when using bazel to manage yarn deps
* chore(NA): remove unused flag
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
## Summary
Fixes error toaster on signals upgrades as well as creation of new signals if you have a user without a cluster manage privilege.
Simplest way to manually test both situations of a user on creating a new signal as well as upgrade is to first create a new role like so in dev tools:
```ts
PUT _security/role/reduced_permissions
{
"indices":[
{
"names":[
".siem-signals-*",
".lists-*",
".items-*"
],
"privileges":[
"all"
],
"field_security":{
"grant":[
"*"
]
},
"allow_restricted_indices":false
}
],
"applications":[
{
"application":"kibana-.kibana",
"privileges":[
"space_all"
],
"resources":[
"space:default"
]
}
]
}
```
You might have to change this line above to match what your `kibana.index` is set to if it is set:
```ts
"application" : "kibana-.kibana-hassanabad8",
```
Double check things in Stack Management to ensure you have access to at least default space:
<img width="1304" alt="Screen Shot 2021-02-01 at 5 45 54 PM" src="https://user-images.githubusercontent.com/1151048/106536383-906f3f00-64b5-11eb-97d3-060fa6f6206e.png">
Next add a user which has this role of `reduced_permissions` to login as that user. Next for testing that this causes an error toaster when there is no signals index is to either manually delete your signals index or change your `kibana.dev.yml` so that it thinks you have a new index:
```ts
xpack.securitySolution.signalsIndex: .siem-signals-some-new-index-name
```
Start up Kibana, login with the new user and visit any page and notice you get an error toaster like below:
<img width="808" alt="Screen Shot 2021-02-01 at 5 04 17 PM" src="https://user-images.githubusercontent.com/1151048/106535815-4afe4200-64b4-11eb-89b3-947b0e4ff7d5.png">
And also notice that you are blocked from viewing signals at this point:
<img width="1195" alt="Screen Shot 2021-02-01 at 5 04 43 PM" src="https://user-images.githubusercontent.com/1151048/106535835-56516d80-64b4-11eb-883c-2745b68843cf.png">
For upgrading signals manually, you can change the version number from dev tools or increment the number directly within this file and restart Kibana:
https://github.com/elastic/kibana/blob/master/x-pack/plugins/security_solution/server/lib/detection_engine/routes/index/get_signals_template.ts#L10
When you visit the detection page you will see the same error toaster and also be blocked. With this PR you will no longer be blocked.
### Checklist
Delete any items that are not applicable to this PR.
- [ ] [Unit or functional tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html) were updated or added to match the most common scenarios
* Add desired hover functionality and a test.
* Switch render from img to EuiImage for step view.
* Create new module for ping_timestamp. Extract a function. Add a test.
* Extract nav buttons, translations. Add tests.
* Fix a typo.
* Extract caption to own file. Add tests.
* Extract no image display to dedicated file. Add aria label. Add tests.
* Make import path more explicit.
* Move step image popover to dedicated file. Add tests.
* Clean up inline code in timestamp component.
* Explicit var names.
* Simplicity.
* Fix refactoring issues in test files.
* Move translations to central file.
* Rename test for better accuracy.