* Set up promoted & hidden documents logic
* Set up result utility for converting CurationResult to Result
* Set up AddResultButton in documents sections
- not hooked up to anything right now, but will be in the next PR
* Add HiddenDocuments section
* Add PromotedDocuments section w/ draggable results
* Update OrganicDocuments results with promote/hide actions
* Add the Restore Defaults button+logic
* PR feedback: key ID
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
* Adding .only clause for testing purposes.
* Removing .only and reenabling test. Also changing back to group 13.
* Removing .only and reenabling test. Also changing back to group 13.
* Removed comment mentioning github issue.
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
This PR addresses an issue where the confirmation modal when removing a content source connector was brokedn. The issue was that the component was not passed the props to render correctly
* Replace custom margin style with EuiFlexGroup gutter
* Replace custom padding style with EuiFlexGroup gutter
* Remove custom wrapper around Loading on Overview page (alpha)
* Replace custom range value output with EuiRange's showInput prop
* Remove custom style
I'll refer the correct handling of this to design pass
* Remove "euiPanel--inset" className, as it doesn't do anything in Amsterdam theme
* Remove unused className `euiPanel--noShadow`
We're already using hasShadow={false} prop that does the same
* Remove `euiPanel--outline` className, as it doesn't do anything in Amsterdam theme
* Inline classNames declaration with the goal to remove them later
They don't do anything in Amsterdam theme, but I'm not removing them to keep context for design pass.
* Remove `eui-textNoWrap` className from buttons, as it's already included in button styles
* Remove classNames with no styles attached
* Replace custom padding in content_section with EuiSpacer
* Remove source-row styles
Most of the classNames were redundant and not needed anymore. The ones that were actually used were either replaced with EUI props or deleted, so we could apply EUI styles during design pass.
* Replace source_icon styles with EUI components and props
* Replace source-card icon styles with EUI prop
* Remove className declarations with no styles attached to classes
* Fix tests
* Increase space between source overview panels
* Use smaller icons on source prioritization and connectors pages
* Invert SourceIcon default size and size provided via props
The default size was "xxl", now it's "m". "m" size is default in EUI, so it's more consistent.
* Get rid of as horizontal spacer
* Validation for the Reporting UI Setting Custom Logo
* add more validations
* check if image is too large
* fix i18n
* clean redundant
* large test strings not necessary
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
* use index patterns and search services for autocomplete
* imports
* extend DataRequestHandlerContext
* Catch error if index patterns service can't be created.
* doc
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
* migrate optimizer mixin to core apps
* fix core_app tests
* add integration tests, extract selectCompressedFile
* add CoreApp unit test
* more unit tests
* unit tests for bundle_route
* more unit tests
* remove /src/optimize/ from codeowners
* fix case
* NIT
* Replace EuiCodeBlock with JsonCodeEditor in DiscoverGrid
* Add optional "hasLineNumbers" property to JsonCodeEditor and removed line numbers from the popover
* Update json_code_editor snapshot
* Add functional test for cell expanded content popover
* Remove unused code
* Fix geo point case and refactor some code
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
- To make use of the docsLinks service which is only usable in client side code, Anomaly Detection's validation messages are not fully returned from the server anymore. Instead just the message ID and necessary metadata to parse the message template gets returned.
- getMessages() no longer uses inline hard coded documentation links but picks links from the docsLinks service.
- The code that rendered the messages originally on the server has been move to a function parseMessages() which can now be used on the client side and accepts the docsLinks services to get URLs to documentation from it.
- This means we no longer need to get the current version/branch information for the server side code.
- Tests have been updated to reflect the changes: API integration tests only check for the now reduced messages containing only message IDs and metadata. The expected results of the API integration tests are used as mocks for the client side function parseMessages(), this allows use to cover the same code and messages as previously.
### Summary
In preparation for moving all the exceptions UI components into the lists plugin adds some linting, adds the lists plugin to the i18n config and adds storybook support. Tried to add a bit stricter linting than exists in the security solution right now, rules that we've talked about wanting to enable.
## Problem
While working on changes for bulk reassign https://github.com/elastic/kibana/issues/90437, I found that the server has a runtime error and returns a 500 if given an invalid or missing id.
<details><summary>server error stack trace</summary>
```
│ proc [kibana] server log [12:21:48.953] [error][fleet][plugins] TypeError: Cannot read property 'policy_revision_idx' of undefined
│ proc [kibana] at map (/Users/jfsiii/work/kibana/x-pack/plugins/fleet/server/services/agents/helpers.ts:15:34)
│ proc [kibana] at Array.map (<anonymous>)
│ proc [kibana] at getAgents (/Users/jfsiii/work/kibana/x-pack/plugins/fleet/server/services/agents/crud.ts:191:32)
│ proc [kibana] at runMicrotasks (<anonymous>)
│ proc [kibana] at processTicksAndRejections (internal/process/task_queues.js:93:5)
│ proc [kibana] at Object.reassignAgents (/Users/jfsiii/work/kibana/x-pack/plugins/fleet/server/services/agents/reassign.ts:91:9)
│ proc [kibana] at postBulkAgentsReassignHandler (/Users/jfsiii/work/kibana/x-pack/plugins/fleet/server/routes/agent/handlers.ts:314:21)
│ proc [kibana] at Router.handle (/Users/jfsiii/work/kibana/src/core/server/http/router/router.ts:272:30)
│ proc [kibana] at handler (/Users/jfsiii/work/kibana/src/core/server/http/router/router.ts:227:11)
│ proc [kibana] at exports.Manager.execute (/Users/jfsiii/work/kibana/node_modules/@hapi/hapi/lib/toolkit.js:60:28)
│ proc [kibana] at Object.internals.handler (/Users/jfsiii/work/kibana/node_modules/@hapi/hapi/lib/handler.js:46:20)
│ proc [kibana] at exports.execute (/Users/jfsiii/work/kibana/node_modules/@hapi/hapi/lib/handler.js:31:20)
│ proc [kibana] at Request._lifecycle (/Users/jfsiii/work/kibana/node_modules/@hapi/hapi/lib/request.js:370:32)
│ proc [kibana] at Request._execute (/Users/jfsiii/work/kibana/node_modules/@hapi/hapi/lib/request.js:279:9)
```
</details>
<details><summary>see test added in this PR fail on master</summary>
```
1) Fleet Endpoints
reassign agent(s)
bulk reassign agents
should allow to reassign multiple agents by id -- some invalid:
Error: expected 200 "OK", got 500 "Internal Server Error"
```
</details>
## Root cause
Debugging runtime error in `searchHitToAgent` found some TS type mismatches for the ES values being returned. Perhaps from one or more of the recent changes to ES client & Fleet Server. Based on `test:jest` and `test:ftr`, it appears the possible types are `GetResponse` or `SearchResponse`, instead of only an `ESSearchHit`.
https://github.com/elastic/kibana/pull/94632/files#diff-254d0f427979efc3b442f78762302eb28fb9c8857df68ea04f8d411e052f939cL11
While a `.search` result will include return matched values, a `.get` or `.mget` will return a row for each input and a `found: boolean`. e.g. `{ _id: "does-not-exist", found: false }`. The error occurs when [`searchHitToAgent`](1702cf98f0/x-pack/plugins/fleet/server/services/agents/helpers.ts (L11)) is run on a get miss instead of a search hit.
## PR Changes
* Added a test to ensure it doesn't fail if invalid or missing IDs are given
* Moved the `bulk_reassign` tests to their own test section
* Filter out any missing results before calling `searchHitToAgent`, to match current behavior
* Consolidate repeated arguments into and code for getting agents into single [function](https://github.com/elastic/kibana/pull/94632/files#diff-f7377ed9ad56eaa8ea188b64e957e771ccc7a7652fd1eaf44251c25b930f8448R70-R87): and [TS type](https://github.com/elastic/kibana/pull/94632/files#diff-f7377ed9ad56eaa8ea188b64e957e771ccc7a7652fd1eaf44251c25b930f8448R61-R68)
* Rename some agent service functions to be more explicit (IMO) but behavior maintained. Same API names exported.
This moves toward the "one result (success or error) per given id" approach for https://github.com/elastic/kibana/issues/90437
### 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
## Summary
Cleanup ..
* Removes commented out old linter rules from 2+ years ago. The project is very large and a lot of people are in the code base now and the comments are not relevant.
* Removes ts config optimize we don't use anymore
* Removes old script for rules we don't use anymore with elastic searches.
* Add engines mock and fix mock role mapping
The original asRoleMapping was merely for a smoke test in the shared component. Refactored to work better in App Search component
* Add RoleMappingsLogic
* Fix test description
Co-authored-by: Jason Stoltzfus <jastoltz24@gmail.com>
* Fix test description
Co-authored-by: Jason Stoltzfus <jastoltz24@gmail.com>
* Add flash messages when creating, updating or deleting
* Add path and resetState calls
Refactoring the tests showed me that some parts of the state weren’t being reset.
* Refactor handleAuthProviderChange logic
I some how got the test coverage at 100% with my wrong way of doing tests before (scary). When I fixed it I noticed that noting I could do would trigger the fallback of just returning the `[ANY_AUTH_PROVIDER]` array. After talking with Constance, we could not come up with a way to trigger it either, given the conditions.
She had suggested removing the first return statement but that caused an empty array being returned sometimes.
Ultimately, I was able to get it working and covered with these changes.
* Refactor tests per PR feedback
The places where `role: 'superuser’` was deleted in the listeners was a side effect of using `setRoleMappingData` and not `mount`
* Add back deleted assertion
* Copy nit
Co-authored-by: Constance <constancecchen@users.noreply.github.com>
Co-authored-by: Jason Stoltzfus <jastoltz24@gmail.com>
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
Co-authored-by: Constance <constancecchen@users.noreply.github.com>
* [Connectors UI] Make UI use new connector APIs
* fixed tests
* fixed due to comment
* fixed due to comment
* fixed test
* fixed test
* fixed test
* moved rewrite_request_case to the common folder
* fixed due to comments
* [Reporting-CSV Export] Re-write CSV Export using SearchSource
* replace PIT solution with scan-and-scroll
* update tests
* cleanup
* simplify pr
* update docs
* update docs
* update telemetry schema
* use getSearchRequestBody instead of flatten
* Revert "update docs"
This reverts commit ab9f4d9642.
* optimize some async calls
* cleanup
* --wip-- [skip ci]
* fix telemetry schema
* fix telemetry tests
* fix snapshot
* api docs
* api doc updates
* use import type
* format the data through chains of maps
* add another saved search to reporting/ecommerce_kibana
* add a failing test
* add error logging to query failures
* put clear scroll in a finally so the ES error can be captured
* log dat error
* set dat fieldsFromSource
* --wip-- [skip ci]
* Revert "add another saved search to reporting/ecommerce_kibana"
This reverts commit 6edf26eff2.
* functional test fixes
* clean up ecommerce test archive
* add test for new search with fieldsFromSource set
* add tests and refactor tests
* cleanup redundant conditionals
* add GenerateCsv.getFields
* fix some tests
* fix double-escaping
* fix test snapshots and refactoring
* fix other tests
* fix test
* fix default index pattern in functional tests
* fix ts and sort fields when they come from API response
* --wip-- [skip ci]
* fix formatting and increase maxSizeBytes for testing
* remove client-side logic for sanitizing fields
* do not prepend timefield name if it already is a column
* test the logic to prepend timeField
* test the logic to sort the fields
* fix functional test
* preserve the error from data.search
* add functional test for ES returning an error
* fix snapshot
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
* XY Axis, integrate legend color picker with the eui palette
* Fix functional test to work with the eui palette
* Order eui colors by group
* Add unit test for use color picker
* Add useMemo to getColorPicker
* Remove the grey background from the first focused circle
* Fix bug caused by comparing lowercase with uppercase characters
* Fix bug on complimentary palette
* Fix CI
* fix linter
* Use uppercase for hex color
* Use eui variable instead
* Changes on charts.json
* Make the color picker accessible
* Fix ci and tests
* Allow keyboard navigation
* Close the popover on mouse click event
* Fix ci
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>