Commit graph

129 commits

Author SHA1 Message Date
James Gowdy 35302ed273
[ML] Client side cut over (#60100)
* [ML] Client side cut over

* updating paths and commented code

* changes based on review

* disabling telemetry tests

* fixing start job stylesheets

* fixing everything that is broken

* fixing types and ml icon order

* using icon constant
2020-03-13 19:16:41 +00:00
Thomas Watson 38717982e3
Clean up .eslintrc.js with better variable naming (#59864) 2020-03-11 15:18:49 +01:00
Thomas Watson 1525dbe73d
ci: disable all Mocha rules for tape tests (#59798) 2020-03-11 08:07:06 +01:00
Thomas Watson a663f65bcc
Harden creation of child processes (#55697)
Add general protection against RCE vulnerabilities similar to the one
described in CVE-2019-7609.

Closes #49605
2020-03-10 07:51:57 +01:00
Maryia Lapata 80db96b823
Fix TS for vis_type_vislib (#58345)
* Fix TS for vislib

* Fix TS

* Revert table changes

* Update unit test

* Refactor updateAxisTitle

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-03-04 13:57:16 +03:00
Maryia Lapata 39f6eaf5f4
Fix TS for vis_type_table (#58347)
* Remove eslint overrides for vis_type_table

* Fix TS for vis_type_table

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-02-26 13:20:24 +03:00
Alexey Antonov deda49e9f0
[ui/utils/query_string]: Remove unused methods & migrate apps to querystring lib (#56957)
* replace querystring (querystring-browser) -> query-string

* QueryString remove encode/decode methods

* remove query_string file

* remove querystring-browser from package.json

* add kibana_utils\url module

* cleanup

* update notice.txt

* fix merge conflict

* fix CI

* fix wrong import

* fix CI

* fix X-Pack firefox smoke test

* remove urlUtils.parseUrlQuery

* remove url.stringifyUrlQuery

* use url.encodeQuery

* Record<string, any> -> ParsedQuery

* Update src/plugins/console/public/application/containers/editor/legacy/console_editor/editor.tsx

Co-Authored-By: Luke Elmers <lukeelmers@gmail.com>

* add more tests for APM

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
Co-authored-by: Luke Elmers <lukeelmers@gmail.com>
2020-02-12 19:51:03 +03:00
Joe Reuter 09f1cad573
Check for legacy imports in vis types and fix problems (#56763) 2020-02-10 12:48:18 +01:00
patrykkopycinski 05edbdac78
[SIEM] Add eslint-plugin-react-perf (#55960)
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-02-04 11:22:40 +01:00
Daniil Suleiman 7f63118d6b
Vis default editor plugin (#55612)
* Shim the default_editor

* Update paths in vis_default_editor

* Update paths in dependent plugins

* Update the dependent plugins

* Create an entry point

* Wrap the editor with kibana context

* Fix circular re-renders

* Update sub aggs mapping

* Move schemas and agg_groups to agg_types, update jest tests

* Use services from kibana context, other fixes

* Fix useEffect maximum update depth

* Create i18n namesapce for visDefaultEditor, rename translations

* Fix tests

* Resolve paths

* Remove ui/vis/vis_types

* Fix vis import

* Move editor_config_provider to ui/vis
2020-01-29 17:41:18 +03:00
Alexey Antonov 5d6dbf07b0
Expose NP FieldFormats service to server side (#55419)
* Expose NP FieldFormats service to server side

* fix CI

* fix PR comments

* fix PR comments

* fix CI

* getFieldFormatsRegistry -> getFieldFormatRegistry

* fix CI

* memoize - add resolve cache function

* fix Jest

* move IFieldFormatMetaParams to types.ts

* FieldFormatRegistry -> FieldFormatsRegistry

* update src/core/MIGRATION.md

* update public contract

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-01-27 22:25:39 +03:00
Jean-Louis Leysens f7c53b5690
Disallow importing Joi client side (#55018)
* Disallow importing Joi client side

* Move elasticsearch lib into server folder

* Add a comment about the 'joi' eslint rule

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-01-24 15:38:44 +01:00
Nick Partridge bd7d5eb9f6
Shim vis_type_vislib (#53536)
* shim of kbn_vislib_vis_types (now vis_type_vislib)
* Move vislib into vis_type_vislib plugin
* Convert remaining plugin files to typescript
* Rename vis to vis_type_vislib
2020-01-15 15:48:19 -06:00
Spencer 357be5970d
share specific instances of some ui packages (#54079)
* share specific instances of some ui packages

* remove unnecessary eslint changes, every package will define deps anyway

* remove mentions of moment webpackShims in eslint resolver

* remove use of lodash

* list angular as dep for x-pack

* add operations as codeowner of shared-deps pkg
2020-01-10 15:22:18 -07:00
Joe Reuter 07278aba37
remove linting rule exception for markdown (#54232) 2020-01-10 20:30:03 +01:00
Tim Roes d03d05106e
Fix tile-map react eslint errors (#54265) 2020-01-10 11:24:59 +01:00
Marta Bondyra d4f584e0cb
Fix eslint rule for vis_type_metric `jsx-a11y/click-events-hav… (#54279) 2020-01-09 17:07:44 +01:00
Matthias Wilhelm 58f792cee3
Remove eslint overwrite for src/legacy/core_plugins/kibana (#54222)
* Cleanup code 
* Remove eslint overwrite
2020-01-09 11:56:14 +01:00
Tim Roes 7ffe38569e
Fix Vega react eslint errors (#54259) 2020-01-08 18:19:20 +01:00
Anton Dosov 513428af44
add examples/ to no-restricted-path config (#54252) 2020-01-08 19:20:07 +03:00
patrykkopycinski 23a0513469
[SIEM] Add react/display-name eslint rule (#53107) 2020-01-07 18:05:04 +01:00
patrykkopycinski 677670b929
[SIEM] Enable eslint prefer-template rule (#53983)
* [SIEM] Enable eslint prefer-template rule

* cleanup

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-01-07 18:02:32 +01:00
patrykkopycinski 6e1328b9f0
[SIEM] Enable eslint react/no-children-prop (#53985) 2020-01-07 17:46:56 +01:00
Chris Roberson 28b6efa260
Fix linting issues (#54068)
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-01-07 11:31:15 -05:00
Justin Kambic bd2be32876
[Uptime] Delete uptime eslint rule skip (#50912)
* Delete uptime eslint rules.

* Update hooks usage to adhere to new eslint rules.

* Delete code accidentally added during rebase.

* WIP trying things.

* Clean up types and hook usage to comply with kibana eslint rules.

* Clean up code.

* Update new useEffect hooks that are missing dependencies.

* Fix edits that broke a page.
2020-01-02 16:36:07 -05:00
spalger c52571be68 ensure prettier overrides take precedence, remove style rules 2019-12-14 17:39:10 -07:00
spalger a3553c924d [eslint] use prettier for all the things 2019-12-13 23:17:11 -07:00
spalger 1ea9d791bc Revert "Revert "Fix wrong impor (#52994)""
This reverts commit c220d770cc.
2019-12-13 14:09:51 -07:00
spalger c220d770cc Revert "Fix wrong impor (#52994)"
This reverts commit 6c1f248c4f.
2019-12-13 13:16:40 -07:00
Josh Dover ec2134d221
Add lint rule to prevent server code being imported into client (#52447) 2019-12-13 12:26:04 -06:00
Mikhail Shustov 6c1f248c4f
Fix wrong impor (#52994)
* Licensing plugin and XPackInfo uses the same license data (#52507)

* convert xpackinfo to TS

* use NP Licensing plugin in XPackInfo

* update mocks

* put license regresh hack back.

otherwise new license won't be re-fetched when signature changed. was deleted by mistake

* add functional test for legacy xpackmain

* declare setup types on client & server explicitly

* rename mock license --> licensing to match plugin name

* add tests for createLicensePoller

* fix type error

* adopt tests for xpack_info

* createXPackInfo uses new platform API

* put back error mute

* address comments

* fix renamed import

* address comment

* update tests to reduce delays

* deprecate xpack.xpack_main.xpack_api_polling_frequency_millis

* use snake_case in config

* fix wrong import
2019-12-13 18:09:36 +01:00
Spencer 7ba47eebbf
[euiUtils] fix unnecessary useEffect dep (#52782) 2019-12-11 12:49:15 -07:00
Felix Stürmer 0cd62cabbb
[Logs + Metrics UI] Remove eslint exceptions (#50979)
This removes the two eslint exceptions specific to the `infra` plugin introduced in #49244.

fixes #49563
2019-12-11 13:48:40 +01:00
Jean-Louis Leysens aa31b535d1
[Watcher] New Platform (NP) Migration (#50908)
* First iteration of watch public -> new platform
Still need to switch to np ready version of use_request

* - Switched to using np ready request
- Some updates after API changes

* First attempt at server shim

* Rename file and re-enable react hooks linting

* Fix some public types and react hooks lint rules

* Fix types

* More ES lint react hooks fixes

* Migrated server lib -> ts. Part way done with migrating routes to NP router and TS

* Big subset of routes to TS and NP router - almost there

* Delete legacy error wrappers and moved last set of routes to TS and NP router

* Remove @ts-ignore's and update route registration to use shim with http router

* Added routes validations, fixes for hooks and fixes for types

* Fix more types and finish testing API routes

* Fix usage of feature catalogue and fix time buckets types

* Fix error message shape [skip ci]

* Split legacy from new platform dependencies server-side

* Refactor: Seperate client legacy and NP dependencies

* Add file: added types file

* Fix UISettings client type import

* Update license pre-routing factory spec

* Update variable names, use of I18nContext (use NP) and docs

* Use NP elasticsearchclient

* Simplify is_es_error_factory

* Fix types

* Improve code legibility and remove second use of `useAppContext`

* Use @kbn/config-schema (not validate: false) on routes!

* Fix watch create JSON spec

* Create threshold test working

* Unskip watch_edit.test.ts

* Unskip watch_list.test.ts

* Done re-enabling component integration tests

* TimeBuckets typo + remove unnecessary // @ts-ignore
2019-12-11 09:54:42 +01:00
Joe Reuter 69e6b2908d
fix linting errors in graph (#50907) 2019-12-03 15:44:37 +01:00
Pierre Gayvallet 99c6396fd5
Migrate Capabilities to new platform (#51438)
* create service skeleton

* move registerCapabilitiesModifier to capabilities service and rename to registerCapabilitiesSwitcher

* starts to move capabilities logic to CapabilitiesService

* move capabilities route to service

* add initial integration test for capabilities route

* capabilitiesMixin now delegates to capability service

* use server-side Capabilities import in server code

* update generated doc

* remove capabilities from injectedMetadatas

* use applications sent from client instead of server-registered navLinks

* disable authRequired for capabilities route

* (temp) exposes two endpoints for capabilities

* Add fetch-mock on capabilities call for karma tests

* adapt xpack Capabilities test - first attempt

* adapt x-pack ui_capabilities test

* add '/status' to the list of anonymous pages

* Add documentation on Capabilities APIs

* move Capabilities to core/types

* update generated docs

* add service tests

* protecting resolveCapabilities against added/removed capabilities

* update generated docs

* adapt mocks due to rebase

* add forgotten exports

* improve capabilities routes registering

* name capabilities registering methods

* resolve conflicts due to merge

* address review issues

* add comment about reason for exposing two routes

* extract createHttpServer test helper

* fix merge conflicts

* improve documentation

* remove `/status` anon registration as now done in NP status plugin

* fix merge conflicts
2019-12-03 09:34:49 +01:00
Mikhail Shustov bd63596d18
add eslint rule banning the core to import plugin code (#51563)
* add eslint rule banning the core to import plugin code

* Ban importing legacy plugin code in the сore

* fix eslint errors

* core cannot import xpack rule

* regen docs
2019-11-28 22:54:21 +01:00
Jean-Louis Leysens 793f1f1191
[Console] Refactoring more legacy code and implementing minor fixes (#51312)
* First part of context refactor

* Finised "hook"ing in to new context for old editor output. Also fixed passing through of content type

* Remove comment

* - update console history behaviour - don't scroll into view on click. Doesn't really make sense.
- make triple quote setting update in place
2019-11-25 18:28:49 +01:00
Pierre Gayvallet 5a93c13420
fix src/core/public/application react/no-danger violations (#51146) 2019-11-20 18:07:18 +01:00
patrykkopycinski ee7338e82d
[SIEM] Fix eslint errors (#49713) 2019-11-16 18:24:27 +01:00
Spencer 0010447f0f
[a11y] add initial accessibility functional tests (#43584)
* [a11y] add initial accessibility functional tests

* add accessibility jobs

* fix config path

* remove percy setup from scripts

* disable color-contrast rule

* apply changes from @myasonik

* define aria-controls/owns props even when suggestions aren't visible

* [ftr/a11y] only throw error when there are errors

* adding tests for management page

* add a11y test for management page

* adding ignore rules' to a11y

* accessibility test for kibana home

* 7 passing tests, 0 failures

* jest snapshot update

* support a11y test in pipeline job

* update a11y test script for pipelines

* use oss compatible ci setup

* fix exclude syntax

* add default exclusion syntax
2019-11-07 10:07:40 -05:00
sainthkh faa48d591d eslint no-restricted-path false positive: bug caused by dir names that start with "index". (#46544)
* index* to index.{ts,tsx}

* Added test.

* Added invalid test.

* Added js.
2019-10-31 12:40:53 +02:00
James Gowdy 636fa27107
[ML] Fixing some of the eslint rule breakages in ML (#49716) 2019-10-30 16:38:08 +00:00
Walter Rafelsberger b368c6acba
[ML] Transforms: Removes temporary x-pack/legacy/plugins/transform eslint overrides.
Re-enables linting rules related to React hooks and adapts inline code.
2019-10-30 08:07:09 -07:00
Larry Gregory 8bd0aacc5f
Spaces - fix react hook deps (#49618)
* fix react hook deps

* removing lint override for spaces
2019-10-29 12:54:21 -04:00
Spencer 19ea92abb7
move react/jsx-a11y rules into shared react preset (#49244)
* move react/jsx-a11y rules into shared react preset

* autofix react/jsx-closing-tag-location

* autofix react/no-unknown-property

* manually fix react/no-unescaped-entities

* maually fix react/jsx-pascal-case

* manually fix react/prefer-stateless-function

* disable known violations in specific plugins/areas

* remove code override
2019-10-29 06:15:33 -07:00
renovate[bot] feceb0f98e Update eslint related packages (#48513)
* Update eslint related packages

* add errorMessage to no-restricted-paths validation

* add license to eslintrc file

* ignore broken plugin fixture

* upgrade tangled peer deps

* give name to unnamed func to avoid typescript-eslint/typescript-eslint#1078

* migrate away from removed prefer-interface

* migrate away from removed no-angle-bracket-type-assertions rule

* migrate away from removed no-triple-slash-reference rule

* old config was invalid and made this rule a noop

* fix array-type rule config

* fix readonly paramProperties that weren't being checked

* fix propType ordering

* remove references to non-existent rules

* remove unnecessary disable that is improperly formatted

* fix comment-related spacing

* fix typo/invalid namespace overrides

* rename fn to avoid hook-alike behavior

* remove reference to old removed rule

* use caret version for prettier

* reference babel-eslint with absolute path
2019-10-21 16:32:31 -07:00
Mikhail Shustov 5676ac00ab
UI settings move to NP (#47590)
* add tests for logWithMetadata in LP

* allow passing metadata to log in NP & LP

* move ui_settings_client to NP

* add ui_settings config

* add ui_settings_service

* switch to NP logging

* export types

* bootstrap uiSettings service in NP

* pass NP uiSettings to LP

* move ui_settings mock to NP

* add  test for mixin and switch to NP logger

* make UiSettingsClient.getDefaults sync as it is

* ui_settings_client uses private fields

* ui_settings_client uses private methods

* keep uiSettings config validation in NP only

* update mocks

* core context should know it is mocked

* add tests for ui_settings_service

* remove unused code from ui_settings_mixin test

* improve types in ui_settings_mixin test

* gen docs

* test moved to NP

* set pkg version in tests explicitly

* update mocks in tests

* UiSettingsServiceSetup --> InternalUiSettingsServiceSetup

* add links to types

* address eli comment

* regen docs

* remove unused types
2019-10-16 14:18:34 +02:00
Mikhail Shustov 27dbcb2796
Expose package info to NP plugins (#48101)
* provide packageInfo to server plugins

* provide env to kbn server

* provide env to client plugins

* update server mocks and tests

* update client mocks and tests

* add integration test

* regen docs

* remove weird file

* export types for the client from special folder

* env should not affect test ourcome
2019-10-15 14:19:11 +02:00
Devin W. Hurley 19df9e2b06
[SIEM] Adds linter rule to disallow undeclared variables (#46249)
* adds linter rule to disallow undeclared variables

* adds cypress eslint plugin, remove redundant packages from siem/package.json

* removes comment from json and adds a line about cypress linting to the cypress README

* adds upgraded package back to siem/package.json

* updates cypress run scripts since cypress package is now located in the x-pack/node_modules

* needed to yarn kbn bootstrap after rebasing with master
2019-09-30 11:25:06 -07:00