Commit graph

99 commits

Author SHA1 Message Date
Quynh Nguyen 65b8dda157
[ML] Move Index Data Visualizer into separate plugin (Part 1) (#100922)
* [ML] Add index visualizer

* [ML] Readd support for global state

* [ML] Add time buckets & fix dependencies

* [ML] Working ver

* [ML] Add back and boolean support

* [ML] Remove old files inside ml

* [ML] Rename files

* [ML] Move field type icon

* [ML] Create new folder structure

* [ML] Organize index_data_visualizer

* [ML] Move types into index_data_visualizer folder

* [ML] Move more files into file_data_visualizer

* [ML] Move more files into index_data_visualizer

* [ML] Add new data visualizer model

* [ML] Remove getVisualizerFieldStats which is not used by dv

* [ML] Delete redundant folder

* [ML] Copy old data visualizer routes to new plugin

* [ML] Remove old routes

* [ML] Disable for ml job cards tests for now

* [ML] Remove todos

* [ML] Move the toast error to the UI component

* [ML] Fix map styling

* [ML] Add runtime_mappings for internal/file_upload/time_field_range

* [ML] Move routes into folder

* [ML] Update permissions

* [ML] Update texts

* [ML] Update schemas import and api get_field_stats

* [ML] Reorg folders into common

* [ML] Update types & tests

* [ML] Update internal/data_visualizer permissions and action panel tests

* [ML] Update imports after #100863

* [ML] Fix CI

* [ML] Rename folder from file_data_visualizer to data_visualizer

* [ML] Rename i18n ids

* [ML] Update fileDataVisualizer -> dataVisualizer dependency name in ml plugin

* [ML] Remove ml prefix in data test subjs

* [ML] Fix settings and docs

* [ML] Update plugin description

* [ML] Remove mlContext dependency completely

* [ML] Set query to optional

* Revert "[ML] Update plugin description"

This reverts commit 4ab1a25c

* [ML] Update plugins list docs

* [ML] Fix types and i18n

* [ML] Revert ml data test subj/class name changes

* [ML] Split up data visualizer model, remove Logger

* [ML] Remove empty file and indexPatternFieldEditor

* [ML] Move imports of file_upload

* [ML] Update plugin dependencies

* Re-add missing data_visualizer.json

* Remove capabilities in data_visualizer

* Fix test subjs

* Update ownership for data_visualizer and file_upload code to be ml

* Update estypes after 98266

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2021-06-08 14:50:14 -05:00
Alejandro Fernández Gómez 83e5b6c689
[Fleet] Remove beats management plugin (#99789) 2021-05-27 11:30:15 +02:00
Frank Hassanabad af228f0f20
[Security Solutions] (Phase 1) Adds an application cache called metrics entities and integrates it within Security Solutions behind a feature flag (#96446)
## Summary

Phase 1 of a multi-phase cautious approach for adding an experimental application cache for Kibana solutions called `metric_entities` and integrates it within Security Solutions.

Phase 1 is putting experimental support into the application without breaking existing features. Lots of TODO's, conversations and a possible RFC from phase 1 to phase 2 approach. Some features are missing, but for phase 1 the general idea and code is all there.

To enable this first phase after checking out the branch add this to your `kibana.dev.yml`

```yml
xpack.metricsEntities.enabled: true
xpack.securitySolution.enableExperimental: ['metricsEntitiesEnabled']
```

Then go into Stack Management -> Advanced Settings (Under Security Solutions) and set the enabled to true like so:
<img width="1229" alt="Screen Shot 2021-04-08 at 2 21 02 PM" src="https://user-images.githubusercontent.com/1151048/114091276-b3cbb700-9875-11eb-9083-5c1d91dd20ed.png">

Next go to the security_solutions page and you will see it being activated and you will have these transforms running if you look under stack management:
<img width="1710" alt="Screen Shot 2021-04-29 at 2 00 27 PM" src="https://user-images.githubusercontent.com/1151048/116611174-4a2e4e00-a8f3-11eb-9e15-55cb504dfb2a.png">

On the hosts page, network, page, etc... You can see them being activated when you have no query/filter and you click on request:
<img width="1405" alt="Screen Shot 2021-04-29 at 2 01 28 PM" src="https://user-images.githubusercontent.com/1151048/116611274-6a5e0d00-a8f3-11eb-9998-9f5b3d1c5c63.png">

You will see in the request the index patterns all starting with `estc_xyz*`

### 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)

We have lots of TODO's but no concrete docs with this just yet.
- [ ] [Documentation](https://www.elastic.co/guide/en/kibana/master/development-documentation.html) was added for features that require explanation or tutorials

Behind a feature flag and this isn't there yet.
- [ ] [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
2021-04-30 12:36:06 -06:00
James Gowdy 088a618f92
[ML] Moving file data vizualizer to its own plugin (#96408)
* [ML] Moving file data vizualizer to file upload plugin

* removing maps plug dependency

* fixing imports

* small refactor

* adding missing endpoints

* fixing translations

* fxing table controls

* fixing types and disabling geo point test

* actually disabling geo point test

* making endpoints internal

* moving UI code to separate plugin

* enabling maps integration

* cleaning up dependencies

* fixing translation ids

* moving analyze file endpoint out of file upload plugin

* fixing transtations issues

* refactor for lazy loading of component

* updating limits

* updating plugin asciidoc

* code clean up

* further clean up

* adding comment

* fixing really obvious CI error

* removing commented out include

* reenabling geo point test

* fixing incorrectly changed import

* removing ml from labels and identifiers

* renaming function

* moving analyse file endpoint to file upload plugin

* reverting import path changes

* adding esUiShared back in

* fixing navigation tabs alignment in basic license

* adding key to tab wrapper

* reverting test label

* further removal of ml references

* removing ml label from more identifiers

* fixing tests

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2021-04-20 22:17:22 +01:00
CJ Cenizal 35214416f8
Extract License service from CCR and Watcher into license_api_guard plugin in x-pack (#95973)
* Localize error messages.
2021-04-15 14:54:49 -07:00
Kevin Qualters 03b104cc61
[Security Solution][RAC][Timeline] Timeline plugin skeleton and test plugin harness (#95683)
* [RAC][Security Solution] Initial timeline and test plugin harness

* Change plugin name from timeline to timelines
2021-03-31 15:33:19 -04:00
Yara Tercero bbee40c819
[Lists][Exceptions] - Adding basic linting, i18n and storybook support (#94772)
### Summary

In preparation for moving all the exceptions UI components into the lists plugin adds some linting, adds the lists plugin to the i18n config and adds storybook support. Tried to add a bit stricter linting than exists in the security solution right now, rules that we've talked about wanting to enable.
2021-03-16 21:46:20 -04:00
Steph Milovic 2bb23291c7
[Security Solution] [Cases] rename case dir/plugin/context/i18n to cases (#94149) 2021-03-10 08:58:51 -07: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
Pierre Gayvallet 570dcc07b5
Implement custom global header banner (#87438)
* first draft

* update plugin list

* fix tsproject

* update bundle limits file

* remove unused start dep

* adapt imports

* POC of footer banner

* update styles, mostly

* plug banner to uiSettings

* adding some unit tests

* add tests on sort_fields

* cleanup sums in sass mixins

* some self review stuff

* update generated doc

* add tests for color field

* update chrome header test snapshots

* retrieve license info from the server

* switch from uiSettings to plugin config

* update plugin list description

* update default colors

* NIT

* add markdown support

* fix banner overlap in fullscreen mode

* change banner height to 32px

* change banner's font size to 14

* delete unused uiSettings
2021-02-11 10:12:24 +01:00
Nathan Reese 1ba7d7af9a
[Maps] remove maps_file_upload plugin and fold public folder into file_upload plugin (#90292)
* get geojson working with api/file_upload/import

* remove maps_file_upload server code

* remove common folder

* remove maps_file_upload plugin

* fix tsconfig paths

* rename file_upload plugin in maps tsconfig

* fix file path

* node scripts/build_plugin_list_docs

* fix webpack compile errors

* telemetry schema cleanup, i18n cleanup, limits cleanup

* remove mapsFileUpload from limits.yml

* remove index pattern link test case

* update telemetry/v2/clusters/_stats for new file_upload path

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2021-02-09 17:31:57 -07:00
Patryk Kopyciński d7028e1a5f
[Security Solution] Init Osquery plugin (#87109) 2021-01-28 08:24:55 +01:00
Nathan Reese 0b61847696
[Maps] rename file_upload to maps_file_upload (#89225)
* migrate file_upload plugin to maps_file_upload

* update plugins list

* results of running node scripts/build_plugin_list_docs

* fix build problems

* remove fileUpload from limits.yml

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2021-01-26 14:32:09 -07:00
Matthew Kime 109bed0768
revert runtime fields editor plugin (#88132) 2021-01-13 08:34:30 -06:00
Matthew Kime 021bb4e3e9
Create runtime field plugin, runtime field editor plugin (#87387)
* create runtime field plugin, runtime field editor plugin
2021-01-07 13:10:30 -06:00
Sébastien Loix e3c2dccf00
[Runtime fields] Editor phase 1 (#81472)
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
Co-authored-by: spalger <spalger@users.noreply.github.com>
2020-11-18 09:10:00 +01:00
Nicolas Chaulet 441a0d4ec9
[Fleet] Move ingestManager plugin to fleet (#82886) 2020-11-09 11:07:04 -05:00
Christos Nasikas 7abb1e3033
[Security Solution][Case] Case action type (#80870)
* Init connector

* Add test

* Improve comment type

* Add integration tests

* Fix i18n

* Improve tests

* Show unknown when username is null

* Improve comment type

* Pass connector to case client

* Improve type after PR #82125

* Add comment migration test

* Fix integration tests

* Fix reporter on table

* Create case connector ui

* Add connector to README

* Improve casting on executor

* Translate name

* Improve test

* Create comment type enum

* Fix type

* Fix i18n

* Move README to cases

* Filter out case connector from alerting

Co-authored-by: Mike Côté <mikecote@users.noreply.github.com>

Co-authored-by: Mike Côté <mikecote@users.noreply.github.com>
2020-11-04 12:07:17 +02:00
Pierre Gayvallet d4b2a5145a
SavedObjects tagging MVP (#79096)
* create xpack plugin skeleton, start to implement management section

* add tag creation modal

* first implementation of the tags table

* use InMemoryTable

* add edit modal and delete action

* update plugin list

* add tag list, fix types

* add capabilities check on client-side

* add tag combo box component

* add missing i18n keys

* fix privilege FTR tests

* add base structure for FTR tests

* fix feature ftr test

* use string literals for i18n

* create savedObjectsTaggingOss plugin, move API types to oss plugin, start to wire to SO management page.

* update plugin list

* fix types

* allow to use `_find` with multiple references

* add FTR test for _find API on references fields

* add _find integration tests

* update generated doc

* start to implement tag filtering on SO management section

* update generated docs

* wire tagging API to dashboard listing page

* fix i18n namespace

* fix type & tests

* update dashboard listing snapshots

* adapt FTR listingTable service to search for parsable queries

* wite tagging API to visualize listing

* update tagging plugin limits

* add server-side and client-side validation for tag create/edit

* rename title field to name

* fix types

* fix types bis

* add removeReferencesTo API to SOR/SOC

* update generated doc

* add server-side unit test for `savedObjectsTagging` plugin

* move tagging API types to its own file

* add savedObjectsTaggingOss mock

* add tags_cache tests

* add tests for client-side tag client

* extract uiApi to distinct files

* various API improvements

* add more tests

* add link between tag and so management sections + add connection counts

* add base functional test suite for tagging

* add more FTR tests

* improve feature control func test

* update codeowners

* update generated doc

* fix access to proxy modal

* adapt SO save modal to allow to add tag field

* add SO decorator registry and tag implementation

* add unit tests for SO tag decorator

* add functional tests for visualize integration

* add tag SO read permission for vis/dash feature

* add RBAC api integ tests

* add API integration tests

* add test for getTagConnectionsUrl

* add SOM test suite

* add dashboard integration suite

* remove test line

* add missing unit tests

* improve API types doc

* fix create modal save button label

* remove console.log

* improve doc

* self review

* add refresh interval for tag cache

* improve page object doc

* minor cleanup

* address review comments

* small layout fixes

* add initial focus

* use lazy accessor for tag request handler context

* adapt SOM export and export route to handle references

* remove icon from feature config due to master changes

* fix SO table tests

* update generated docs

* sort tags by name in filter dropdown and listing component

* wire SO tagging to dashboard save modal

* fix types

* - add 'create tag' action in tag selector
- add notifications on update/create/delete from management
- delete modal wording

* add description max length validation

* remove real-time validation

* fix i18n bundle id

* update expected size of savedObjectsTagging plugin

* use own useIfMounted

* update limit again, contract components cannot be lazy loaded atm.

* math is hard

* remove single usage of lodash for bundle size

* add async imports for create/edit modal

* add FTR test for 'create tag' action from tag selector

* allow 'create new' option to prepopulate name field

* extract savedObjectToTag

* add advancedSettings read user for security api_integ suite

* add audit login for security client wrapper

* use import type when possible

* wire SO tagging to lens visualization

* fix lens jest test

* Fix `create tag` option being selected when closing the selector dropdown

* add sorting to tag column from getTableColumnDef

* address some of restrry comments

* rename tag selector's setSelected option to onTagsSelected

* fix audit logging even type for saved_object_remove_references

* update plugin size limit to current size

* adapt maxlength validation wording

* remove selection column until we have batch action menu

* remove connections link when user lack read privilege to savedObjectManagement

* forbid registering multiple SO decorators with the same priority

* add so decorator test

* extract getTagFindReferences and create API mock

* update audit-logging ascidoc

* doc nit

* throw conflict error if update returns any failure

* use refresh=true as default

* wording nits

* export: rename `references` to `hasReference`

* update generated doc

* set description max length to 100

* do not initialize tag cache on anonymous pages

* split fetchObjectsToExport into two distinct functions

* change tag client `delete` call order

* tsdoc nits

* more nits

* add README for oss plugin

* add oss plugin start tests

* SavedObject.find: rename `references` to `hasReference`

* change section description label

* remove url prefix constants

* last nits and comments

* update generated doc
2020-11-03 10:33:18 +01:00
Nicolas Chaulet 415a90fb69
[Fleet] Rename ingestManager translations fleet (#81837) 2020-10-28 08:27:20 -04:00
Gidi Meir Morris 25c5daa83a
Renames "Built-In Alerts" feature to "Stack Alerts" and "Actions" feature to "Actions and Connectors" (#79513)
Renames "Built-In Alerts" feature to "Stack Alerts" and "Actions" feature to "Actions and Connectors" as we've decided these names make more appropriate and better communicate what these features are.
2020-10-06 17:51:05 +01:00
Spencer f5ca7d82d5
[kbn/optimizer] only build xpack examples when building xpack plugins (#78656)
Co-authored-by: spalger <spalger@users.noreply.github.com>
2020-09-28 13:25:15 -07:00
Anton Dosov 4b6d77fa5d
[Drilldowns] Config to disable URL Drilldown (#77887)
This pr makes sure there is way to disable URL drilldown feature.
I decided to extract Url drilldown definition into a separate plugin to benefit from regular disabling a plugin feature.
Having it as a separate plugin also makes sense because we will start adding registries specific to URL drilldown implementation

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-09-23 11:12:12 +02:00
Pierre Gayvallet 0d09cea436
Remove legacy plugins support (#77599)
* remove ALL the things.

* adapt some types and tests

* restore ensureValidConfiguration

* fix legacy service tests

* adapt uiRender mixin

* remove legacy types

* update generated doc

* restore legacy plugin schema

* update generated doc

* remove remaining code of x-pack/legacy

* adapt imports due to merge

* cleanup CODEOWNERS

* cleanup gitignore & i18nrc

* cleanup tsconfig.json

* remove unused i18n keys

* add back `"legacy/plugins/**/*",` to tsconfig until legacy space plugin is deleted

* fix create_jest_config

* remove references from eslintrc

* more eslint cleanup

* remove `x-pack/index.js`

* fix xpack gulp scripts

* fix bug with default + named imports from boom

* remove rules from eslintrc

* remove LegacyInternals

* review comments

* update generated doc

* cleanup legacy metadatas

* revert changes to eslintrc

* update generated doc
2020-09-23 09:52:51 +02:00
Larry Gregory 32a8eb2aae
Remove legacy spaces plugin (#74532) 2020-09-18 10:15:14 -04:00
Michail Yasonik 61c4e6fd8d
Stacked headers and navigational search (#72331)
Co-authored-by: Poff Poffenberger <poffdeluxe@gmail.com>
Co-authored-by: Ryan Keairns <contactryank@gmail.com>
Co-authored-by: pgayvallet <pierre.gayvallet@elastic.co>
Co-authored-by: cchaos <caroline.horn@elastic.co>
2020-09-14 14:32:30 -05:00
Chris Roberson 54926523e8
Convert to using new status, and remove legacy plugin (#75806)
* Convert to using new status, and remove legacy plugin

* PR feedback

* Fix test

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-08-31 11:42:17 -04:00
Gidi Meir Morris 67025579ba
[Event log] Use Alerts client & Actions client when fetching these types of SOs (#73257)
Introduces a pluggable API to Event Log which allows custom Providers for Saved Objects which is used to ensure a user is authorised to get the Saved Object referenced in the Event Log whenever the find api is called.
2020-08-11 15:00:02 +01:00
Constance f7b5144e1d
New Enterprise Search Kibana plugin (#66922)
* Initial App Search in Kibana plugin work

- Initializes a new platform plugin that ships out of the box w/ x-pack
- Contains a very basic front-end that shows AS engines, error states, or a Setup Guide
- Contains a very basic server that remotely calls the AS internal engines API and returns results

* Update URL casing to match Kibana best practices

- URL casing appears to be snake_casing, but kibana.json casing appears to be camelCase

* Register App Search plugin in Home Feature Catalogue

* Add custom App Search in Kibana logo

- I haven't had much success in surfacing a SVG file via a server-side endpoint/URL, but then I realized EuiIcon supports passing in a ReactElement directly. Woo!

* Fix appSearch.host config setting to be optional

- instead of crashing folks on load

* Rename plugin to Enterprise Search

- per product decision, URL should be enterprise_search/app_search and Workplace Search should also eventually live here
- reorganize folder structure in anticipation for another workplace_search plugin/codebase living alongside app_search
- rename app.tsx/main.tsx to a standard top-level index.tsx (which will contain top-level routes/state)
- rename AS->ES files/vars where applicable
- TODO: React Router

* Set up React Router URL structure

* Convert showSetupGuide action/flag to a React Router link

- remove showSetupGuide flag
- add a new shared helper component for combining EuiButton/EuiLink with React Router behavior (https://github.com/elastic/eui/blob/master/wiki/react-router.md#react-router-51)

* Implement Kibana Chrome breadcrumbs

- create shared helper (WS will presumably also want this) for generating EUI breadcrumb objects with React Router links+click behavior
- create React component that calls chrome.setBreadcrumbs on page mount
- clean up type definitions - move app-wide props to IAppSearchProps and update most pages/views to simply import it instead of calling their own definitions

* Added server unit tests (#2)

* Added unit test for server

* PR Feedback

* Refactor top-level Kibana props to a global context state

- rather them passing them around verbosely as props, the components that need them should be able to call the useContext hook

+ Remove IAppSearchProps in favor of IKibanaContext

+ Also rename `appSearchUrl` to `enterpriseSearchUrl`, since this context will contained shared/Kibana-wide values/actions useful to both AS and WS

* Added unit tests for public (#4)

* application.test.ts

* Added Unit Test for EngineOverviewHeader

* Added Unit Test for generate_breadcrumbs

* Added Unit Test for set_breadcrumb.tsx

* Added a unit test for link_events

- Also changed link_events.tsx to link_events.ts since it's just TS, no
React
- Modified letBrowserHandleEvent so it will still return a false
boolean when target is blank

* Betterize these tests

Co-Authored-By: Constance <constancecchen@users.noreply.github.com>

Co-authored-by: Constance <constancecchen@users.noreply.github.com>

* Add UI telemetry tracking to AS in Kibana (#5)

* Set up Telemetry usageCollection, savedObjects, route, & shared helper

- The Kibana UsageCollection plugin handles collecting our telemetry UI data (views, clicks, errors, etc.) and pushing it to elastic's telemetry servers
- That data is stored in incremented in Kibana's savedObjects lib/plugin (as well as mapped)
- When an end-user hits a certain view or action, the shared helper will ping the app search telemetry route which increments the savedObject store

* Update client-side views/links to new shared telemetry helper

* Write tests for new telemetry files

* Implement remaining unit tests (#7)

* Write tests for React Router+EUI helper components

* Update generate_breadcrumbs test

- add test suite for generateBreadcrumb() itself (in order to cover a missing branch)
- minor lint fixes
- remove unnecessary import from set_breadcrumbs test

* Write test for get_username util

+ update test to return a more consistent falsey value (null)

* Add test for SetupGuide

* [Refactor] Pull out various Kibana context mocks into separate files

- I'm creating a reusable useContext mock for shallow()ed enzyme components
+ add more documentation comments + examples

* Write tests for empty state components

+ test new usecontext shallow mock

* Empty state components: Add extra getUserName branch test

* Write test for app search index/routes

* Write tests for engine overview table

+ fix bonus bug

* Write Engine Overview tests

+ Update EngineOverview logic to account for issues found during tests :)
  - Move http to async/await syntax instead of promise syntax (works better with existing HttpServiceMock jest.fn()s)
  - hasValidData wasn't strict enough in type checking/object nest checking and was causing the app itself to crash (no bueno)

* Refactor EngineOverviewHeader test to use shallow + to full coverage

- missed adding this test during telemetry work
- switching to shallow and beforeAll reduces the test time from 5s to 4s!

* [Refactor] Pull out React Router history mocks into a test util helper

+ minor refactors/updates

* Add small tests to increase branch coverage

- mostly testing fallbacks or removing fallbacks in favor of strict type interface
- these are slightly obsessive so I'd also be fine ditching them if they aren't terribly valuable

* Address larger tech debt/TODOs (#8)

* Fix optional chaining TODO

- turns out my local Prettier wasn't up to date, completely my bad

* Fix constants TODO

- adds a common folder/architecture for others to use in the future

* Remove TODO for eslint-disable-line and specify lint rule being skipped

- hopefully that's OK for review, I can't think of any other way to sanely do this without re-architecting the entire file or DDoSing our API

* Add server-side logging to route dependencies

+ add basic example of error catching/logging to Telemetry route
+ [extra] refactor mockResponseFactory name to something slightly easier to read

* Move more Engines Overview API logic/logging to server-side

- handle data validation in the server-side
- wrap server-side API in a try/catch to account for fetch issues
- more correctly return 2xx/4xx statuses and more correctly deal with those responses in the front-end
- Add server info/error/debug logs (addresses TODO)
- Update tests + minor refactors/cleanup
    - remove expectResponseToBe200With helper (since we're now returning multiple response types) and instead make mockResponse var name more readable
    - one-line header auth
    - update tests with example error logs
    - update schema validation for `type` to be an enum of `indexed`/`meta` (more accurately reflecting API)

* Per telemetry team feedback, rename usageCollection telemetry mapping name to simpler 'app_search'

- since their mapping already nests under 'kibana.plugins'
- note: I left the savedObjects name with the '_telemetry' suffix, as there very well may be a use case for top-level generic 'app_search' saved objects

* Update Setup Guide installation instructions (#9)

Co-authored-by: Chris Cressman <chris@chriscressman.com>

* [Refactor] DRY out route test helper

* [Refactor] Rename public/test_utils to public/__mocks__

- to better follow/use jest setups and for .mock.ts suffixes

* Add platinum licensing check to Meta Engines table/call (#11)

* Licensing plugin setup

* Add LicensingContext setup

* Update EngineOverview to not hit meta engines API on platinum license

* Add Jest test helpers for future shallow/context use

* Update plugin to use new Kibana nav + URL update (#12)

* Update new nav categories to add Enterprise Search + update plugin to use new category

- per @johnbarrierwilson and Matt Riley, Enterprise Search should be under Kibana and above Observability
- Run `node scripts/check_published_api_changes.js --accept` since this new category affects public API

* [URL UPDATE] Change '/app/enterprise_search/app_search' to '/app/app_search'

- This needs to be done because App Search and Workplace search *have* to be registered as separate plugins to have 2 distinct nav links
- Currently Kibana doesn't support nested app names (see: https://github.com/elastic/kibana/issues/59190) but potentially will in the future

- To support this change, we need to update applications/index.tsx to NOT handle '/app/enterprise_search' level routing, but instead accept an async imported app component (e.g. AppSearch, WorkplaceSearch).
- AppSearch should now treat its router as root '/' instead of '/app_search'

- (Addl) Per Josh Dover's recommendation, switch to `<Router history={params.history}>` from `<BrowserRouter basename={params.appBasePath}>` since they're deprecating appBasePath

* Update breadcrumbs helper to account for new URLs

- Remove path for Enterprise Search breadcrumb, since '/app/enterprise_search' will not link anywhere meaningful for the foreseeable future, so the Enterprise Search root should not go anywhere
- Update App Search helper to go to root path, per new React Router setup

Test changes:
- Mock custom basepath for App Search tests
- Swap enterpriseSearchBreadcrumbs and appSearchBreadcrumbs test order (since the latter overrides the default mock)

* Add create_first_engine_button telemetry tracking to EmptyState

* Switch plugin URLs back to /app/enterprise_search/app_search

Now that https://github.com/elastic/kibana/pull/66455 has been merged in 🎉

* Add i18n formatted messages / translations (#13)

* Add i18n provider and formatted/i18n translated messages

* Update tests to account for new I18nProvider context + FormattedMessage components

- Add new mountWithContext helper that provides all contexts+providers used in top-level app
- Add new shallowWithIntl helper for shallow() components that dive into FormattedMessage

* Format i18n dates and numbers

+ update some mock tests to not throw react-intl invalid date messages

* Update EngineOverviewHeader to disable button on prop

* Address review feedback (#14)

* Fix Prettier linting issues

* Escape App Search API endpoint URLs

- per PR feedback
- querystring should automatically encodeURIComponent / escape query param strings

* Update server plugin.ts to use getStartServices() rather than storing local references from start()

- Per feedback: https://github.com/elastic/kibana/blob/master/src/core/CONVENTIONS.md#applications

- Note: savedObjects.registerType needs to be outside of getStartServices, or an error is thrown

- Side update to registerTelemetryUsageCollector to simplify args

- Update/fix tests to account for changes

* E2E testing (#6)

* Wired up basics for E2E testing

* Added version with App Search

* Updated naming

* Switched configuration around

* Added concept of 'fixtures'

* Figured out how to log in as the enterprise_search user

* Refactored to use an App Search service

* Added some real tests

* Added a README

* Cleanup

* More cleanup

* Error handling + README updatre

* Removed unnecessary files

* Apply suggestions from code review

Co-authored-by: Constance <constancecchen@users.noreply.github.com>

* Update x-pack/plugins/enterprise_search/public/applications/app_search/components/engine_overview/engine_table.tsx

Co-authored-by: Constance <constancecchen@users.noreply.github.com>

* PR feedback - updated README

* Additional lint fixes

Co-authored-by: Constance <constancecchen@users.noreply.github.com>

* Add README and CODEOWNERS (#15)

* Add plugin README and CODEOWNERS

* Fix Typescript errors (#16)

* Fix public mocks

* Fix empty states types

* Fix engine table component errors

* Fix engine overview component errors

* Fix setup guide component errors

- SetBreadcrumbs will be fixed in a separate commit

* Fix App Search index errors

* Fix engine overview header component errors

* Fix applications context index errors

* Fix kibana breadcrumb helper errors

* Fix license helper errors

*  Refactor React Router EUI link/button helpers
- in order to fix typescript errors

- this changes the component logic significantly to a react render prop, so that the Link and Button components can have different types - however, end behavior should still remain the same

* Fix telemetry helper errors

* Minor unused var cleanup in plugin files

* Fix telemetry collector/savedobjects errors

* Fix MockRouter type errors and add IRouteDependencies export

- routes will use IRouteDependencies in the next few commits

* Fix engines route errors

* Fix telemetry route errors

* Remove any type from source code

- thanks to Scotty for the inspiration

* Add eslint rules for Enterprise Search plugin

- Add checks for type any, but only on non-test files
- Disable react-hooks/exhaustive-deps, since we're already disabling it in a few files and other plugins also have it turned off

* Cover uncovered lines in engines_table and telemetry tests

* Fixed TS warnings in E2E tests (#17)

* Feedback: Convert static CSS values to EUI variables where possible

* Feedback: Flatten nested CSS where possible

- Prefer setting CSS class overrides on individual EUI components, not on a top-level page

+ Change CSS class casing from kebab-case to camelCase to better match EUI/Kibana

+ Remove unnecessary .euiPageContentHeader margin-bottom override by changing the panelPaddingSize of euiPageContent

+ Decrease engine overview table padding on mobile

* Refactor out components shared with Workplace Search (#18)

* Move getUserName helper to shared

- in preparation for Workplace Search plugin also using this helper

* Move Setup Guide layout to a shared component

* Setup Guide: add extra props for standard/native auth links

Note: It's possible this commit may be unnecessary if we can publish shared Enterprise Search security mode docs

* Update copy per feedback from copy team

* Address various telemetry issues

- saved objects: removing indexing per #43673
- add schema and generate json per #64942
- move definitions over to collectors since saved objects is mostly empty at this point, and schema throws an error when it imports an obj instead of being defined inline
- istanbul ignore saved_objects file since it doesn't have anything meaningful to test but was affecting code coverage

* Disable plugin access if a normal user does not have access to App Search (#19)

* Set up new server security dependency and configs

* Set up access capabilities

* Set up checkAccess helper/caller

* Remove NoUserState component from the public UI

- Since this is now being handled by checkAccess / normal users should never see the plugin at all if they don't have an account/access, the component is no longer needed

* Update server routes to account for new changes

- Remove login redirect catch from routes, since the access helper should now handle that for most users by disabling the plugin (superusers will see a generic cannot connect/error screen)
- Refactor out new config values to a shared mock

* Refactor Enterprise Search http call to hit/return new internal API endpoint

+ pull out the http call to a separate library for upcoming public URL work (so that other files can call it directly as well)

* [Discussion] Increase timeout but add another warning timeout for slow servers

- per recommendation/convo with Brandon

* Register feature control

* Remove no_as_account from UI telemetry

- since we're no longer tracking that in the UI

* Address PR feedback - isSuperUser check

* Public URL support for Elastic Cloud (#21)

* Add server-side public URL route

- Per feedback from Kibana platform team, it's not possible to pass info from server/ to public/ without a HTTP call :[

* Update MockRouter for routes without any payload/params

* Add client-side helper for calling the new public URL API

+ API seems to return a URL a trailing slash, which we need to omit

* Update public/plugin.ts to check and set a public URL

- relies on this.hasCheckedPublicUrl to only make the call once per page load instead of on every page nav

* Fix failing feature control tests

- Split up scenario cases as needed
- Add plugin as an exception alongside ML & Monitoring

* Address PR feedback

- version: kibana
- copy edits
- Sass vars
- code cleanup

* Casing feedback: change all plugin registration IDs from snake_case to camelCase

- note: current remainng snake_case exceptions are telemetry keys
- file names and api endpoints are snake_case per conventions

* Misc security feedback

- remove set
- remove unnecessary capabilities registration
- telemetry namespace agnostic

* Security feedback: add warn logging to telemetry collector

see https://github.com/elastic/kibana/pull/66922#discussion_r451215760
- add if statement
- pass log dependency around (this is kinda medium, should maybe refactor)
- update tests
- move test file comment to the right file (was meant for telemetry route file)

* Address feedback from Pierre

- Remove unnecessary ServerConfigType
- Remove unnecessary uiCapabilities
- Move registerTelemetryRoute / SavedObjectsServiceStart workaround
- Remove unnecessary license optional chaining

* PR feedback

Address type/typos

* Fix telemetry API call returning 415 on Chrome

- I can't even?? I swear charset=utf-8 fixed the same error a few weeks ago

* Fix failing tests

* Update Enterprise Search functional tests (without host) to run on CI

- Fix incorrect navigateToApp slug (hadn't realized this was a URL, not an ID)
- Update without_host_configured tests to run without API key
- Update README

* Address PR feedback from Pierre

- remove unnecessary authz?
- remove unnecessary content-type json headers
- add loggingSystemMock.collect(mockLogger).error assertion
- reconstrcut new MockRouter on beforeEach for better sandboxing
- fix incorrect describe()s -should be it()
- pull out reusable mockDependencies helper (renamed/extended from mockConfig) for tests that don't particularly use config/log but still want to pass type definitions
- Fix comment copy

Co-authored-by: Jason Stoltzfus <jastoltz24@gmail.com>
Co-authored-by: Chris Cressman <chris@chriscressman.com>
Co-authored-by: scottybollinger <scotty.bollinger@elastic.co>
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-07-09 13:10:31 -07:00
Catherine Liu 8ed4f7f91f
Adds link for Cloud deployment settings (#66486)
Co-authored-by: Michail Yasonik <michail@yasonik.com>
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-06-24 15:08:37 -07:00
Alexey Antonov 6cc8ea1861
Migrate dashboard mode (#69305)
Closes: #67469

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-06-23 14:38:39 +03:00
Anton Dosov f33192d35f
[refactor] remove drilldown plugin, move components to uiActionsEnhanced (#69403)
* refactor: remove drilldown plugin by moving components to uiActionsEnhanced

* fix

* fix mistake in test

* fix i18n
2020-06-18 15:35:22 +02:00
Vadim Dalecky 3ee0bf2132
Explore underlying data (#68496)
* feat: 🎸 stub discover_enhanced plugin

* feat: 🎸 improve view in discover action

* feat: 🎸 add URL generator to "View in Discover" action

* feat: 🎸 implement navigation and getHref in view raw logs actio

* fix: 🐛 disable action in "edit" mode

* refactor: 💡 renamce context menu view in discover action

* feat: 🎸 rename action to "explore data"

* fix: 🐛 correctly generate action path

* feat: 🎸 add internationalization to "explore action"

* fix: 🐛 correctly parse generated Discover URL path

* test: 💍 setup basic functional tests

* refactor: 💡 modularize url generation logic

* feat: 🎸 export CommonlyUsed type

* test: 💍 add test subjects to panel custom time range modal

* test: 💍 add index patterna and time range functional tests

* refactor: 💡 rename action file

* refactor: 💡 use URL generator from Discover plugin's contract

* test: 💍 add "Explore raw data" action unit tests

* fix: 🐛 import share plugin to check if it is enabled

* Update x-pack/plugins/discover_enhanced/public/actions/view_in_discover/explore_data_context_menu_action.ts

Co-authored-by: Matthias Wilhelm <ankertal@gmail.com>

* chore: 🤖 add discover_enhanced to KibanaApp codeowners

* test: 💍 improve "Explore underlying data" functional tests

* test: 💍 improve <a> link assertion

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
Co-authored-by: Matthias Wilhelm <ankertal@gmail.com>
2020-06-17 10:31:16 +02:00
Cauê Marcondes 07e3c9cb41
[Observability] Landing page for Observability (#67467)
* creating overview page and menu

* styling the home page

* adjusting breadcrumb

* renaming isnt working

* renaming isnt working

* renaming isnt working

* fixing import

* fixing scroll when resize window

* fixing eslint errors

* prepending links

* adding target option

* refactoring

* adding dark mode support

* fixing prettier format

* fixing i18n

* reverting some unnecessary changes

* addressing PR comments

* fixing functional tests

* ordering observability menu

* fixing tests

* addressing PR comments

* fixing test

* fixing scroll

* addressing pr comments

* addressing pr comments

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-06-08 09:07:35 +02:00
Vadim Dalecky 99a6435daf
advanced_ui_actions 👉 ui_actions_enhanced (#68258)
* chore: 🤖 rename advanced_ui_actions to ui_actions_enhanced

* chore: 🤖 rename exported interface to "enhanced"
2020-06-05 13:14:01 +02:00
Aleh Zasypkin c6e2fed1c6
Register privileges in Kibana Platform Security plugin and remove legacy getUser API. (#65472) 2020-06-05 08:11:58 +02:00
Pierre Gayvallet c5546f4a39
Add globalSearch x-pack plugin (#66293)
* add skeleton for global_search plugin

* base implementation of the server-side service

* add utils tests

* add server-side mocks

* move take_in_array to common folder

* implements base of client-side plugin

* add tests for server-side service

* fix server plugin tests

* implement `navigateToUrl` core API

* extract processResults for the client-side

* fetch server results from the client side

* factorize process_results

* fix plugin start params

* move things around

* move all server types to single file

* fix types imports

* add basic FTR tests

* add client-side service tests

* add tests for addNavigate

* add getDefaultPreference & tests

* use optional for RequestHandlerContext

* add registerRoutes test

* add base test for context

* resolve TODO

* common nits/doc

* common nits/doc on public

* update CODEOWNERS

* add import for declare statement

* add license check on the server-side

* add license check on the client-side

* eslint

* address some review comments

* use properly typed errors for obs

* add integration tests for the find endpoint

* fix unit tests

* use licensing start contract

* translate the error message

* fix eslint rule for test_utils

* fix test_utils imports

* remove NavigableGlobalSearchResult, use `application.navigateToUrl` instead.

* use coreProvider plugin in FTR tests

* nits

* fix service start params

* fix service start params, bis

* I really need to fix this typecheck oom error

* add README, update missing jsdoc

* nits on doc
2020-06-04 16:18:02 +02:00
Xavier Mouligneau 1216b0f7cd
[SECURITY] Rename siem plugin to security_solution (#67902)
* rename siem to security_solution

* rename siem to security solution inside of code

* rename translation keys

* fix snapshot

* replace siem for security solution in tutorial

* missing translation to be renamed

* fix types for api test integration

* updates runner file to match the new path

* change category for kibana settings

* miss renaming in advance settings

* fixes cypress tests

* fix api integration test

* fix new translation

* fix unit test

* update translation i18n

* update translation i18n II

Co-authored-by: Gloria Hornero <snootchie.boochies@gmail.com>
2020-06-04 05:35:13 -04:00
Tim Sullivan 2f67cbfa9c
[Reporting] Move code out of Legacy (#67904)
* [Reporting] Move code out of Legacy

* Elasticsearch is not a plugin dep

* add data as plugin dependo

* diff cleanup 1

* log the browser download

* Update paths in outside code for new Reporting home

* fix download test

* add numeral typing for x-pack/test

* Fix jest tests for np migration

* Shorten import paths

* remove this file, add typings to the node module

* remove local typing that has been provided by node module

* Add optional security plugin dep

* revert conflicting apm typings removal

* fix i18n

* fix snakecase whitelist

Co-authored-by: Joel Griffith <joel.griffith@elastic.co>
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-06-03 15:40:56 -07:00
Yuliia Naumenko ce45dad8b6
Changed alerting API endpoints urls, bodies and params to follow Kibana STYLEGUIDE (#66838)
* Changed alerting API endpoints urls, bodies and params to follow Kibana STYLEGUIDE

* Changed alerting REST API to keep the pattern 'alerts/alert/{id}'

* fixed tests

* fixed tests

* Fixed jest tests

* Renamed plugin from alerting to alerts

* fixed tests

* fixed tests

* Fixed alert type check error

* Fixed find api

* fixed type checks

* fixed tests security issues

* Fixed view in app

* -

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-06-01 18:45:36 -07:00
Josh Dover 62e8214f90
Migrate Beats Management UI to KP (#65791) 2020-05-15 10:22:12 -06:00
Vadim Dalecky 86bafec3a4
Drilldown count tooltip (#65105)
* feat: 🎸 add tooltip ability to ui_actions

* feat: 🎸 add tooltip support to drilldown count notification

* test: 💍 add drilldown tooltip text tests

* fix: 🐛 improve tooltip texts

* fix: 🐛 put tooltip on top

* fix: 🐛 add missing method to ActionFactory

* fix: 🐛 improve handling of optional method
2020-05-08 10:05:27 +02:00
Corey Robertson b8bea5b8b2
[Canvas] move files from legacy/plugins to plugins (#65283)
* Moves the files

* Rename legacy/plugins/canvas paths

* Correct paths

* Fix shareable_runtime and storybook

* ESLint Fixes

* Fix jest test and paths
2020-05-05 20:52:56 -04:00
Vadim Dalecky 360b9c1200
Drilldowns (#61219)
* Add drilldown wizard components

* Dynamic actions (#58216)

* feat: 🎸 add DynamicAction and FactoryAction types

* feat: 🎸 add Mutable<T> type to @kbn/utility-types

* feat: 🎸 add ActionInternal and ActionContract

* chore: 🤖 remove unused file

* feat: 🎸 improve action interfaces

* docs: ✏️ add JSDocs

* feat: 🎸 simplify ui_actions interfaces

* fix: 🐛 fix TypeScript types

* feat: 🎸 add AbstractPresentable interface

* feat: 🎸 add AbstractConfigurable interface

* feat: 🎸 use AbstractPresentable in ActionInternal

* test: 💍 fix ui_actions Jest tests

* feat: 🎸 add state container to action

* perf: ️ convert MenuItem to React component on Action instance

* refactor: 💡 rename AbsractPresentable -> Presentable

* refactor: 💡 rename AbstractConfigurable -> Configurable

* feat: 🎸 add Storybook to ui_actions

* feat: 🎸 add <ErrorConfigureAction> component

* feat: 🎸 improve <ConfigureAction> component

* chore: 🤖 use .story file extension prefix for Storybook

* feat: 🎸 improve <ErrorConfigureAction> component

* feat: 🎸 show error if dynamic action has CollectConfig missing

* feat: 🎸 render sample action configuration component

* feat: 🎸 connect action config to <ConfigureAction>

* feat: 🎸 improve <ConfigureAction> stories

* test: 💍 add ActionInternal serialize/deserialize tests

* feat: 🎸 add ActionContract

* feat: 🎸 split action Context into Execution and Presentation

* fix: 🐛 fix TypeScript error

* refactor: 💡 extract state container hooks to module scope

* docs: ✏️ fix typos

* chore: 🤖 remove Mutable<t> type

* test: 💍 don't cast to any getActions() function

* style: 💄 avoid using unnecessary types

* chore: 🤖 address PR review comments

* chore: 🤖 rename ActionContext generic

* chore: 🤖 remove order from state container

* chore: 🤖 remove deprecation notice on getHref

* test: 💍 fix tests after order field change

* remove comments

Co-authored-by: Matt Kime <matt@mattki.me>
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>

* Drilldown context menu (#59638)

* fix: 🐛 fix TypeScript error

* feat: 🎸 add CONTEXT_MENU_DRILLDOWNS_TRIGGER trigger

* fix: 🐛 correctly order context menu items

* fix: 🐛 set correct order on drilldown flyout actions

* fix: 🐛 clean up context menu building functions

* feat: 🎸 add context menu separator action

* Add basic ActionFactoryService. Pass data from it into components instead of mocks

* Dashboard x pack (#59653)

* feat: 🎸 add dashboard_enhanced plugin to x-pack

* feat: 🎸 improve context menu separator

* feat: 🎸 move drilldown flyout actions to dashboard_enhanced

* fix: 🐛 fix exports from ui_actions plugin

* feat: 🎸 "implement" registerDrilldown() method

* fix ConfigurableBaseConfig type

* Implement connected flyout_manage_drilldowns component

* Simplify connected flyout manage drilldowns component. Remove intermediate component

* clean up data-testid workaround in new components

* Connect welcome message to storage

Not sure, but use LocalStorage. Didn’t find a way to persist user settings. looks like uiSettings are not user scoped.

* require `context` in Presentable. drill context down through wizard components

* Drilldown factory (#59823)

* refactor: 💡 import storage interface from ui_actions plugin

* refactor: 💡 make actions not-dynamic

* feat: 🎸 fix TypeScript errors, reshuffle types and code

* fix: 🐛 fix more TypeScript errors

* fix: 🐛 fix TypeScript import error

* Drilldown registration (#59834)

* feat: 🎸 improve drilldown registration method

* fix: 🐛 set up translations for dashboard_enhanced plugin

* Drilldown events 3 (#59854)

* feat: 🎸 add serialize/unserialize to action

* feat: 🎸 pass in uiActions service into Embeddable

* feat: 🎸 merge ui_actions oss and basic plugins

* refactor: 💡 move action factory registry to OSS

* fix: 🐛 fix TypeScript errors

* Drilldown events 4 (#59876)

* feat: 🎸 mock sample drilldown execute methods

* feat: 🎸 add .dynamicActions manager to Embeddable

* feat: 🎸 add first version of dynamic action manager

* Drilldown events 5 (#59885)

* feat: 🎸 display drilldowns in context menu only on one embed

* feat: 🎸 clear dynamic actions from registry when embed unloads

* fix: 🐛 fix OSS TypeScript errors

* basic integration of components with dynamicActionManager

* fix: 🐛 don't overwrite explicitInput with combined input (#59938)

* display drilldown count in embeddable edit mode

* display drilldown count in embeddable edit mode

* improve wizard components. more tests.

* partial progress, dashboard drilldowns (#59977)

* partial progress, dashboard drilldowns

* partial progress, dashboard drilldowns

* feat: 🎸 improve dashboard drilldown setup

* feat: 🎸 wire in services into dashboard drilldown

* chore: 🤖 add Storybook to dashboard_enhanced

* feat: 🎸 create presentational <DashboardDrilldownConfig>

* test: 💍 add <DashboardDrilldownConfig> stories

* test: 💍 use presentation dashboar config component

* feat: 🎸 wire in services into React component

* docs: ✏️ add README to /components folder

* feat: 🎸 increase importance of Dashboard drilldown

* feat: 🎸 improve icon definition in drilldowns

* chore: 🤖 remove unnecessary comment

* chore: 🤖 add todos

Co-authored-by: streamich <streamich@gmail.com>

* Manage drilldowns toasts. Add basic error handling.

* support order in action factory selector

* fix column order in manage drilldowns list

* remove accidental debug info

* bunch of nit ui fixes

* Drilldowns reactive action manager (#60099)

* feat: 🎸 improve isConfigValid return type

* feat: 🎸 make DynamicActionManager reactive

* docs: ✏️ add JSDocs to public mehtods of DynamicActionManager

* feat: 🎸 make panel top-right corner number badge reactive

* fix: 🐛 correctly await for .deleteEvents()

* Drilldowns various 2 (#60103)

* chore: 🤖 address review comments

* test: 💍 fix embeddable_panel.test.tsx tests

* chore: 🤖 clean up ActionInternal

* chore: 🤖 make isConfigValid a simple predicate

* chore: 🤖 fix TypeScript type errors

* test: 💍 stub DynamicActionManager tests (#60104)

* Drilldowns review 1 (#60139)

* refactor: 💡 improve generic types

* fix: 🐛 don't overwrite icon

* fix: 🐛 fix x-pack TypeScript errors

* fix: 🐛 fix TypeScript error

* fix: 🐛 correct merge

* Drilldowns various 4 (#60264)

* feat: 🎸 hide "Create drilldown" from context menu when needed

* style: 💄 remove AnyDrilldown type

* feat: 🎸 add drilldown factory context

* chore: 🤖 remove sample drilldown

* fix: 🐛 increase spacing between action factory picker

* workaround issue with closing flyout when navigating away

Adds overlay just like other flyouts which makes this defect harder to bump in

* fix react key issue in action_wizard

* don’t open 2 flyouts

* fix action order

https://github.com/elastic/kibana/issues/60138

* Drilldowns reload stored (#60336)

* style: 💄 don't use double equals __

* feat: 🎸 add reload$ to ActionStorage interface

* feat: 🎸 add reload$ to embeddable event storage

* feat: 🎸 add storage syncing to DynamicActionManager

* refactor: 💡 use state from DynamicActionManager in React

* fix: 🐛 add check for manager being stopped

* Drilldowns triggers (#60339)

* feat: 🎸 make use of supportedTriggers()

* feat: 🎸 pass in context to configuration component

* feat: 🎸 augment factory context

* fix: 🐛 stop infinite re-rendering

* Drilldowns multitrigger (#60357)

* feat: 🎸 add support for multiple triggers

* feat: 🎸 enable Drilldowns for TSVB

Although TSVB brushing event is now broken on master, KibanaApp plans to
fix it in 7.7

* "Create drilldown" flyout - design cleanup (#60309)

* create drilldown flyout cleanup

* remove border from selectedActionFactoryContainer

* adjust callout in DrilldownHello

* update form labels

* remove unused file

* fix type error

Co-authored-by: Anton Dosov <anton.dosov@elastic.co>

* basic unit tests for flyout_create_drildown action

* Drilldowns finalize (#60371)

* fix: 🐛 align flyout content to left side

* fix: 🐛 move context menu item number 1px lower

* fix: 🐛 move flyout back nav chevron up

* fix: 🐛 fix type check after refactor

* basic unit tests for drilldown actions

* Drilldowns finalize 2 (#60510)

* test: 💍 fix test mock

* chore: 🤖 remove unused UiActionsService methods

* refactor: 💡 cleanup UiActionsService action registration

* fix: 🐛 add missing functionality after refactor

* test: 💍 add action factory tests

* test: 💍 add DynamicActionManager tests

* feat: 🎸 capture error if it happens during initial load

* fix: 🐛 register correctly CSV action

* feat: 🎸 don't show "OPTIONS" title on drilldown context menus

* feat: 🎸 add server-side for x-pack dashboard plugin

* feat: 🎸 disable Drilldowns for TSVB

* feat: 🎸 enable drilldowns on kibana.yml feature flag

* feat: 🎸 add feature flag comment to kibana.yml

* feat: 🎸 remove places from drilldown interface

* refactor: 💡 remove place in factory context

* chore: 🤖 remove doExecute

* remove not needed now error_configure_action component

* remove workaround for storybook

* feat: 🎸 improve DrilldownDefinition interface

* style: 💄 replace any by unknown

* chore: 🤖 remove any

* chore: 🤖 make isConfigValid return type a boolean

* refactor: 💡 move getDisplayName to factory, remove deprecated

* style: 💄 remove any

* feat: 🎸 improve ActionFactoryDefinition

* refactor: 💡 change visualize_embeddable params

* feat: 🎸 add dashboard dependency to dashboard_enhanced

* style: 💄 rename drilldown plugin life-cycle contracts

* refactor: 💡 do naming adjustments for dashboard drilldown

* fix: 🐛 fix Type error

* fix: 🐛 fix TypeScript type errors

* test: 💍 fix test after refactor

* refactor: 💡 rename context -> placeContext in React component

* chore: 🤖 remove setting from kibana.yml

* refactor: 💡 change return type of getAction as per review

* remove custom css per review

* refactor: 💡 rename drilldownCount to eventCount

* style: 💄 remove any

* refactor: 💡 change how uiActions are passed to vis embeddable

* style: 💄 remove unused import

* fix: 🐛 pass in uiActions to visualize_embeddable

* fix: 🐛 correctly register action

* fix: 🐛 fix type error

* chore: 🤖 remove unused translations

* Dynamic actions to xpack (#62647)

* feat: 🎸 set up sample action factory provider

* feat: 🎸 create dashboard_enhanced plugin

* feat: 🎸 add EnhancedEmbeddable interface

* refactor: 💡 move DynamicActionManager to x-pack

* feat: 🎸 connect dynamic action manager to embeddable life-cycle

* test: 💍 fix Jest tests after refactor

* fix: 🐛 fix type error

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>

* refactor: 💡 move action factories to x-pack (#63190)

* refactor: 💡 move action factories to x-pack

* fix: 🐛 use correct plugin embeddable deps

* test: 💍 fix Jest test after refactor

* chore: 🤖 remove kibana.yml flag (#62441)

* Panel top right (#63466)

* feat: 🎸 add PANEL_NOTIFICATION_TRIGGER

* feat: 🎸 add PanelNotificationsAction action

* test: 💍 add PanelNotificationsAction unit tests

* refactor: 💡 revert addTriggerAction() change

* style: 💄 remove unused import

* fix: 🐛 fix typecheck errors after merge

* support getHref in drilldowns (#63727)

* chore: 🤖 remove ui_actions storybook config

* update docs

* fix ts

* fix: 🐛 fix broken merge

* [Drilldowns] Dashboard to dashboard drilldown (#63108)

* partial progress on async loading / searching of dashboard titles

* feat: 🎸 make combobox full width

* filtering combobox polish

* storybook fix

* implement navigating to dashboard, seems like a type problem

* try navToApp

* filter out current dashboard

* rough draft linking to a dashboard

* remove note

* typefix

* fix navigation from dashboard to dashboard

except for back button - that would be addressed separatly

* partial progress getting filters from action data

* fix issue with getIndexPatterns undefined

we can’t import those functions as static functions, instead we have to expose them on plugin contract because they are statefull

* fix filter / time passing into url

* typefix

* dashboard to dashboard drilldown functional test and back button fix

* documentation update

* chore clean-ups

fix type

* basic unit test for dashboard drilldown

* remove test todos

decided to skip those tests because not clear how to test due to EuiCombobox is using react-virtualized and options list is not rendered in jsdom env

* remove config

* improve back button with filter comparison tweak

* dashboard filters/date option off by default

* revert change to config/kibana.yml

* remove unneeded comments

* use default time range as appropriate

* fix type, add filter icon, add text

* fix test

* change how time range is restored and improve back button for drilldowns

* resolve conflicts

* fix async compile issue

* remove redundant test

* wip

* wip

* fix

* temp skip tests

* fix

* handle missing dashboard edge case

* fix api

* refactor action filter creation utils

* updating

* updating docs

* improve

* fix storybook

* post merge fixes

* fix payload emitted in brush event

* properly export createRange action

* improve tests

* add test

* post merge fixes

* improve

* fix

* improve

* fix build

* wip getHref support

* implement getHref()

* give proper name to a story

* use sync start services

* update text

* fix types

* fix ts

* fix docs

* move clone below drilldowns (near replace)

* remove redundant comments

* refactor action filter creation utils

* updating

* updating docs

* fix payload emitted in brush event

* properly export createRange action

* some more updates

* fixing types

* ...

* inline EventData

* fix typescript in lens and update docs

* improve filters types

* docs

* merge

* @mdefazio review

* adjust actions order

* docs

* @stacey-gammon review

Co-authored-by: Matt Kime <matt@mattki.me>
Co-authored-by: streamich <streamich@gmail.com>
Co-authored-by: ppisljar <peter.pisljar@gmail.com>

* fix docs

* nit fixes

* chore: 🤖 remove uiActions from Embeddable dependencies

* chore: 🤖 don't export ActionInternal from ui_actions

* test: 💍 remove uiActions deps in x-pack test mocks

* chore: 🤖 cleanup ui_actions types

* docs: ✏️ add JSDoc comment to addTriggerAction()

* docs: ✏️ regenerate docs

* Drilldown demo 2 (#64300)

* chore: 🤖 add example of Discover drilldown to sample plugin

* fix: 🐛 show drilldowns with higher "order" first

* feat: 🎸 add createStartServicesGetter() to /public  kibana_util

* feat: 🎸 load index patterns in Discover drilldown

* feat: 🎸 add toggle for index pattern selection

* feat: 🎸 add spacer to separate unrelated config fields

* fix: 🐛 correctly configre setup core

* feat: 🎸 navigate to correct index pattern

* chore: 🤖 fix type check errors

* fix: 🐛 make index pattern select full width

* fix: 🐛 add getHref support

* feat: 🎸 add example plugin ability to X-Pack

* refactor: 💡 move Discover drilldown example to X-Pack

* feat: 🎸 add dashboard-to-url drilldown example

* feat: 🎸 add new tab support for URL drilldown

* feat: 🎸 add "hello world" drilldown example

* docs: ✏️ add README

* feat: 🎸 add getHref support

* chore: 🤖 cleanup after moving examples to X-Pack

* docs: ✏️ add to README.md info on how to find drilldowns

* feat: 🎸 store events in .enhancements field

* docs: ✏️ add comment to range trigger title

* refactor: 💡 move Configurable interface into kibana_utils

* chore: 🤖 simplify internal component types

* refactor: 💡 move registerDrilldwon() to advanced_ui_actions

* test: 💍 update functional test data

* merge

* docs: ✏️ make drilldown enhancement comment more general

* fix: 🐛 return public type from registerAction() call

* docs: ✏️ add comment to value click trigger title field

* docs: ✏️ improve comment

* fix: 🐛 use second argument of CollectConfigProps interface

* fix: 🐛 add workaround for Firefox rendering issue

See:
https://github.com/elastic/kibana/pull/61219/#pullrequestreview-402903330

* chore: 🤖 delete unused file

* fix: 🐛 import type from new location

* style: 💄 make generic type variable name sconsistent

* fix: 🐛 show "Create drilldown" only on dashboard

* test: 💍 add extra unit test for root embeddable type

* docs: ✏️ update generated docs

* chore: 🤖 add example warnings to sample drilldowns

* docs: ✏️ add links to example warnings

* feat: 🎸 add URL drilldown validation and https:// prefixing

* fix: 🐛 disable drilldowns for lens

* refactor: 💡 remove PlaceContext from DrilldownDefinition

* fix: 🐛 fix type check error

* feat: 🎸 show warning message if embeddable not provided

Co-authored-by: Anton Dosov <anton.dosov@elastic.co>
Co-authored-by: Matt Kime <matt@mattki.me>
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
Co-authored-by: Andrea Del Rio <delrio.andre@gmail.com>
Co-authored-by: ppisljar <peter.pisljar@gmail.com>
2020-05-04 16:11:20 +02:00
Alison Goryachev 6e3791ea12
Ingest Node Pipelines UI (#62321) 2020-04-30 15:52:14 -04:00
Justin Kambic 05f0d0ac8a
[Uptime] Migrate client to New Platform (#55086)
* Move uptime legacy server to plugins directory.

* Re-add feature registration code.

* Move uptime legacy server to plugins directory.

* Re-add feature registration code.

* Move all files.

* WIP fixing things.

* WIP fixing things.

* WIP fixing things.

* Finished fixing server.

* Fix alert type registration glitch.

* Remove obsolete file.

* Fix unwanted revisions, uncomment previously un-migrated code, delete accidentally-merged files.

* More cleanup.

* Fix all non-maps unit tests.

* Get functional tests working.

* Delete misplaced file.

* Add uptime CODEOWNERS entry.

* Get map working in Uptime app on NP.

* Update CODEOWNERS to remove legacy entry.

* Update server imports.

* Delete and clean up unused or redundant code/comments.

* Move new files from legacy to NP to fix merge error.

* Fix broken import.

* Delete obsolete test snapshots.

* Clean up imports and types, delete obsolete code.

* Clean up redundant common imports.

* Delete obsolete translation keys.

* Add additional explicit typing to plugin class.

* Combine redundant common imports.

* Delete unneeded optionalPlugin entry.

* Revert "Combine redundant common imports."

This reverts commit 159e66c349.

* Update a translation description.

* Revert "Clean up redundant common imports."

This reverts commit 8794013fbe.

* Remove new common index file and revert imports from only common to more specific paths.

* Fix broken imports in `~/x-pack/test`.

* Move new file from legacy to NP location.

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-04-29 07:28:03 -04:00
Ryland Herrick 4cc5b3a4d3
[SIEM] Client NP Cutover (#64251)
* Move SIEM public/ folder to NP plugin

This is solely renames; fixes come next.

* Update relative imports in our API tests

* Fix linter errors following move to NP folder

These paths got a little shorter, so some lines could be collapsed.

* Move client dependencies to NP package.json

I'm removing the @types/js-yaml for now because I'm not sure we need it;
I'll add it back later if we do.

* Fix relative imports to other plugins

* Fix errant uses of ui/chrome

* Remove legacy plugin shim

* Move feature registration into plugin

This previously had to be part of legacy bootstrapping due to an order
of operations issue.

* Disconnect legacy plugin

The index file should now be redundant with what's in the plugin:

* app registration
* feature registration

* Move public gitattributes

* Remove references to legacy embeddables

We can now use the NP API. Maps embeddable will not work here until
their work is merged, but this should prevent us from importing legacy
code and thus breaking the build.

* Add our frontend dependencies to kibana.json

These are all required for now, because that's how they're typed. If
they _should_ be optional (and I think several should), we need to
update the type and handle the null case within the app.

* Replace use of ui/new_platform mocks in embeddable utils

* Fix remaining jest tests

* Replace build-breaking ui/new_platform mocks with equivalents in core
proper
* Remove unnecessary mocks of ui/new_platform

* Remove references to legacy SIEM folder

* I left the reference in CODEOWNERS in case someone tries to sneak
something back
* I left the .gitignore reference for the same reason

* Fix mocks of relative paths

These were not caught by typescript and were causing test failures.

* Export our client plugin contracts

They're empty for now.

* Move from deprecated appmount API

The new one dropped a param we weren't using.

* Add missing mock causing test failures

* Don't re-export core types from our plugin

Import them from core where we need them, instead

* Move Actions UI registry outside of mount

This is already imported, there's no benefit (and potential timing
issues) with doing this inside the mount.

* Add security's setup contract to our StartServices

This doesn't change what's used, only how we're typing it. The types are now a
little more truthful as:

* our StartPlugins don't include setup contracts
* our StartServices includes everything we use at Start time, including
the one setup plugin.

* Add order and icon back to the sidebar link

* Replace plugin class properties with constants

These are shared, and should be consistent.

* Enable our UI on NP

* Add missed plugin dependencies

We're not using their contracts, but we are importing code from them.

* Revert use of constant in translation

Can't do that, whoops

* i18n our feature catalogue entry

* Remove unnecessary array from single element

* Remove unused keys

These were the legacy translations used... well, I don't know where they
were used.

* Ignore circular dependencies in external plugins

* Normalize exclusions

* Add undeclared dependencies to kibana.json

We import our maps embeddable from maps, and we pass inspector to the
embeddable. I just missed these in my audit. This was causing errors in
the map embeddable.

* Await our call to setLayerList

This is an async call that we need to complete before we can render.

* Reduce siem plugin size

When we load our initial plugin (before our app is loaded), were were
implicitly importing all of kibana_react with this import. While a
global module prevents this from affecting our bundle size currently,
that could change in the future. Since we only need a reference to our
class, we just import that instead.
2020-04-27 17:59:21 -05:00
Matthias Wilhelm 6d099d0a4f
Migrate graph_workspace saved object registration to Kibana platform (#64157)
* Migrate graph_workspace saved object registration to Kibana platform
* Remove legacy plugin 🎉
2020-04-24 14:55:43 +02:00
CJ Cenizal 91f7911d15
Move CCR out of legacy (#62890)
* Convert common/services and server/lib to TypeScript. Update Jest tests.
  - Remove deserializeAutoFollowPattern behavior that returned an empty object if the pattern was undefined.
* Localize mocks with the component integration tests.
* Update API unit tests to use NP mocks.
  - Break up test files.
  - Use inline mocked ES response instead of fixture files.
  - Move remaining fixture files into client integration tests directory.
* Make API route validation more strict.
* Publish isUiDisabled as part of Remote Clusters contract.
* Default trackUiMetric service to be a no-op.
* Remove security dependency.
  - Fix license check so that CCR won't render if the license is invalid.
  - Fix server security check to be more precise by checking if ES has security disabled.
* Render timestamp for autofollow errors.
2020-04-22 07:15:25 -07:00
Ryland Herrick 40f82229f0
[SIEM] Server cutover to New Platform (#63430)
* Move server code into NP folder

* NP config is not yet used
* Relative imports are somewhat broken

* Move common folder into NP

* Move cypress folder into NP

* Move scripts folder into NP

* Move misc. config into NP folder

A few of these were moved into the cypress folder as they're
cypress-specific.

I tried to update all the relative paths but some are likely broken. I'm
not going to know until other stuff is fixed, though.

* Move value for siem index pattern into common/constants

The other default values live in there, this is no different.

* Update paths following file move

If this was referencing the full project, it now references both paths
(legacy for UI, and NP for server).

* Fix typescript errors related to module resolution

These are mostly updating imports to the common/ folder on the UI side
(since things changed relative to those files).

* Replace Legacy Config with NP Config

* Updates plugin to use NP config
  * defines new config previously coming from savedObjects config
* cleans up legacy types

 Conflicts:
	x-pack/plugins/siem/server/lib/detection_engine/routes/rules/export_rules_route.ts
	x-pack/plugins/siem/server/lib/detection_engine/routes/rules/import_rules_route.ts
	x-pack/plugins/siem/server/lib/detection_engine/rules/types.ts
	x-pack/plugins/siem/server/plugin.ts
	x-pack/plugins/siem/server/routes/index.ts
	x-pack/plugins/siem/server/types.ts

* Remove local SIEM tsconfig

This was originally added to address an issue with tsserver, but that
issue is no longer relevant. The presence of this file confuses
typescript into thinking that siem is a separate TS project.

* Update kibana.json to declare our dependencies

These are not necessarily correct in terms of what's required/optional,
but this is what's declared in our types.

* Remove legacy plugin instantiation

* Removes legacy instantiation of server plugin, which is now handled by
NP
* Loosens legacy config spec so we no longer have to duplicate config
types

* Update tests with NP config

These were written against the old Hapi config function; now, we just
have a POJO.

* Update es_archiver helpers' paths

I'm not quite sure if these are working yet, but they're no longer
throwing errors.

* Ignore restricted path on script

This was cribbed from infra, who has made a similar change.

* Ignore restricted path on temporary savedObject mappings import

This will be changed subsequently when we switch to the NP form of
savedObject type registration.

* Add symlink to lockfile

* Fix paths on circular deps script

* Add separate config for Rule and Timeline saved objects

We had previously used the savedObjects' config, but those are not
currently exposed to us on New Platform. For now, we're going to split
this into two sets of values for the SOs we deal with
importing/exporting within the SIEM app, with the same defaults as
savedObjects.

* Fixing relative paths within cypress

These are strings that wouldn't be caught by typescript.
2020-04-17 12:31:54 -05:00