Commit graph

20 commits

Author SHA1 Message Date
Brandon Kobel 57af8462e4
[7.x] Elastic License 2.0 (#90192)
* Updating everything except the license headers themselves

* Applying ESLint rules

* Manually replacing the stragglers
2021-02-03 18:39:13 -08:00
Anton Dosov 104fdb8f63
[Docs] Clean up state management examples (#88980) (#89005) 2021-01-22 10:22:13 +01:00
Tyler Smalley baf56d80c4
[7.x] Updating the License (#88343) (#88745)
* Updating the Licenses, except for applying eslint, building

* Applying ESLint rules,building @kbn/pm, regenerating api docs

Co-authored-by: kobelb <brandon.kobel@elastic.co>
2021-01-19 17:54:11 -08:00
Mikhail Shustov 90f76994d2
Update typescript eslint to v4.8 (#83520) (#83677)
* update deps

* update rules

use type-aware @typescript-eslint/no-shadow instead of no-shadow. do not use no-undef, rely on TypeScript instead

* fix or mute all lint errors

* react-hooks eslint plugin fails on ? syntax

* fix wrong typings in viz

* remove React as a global type

* fix eslint errors

* update version to 4.8.1

* fix a new error
2020-11-18 20:50:46 +01:00
Luke Elmers 3153eb6afe
[docs] Add missing App Arch READMEs. (#82080) (#82385) 2020-11-02 20:36:59 -07:00
Mikhail Shustov e8a05ae57b
Add TS projects for src/plugins & x-pack/plugins (#78440) (#78946)
* bump query-string version to remove manual type definitions

* remove manual type declaration

* add kibana_utils tsconfig

* add refs to kibana_utils tsconfig

* add kibana_utils to the project list

* add kibana_react project

* add support for x-pack/tsconfig.refs.json

* add ts project for x-pack licensing plugins

* add glob for ts projects in src/plugins & x-pack/plugins

* add refs to projects in examples

* fix ref paths in x-pack/test

* address mistic comments

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
# Conflicts:
#	src/plugins/kibana_utils/kibana.json
2020-09-30 17:10:04 +02:00
Mikhail Shustov ee8bc62637
Extract src/core in a separate TS project (#76785) (#77509)
* break dependency on data plugin TS code

* move global typings to @kbn/utility-types

* import types from @kbn/utility-types

* remove type dependency on plugins

* add intermediate js files to break dependency on outter TS code

* temp type declaration for query-string

* declare src/core project

* export types to reference in the built d.ts files

* reference core project

* move jest types out of kbn/utility-types due to a clash with mocha types

* fix wrong es_kuery path and ts project paths

* reference core from packages consuming it

* x-pack & oss should use the same lodash version

* Revert "x-pack & oss should use the same lodash version"

This reverts commit 79cec5781e.

* use the same lodash version

* fix @types/lodash TS2300: Duplicate identifier error

* fix wrong imports

* update docs

* update docs

* add a comment why file is needed
# Conflicts:
#	packages/kbn-utility-types/index.ts
#	src/core/public/application/capabilities/capabilities_service.mock.ts
#	src/core/public/chrome/chrome_service.mock.ts
2020-09-16 07:51:42 +02:00
Mikhail Shustov bd66fab861
Introduce TS incremental builds & move src/test_utils to TS project (#76082) (#76632)
* move test_helpers to the core

* create base tsconfig

* all tsconfigs use the base one

* use test_helpers exposed from the src/core

* move getFieldFormatsRegistry to data plugin

* add test_utils project

* compile types after checkout

* add a stub for platform tsconfig.json

* fix broken import

* fix broken path to the base config

* set tsBuildInfoFile for project without outDir

* do not commit tsbuildinfo file

* do not check output d.ts files

* fix type error

* use separate config to build types

* rollback changes to include paths

* mute import zone error

* rename files to avoid references to tsd

* do not use tsd for type tests

* include all ts files in project

* run buildRefs before type check to ensure the latest version

* store tsbuildinfo locally

* update paths to base config

* comment out core/tsconfig.json

* remove ui path

* fix wrong tsbuildinfo path
2020-09-03 23:02:05 +02:00
Liza Katz 25ceed986b
[7.x] [Data] Query Input String manager (#72093) (#73634)
* [Data] Query Input String manager (#72093)

* improve test stability

* query string input manager (needed for search demo)

* docs

* dashboard

* Fix jest

* mock fix

* Allow restoring a saved query

* sync url

* Luke's fix to test

* cleanup

* lens jest tests

* docs

* use queryStringManager.getDefaultQuery
Don't sync query to global state

* Update app.test.tsx

lens mock

* jest fix

* jest

* use new api in the example

* Rename state param to query to match url state

* Apply changes to discover

* Update src/plugins/data/public/query/query_string/index.ts

Co-authored-by: Anton Dosov <dosantappdev@gmail.com>

* Improve query string state manager

* Cleanup dashboard code

* Handle refresh button

* Set initial dashboard state

* visualize state

* remove unused

* docs

* fix example

* fix jest

* fix filter app state in discover

* fix maps test

* jest

Co-authored-by: Anton Dosov <anton.dosov@elastic.co>
Co-authored-by: Anton Dosov <dosantappdev@gmail.com>
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
# Conflicts:
#	src/plugins/data/public/public.api.md

* docs
2020-07-29 13:47:55 +03:00
spalger e535aa6446 Revert "Revert "[7.x] [kbn/optimizer] implement "requiredBundles" property of KP plugins (#70911) (#71355)" (#71382)"
This reverts commit c45fa3dd58.
2020-07-10 20:13:28 -07:00
Brian Seeders c45fa3dd58
Revert "[7.x] [kbn/optimizer] implement "requiredBundles" property of KP plugins (#70911) (#71355)" (#71382)
This reverts commit 243a864359.
2020-07-10 23:07:01 -04:00
Spencer 243a864359
[7.x] [kbn/optimizer] implement "requiredBundles" property of KP plugins (#70911) (#71355)
Co-authored-by: Josh Dover <me@joshdover.com>
Co-authored-by: spalger <spalger@users.noreply.github.com>
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
# Conflicts:
#	packages/kbn-optimizer/src/integration_tests/__snapshots__/basic_optimization.test.ts.snap
#	src/plugins/embeddable/kibana.json
#	src/plugins/telemetry/kibana.json
#	src/plugins/ui_actions/kibana.json
#	x-pack/plugins/apm/kibana.json
#	x-pack/plugins/upgrade_assistant/kibana.json
2020-07-10 09:37:22 -07:00
Stacey Gammon 86ea134591
Kibana developer examples landing page (#67049) (#68705)
* Kibana developer examples

* Batch explorer tests should be run in examples config

* Fix tests

* add codeowner for new developer examples plugin & readme cleanup

* Try to frame embeddable wording based on what a developer's goals are.

* Add noopener noreferer, fix bad merge

* Remove bfetch.png

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
# Conflicts:
#	.github/CODEOWNERS
2020-06-10 07:55:11 -04:00
restrry 2fefd60e90 update code style 2020-05-22 10:35:02 +02:00
Stacey Gammon edd9af0b16
more propagated bad examples (#66920) (#67012) 2020-05-19 13:32:53 -04:00
Stacey Gammon 2901b93157
KP plugins shouldn't need package.json (#66654) (#66745)
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-05-15 14:24:33 -04:00
Anton Dosov 50cf8a764e
[State Management] ScopedHistory support for state syncing utils (#62761) (#64061)
The needed change is to rely on history as source of truth for location instead of window.location.

btw, This makes possible to test state syncing utils integration using createMemoryHistory()

One issue was discovered after this change:
When switching from context to discover url was incorrect. history.location inside state syncing utils didn't get the last update. This happened, because history instance created in discover wasn't used in context app and when all listeners unsubscribed from it - it stopped receiving location updates. To fix this I just reused one history instance in discover, context and their kbnUrlTracker
2020-04-21 15:56:14 +02:00
Anton Dosov 6cd0e5c0d6
[State Management] State syncing helpers for query service I (#56128) (#58711)
Before this pr:

Discover, Visualise and Dashboard in setup phase create own state containers which watch for pinned filters, time and refresh interval changes. This watching and state comparisons happen for each plugin separately and not only when a specific app is mounted. So we ended up with a bunch of similar synchronous work which happens every time query services state changes.

After this pr:

Query service exposes observable to watch for changes (state$). Discover, Visualise and Dashboard use this observable for sub url tracking instead of creating its own.
2020-02-27 14:03:59 +01:00
Anton Dosov 26b5cd89c2
[State Management] State containers improvements (#54436) (#54562)
Some maintenance and minor fixes to state containers based on experience while working with them in #53582

Patch unit tests to use current "terminology" (e.g. "transition" vs "mutation")
Fix docs where "store" was used instead of "state container"
Allow to create state container without transition.
Fix freeze function to deeply freeze objects.
Restrict State to BaseState with extends object.
in set() function, make sure the flow goes through dispatch to make sure middleware see this update
Improve type inference for useTransition()
Improve type inference for createStateContainer().

Other issues noticed, but didn't fix in reasonable time:
Can't use addMiddleware without explicit type casting #54438
Transitions and Selectors allow any state, not bind to container's state #54439
2020-01-13 14:12:25 +01:00
Anton Dosov 5f52cf0bf3
[State Management] State syncing utilities (#53582) (#54454)
Today, apps rely on AppState and GlobalState in the ui/state_management module to deal with internal (app) and shared (global) state. These classes give apps an ability to read/write state, when is then synced to the URL as well as sessionStorage. They also react to changes in the URL and automatically update state & emit events when changes occur.

This PR introduces new state synching utilities, which together with state containers src/plugins/kibana_utils/public/state_containers will be a replacement for AppState and GlobalState in New Platform.

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-01-13 10:10:56 +03:00