Commit graph

90 commits

Author SHA1 Message Date
Or Ouziel f2b9acf67b
replace any with unknown in http client and types (#114265) 2021-11-02 13:53:56 +02:00
Tyler Smalley c4815d319e
Updates Github link references from master to main (#116789)
Signed-off-by: Tyler Smalley <tyler.smalley@elastic.co>
2021-10-29 09:53:08 -07:00
Jean-Louis Leysens 8b66ef161d
[Reporting] Baseline capture tests (#113910)
* added page to reporting example app that contains the capture tests

* first version of PNG capture for test A

* added types file to common

* added data-shared-item attr to image, also added capture menu items

* fix image CSS by providing a fixed width and height

* explicitly add layout for print, does not seem to do anything though?

* added magic numbers of image sizes

* added reporting examples test folder

* first version of capture test for generating and comparing PNGs

* added PNG service and PNG baseline fixture

* added pdf-to-img dev dependency

* refactor compare_pngs to accept a buffer

* added comment to interface

* png service -> compare images service

* export image compare service

* added test for pdf export

* clean up log

* minor fixes and added pdf print optimized test

* added pdf and pdf print fixtures

* refactor lib function name

* Update difference thresholds

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2021-10-21 14:59:07 +02:00
Jean-Louis Leysens 45e07af1fa
[Reporting] Add new data-render-error attribute (#114472)
* added new data-render-error attribute, read it and store it on job object

* added data-render-error to the example app

* added jest test

* address pr feedback

- make renderErrors optional in interfaces
- create separate selectors for data render error selector/attr
- Tidy up mergeMap behaviour

* fix observable.test.ts snapshots and browser driver mock

* updated jest snapshots

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2021-10-13 14:55:06 +02:00
Shahzad b8cdc6fd1b
[Exploratory View] Embedddable component (#113108)
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2021-10-05 17:23:44 +02:00
Tyler Smalley 4681a80317
[DX] Upgrade prettier to v2.4.0 (#112359)
Signed-off-by: Tyler Smalley <tyler.smalley@elastic.co>
2021-09-19 22:34:30 -07:00
Tim Roes c510288c05
Split KibanaApp into VisEditors and DataDiscovery (#110588)
* Split KibanaApp into VisEditors and DataDiscovery

* Add discover functional tests to codeowners

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2021-08-31 15:57:23 +02:00
Patryk Kopyciński 754b79f08a
[Cases] Add Lens markdown plugin (#96703) 2021-08-17 15:49:44 -07:00
Stacey Gammon 9258ba5147
Adding owners to kibana plugins (#108407)
* Adding owners to kibana plugins

* Fix ui actions enhanced owner

* Account for virtual RAC team owning a plugin

* Fix empty githubTeam for ui actions
2021-08-17 10:21:06 -04:00
Jean-Louis Leysens f08005e0e7
[Reporting] Create reports with full state required to generate the report (#101048)
* very wip

* - Reached first iteration of reporting body value being saved with
  the report for **PDF**
- Removed v2 of the reporting since it looks like we may be able
  to make a backwards compatible change on existing PDF/PNG
  exports

* reintroduced pdfv2 export type, see https://github.com/elastic/kibana/issues/99890\#issuecomment-851527878

* fix a whol bunch of imports

* mapped out a working version for pdf

* refactor to tuples

* added v2 pdf to export type registry

* a lot of hackery to get reports generated in v2

* added png v2, png reports with locator state

* wip: refactored for loading the saved object on the redirect app URL

* major wip: initial stages of reporting redirect app, need to add a way to generate v2 reports!

* added a way to generate a v2 pdf from the example reporting plugin

* updated reporting example app to read and accept forwarded app state

* added reporting locator and updated server-side route to not use Boom

* removed reporting locator for now, first iteration of reports being generated using the reporting redirect app

* version with PNG working

* moved png/v2 -> png_v2

* moved printable_pdf/v2 -> printable_pdf_v2

* updated share public setup and start mocks

* fix types after merging master

* locator -> locatorParams AND added a new endpoint for getting locator params to client

* fix type import

* fix types

* clean up bad imports

* forceNow required on v2 payloads

* reworked create job interface for PNG task payload and updated consumer code report example for forcenow

* put locatorparams[] back onto the reportsource interface because on baseparams it conflicts with the different export type params

* move getCustomLogo and generatePng to common for export types

* additional import fixes

* urls -> url

* chore: fix and update types and fix jest import mocks

* - refactored v2 behaviour to avoid client-side request for locator
  instead this value is injected pre-page-load so that the
  redirect app can use it
- refactored the interface for the getScreenshot observable
  factory. specifically we now expect 'urlsOrUrlTuples' to be
  passed in. tested with new and old report types.

* updated the reporting example app to use locator migration for v2 report types

* added functionality for setting forceNow

* added forceNow to job payload for v2 report types and fixed shared components for v2

* write the output of v2 reports to stream

* fix types for forceNow

* added tests for execute job

* added comments, organized imports, removed selectors from report params

* fix some type issues

* feedback: removed duplicated PDF code, cleaned screenshot observable function and other minor tweaks

* use variable (not destructured values) and remove unused import

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2021-08-12 18:40:19 +02:00
Marco Liberati dc2a1e1cea
[Lens] Introduce new layer types (#107791) 2021-08-12 08:29:31 +02:00
Spencer c0395c9ef6
[build_ts_refs] improve caches, allow building a subset of projects (#107981)
* [build_ts_refs] improve caches, allow building a subset of projects

* cleanup project def script and update refs in type check script

* rename browser_bazel config to avoid kebab-case

* remove execInProjects() helper

* list references for tsconfig.types.json for api-extractor workload

* disable composite features of tsconfig.types.json for api-extractor

* set declaration: true to avoid weird debug error

* fix jest tests

Co-authored-by: spalger <spalger@users.noreply.github.com>
2021-08-10 22:12:45 -07:00
Liza Katz 204efae5bf
[Data cleanup] unify serializable state (#107745)
* Use Serializable from package

* Rename to align with core

* fix

* more replacements

* docssss

* fix

* Move it to @kbn/utility-types and remove core export

* buildy build

* tests

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2021-08-10 13:03:48 +02:00
Tim Sullivan 5e8b24230a
[Reporting] add version to all export types job params (#106137)
* add version to csv params

* fix ts

* fix api tests

* use kibana version from packageInfo

* use kibana version from packageInfo

* clean up ide warnings

* utility to log and set a default params version

* fix baseparams ts

* update snapshot

* check version in enqueue job

* add temporary ts-ignore for canvas

* clarify comment

* fix hardcoded version in png_pdf_panel

* clarify the UNVERSIONED_VERSION variable with a comment

* fix canvas jest test

* fix ts in example app

* fix types

* send version param to canvas util for job params

* update jest snapshot

* Update utils.test.ts

* fix snapshot

* remove browserTimezone and version from integration boilerplate

* wip ensure version is always populated in job params inside of the service

* wip2

* wip3

* wip4

* wip5

* wip6

* update note

* update example plugin

* wip7

* improve tests

* fix dynamic job params

* better testing

* improve enqueue_job test

* more tests

* fix types

* fix types

* fix example ts

* simplify props

* fix test

* --wip-- [skip ci]

* consolidate baseparams back into one interface

* fix rison encoding of apiClient param

* clean up

* reorganize imports

* back out functional change

* fix 400 error in download csv

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2021-08-02 13:00:37 -04:00
Tim Roes 271220cf3a
Add missing Kibana App plugin owners (#107153) 2021-07-29 17:00:28 +02:00
Yuliia Naumenko f589c2fc29
[Alerting] Rename alertTypeRegistry to ruleTypeRegistry according to the new terminology. (#106519)
* [Alerting] Renamed Alerting framework AlertsClient to RulesClient according to the new terminology.

* fixed path

* fixed type checks

* fixed type checks

* [Alerting] Rename alertTypeRegistry to ruleTypeRegistry.

* Apply suggestions from code review

Co-authored-by: ymao1 <ying.mao@elastic.co>

* fixed type checks

* fixed tests

* fixed merge issues

* fixed merge issues

* fixed tests

* fixed tests

* fixed functional tests

Co-authored-by: ymao1 <ying.mao@elastic.co>
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2021-07-27 10:03:00 -07:00
Tim Sullivan 7c86f599a6
[Reporting] Update kibana.json files with owner information (#106463) 2021-07-22 10:03:37 +02:00
ymao1 e2aacdc186
[Alerting] Allow rule types to extract/inject saved object references on rule CRU (#101896)
* Adding function hooks into rule type definition and call extract fn on rule create

* Adding hooks for extracting and injecting saved object references. Adding extractReferences to create and update workflow

* Adding type template for extracted params

* Adding type template for extracted params

* Adding type template for extracted params

* Adding type template for extracted params

* Calling injectReferences function if defined. Finishing unit tests for create and update

* Adding tests for get

* Adding tests for find

* Cleanup

* Fixing types check

* Fixing functional tests

* Fixing functional tests

* Fixing tests

* Updating README

* Throwing boom error instead of normal error

* Adding framework level prefix to extracted saved object reference names

* Fixing types

* Fixing types

* PR fixes

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2021-07-20 17:09:02 -04:00
Marta Bondyra 6e3df60aba
[Lens] Move editorFrame state to redux (#100858)
Co-authored-by: Joe Reuter <johannes.reuter@elastic.co>
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
Co-authored-by: dej611 <dej611@gmail.com>
2021-07-01 11:00:56 +02:00
Joe Reuter 65ff74ff5a
[Lens] Add functional test for example integration (#103460) 2021-07-01 10:48:34 +02:00
ymao1 c05588f077
[Alerting] Enable rule import/export and allow rule types to exclude themselves from export (#102999)
* Removing feature flag changes

* Adding isExportable flag to rule type definition

* Adding isExportable flag to rule type definition

* Adding isExportable flag to rule type definition

* Filtering rule on export by rule type isExportable flag

* Fixing types

* Adding docs

* Fix condition when exportCount is 0

* Unit test for fix condition when exportCount is 0

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2021-06-28 20:35:27 -04:00
Marco Liberati dfc70bdfd1
[Lens] Enable actions on Lens Embeddable (#102038)
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2021-06-25 14:59:36 +02:00
Vadim Dalecky baf2de5415
Dashboard locator (#102854)
* Add dashboard locator

* feat: 🎸 expose dashboard locator from dashboard plugin

* Use dashboard locator in dashboard drilldown

* Add tests for dashboard locator

* Fix dashboard drilldown tests after refactor

* Deprecate dashboard URL generator

* Fix TypeScript errors in exmaple plugin

* Use correct type for dashboard locator

* refactor: 💡 change "route" attribute to "path"

* chore: 🤖 remove unused bundle

Co-authored-by: Vadim Kibana <vadimkibana@gmail.com>
Co-authored-by: Vadim Kibana <82822460+vadimkibana@users.noreply.github.com>
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2021-06-25 07:58:03 +02:00
Shahzad 264339e156
[Lens] Export lens save modal (#100381)
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2021-06-15 20:06:06 +02:00
Tim Sullivan 3559d375b6
[Reporting] Make "ScreenCapturePanel" shareable for Canvas (#100623)
* use ScreenCapturePanel component in Canvas

* use smaller state object

* add comment about canvas-specific shared component

* fix example

* fix toast error

* fix i18n

* fix data-test-subj

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2021-06-09 17:08:33 -07:00
Stacey Gammon 356b7d6c92
Add ssl instructions to example alerting plugin (#101529)
* Update documentation.tsx

* Update documentation.tsx

* Update documentation.tsx

* fix type issue

* Noticed a lack of a space in the screenshot
2021-06-08 11:43:16 -04:00
ymao1 71379b755a
[Alerting] Split alerting feature privilege between rules and alerts and handle subfeature privilege specification (#100127)
* WIP - creating alerting authorization client factory and exposing authorization client on plugin start contract

* Updating alerting feature privilege builder to handle different alerting types

* Passing in alerting authorization type to AlertingActions class string builder

* Passing in authorization type in each function call

* Passing in exempt consumer ids. Adding authorization type to audit logger

* Changing alertType to ruleType

* Changing alertType to ruleType

* Updating unit tests

* Updating unit tests

* Passing field names into authorization query builder. Adding kql/es dsl option

* Converting to es query if requested

* Fixing functional tests

* Removing ability to specify feature privilege name in constructor

* Fixing some types and tests

* Consolidating alerting authorization kuery filter options

* Cleanup and tests

* Cleanup and tests

* Initial commit with changes needed for subfeature privilege

* Throwing error when AlertingAuthorizationClientFactory is not defined

* Renaming authorizationType to entity

* Renaming AlertsAuthorization to AlertingAuthorization

* Fixing unit tests

* Changing schema of alerting feature privilege

* Changing schema of alerting feature privilege

* Updating feature privilege iterator

* Updating feature privilege builder

* Fixing types check

* Updating privilege string terminology

* Updating privilege string terminology

* Wip

* Fixing unit tests

* Unit tests

* Updating README and removing stack subfeature privilege changes

* Fixing README

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2021-05-27 14:59:02 -04:00
Jean-Louis Leysens f97aad30f4
[Screenshot mode] Create plugin to provide "screenshot mode" awareness (#99627)
* initial version of the screenshot mode service

* First iteration of client side of screenshot mode plugin

Also hooked it up to the chromium browser imitating the preload
functionality of electron to set up the environment before
code runs.

* First implementation of server-side logic for detecting
screenshot mode

* fix some type issues and do a small refactor

* fix size limits, docs and ts issues

* fixed types issues and made sure screenshot mode is correctly detected on the client

* Moved the screenshot mode header definition to common
Added a server-side example for screenshot mode
Export the screenshot mode header in both public and server

* move require() to screenshotMode plugin

* Update chromium_driver.ts

* cleaned up some comments, minor refactor in ReportingCore and
changed the screenshotmode detection function to check for a
specific value.

* fix export

* Expanded server-side screenshot mode contract with function that
checks a kibana request to determine whether we in screenshot
mode

* added comments to explain use of literal value rather than external reference

* updated comment

* update reporting example

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
Co-authored-by: Timothy Sullivan <tsullivan@elastic.co>
Co-authored-by: Tim Sullivan <tsullivan@users.noreply.github.com>
2021-05-19 16:03:27 +02:00
Vadim Dalecky 77fe59d58f
Drilldown cloning (#91959)
* refactor: 💡 remove switch statement

* feat: 🎸 improve <ListManageDrilldowns> stories

* refactor: 💡 remove <FlyoutListManageDrilldowns> component

* refactor: 💡 simplify <FlyoutDrilldownWizard> component

* feat: 🎸 introduce React context for drilldowns flyout

* refactor: 💡 rename drilldown manager component

* refactor: 💡 rename drilldown manager in example plugin

* refactor: 💡 rename folder to "containers"

* feat: 🎸 use drilldown context to store UI state

* chore: 🤖 fix linter errors

* refactor: 💡 move Drilldown Manager into its own folder

* feat: 🎸 add drilldown state management

* feat: 🎸 add <PresentablePicker> component

* chore: 🤖 clean up component props

* feat: 🎸 add <ActionFactoryPicker> component

* feat: 🎸 connect action factory picker component

* chore: 🤖 cleanup

* feat: 🎸 start work on <DrilldownForm>

* feat: 🎸 add <TriggerPicker> component

* test: 💍 add <TriggerPicker> stories

* feat: 🎸 add <DrilldownForm> component

* refactor: 💡 remove ActionFactory from <DrilldownForm>

* feat: 🎸 connect <DrilldownForm> component

* feat: 🎸 improve new drilldown connected form

* fix: 🐛 correct TypeScript types

* feat: 🎸 show trigger intersection in the UI

* feat: 🎸 add <ActionFactory> component

* feat: 🎸 show connected <ActionFactoryView> component

* feat: 🎸 use a single action factory control

* fix: 🐛 remove unused props

* refactor: 💡 improve create drilldown form

* fix: 🐛 correct hello bar close callback

* feat: 🎸 connect welcome message state to local storage

* fix: 🐛 correct TypeScript errors

* fix: 🐛 hide correctly hello bar

* feat: 🎸 add drilldown creation logic

* feat: 🎸 connect event list state

* fix: 🐛 correct story props

* fix: 🐛 correct typescript errors

* feat: 🎸 navigate to list view when drilldown is created

* feat: 🎸 add EUI tabs

* feat: 🎸 connect route state to tabs

* refactor: 💡 move flyout content into a separate component

* refactor: 💡 move manager tabs into a separate component

* chore: 🤖 delete unused variables

* feat: 🎸 make drilldowns title dynamic

* docs: ✏️ update README

* feat: 🎸 add <DrilldownManagerTitle> component

* feat: 🎸 make flyout footer dynamic

* refactor: 💡 make action factory state depend on the route

* feat: 🎸 create standalone new drilldown form

* fix: 🐛 support i18n in new drilldown form

* feat: 🎸 add space between action factory picker

* refactor: 💡 simplify <DrilldownManagerContent>

* feat: 🎸 add back chevron button to drilldown flyout

* chore: 🤖 remove unused translations

* chore: 🤖 delete unused translation file

* feat: 🎸 add <DrilldownManagerFooter> and improve title comp

* feat: 🎸 improve <CreateDrilldownForm>

* refactor: 💡 improve variable name

* feat: 🎸 add isValid() to drilldown state

* refactor: 💡 move drilldown hello bar into a seprate component

* feat: 🎸 show drilldown list on "Manage" tab

* refactor: 💡 improve drilldown list component

* feat: 🎸 connect drill list comp to delete and edit functional

* feat: 🎸 support form disabling when drill creation in progress

* feat: 🎸 connect drilldown edit form

* feat: 🎸 use /manage route for editing drilldowns

* fix: 🐛 render constant action factory in edit mode

* refactor: 💡 move drilldown footer submit button in a sep comp

* feat: 🎸 connect editing to drilldown edit form

* feat: 🎸 disable edit buttons when list has selection

* chore: 🤖 remove unused code

* feat: 🎸 show error if delete fails

* chore: 🤖 remove legacy code

* feat: 🎸 improve drilldown table component

* fix: 🐛 fix "Trigger" translation

* fix: 🐛 import correct drilldown table item

* feat: 🎸 handle empty name errors

* feat: 🎸 track config error in drilldown state

* feat: 🎸 track drilldown state trigger errors

* fix: 🐛 pre-select trigger if only one trigger is available

* feat: 🎸 add drilldown template interface

* feat: 🎸 progress on drilldown cloning list

* feat: 🎸 use table view to display drilldown cloning templates

* feat: 🎸 generate drilldown templates from embeddable siblings

* feat: 🎸 improve drilldown template generation logic

* feat: 🎸 improve drilldown template preview

* feat: 🎸 improve start from template table view

* feat: 🎸 show number of items to be cloned

* feat: 🎸 add ID to drilldown templates

* feat: 🎸 implement basic cloning functionality

* feat: 🎸 add ability to create drilldown from existing one

* feat: 🎸 improve cloning behaviour

* feat: 🎸 improve icon of templates

* feat: 🎸 remove "Start from template" accordion

* feat: 🎸 improve cloning table view

* feat: 🎸 add "Triggers" column

* feat: 🎸 enable drilldown actions in "edit" mode

* fix: 🐛 reset drilldown state cache by factory on new creation

* refactor: 💡 use in-memory table for drilldown template list

* feat: 🎸 add search box to drilldown template in-memory table

* feat: 🎸 show back chevron on no steps back, to close flyout

* feat: 🎸 show notification when drilldown was just cloned

* feat: 🎸 add i18n to cloning notification, and move to sep comp

* feat: 🎸 add support for plural and singular in translation

* feat: 🎸 make new drilldown names unique with (copy x) at end

* feat: 🎸 rename cloning to copying

* feat: 🎸 show incompatible trigger warning in template list

* refactor: 💡 craete text with icon component

* feat: 🎸 show trigger warning in manage view

* refactor: 💡 use <TextWithIcon> in drilldown table view

* feat: 🎸 add <TriggerLineItem> component

* feat: 🎸 show tooltip on incompatible icon hover

* feat: 🎸 unify tooltips in <TextWithIcon> component

* feat: 🎸 enable sorting in drilldown tables

* fix: 🐛 correct ui actions x-pack typescript errors

* fix: 🐛 correct ui actions example plugin errors

* docs: ✏️ update autogenerated docs

* chore: 🤖 remove unused translations

* test: 💍 remove implementation from todo placeholders

* test: 💍 fix dashboard drilldown functional test

* chore: 🤖 remove unused constants

* test: 💍 fix url drilldown functional test

* test: 💍 add drilldown manager state tests

* feat: 🎸 dont show back button when no more steps back

* feat: 🎸 pre-fill in drilldown name

* feat: 🎸 add copy suffix when creating new drilldown

* feat: 🎸 close flyout if opened in create mode

* feat: 🎸 dont close flyout if user navigated to "manage" tab

* feat: 🎸 show smaller notification message on cloning

* feat: 🎸 add "(copy X)" text when cloning/copying drilldowns

* feat: 🎸 make copy prefixes start from "(copy)"

* feat: 🎸 add link to dismiss notification

* feat: 🎸 rename "Clone (x)" button to "Copy (x)"

* feat: 🎸 rename tempalte table last column copy button

* feat: 🎸 use "copied" terminology in notification

* feat: 🎸 add "Copy existing drilldown" label to template picker

* feat: 🎸 use "auto" layout on drilldown template picker table

* test: 💍 add drilldown manager tests

* feat: 🎸 swap label for title
2021-04-19 19:26:05 +02:00
Shahzad cbf24cd640
[Lens] Open lens in new tab via state transfer (#96723) 2021-04-15 14:49:55 +02:00
Spencer 27c191d405
[plugin-generator] don't generate .eslintrc.js files for internal plugins (#96921)
Co-authored-by: spalger <spalger@users.noreply.github.com>
2021-04-13 07:43:03 -07:00
ymao1 03a51f4eec
[Alerting] Update feature privilege display names (#96083)
* Updating feature display names

* Updating feature display names
2021-04-08 07:47:29 -04:00
Shahzad 9d8a2f183e
[Lens] Expose events from lens for lens embeddable (#94670)
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2021-03-30 15:19:35 +02:00
Mike Côté 3abb79a179
Create new alerting HTTP APIs that use the new terminology (#93977)
* Move current alert HTTP APIs to legacy folder (#93943)

* Move current HTTP APIs to legacy folder

* Rename BASE_ALERT_API_PATH to LEGACY_BASE_ALERT_API_PATH

* Fix failing tests and extra files

* Create new rule HTTP APIs (#93980)

* Move current HTTP APIs to legacy folder

* Rename BASE_ALERT_API_PATH to LEGACY_BASE_ALERT_API_PATH

* Fix failing tests and extra files

* Move current alert HTTP APIs to legacy folder (#93943)

* Move current HTTP APIs to legacy folder

* Rename BASE_ALERT_API_PATH to LEGACY_BASE_ALERT_API_PATH

* Fix failing tests and extra files

* Add necessary files

* Create rule route

* Get rule API

* Update rule API

* Delete rule route

* Aggregate rules API

* Disable rule API

* Enable rule API

* Find rules API

* Fix Update API

* Get rule alert summary API

* Get rule state API

* Health API

* Rule types API

* Mute all API

* Mute alert API

* Unmute all API

* Unmute alert route

* Update API key API

* corrected tpye by making it much more complicated

* removed unneeded cocde

* Fixes

* Add back health route

* mutedInstanceIds -> mutedAlertIds

* lastRun -> last_run

* alert_type_state -> rule_type_state & alert_instances -> alerts

Co-authored-by: Gidi Meir Morris <github@gidi.io>

* Create docs for new rule HTTP APIs, deprecate old docs (#94745)

* Create docs for new APIs, deprecate old docs

* Remove connector_type_id

* Update docs

* Add link to legacy APIs from rules API docs

* Remove connector_type_id references

* [DOCS] Add legacy APIs to index.asciidoc

* Fix camel case

Co-authored-by: lcawl <lcawley@elastic.co>

* Make alerting tests use new rules APIs (#95159)

* Make API integration tests use new HTTP APIs

* Fix end to end tests

* Fix test failures

* Fix more test failures

* Rename some files

* Add tests for legacy APIs (#95333)

* Initial commit (#95457)

* Move some new alerting APIs to /internal (#95461)

* Initial commit

* Update README.md

* Use internal API

* Merge deprecated warning w/ alternative solution

* Update API docs

Co-authored-by: Gidi Meir Morris <github@gidi.io>
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
Co-authored-by: lcawl <lcawley@elastic.co>
2021-03-30 08:27:28 -04:00
Mikhail Shustov ee84e0b0b7
Merge tsconfig and x-pack/tsconfig files (#94519)
* merge all the typings at root level

* merge x-pack/tsconfig into tsconfig.json

* fix tsconfig after changes in master

* remove unnecessary typings

* update paths to the global typings

* update paths to the global elaticsearch typings

* fix import

* fix path to typings/elasticsearch in fleet plugin

* remove file deleted from master

* fix lint errors
2021-03-16 15:13:49 +01:00
ymao1 a7c9d3f1e0
[Alerting] Update UI to reflect new terminology (#93597)
* Renaming alerts to rules

* Updating formatted messages

* Updating i18n labels

* Completed renaming in UI

* Updating client routes including redirect

* wip docs update

* Reverting title changes for now

* Fixing types check

* Fixing unit tests

* Fixing functional test

* Fixing functional test

* docs wip

* wip docs update

* Finished first run through docs

* docs docs docs

* Fixing bad merge

* Fixing functional test

* Docs cleanup

* Cleaning up i18n labels

* Fixing functional test

* Updating screenshots

* Updating screenshots

* Updating screenshots

* Updating terminology in alerting examples

* Updating terminology in alerting examples

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2021-03-15 10:03:39 -04:00
Anton Dosov bd9170f7dc
[Search Sessions] Search session example app functional test (#92133) 2021-03-15 14:47:14 +01:00
Mike Côté 23ce8dcfdb
Rename alerts plugin to alerting (#92898)
* Rename alerts plugin to alerting

* Deprecate old config values

* Few more renames

* Update plugin list

* Rename xpack.alerts -> xpack.alerting

* Fix some ESLint rules

* Fix typecheck

* Fix some test failures

* Some more renames

* Fix ESLint

* Fix some test failures

* Fix failing jest test

* Undo exclusive test

* Fix APM deps

* Fix docs

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2021-03-05 13:59:34 -05:00
Brandon Kobel 4584a8b570
Elastic License 2.0 (#90099)
* Updating everything except the license headers themselves

* Applying ESLint rules

* Manually replacing the stragglers
2021-02-03 18:12:39 -08:00
Joe Reuter f4ebdf3a79
[Lens] Export nested types (#89868) 2021-02-03 12:03:55 +01:00
Yuliia Naumenko 8b1a228c29
[Alerting] Migrate Actions, Alerts, Stack Alerts and TriggersActionsUI plugins to TS project references (#88556)
* [Alerting] Migrate Actions plugin to TS project references

* alerts plugin ts migration

* triggers_actions_ui plugin ts migration

* fixed build

* fixed build
2021-01-20 10:53:01 -08:00
Brandon Kobel 170a2956c8
Updating the License (#88343)
* Updating the Licenses, except for applying eslint, building

* Applying ESLint rules,building @kbn/pm, regenerating api docs
2021-01-19 17:52:56 -08:00
Joe Reuter 94b02d97ed
[Lens] Implement deep linking and embedding (#84416) 2021-01-12 10:45:53 +01:00
Gidi Meir Morris b99ca969e0
[Alerting] revert the revert of Enforces typing of Alert's ActionGroups (#87382)
The https://github.com/elastic/kibana/pull/86761 PR was reverted due to a small typing issue.

This PR reverts that revert and adds a commit to address the issue: 9e4ab2002c.
2021-01-06 10:38:33 +00:00
Jonathan Budzenski 051be28c69 Revert "[Alerting] Enforces typing of Alert's ActionGroups (#86761)"
This reverts commit 76b8c491ee.
2021-01-05 13:24:59 -06:00
Gidi Meir Morris 76b8c491ee
[Alerting] Enforces typing of Alert's ActionGroups (#86761)
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
2021-01-05 18:44:57 +00:00
Josh Dover 0af81310b6
Remove dynamic mapped types from UiActions (#87075)
* Remove dynamic mapped types from UiActions

* Remove import between data <-> embeddables

* remove outdated comments, export action types from discover_enhanced

* fix notice.txt

Co-authored-by: restrry <restrry@gmail.com>
2021-01-05 10:11:05 +01:00
Tim Sullivan b120cb3218
[AppServices/Examples] Add the example for Reporting integration (#82091)
* 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>
2020-12-29 09:55:48 -07:00
Gidi Meir Morris 2db76660ce
[Alerting] Encourage type safe usage of Alerting (#86623)
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`.
2020-12-21 19:17:04 +00:00
Yuliia Naumenko 396018fd4d
Removed a possibility to define two different names for Alert types on API and UI level. (#86236)
* 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
2020-12-20 08:52:54 -08:00