* [TSVB] Allow custom label for fields via index pattern field management
Closes: #84336
* replace saveObject, elasticsearch client to new one
* fix CI
* update schema
* fix Top Hit
* some changes
* partially move getting fields into client side
* fix PR comments
* fix issue with getting fields
* move SanitizedFieldType to common types
* fix issue on changing index pattern
* fix issue
* fix regression
* some work
* remove extractFieldName, createCustomLabelSelectHandler
* request/response processors should be async
* some work
* remove tests for createCustomLabelSelectHandler
* fix table
* fix placeholder
* some work
* fix jest
* fix CI
* fix label for table view
* test: visualize app visual builder switch index patterns should be able to switch between index patterns
* fix functional tests
* fix sorting
* fix labels for entire timerange mode
* add createFieldsFetcher method
* table view - fix pivot label
* fix PR comments
* fix issue with selecting buckets scripts
* fix types
* Update create_select_handler.test.ts
* fix PR comments
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
## [Security Solution] Accessibility (a11y) fixes
This PR fixes the following accessibility (a11y) issues:
- Fixes an issue that prevented tabbing through all elements on pages with embedded Timelines
- Fixes an issue where the Timeline data providers popover menu was not displayed when Enter is pressed
- Fixes an issue where duplicate draggable IDs caused errors when re-arranging Timeline columns
- Fixes an issue where Timeline columns could not be removed or sorted via keyboard
- Fixes an issue where focus is not restored to the `Customize Columns` button when the `Reset` button is pressed
- Fixes an issue where filtering the `Customize Event Renderers` view via the input cleared selected entries
- Fixes an issue where the active timeline button wasn't focused when Timeline is closed
- Fixes an issue where the `(+)` Create / Open Timeline button's hover panel didn't own focus
* add additional component test helpers
* add test examples
* uptime testing utils remove custom prefix from props and parameter options
* skip executed step tests
* adjust MlJobLink test
* add testing util interfaces
* update mock core
* combine wrappers into one custom render function
* split enzyme helpers and rtl helpers into different files and adjust types
* adjust types
* spread core on render function
* remove unnecessary items from MLJobLink test
* update use_monitor_breadcrumbs test
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
* [Security Solution] Fix sorting on unmapped fields in Timeline Events table
* set unmapped_type to the column type
* add missing types
* Update saved_object_mappings.ts
Co-authored-by: Xavier Mouligneau <189600+XavierM@users.noreply.github.com>
* DRY out repeated DOCUMENTS_TITLE
* Move temporary title const's in engine folder to their own respective folders
- might as well get it set up early + prevents us from forgetting to clean this up later
* Update engine nav & engine router files
* uptime waterfall enable timings for static files by leveraging total time
* update cases for when their is no waterfall timing available
* add showTooltip propertier to WaterfallDataSeriesConfigProperties
* remove content downloading from the legend
* add mime type to content downloading label
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
* [maps] abort sync data if any data request fails
* review feedback
* fix broken rename of e to error
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
Adds additional polling stats to Task Manager monitoring:
- **duration**: Running average of polling duration measuring the time from the scheduled polling cycle start until all claimed tasks are marked as running
- **claim_conflicts**: Running average of number of version clashes caused by the markAvailableTasksAsClaimed stage of the polling cycle
- **claim_mismatches**: Running average of mismatch between the number of tasks updated by the markAvailableTasksAsClaimed stage of the polling cycle and the number of docs found by the sweepForClaimedTasks stage
- **load** - Running average of the percentage of workers in use at the end of each polling cycle.
* getPackageFromSource to use package storage
* fix type
* use bulkGet
* add data streams and policy templates to package info from storage
* fix merge conflict
* comment out policy_templates for now
* add policy_templates to package info, remove required inputs from parseAndVerifyPolicyTemplates
* add storage assets to cache
* tidy up
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
* Monitor ids
* import fix
* solve circular dep
* eslint
* mock circular dep
* max retries test
* mock circular dep
* test
* jest <(-:C
* jestttttt
* [data.search] Move search method inside session service and add tests
* merge
* Move background session service to data_enhanced plugin
* Better logs
Save IDs only in monitoring loop
* Fix types
* Space aware session service
* ts
* initial
* initial
* Fix session service saving
* merge fix
* stable stringify
* INMEM_MAX_SESSIONS
* INMEM_MAX_SESSIONS
* use the status API
* Move task scheduling behind a feature flag
* Update x-pack/plugins/data_enhanced/server/search/session/session_service.ts
Co-authored-by: Anton Dosov <dosantappdev@gmail.com>
* Add unit tests
* Update x-pack/plugins/data_enhanced/server/search/session/session_service.ts
Co-authored-by: Anton Dosov <dosantappdev@gmail.com>
* Use setTimeout to schedule monitoring steps
* Update request_utils.ts
* settimeout
* tiny cleanup
* Core review + use client.asyncSearch.status
* update ts
* fix unit test
* code review fixes
* Save individual search errors on SO
* Don't re-fetch completed or errored searches
* Rename Background Sessions to Search Sessions (with a send to background action)
* doc
* doc
* jest fun
* rename rfc
* translations
* merge fix
* merge fix
* code review
* update so name in features
* Move deleteTaskIfItExists to task manager
* task_manager to ts project
* Move deleteTaskIfItExists to public contract
* mock
* use task store
* ts
* code review
* code review + jest
* Alerting code review
Co-authored-by: Lukas Olson <olson.lukas@gmail.com>
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
Co-authored-by: Anton Dosov <dosantappdev@gmail.com>
Co-authored-by: restrry <restrry@gmail.com>
* Remove tabs from details page
* update
* fix monitord id
* var name
* add Uptime PageHeader tests to test for the presences of tabs or header
* add Uptime MonitorPageTitle test
* Uptime adjust auto generated monitor id regex
* Uptime add tests for MonitorPageTitle to test behavior for missing monitor names and auto generated monitor ids
* remove history from MonitorPageTitle test
* adjust uptime tabs tests
* adjust MonitorPageTitle tests to mock useSelector
* adjust uptime PageHeader tests
* adjust import order in page_header.test
* add props to Uptime PageHeader to determine render, rather than route context
* alphabetize props in Uptime PageHeader
* remove header from individual pages
* add indepdent page header route that matches all paths
* adjust monitor tests to use mockReduxHooks helper, and add mockReactRouterDomHooks
* update tests
* adjust header spacing
Co-authored-by: Shahzad <shahzad31comp@gmail.com>
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
## Summary
Addresses issue 87112 .
With the addition of the exceptions table, users were able to now delete exception lists from the UI. However, the "endpoint_list" is particular in some ways and should not be so easily deleted from the UI. Moved to disable the delete button for "endpoint_list exception list.
* [Lens] Transition between functions involving references
* Organize transition cases and cover all the basic transitions
* Add functional test
* Change logic for displaying valid transitions
* Show valid transitions more accurately
* Fix transition to only consider valid outputs
* Update test names and style
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
* [Maps] labels for polygons and lines
* remove x-pack yarn.lock
* add labels to choropleth map wizard
* clean up comment
* add mvt tile support
* only add centroids if there may be lines or polygons
* tslint
* tslint
* do not add centroid to too many features polygon
* update get_tile expect statements
* move turf dependencies from devDependencies to dependencies
* update jest snapshot and functional test expects
* fix functional test expect
* another functional test expect update
* functional test updates
* expect
* pew pew source expect updates
* update joins expect
* update mapbox style expects
* update join visibility expects for geocentroids
* update join visibility expects for geocentroids
* another functional test expect update
* review feedback
* update yarn.lock
* tslint
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
* [Maps] fix multi-select query from Controls visualization not always getting applied to map in dashboard
* fix underlying problem in blended layer
* clean-up
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
* chore(NA): move server and common from monitoring out of the __tests__ folder
* chore(NA): move monitoring public out of __tests__ folder
* chore(NA): add missing skip on test
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
* Rename Background Sessions to Search Sessions (with a send to background action)
* doc
* doc
* jest fun
* rename rfc
* translations
* update so name in features
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
* Replaced single invalidateApiKey request with the bulk
* fixed failing test
* Extended invalidate method to support multiple invalidation. Updated fleets plugin usage of this API.
* fixed due to comments
* [Transform] retrieve mappings from the source index
* [Transform] fix preview for nested props
* [Transform] exclude meta fields
* [Transform] use agg config to only suggest term agg supported fields
* [Transform] refactor
* [Transform] remove incorrect data mock
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
* [Reporting] set viewport to include clip area
* remove getViewport
* fix tests
* simpler
* fix 1
* revert
* hacks
* scope the logging variables
* polish
* hacky fix
* quieter logging
* make less hacky
* fix functional test
* revert lowering log level of browser console messages
* revise comments
* setViewport only to happen once
* fix snapshot of layout type tests
* fix comment text
* Revert "setViewport only to happen once"
This reverts commit 15977f9db4.
* fix disgusting bug
* use x/y ordering for width/height
* fix fn test snapshots
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
* Showing all broken connectors and updating all matching broken connectors on new connector create
* Adding unit test
* Adding functional test
* Fixing functional test
* Simplifying logic
* Fixing functional test
* Fixing functional test
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
Added the following values to the Polling stats:
- **NoAvailableWorkers**: This tells us when a polling cycle resulted in no tasks being claimed due to there being no available workers
- **RunningAtCapacity**: This tells us when a polling cycle resulted in tasks being claimed at 100% capacity of the available workers
- **Failed**: This tells us when the poller failed to claim
* [Maps] term join limit
* update region map migration to set size
* display size in join expression
* tslint
* update jest snapshots
* remove default size and just default to max buckets
* add size to sourceMeta so join data is re-requested on size change
* tslint
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
* Replace favicons
* update build process to swap favion version
* Replace favicons with built, branded version at build time
* update snapshot
* Addressing feedback
## Summary
This PR introduces the following changes. If the user has insufficient write privileges on the signals index:
- we disable the status-changing actions on detection alerts ("Open alert", "Close Alert", "Mark in progress") in the context menu of an alert in alerts table
- we make sure to show the corresponding callout that tells about read-only access to detection alerts
- in the callout we provide links to docs for understanding why/how to fix
* Re-enable test skipped due to temporary failure
This failure may still be present/intermittent, but it passes reliably
locally; trying again on CI to check status.
* Triggering build
This should fail on the latest snapshot
* Update EQL integration tests to reflect new default pipe
We were previously using what is effectively `results | head` to
retrieve the desired amount of results. The default behavior was changed
in elastic/elasticsearch#66387, which caused these tests to fail as
different results were returned over such a large dataset.
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
* Alert and Connector flyouts Save and Save&Test buttons should be active by default.
* fixed typechecks
* fixed typechecks
* refactored repeted code
* fixed typechecks
* fixed typechecks
* fixed typechecks
* fixed due to comments
* fixed failing tests
* fixed due to comments
* fixed due to comments
* fixed due to comments
* fixed typescript checks
This PR tightens the typing on the Alerting framework's `AlertType` and its deeper typing around `AlertServices ` and `AlertExecutorOptions`.
This ensures the following:
1. It's now impossible<sup>✴</sup> to schedule actions on any ActionGroup other than the groups specified on the AlertType (including the Recovery group)
2. It's now impossible<sup>✴</sup> to schedule actions with incorrect `InstanceState` or `InstanceContext`
✴ Unless they bypass the Typescript typing, which is an explicit choice to bypass type safety
* Removed skip test for delete all alerts integration test
* fixed typechecks
* reduced nuber of selected alert to delete to a single one
* fixed due to comments
* removed long timing retry
* fixed typechecks
* fixed failing tests
### Summary
This PR concentrates on fixing the deletion on the exceptions list table view. This fix is intermediary and a more thorough, backend solution is needed. Currently, if you delete an exception list, it deletes the exception list SO, but does not remove references to it from rules. This PR allows for a quick fix conducting this logic client side.
* uptime only render ping status code badge when status code is available
* uptime update ResponseCodeColumn error state
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
* Var rename
- so it doesn't sound negative or like a bug, but is instead an anticipated load/use case
- remove unncessary function
- move declaration down to right before it's used
* [Proposal] Other misc cleanup
- Rename engineNameParam to engineNameFromUrl to make reading flow a little bit more nicely + hopefully make the var source a bit clearer
- Change other references back to engineName for simplicity (they should really only be running after engineName has already been set, so there shouldn't be any race conditions there - moving engineBreadcrumb to after Loading should also solve that)
* Remove comment
We aren’t going to use icons like we have in ent-search
* Add new constant
* Use constant instead of inline i18n
* Add link to top bar
The external href to sources will be changed once that component is built
* Remove link from sidebar
* Update i18n translation key names
CI was failing and this should fix it
* Alphabetize items
* making transaction type required on some apis
* addressing PR comments
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
* uptime add title to waterfall sidebar truncated text
* Uptime add tooltip and screen reader only text to MiddleTruncatedText
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
* Initial EMS integration test
* Convert to TS
* extra cleanup and comments
* Removed common page objects
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
* Fixed responsive state when opening the menu
* Update x-pack/plugins/apm/public/components/app/Settings/index.tsx
Co-authored-by: Cauê Marcondes <55978943+cauemarcondes@users.noreply.github.com>
* Update/refactor some cypress documentation
* Fixes some whitespace/grammar/typos
* Condenses the explanation/instructions for the different modes of
execution
* Condense Artifacts section
This is a big sprawling file; trying to cut down on the noise.
* Move test-running section to top of README
This is going to be what 90% of readers are looking for, methinks.
* Adds Security Solution's cypress suite to x-pack testing README
* Fix broken link
This file was moved as part of #64368.
* Remove broken link
This file was deleted in #67138.
* Apply suggestions from code review
Co-authored-by: Devin W. Hurley <snowmiser111@gmail.com>
* Fix typo
Co-authored-by: Devin W. Hurley <snowmiser111@gmail.com>
Make it so clicking the icon menu or action menu while the popover is open closes the popover. This also fixes the issue where the action menu would not close at all.
Rename the `onOpen` prop to `onClick` to match what it does.
Fixes#87161. Fixes#87131.
* [data.search.session] Store search strategy in saved object
* Update unit test to check strategy
* Fix test
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
* Fully control the basic table pagination/sorting properties
* Not necessary
* Support index listing page
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
* [Setup] Server API route
* [Cleanup] Remove unnecessary DocumentCreationSteps
- errors can/should be shown in the EuiFlyoutBody banner (better UX since the JSON/file is right there for reference) vs its own page
- No need to distinguish between ShowErrorSummary and ShowSuccessSummary
+ placeholder Summary view for now
* Add DocumentCreationLogic file upload logic
* Update creation form components to show error/warning feedback
* Add final post-upload summary view
- split up into subcomponents for easier reading/testing
* [lint] oops, double licenses
* [PR feedback] map -> forEach
* [PR feedback] Reset form state on flyout close
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
* Use filter to bulk find
* Update x-pack/plugins/data_enhanced/server/search/session/session_service.ts
Co-authored-by: Lukas Olson <olson.lukas@gmail.com>
* Dashboard in space test
* Add warning on update failure
* fix merge
* Added functional test for sessions in space
* snapshot
* test cleanup
* sub perms
* test snapshots
* Update tests
* test
* code review
* snap
* Added discover test
* Update x-pack/plugins/data_enhanced/public/search/ui/connected_background_session_indicator/connected_background_session_indicator.tsx
Co-authored-by: Anton Dosov <dosantappdev@gmail.com>
Co-authored-by: Lukas Olson <olson.lukas@gmail.com>
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
Co-authored-by: Anton Dosov <dosantappdev@gmail.com>
* Remove unnecessary || {} branch
schema is always required / should never be undefined
* Cover if (addFieldFormErrors) branch
* Increase coverage of determineTooltipContent by simplifying branching
- most of these checks aren't necessary due to early returns
* Cover branch in WS source_icon
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
* Removing old backend routes and cleaning up types
* updating the docs
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
This PR makes the `actionParamsFields` field required, as it is in use by all plugins anyway and only tests were omitting it.
To make this change more streamlined I've added a `createMockActionTypeModel` helper which generates a basic mock `ActionTypeModel`.
* wip
* Using object remover for alerts list
* wip - using supertest instead of axios
* wip - using supertest instead of axios
* Removing custom services in favor of supertest
* Fixing test
* Fixing test
* Fixing types check
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
* disabling buttons when user does not permission
* fixing test
* disabling create/edit button when user does not have write permission
* addressing PR comments
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
* Add developer example for Reporting
Refactor Reporting plugin to have shareable services
* Update plugin.ts
* use constant
* add more description to using reporting as a service
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
* query timestamp override and default @timestamp field, adds functional test for this
* fix logic for when to filter out timestamp override documents
* update the total hits field of the search result if we find hits within the secondary search. Without updating the total hits field, we could be finding events but not indexing them based on the bulk create logic
* update integration test, updates logic for performing second search and excluding documents with timestamp override field
* cleanup comments, remove commented out console logs, fix logic to break out of loop during secondary search after
* default param to 'succeeded'
* remove commented out code
* always perform a secondary search when timestamp override field is present
* perf improvement and fix bug where sortIds were being mixed between search after calls
* set sortIds to undefined when not present on search result
* exit loop and prevent extraneous searches from occurring if we exhaust sort ids
## Summary
Currently working on issues related to exceptions and it was noted on a separate PR that the request payload validation being done in the client side API calls was unnecessary. It was helpful in development, but not of any added value in production. Not only that, but the extra validations also add to the performance hit.
Removed the payload validation and formatted the code to follow the same pattern as that in the value lists api file.
Tested that exceptions flows not affected by testing out exceptions CRUD flows.
* add hasVitals prop to CoreVitalItem
* pass hasVitals prop to CoreVitalsItem based on coreVitalPages
* adjust criteria for displaying no core vital item data
* add stories for CoreVitalItem edge cases
* remove comment from core web vitals index page
* update test comment in CoreVitalItem
* adjust APM get_web_core_vitals endpoint to return a number for cls value, and adjust corresponding observability components
* remove hasVitals from CoreVitalItem props and adjust storybook stories
* add comment to EuiStat aria-label in CoreVitalItem
* adjust CoreVitalItem tests
* adjust APM KeyUXMetrics test
* adjust APM get_web_core_vitals endpoint to return null for cls when cls is undefined
* adjust unit and integration tests that rely on apm get_web_core_vitals
* add comment in get_web_core_vitals
* update CLS value in Observability core_web_vitals index
* add withKibanaIntl to CoreVitalItem test to wrap in Intl Provider and KibanaReact provider
* update CoreVitalItem test to use testing-library/react test_helper
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
* Refactor Result card layout
- Move toggle action to the bottom of the card content
- [TODO] Action button to the right will be used for new link button (separate for accessibility/screen readers)
- Use grid to get the layout we want without extra div wrappers
* Add action button link to document detail
+ remove <a> tag on article content - should have onClick only
- this allows screenreaders to granularly navigate through the card content while allowing mouse users the entire card to click
- the new actionButton details link is accessible to both keyboard & screen reader users
* [Polish] Hover effects to help guide mouse users
* [i18n] Add pluralization to fields copy
* Update tests
* [Cleanup] Remove unneeded wrapper
* [??] More specific title for result group
- since the aria-label for the new detail button link is basically that
* move LinkedAgentCount component to top-level components and adjust output
* refactor integration details Policies list to use LinkedAgentCount component
* test cases for agent counts on integrations
## Summary
This PR addresses a fix on the exceptions list table export functionality. A dedicated route for exception list export needed to be created. List is exported into an `.ndjson` format.
Exception lists consist of two elements - the list itself, and its items. The export file should now contain both these elements, the list followed by its items.
* Fix screen reader still reading out bullet bullet bullet
* Even out horizontal spacing
* Break long password text
* Make EUI table cell full width on mobile
* adds privilege check in rule execution function, need to abstract these lines into a util function to be used in create rules and use that check on the UI too
* fixes tests
* cleanup code, adds a unit test
* set rule to failure status if the rule does not have read privileges to ANY of the index patterns provided
* use badge component to keep group badge consistent. sort groups
* use all colors now that badge component is used
* set left margin on group badge wrapped in link to match badge margin
* add badge colors to edit flyout job groups
* [Lens] UI for reference-based functions
* Fix tests
* Add a few unit tests for reference editor
* Respond to review comments
* Update error handling
* Update suggestion logic to work with errors and refs
* Support ParamEditor in references to fix Last Value: refactoring as
needed
* Fix error states
* Update logic for showing references in dimension editor, add tests
* Fix tests
Co-authored-by: Joe Reuter <johannes.reuter@elastic.co>
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
* Remove charts - editor cyclic dependencies
* Move translations from the charts plugin to the editor plugin
* Remove the dependency from the script as it is gone
* Fix types
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
This PR encourages type safe usage of the Alerting framework by replacing the current default Params/State/InstanceState/InstanceContext types (which are `AlertTypeParams`/`AlertTypeState`/etc.) with `never`.
This means that code can continue to omit the specific types for these fields, as long as they aren't referenced.
Once an alert developer wishes to actually reference the parameters (or state/context), then they have to specify the type.
This PR also changed the typing of the `AlertTypeParams` and `AlertTypeState` from `Record<string, any>` to `Record<string, unknown>`, to ensure that where these catch-all types are used they will at least enforce `unknown` rather than `any`.
This change broke some usage in both @elastic/kibana-alerting-services plugins, but also other plugins in the Stack/Solutions. I tried to fix these where I could, but some of these require new types and refactoring in other teams' code, which I decided is best done by the team who own and maintain that code - I've added explicit `TODO` comments in all of these places, describing the required fix.
This PR also introduced a Generics based typing for the `Alert` type so that the `params` field can be typed as something other than `AlertTypeParams`.
- use ml API service from the Kibana context
- adds jest tests for the Vega Lite Spec generator
- fix chart layout overflow with too many fields selected
* [ML] Fixing endpoint schema for can_delete_job endpoint
* changing get to post in docs
* renaming canUntag
* fixing typo
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
* Move threshold dupe detection logic to its own function
* Minor fixup
* Refactor and remove property injection for threshold signals
* Only show aggregatable fields for threshold rule grouping
* Add threshold rule kql filter to timeline
* Remove outdated getThresholdSignalQueryFields tests
* Filter aggregatable fields on client
* Revert "Only show aggregatable fields for threshold rule grouping"
This reverts commit 539fa49cc9.
* Fix bug with incorrect calculation of threshold signal dupes when no threshold field present
* Revert "Add threshold rule kql filter to timeline"
This reverts commit 64823744a3.
* Add test skeleton
* Finish tests
* Address comment
* Removed a possibility to define two different names for Alert types on API and UI level
* fixed typechecks
* fixed typechecks
* fixed due to comments
* fixed typechecks
* fixed jest tests
* fixed typechecks
* Move applyFilter, selectRange, valueClick triggers to data/embeddables.
* Update imports.
* Remove embeddable references to non-existent data plugin dependency.
* remove data mocks from embeddable
* Remove query, filters, timeRange from EmbeddableInput and move to apps.
* Remove data plugin imports from embeddable test samples.
* Remove circular dependencies caused by expressions renderer handlers.
* Update circular deps allowList.
* Remove data dependency on embeddable.
* Revert accidental data plugin change.
* Fix new circular deps issues.
* Update generated docs.
* Fix type errors in vis_type_xy
* Fix inspector data table.
* Remove logic preventing Crawler from being used on sample engines
* Remove check around crawler button in DocumentCreationButtons
- primarily a UI thing - ideally we always want to show 4 buttons
* Creating shared loading spinner component
* Using section loading component where it makes sense
* Fixing tests
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
* Rename variables
This will make reviewing later commits easier
* Use internal routing instead of history.push
Also updates path to Loading
* Move state from component to logic
* Add tests
* Add ApiCodeExample modal component
- Previously lived in EngineOverview / Onboarding
* Add basic PasteJsonText component
* Add basic UploadJsonFile component
* [Refactor] Have all modal components manage their own ModalHeader & ModalFooters
- Per feedback from Casey
+ Update DocumentCreationModal to use switch
* Set basic empty/disabled validation on ModalFooter continue buttons
* Update x-pack/plugins/enterprise_search/public/applications/app_search/components/document_creation/creation_mode_components/api_code_example.tsx
Co-authored-by: Jason Stoltzfus <jastoltz24@gmail.com>
* [PR feedback] Typescript improvements
* [PR feedback] Remove need for hasFile reducer
- by storing either 1 file or null
- which gets around the stored FileList reference not triggering a rerender/change
Co-authored-by: Jason Stoltzfus <jastoltz24@gmail.com>
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
* Remove missed action calls
These were missed in the PR that split apart add_source_logic from source_logic. These 2 mthods aren’t even in this file. My mistake
* Change order of method calls
For some reason the test would not pass with the order of the methods the way they were. Changing the order to where the error callback is called first somehow made the test pass
* Fix bug where query params never set
Uncovered a bug while writing this test. After moving from ent-search to Kibana, it was discovered that the Kibana server did not work well with an empty question mark in the URL. The fix attempted to use lodash’s isEmpty metthod. The problem is that the URLSearchParams class instance created is not an object but has getter/setter functionality so isEmpty always returned true. This fixes it to actually work.
* Remove throw blocks
In ent-search we had to account for edge cases where the error state wasn’t bubbling up. One of these has been covered with global flash messages. The other will be tested at later date. A tech-debt item has been created.
Reference PRs:
https://github.com/elastic/ent-search/pull/394https://github.com/elastic/ent-search/pull/701
* Export interfaces for use in tests
* Add tests for add_source_logic
* Remove weird import
I guess the IDE autocompleted that. Should not have been there
* Remove redundant test
This test was added before this comit when trying to get coverage for the throw blocks
7ca9c2b244
* Lint fixes
This replaces the usage of a custom auto-completion component with the shared `<QueryStringInput>` component provided by the `data` plugin. Aside from fixing the focus loss issue that caused #84543 this also introduces the inclusion of historic, local-storage-persisted queries in the suggestions.
* Ensure transactionType is used in overview
Fix the places where it was not being used:
- Transactions table
- Error rate chart
- Errors table
Also fix broken column sorting on transaction table.
* fix a sort
* test fix
* Snapshot update
* adds missing required param transactionType to API test
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
Co-authored-by: Oliver Gupte <olivergupte@gmail.com>
For cardinality checks, an empty index of the fields checks not returning any results would block the user from moving to the next step in the Anomaly Detection job wizard.
This PR fixes it by adding more fine grained checks and only returning warning-level messages for the above cases. A warning-level message will allow the user to continue to the next step in the wizard.
* Update Jest config to automatically report coverage
- No more super intricate yarn commands! Hooray
* Add handy shell script for running tests & coverage on specific folders/subdirectories
* Fixes for service overview layout
* Use 3/7 instead of 4/6 for `grow` between charts/tables
* Decrease chart height
* Use "s" gutterSize on tables
* Decrease table height
* Use `TruncateWithToolTip` on errors and transactions tables to remove tooltip inline-block style
* Use `responsive={false}` on dependency titles so icon/name pairs don't wrap
* Use `responsive={false}` on spark plots so plot/value pairs don't wrap
* Use `responsive={false}` on latency chart and table titles so controls and links don't wrap
* Make the fixed sizing overrides for the tables only be applied when we're using a wide, non-mobile (> 992) viewport
* Switch to "mobile" viewport (with one item per row) at 992 instead of 768
Since you cannot control the breakpoints at which EUI switches to "responsive" mode, we trigger these manually to change the number of columns. and whether or not the tables use a fixed height.
The overview now has three "modes":
* Two columns for chart/table rows
* Tables in non-responsive mode
* One column for charts/tables
* Tables in non-responsive mode
* One column for charts/tables
* Tables in non-responsive mode
Fixes#85781.
* remove unused imports
* [ML] Fix sort order of data recognizer module cards
* [ML] Add sort by ID to server side recognize endpoint
* [ML] Enhance docs for recognize endpoint success response.
* Only allow one panel to be open at a time
* Move EuiOutsideClickDetector inside the portal
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
* [ML] Fix synching jobs from other spaces
* updating text in delete modal
* updating translations
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
* creating service name header
* fixing icons
* removing unused api import
* fixing some stuff
* adding API tests
* refactoring some stuff
* fixing tests
* refactoring some stuff
* fixing i18n
* reverting
* renaming
* applying min width
* addressing PR comments and adding test
* sorting service version
* changing sort type to desc
* addressing pr comments
* changing to show total and not avg
* addressing pr comments
* addressing pr comments
* addressing pr comments
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
* Make `getAgentIcon` return a default icon instead of `undefined` when no icon is matched.
* Have the service map icon method check for the agent name to determine whether to use an agent or span icon. Both functions return the default icon when no match is found
* Remove the IE11 conditionals for service map icons
* Set a width on the icons used in the lists to prevent them from being stretched out
* Use EUI theme for icon sizing
Fixes#85150.
* Add mocks
* Make mergeServerAndStaticData available to tests
This method is needed to combine the 3 types of data to use in the logic files. Exporting this so that the mock data can be combined for testing in components.
It was discovered that the serverData had the wrong typings. This was only discovered when actully mocking the real server data, so it was changed here.
* Add tests for AddSourceHeader
* Add tests for AddSourceList
* Add tests for AvailableSourcesList
* Add tests for ConfigCompleted
* Add tests for ConfigDocsLinks
* Add tests for ConfigurationIntro
* Add tests for ConfigureCustom
* Add tests for ConfigureOauth
* Fix typo
* Add coverage for missing functions
The converage tool was complaining and this change assures formSubmitSuccess and handleFormSubmitError are covered
* Fix mocks
Needed an accountOnly source in this test so changed and update other tests where used
* Add tests for ConfiguredSourcesList
* Add tests for ReAuthenticate
Also changes the syntax of the redirect to use the replace method for easier testing
* Add sourceConfigData mock
* Add tests for SaveConfig
* Add tests for SaveCustom
* Add tests for SourceFeatures
* Add tests for ConnectInstance
As with the ReAuthenticate component, changes the syntax of the redirect to use the replace method for easier testing.
* [coverage] re-enable jest
* fix coverage script for x-pack
* use presets in entry configs
* set max workers
* run tests from x-pack folde
* remove duplicate 'reporters' prop
* remove reporters for x-pack config
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
* Unskipping test
* Using simpler alert type during test
* Fixing test
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
* [KQL] Fix handling of backslashes when autocompleting values
* Revert change to test
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
* [Maps] convert MBMap component to TS
* clean up imports messed up by eslint fix
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
* [ML] Adding runtime_mappings to job wizards
* fixing test
* adding runtime fields to fields list in datafeed preview
* fixing cardinality count for runtime field
* fixing cardinality check in data visualizer
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
* Pass filters from SIEM to resolver
* Fix test type errors
* Revert loading state change, update snapshots
* Make correct check in nodeData selector
* Fix inverted logic in nodeData selector
* Adding request id to node data
* Working time range filters and node data stale selector
* Fixing random name from generator and panel icons
* Fixing unused import
* Remove hardcoded node id
* Ensure that the actions array is reset before each test
Co-authored-by: Kevin Qualters <kevin.qualters@elastic.co>
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
# [Security Solution][Timeline] Timeline and Draggable Accessibility (a11y) Improvements
This PR improves the accessibility of Timeline and the draggables used throughout the Security Solution.
- ⌨️ Keyboard support for all draggables
- 🖱 Click on any draggable with the mouse to give it keyboard focus
- 🕵️♀️ Press `Enter` to display the draggable's action / options menu (e.g. Filter value, Investigate in Timeline, Show Top N). The menu also displays hyperlinks to allow for keyboard navigation from draggables containing links.
- 🚀 Press `Space` to start dragging via keyboard, and press `Space` again to drop
- 🏓 Timeline, + all Timeline-based tables (i.e. Detections, Host / Network Events, External alerts) support keyboard navigation
- ⬆️⬇️⬅️➡️ arrow key navigation per the `Keyboard Support` section of [w3.org grid examples](https://www.w3.org/TR/wai-aria-practices-1.1/examples/grid/dataGrids.html)
- 📉📈 `page down` and `page up` support per the `Keyboard interactions` section of the [MDN ARIA grid role documentation](<https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Roles/Grid_Role>) (and also the [w3](https://www.w3.org/TR/wai-aria-practices-1.1/examples/grid/dataGrids.html))
- 🏠🔚 `home` and `end` moves focus to the first and last cell in the row, per [w3.org](https://www.w3.org/TR/wai-aria-practices-1.1/examples/grid/dataGrids.html) & [MDN](<https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Roles/Grid_Role>)
- 🕹🏠 🕹🔚 `ctrl + home` and `ctrl + end` moves focus to the first and last cell in the row, per [w3.org](https://www.w3.org/TR/wai-aria-practices-1.1/examples/grid/dataGrids.html) & [MDN](<https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Roles/Grid_Role>)
- 🎉 Screenreader improvements for Timeline, + all Timeline-based tables, and draggables (tested with Voiceover for `macOS` version `10.15`)
- 👂 Draggables implement custom screenreader announcements. For example, when a draggable field is selected, the screenreader reads a custom message that reads the _field name_ in addition to the value, to provide additional context. For example, selecting a field named `network_flow` may be read phonetically by the screen reader as:
> event.action network underscore flow Press enter for actions, or press space to begin dragging
- 📅 Timeline, + all Timeline-based tables provide an enhanced screenreader experience via the use of `EuiScreenReaderOnly` and [w3 grid roles](https://www.w3.org/TR/wai-aria-practices-1.1/examples/grid/dataGrids.html) to provide context. For example, after clicking an arrow key to select a cell, the screenreader reads:
> You are in a table cell. row: 2, column: 5, event.module system Press enter for options, or press space to begin dragging.
![you-are-in-a-table-cell](https://user-images.githubusercontent.com/4459398/102074207-a7e95000-3dc1-11eb-8e01-5b14c72094c9.png)
- 📰 Timeline's table supports Voiceover screenreader shortcuts that read all cells across a row, or all rows down a column. See <https://github.com/elastic/kibana/issues/83364> for details
- 🍿 popovers and tooltips were enhanced via `EuiScreenReaderOnly` to provide additional context to screen readers
- 🪓 The [axe - Web Accessibility Testing Chrome extension](https://chrome.google.com/webstore/detail/axe-web-accessibility-tes/lhdoppojpmngadmnindnejefpokejbdd) was run interactively throughout the Security Solution to find and fix the highest-severity issues found by `axe`
- 🧹 Other keyboard-related improvements include
- The `Customize Columns` popover traps keyboard focus, and allows navigation of content via arrow keys & home / end
- The `Event details` view allows navigation of content via arrow keys & home / end
- Improvements to keyboard-focus trapping in popovers throughout the Security Solution
This PR addresses the following issues:
- [X] [[Security Solution] Add support for Voiceover announcements In Timeline's table #83364](https://github.com/elastic/kibana/issues/83364)
- [X] [[Security app] Detections events list 'overflow' ... button and expand > button do not have hover over names #74140](https://github.com/elastic/kibana/issues/74140)
- [X] [SIEM app accessibility issues #64596](https://github.com/elastic/kibana/issues/64596)
- After merging with the _Timeline Evolution_ PR, the drop zone at the bottom of the screen stopped accepting draggables after the first draggable is dropped. The current workaround is to press `Enter` to open the draggables action menu, and select the `Investigate in timeline` action. When Timeline is open, the drag area at the top of the screen accepts additional draggables via keyboard. EDIT: I paired with @XavierM on this, and he has a fix for this issue (duplicate draggable IDs) in his PR.
## Summary
Resolves https://github.com/elastic/kibana/issues/77324, https://github.com/elastic/kibana/issues/77325, resolves https://github.com/elastic/kibana/issues/77325, and resolves https://github.com/elastic/kibana/issues/81302
This PR addresses referential integrity issues when deleting value lists. Previously when deleting value lists, any references in Exception Lists/Items would be left behind. This PR introduces a new confirmation modal when deleting value lists that are referenced in either space aware (`simple`) or space `agnostic` exception lists.
Also includes:
* Fixed Lists plugin `quick_start.sh` as it was using endpoint exception list + value lists (unsupported)
* Adds `quick_start_value_list_references.sh` to create exception lists/items, value lists, and references to easily test
* Add support to `findExceptionList` for searching for both `simple` and `agnostic` list types
* Two new query params have been added to the `deleteListRoute`
* `ignoreReferences` (default:false) when true, maintains pre-7.11 behavior of deleting value list without performing any additional checks.
* NOTE: As written, this becomes an API breaking change as existing existing calls to the same API will `409` conflict if references exist. cc @jmikell821 @DonNateR
* `deleteReferences` (default:false) to perform dry run and identify referenced exception lists/items
## Testing
To test, run `quick_start_value_list_references.sh` and it will create all the necessary resources/references to easily exercise the above functionality. The below diagram details the resources created and how the references are wired up.
> Creates three different exception lists and value lists, and associates as
> below to test referential integrity functionality.
>
> NOTE: Endpoint lists don't support value lists, and are not tested here
>
> EL: Exception list
> ELI Exception list Item
> VL: Value list
>
> EL1 EL2 (Agnostic) EL3
> | | |
> ELI1 ELI2 ELI3
> |\ /| |
> | \ / | |
> | \ / | |
> | \ / | |
> | \/ | |
> | /\ | |
> | / \ | |
> | / \ | |
> | / \ | |
> |/ \| |
> VL1 VL2 VL3 VL4
> ips.txt ip_range.txt text.txt hosts.txt
>
Corner cases to be aware of:
* An exception item may have multiple value list entries -- only referenced value list entries should be removed
* There is no API for removing individual entries. If all entries are references the entire item is deleted. If only some entries are references, the item is updated via a `PUT` (no `PATCH` support for exception items)
* It's not possible via the UI to create a space agnostic list that has value list exception items (only agnostic endpoint exception lists can be created and they do not support value lists). Please use above script to exercise this behavior.
Additional notes:
* Once the Exception List table is introduced (https://github.com/elastic/kibana/pull/85465), we can add an enhancement for deeplinking to exception lists from the reference error modal.
* The `deleteListRoute` response has been updated to include the responses from the reference checks to provide maximum flexibility
* There is no bulk API for deleting exception list items, and so they are iterated over via the `deleteExceptionListItem` API.
##### Reference error modal
<p align="center">
<img width="500" src="https://user-images.githubusercontent.com/2946766/102199153-813e1e80-3e80-11eb-8a9b-af116ca13df9.gif" />
</p>
##### Overflow example
<p align="center">
<img width="500" src="https://user-images.githubusercontent.com/2946766/102199032-5784f780-3e80-11eb-81c7-17283d002ce4.gif" />
</p>
### Checklist
Delete any items that are not applicable to this PR.
- [X] Any text added follows [EUI's writing guidelines](https://elastic.github.io/eui/#/guidelines/writing), uses sentence case text and includes [i18n support](https://github.com/elastic/kibana/blob/master/packages/kbn-i18n/README.md)
- [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
- [X] Any UI touched in this PR is usable by keyboard only (learn more about [keyboard accessibility](https://webaim.org/techniques/keyboard/))
### For maintainers
- [X] This was checked for breaking API changes and was [labeled appropriately](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)
* [Maps] unify legend for percentiles, interpolate, and custom ordinal color breaks (#85343)
* [Maps] unify legend for percentiles, interpolate, and custom ordinal color breaks
* unify mapbox style expression
* snapshot updates
* update jest expects
* use less than and great than symbol for first and last stop
* tslint
* do not show legend if customColorRamp is not provided
* update functional test expects
* update functional test expect
* update mapbox expect expressions in join functional tests
* update mvt expects
* revert mapbox style expression changes for interpole color ramp
* add greater then and equal to symbol for last stop
* disable stop input for first ordinal color stop
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
* fix crossmerge
Co-authored-by: Nathan Reese <reese.nathan@gmail.com>
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
**Addresses:** https://github.com/elastic/kibana/issues/76587
## Summary
In this PR I'm doing basically 2 things:
1. Making readonly callouts we have in Detections `primary` instead of `warning` and thus persistable in local storage (if a callout is dismissed, we remember it there)
2. Creating a reusable implementation for that.
TODO:
- [x] Adjust all callouts used in Detections to be of type `primary`
- [x] Implement the local storage logic (dumb)
- [x] Implement the local storage logic (reusable)
- [x] Add a new user role: "Reader" (read-only user)
- [x] Add Cypress tests
Out of scope:
- Add unit tests. I'll probably address this in a follow-up PR. Do you think it's worth it or better to wait until the rework (see the next point)?
- Rework callouts to standardise them across Detections, Cases and other parts of the Security app? See my comment below in this PR.
## Screen recordings
Quick demo of how this implementation works:
- [primary callouts](https://drive.google.com/file/d/1SYQd_ihKPvzlVUxELI8qNEqLBOkL18Gd/view?usp=sharing)
- [warning, danger](https://drive.google.com/file/d/1lrAFPyXNjOYSiEsUXxY_fjXsvmyDcdWY/view?usp=sharing) (callout types here were manually adjusted)
## Additional notes
Cypress tests are based on the work done in https://github.com/elastic/kibana/pull/81866.
![](https://puu.sh/GXwOd/1c855cb03f.png)
* [Maps] unify legend for percentiles, interpolate, and custom ordinal color breaks
* unify mapbox style expression
* snapshot updates
* update jest expects
* use less than and great than symbol for first and last stop
* tslint
* do not show legend if customColorRamp is not provided
* update functional test expects
* update functional test expect
* update mapbox expect expressions in join functional tests
* update mvt expects
* revert mapbox style expression changes for interpole color ramp
* add greater then and equal to symbol for last stop
* disable stop input for first ordinal color stop
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
* [Setup] Add EuiCardTo helper
* Set up very basic DocumentCreationLogic file modal management
* Create buttons and modal components
* Update EngineOverviewEmpty to use only DocumentCreationButtons
- Remove API section/example/constants for now: per design discussion, we'll be moving this section into the document creation modal
- Move preceding DOCUMENT_CREATION_DESCRIPTION paragraph directly into DocumentCreationButtons, since the Documents view will just use this verbatim
* Update Documents view Index Documents button to show DocumentsCreationModal
- with some extra logic to add a new creationStep view
+ some minor test cleanup / clarification for openDocumentCreation
* Update Crawler button with conditional check
- Forgot to port this over initially
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
resolves https://github.com/elastic/kibana/issues/75601
Previously, if a context variable that is an object is referenced in a
mustache template used as an action parameter, the resulting variable
expansion will be `[Object object]`. In this PR, we change this so that
the expansion is a JSON representation of the object.
This is primarily for diagnostic purposes, so that customers can see
all the context variables available, and their values, while testing
testing their alerting actions.
* Initial structure of migration state-action machine
* Fix type import
* Retries with exponential back off
* Use discriminated union for state type
* Either type for actions
* Test exponential retries
* TaskEither types for actions
* Fetch indices instead of aliases so we can collect all index state in one request
* Log document id if transform fails
* WIP: Legacy pre-migrations
* UPDATE_TARGET_MAPPINGS
* WIP OUTDATED_DOCUMENTS_TRANSFORM
* Narrow res types depending on control state
* OUTDATED_DOCUMENTS_TRANSFORM
* Use .kibana instead of .kibana_current
* rename control states TARGET_DOCUMENTS* -> OUTDATED_DOCUMENTS*
* WIP MARK_VERSION_INDEX_READY
* Fix and expand INIT -> * transition tests
* Add alias/index name helper functions
* Add feature flag for enabling v2 migrations
* split state_action_machine, reindex legacy indices
* Don't use a scroll search for migrating outdated documents
* model: test control state progressions
* Action integration tests
* Fix existing tests and type errors
* snapshot_in_progress_exception can only happen when closing/deleting an index
* Retry steps up to 10 times
* Update api.md documentation files
* Further actions integration tests
* Action unit tests
* Fix actions integration tests
* Rename actions to be more domain-specific
* Apply suggestions from code review
Co-authored-by: Josh Dover <me@joshdover.com>
* Review feedback: polish and flesh out inline comments
* Fix unhandled rejections in actions unit tests
* model: only delay retryable_es_client_error, reset for other left responses
* Actions unit tests
* More inline comments
* Actions: Group index settings under 'index' key
* bulkIndex -> bulkOverwriteTransformedDocuments to be more domain specific
* state_action_machine tests, fix and add additional tests
* Action integration tests: updateAndPickupMappings, searchForOutdatedDocuments
* oops: uncomment commented out code
* actions integration tests: rejection for createIndex
* update state properties: clearer names, mark all as readonly
* add state properties currentAlias, versionAlias, legacyIndex and test for invalid version scheme in index names
* Use CONSTANTS for constants :D
* Actions: Clarify behaviour and impact of acknowledged: false responses
* Use consistent vocabulary for action responses
* KibanaMigrator test for migrationsV2
* KibanaMigrator test for FATAL state and action exceptions in v2 migrations
* Fix ts error in test
* Refactor: split index file up into a file per model, next, types
* next: use partial application so we don't generate a nextActionMap on every call
* move logic from index.ts to migrations_state_action_machine.ts and test
* add test
* use `Root` to allow specifying oss mode
* Add fix and todo tests for reindexing with preMigrationScript
* Dump execution log of state transitions and responses if we hit FATAL
* add 7.3 xpack tests
* add 100k test data
* Reindex instead of cloning for migrations
* Skip 100k x-pack integration test
* MARK_VERSION_INDEX_READY_CONFLICT for dealing with different versions migrating in parallel
* Track elapsed time
* Fix tests
* Model: make exhaustiveness checks more explicit
* actions integration tests: add additional tests from CR
* migrations_state_action_machine fix flaky test
* Fix flaky integration test
* Reserve FATAL termination only for situations which we never can recover from such as later version already migrated the index
* Handle incompatible_mapping_exception caused by another instance
* Cleanup logging
* Fix/stabilize integration tests
* Add REINDEX_SOURCE_TO_TARGET_VERIFY step
* Strip tests archives of */.DS_Store and __MAC_OSX
* Task manager migrations: remove invalid kibana property when converting legacy indices
* Add disabled mappings for removed field in map saved object type
* verifyReindex action: use count API
* REINDEX_BLOCK_* to prevent lost deletes (needs tests)
* Split out 100k docs integration test so that it has it's own kibana process
* REINDEX_BLOCK_* action tests
* REINDEX_BLOCK_* model tests
* Include original error message when migration_state_machine throws
* Address some CR nits
* Fix TS errors
* Fix bugs
* Reindex then clone to prevent lost deletes
* Fix tests
Co-authored-by: Josh Dover <me@joshdover.com>
Co-authored-by: pgayvallet <pierre.gayvallet@elastic.co>
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
* Copy SourceLogic to AddSourceLogic
This commit merely copies SourceLogic and renames it to AddSourceLogic with the name of the component and interfaces changed. This will make reviewing the changes easier later
* Delete duplicated logic data
* Update component paths
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
* [Maps] provide function to create basemap layer descriptor
* update typing
* update APM map to use createBasemapLayerDescriptor
* fix useLayerList jest test
* tslint fixes
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
* Initial work
* Change messaging from copy
* Fix jest tests for email connector
* Fix jest tests for alerts plugin
* Update copy
* Use server.publicBaseUrl
* Fix jest tests
* Update tests
* Cleanup jest test
* Code cleanup
* Improve email parameter names for kibana footer url
* Cleanup
* Add test for kibana footer link
* Fix type check
* Fix jest test
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
* Add i18n for AddSourceList
* Add i18n for AvailableSourcesList
* Replace all instances of interal Link
This was missed during the migration. We need to use the components we wrap Eui components with internally.
Also fixes some imports that were unnecessarily going up one level and back down for imports.
* Add i18n for ConfigCompleted
* Add i18n for ConfigDocsLinks
* Add i18n for ConfigurationIntro
* Add i18n for ConfigureCustom
* Add i18n for ConfigureOauth
* Add i18n for ConfiguredSourcesList
* Add i18n for ReAuthenticate
* Add i18n for shared field labels
Also includea shared SourceConfigFields
* Add i18n for SaveConfig
* Add i18n for SaveCustom
* Add i18n for SourceFeatures
* Add i18n for ConnectInstance
* Fix duplicate i18n ID
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
* disable delete until checks complete
* add canDeleteJobs wrapper in saved objects service
* create DeleteJobCheckModal shared component
* wip: add deleteJobModal check in list and map views
* adding remove from current space endpoint
* updating error text
* fixing typo in variable name
* Update button content. Add untagging functionality
* adding anomaly detection delete job modal
* fix modal content bug
* refresh job map after deletion or untagging
* adding job refresh to anomaly detectors
* go straight to delete flow if only action available
* fixing test
* update text
* increase line spacing in check modal
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
Co-authored-by: James Gowdy <jgowdy@elastic.co>
* Fixing resolver functional tests
* Import the animation constant
* Only check specific nodes instead of all the ones in view
* Removing check for link text
* updating test description
* Adding comments
* Adds new SO type for persisting our signals migrations
* WIP: Migration status SO client
Trying to forge a patterrn using io-ts to validate at runtime. I think
I've got it working but I want to refactor the pipeline out into a
reusable function(s).
* Implements our SavedObjects service for signals migrations
* Defines a simple client that delegates to the base SO client with
our SO type
* Defines a service that consumes the simpler client, adding validations
and data transforms on top.
* Refactoring migration code to work with saved objects
As opposed to the previous ephemeral, encoded tokens, we now retrieve migration
info from saved objects.
At the API level, this means that both the create and finalize endpoints
receive a list of concrete indices. No more passing around tokens.
As both endpoints are idempotent, users can hammer them as much as they
want with the same lists of indices. Redundant creates and finalizes
will be met with inline 400 messages, and as one continues to poll the
finalize endpoint they should see more and more indices respond with
"completed: true"
* Fixing integration tests first, and anything upstream breaking them
* Clean up API integration tests
* standardize assignment of responses (with types)
* deletes migration SOs as test cleanup
* Split API tests into separate files
This was getting big and unwieldy; this splits these into one file per
endpoint.
* Refactor: split existing migration service functionality into atomic functions
This will allow us to repurpose the service to compose more
functionality and be more specifically useful, while keeping the
component logic separate.
* WIP: moving logic into migrationService.create
* Splitting get_migration_status into component functions
getMigrationStatus was really two separate aggregations, so I split them
out and we recompose them in the necessary routes.
* Move finalization logic into function
* migrationService exposes this as .finalize()
* adds an error field to our migration SO
* We currently only have one error that we persist there, but it would
be very time-consuming to track down that information were it not
there.
* Adds function for migration "deletion" logic
* migrationService leverages this function
* adds new boolean to our savedObject
* deletes unused function (deleteMigrationSavedObject)
* Adds route for soft-deletion of migrations
* Updating tests related to migration status
* Adding/updating mocks/unit tests necessary to satisfy the things I
need to test
* I mainly wanted to test that the the status endpoint filtered out the
deleted migrations; this was accomplished with a unit test after
fleshing out some mocks/sample data.
* Move old migration service tests to the relevant function tests
This logic was previously moved out into component functions; this moves
the tests accordingly.
* Add some unit tests around our reindex call
* Fix create migration route tests
Mocks out our migration functions, rather than stubbing ES calls
directly.
* Updates finalize route unit tests
Addresses functionality that hasn't been moved to finalizeMigration()
* Unit tests our finalization logic
Fixes a bug where we weren't accounting for soft-deleted migrations.
ALso updates our test migration SO to have a status of 'pending' as
that's a more useful default.
* Fixes finalization integration tests
These were failing due:
* a change in the migration status API response
* a bug I introduced in the finalize route
* Adds tests for our migration deletion endpoint
* unit tests
* API integration tests
* Caught/fixed bug with deleting a successful migration
* Fixes types
Removes unused code.
* Prevent race condition due to template rollover during migration
If a user has an out of date index (v1) relative to the template (v2), but the
template itself is out of date (newest is v3), then it's possible that
the template is rolled over to v3 after the v1-v2 migration has been
created but before the new index has been created.
In such a case, the new index would receive the v3 mappings but would
incorrectl be marked as v2. This shouldn't necessarily be an issue, but
it's an unnecessary state that can easily be prevented with the guard
introduced here.
* Add real usernames to migration savedObjects
In addition to the SOs themselves giving us observability into what
migration actions were performed, this gives us the additional info of
_who_ performed the action.
* Index minimal migration SO fields needed for current functionality
* Add additional migration info to status endpoint
This will allow users to finalize a migration if they've lost the
response to their POST call.
* Finalize endpoint receives an array of migration IDs, not indices
This disambiguates _which_ migrations we were finalizing if you passed
an index (which was previously: the most recent migration).
* Fix type errors in tests after we threaded through username
* Update responsibilities of migration finalize/delete endpoints
Discussions with @marshallmain lead to the following refactor:
* finalize does not delete tasks
* finalize only applies cleanup policy to a failed migration
* delete takes an array of migration ids (like finalize)
* delete hard-deletes the SavedObject of a completed (failed or
successful) migration
This gives a bit more flexibility with the endpoints, as well as
disambiguates the semantics: it just deletes migrations!
* Fix tests that were broken during refactoring
* Fix type errors
I removed some logic here but forgot the imports :(
* Move outdated integration test
In the case of a successful migration, application of the cleanup policy
is done by the deletion endpoint. In the interest of data preservation,
we do not delete a sourceIndex unless it is explicitly deleted.
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
* Adds context.alerts as available parameter for detection rule actions
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
* [Alerts][License] Define minimum license required for each alert type (#84997)
* Define minimum license required for each alert type
* fixed typechecks
* fixed tests
* fixed tests
* fixed due to comments
* fixed due to comments
* removed file
* removed casting to LicenseType
* [Alerts][License] Add license checks to alerts HTTP APIs and execution (#85223)
* [Alerts][License] Add license checks to alerts HTTP APIs and execution
* fixed typechecks
* resolved conflicts
* resolved conflicts
* added router tests
* fixed typechecks
* added license check support for alert task running
* fixed typechecks
* added integration tests
* fixed due to comments
* fixed due to comments
* fixed tests
* fixed typechecks
* [Alerting UI][License] Disable alert types in UI when the license doesn't support it. (#85496)
* [Alerting UI][License] Disable alert types in UI when the license doesn't support it.
* fixed typechecks
* added licensing for alert list and details page
* fixed multy select menu
* fixed due to comments
* fixed due to comments
* fixed due to comments
* fixed typechecks
* fixed license error message
* fixed license error message
* fixed typechecks
* fixed license error message
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
resolves https://github.com/elastic/kibana/issues/79371
resolves https://github.com/elastic/kibana/issues/62928
In this PR, we allow action types to determine how to escape the
variables used in their parameters, when rendered as mustache
templates. Prior to this, action parameters were recursively
rendered as mustache templates using the default mustache
templating, by the alerts library. The default mustache
templating used html escaping.
Action types opt-in to the new capability via a new optional
method in the action type, `renderParameterTemplates()`. If not
provided, the previous recursive rendering is done, but now with
no escaping at all.
For #62928, changed the mustache template rendering to be
replaced with the error message, if an error occurred,
so at least you can now see that an error occurred. Useful
to diagnose problems with invalid mustache templates.
* Closes#81948 by setting the default route for services to the service overview page
also updates links to the general path which gets redirected according to user settings
* fixes incorrect test names
* Update x-pack/plugins/apm/public/components/app/Main/route_config/index.tsx
Co-authored-by: Cauê Marcondes <55978943+cauemarcondes@users.noreply.github.com>
* fixes linting
Co-authored-by: Cauê Marcondes <55978943+cauemarcondes@users.noreply.github.com>