Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[TSVB] Type public code. Step 1 #93231

Merged
merged 26 commits into from
Mar 11, 2021
Merged

Conversation

sulemanof
Copy link
Contributor

@sulemanof sulemanof commented Mar 2, 2021

Summary

Part of #63593

This PR converts files from vis_type_timeseries/public folder to TypeScript. These are:

  • application/editor_controller.js
  • application/components/vis_editor.js
  • application/components/panel_config.js
  • application/components/vis_picker.js

Other changes mostly consists of export/import changes.

Daniil Suleiman added 26 commits February 24, 2021 13:09
…ade_removal

# Conflicts:
#	src/plugins/vis_type_timeseries/server/lib/get_fields.ts
#	src/plugins/vis_type_timeseries/server/lib/get_vis_data.ts
#	src/plugins/vis_type_timeseries/server/lib/search_strategies/strategies/abstract_search_strategy.ts
#	src/plugins/vis_type_timeseries/server/lib/vis_data/annotations/get_request_params.js
#	src/plugins/vis_type_timeseries/server/lib/vis_data/series/get_request_params.js
…blic

# Conflicts:
#	api_docs/core.json
#	api_docs/vis_type_timeseries.json
#	packages/kbn-pm/src/utils/bazel/ensure_yarn_integrity_exists.ts
#	src/plugins/index_pattern_field_editor/public/components/field_format_editor/editors/histogram/index.ts
#	src/plugins/vis_type_timelion/common/parser_async.ts
#	src/plugins/vis_type_timeseries/server/lib/vis_data/annotations/build_request_body.ts
#	src/plugins/vis_type_timeseries/server/lib/vis_data/annotations/get_request_params.ts
#	src/plugins/vis_type_timeseries/server/lib/vis_data/series/get_request_params.ts
@kibanamachine
Copy link
Contributor

💚 Build Succeeded

Metrics [docs]

Module Count

Fewer modules leads to a faster build time

id before after diff
visTypeTimeseries 471 472 +1

Async chunks

Total size of all lazy-loaded chunks that will be downloaded as the user navigates the app

id before after diff
visTypeTimeseries 1.7MB 1.7MB -221.0B

Page load bundle

Size of the bundles that are downloaded on every page load. Target size is below 100kb

id before after diff
visTypeTimeseries 126.8KB 126.7KB -149.0B

History

To update your PR or re-run it, just comment with:
@elasticmachine merge upstream

@sulemanof sulemanof marked this pull request as ready for review March 10, 2021 08:28
@sulemanof sulemanof requested a review from a team March 10, 2021 08:28
@@ -123,7 +123,9 @@ export const IndexPattern = ({
);
const isTimeSeries = model.type === PANEL_TYPES.TIMESERIES;

updateControlValidity(intervalName, intervalValidation.isValid);
useEffect(() => {
updateControlValidity(intervalName, intervalValidation.isValid);
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is wrapped into effect since it changes a parent component state

const [visData, setVisData] = useState({});

useEffect(() => {
model.isModelInvalid = !checkModelValidity(formValidationResults);
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it is not allowed to modify props, so this was converted to the callback

Comment on lines +9 to +21
// these are not typed yet
// @ts-expect-error
import { TimeseriesPanelConfig as timeseries } from './timeseries';
// @ts-expect-error
import { MetricPanelConfig as metric } from './metric';
// @ts-expect-error
import { TopNPanelConfig as topN } from './top_n';
// @ts-expect-error
import { TablePanelConfig as table } from './table';
// @ts-expect-error
import { GaugePanelConfig as gauge } from './gauge';
// @ts-expect-error
import { MarkdownPanelConfig as markdown } from './markdown';
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Each panel config is typed in a follow up PR

this.visDataSubject.next(visData);
};

render() {
const { model } = this.state;

if (model) {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this check was simply replaced with if (!visFields), since render is only waiting for fields fetched.

@sulemanof sulemanof added Feature:TSVB TSVB (Time Series Visual Builder) release_note:skip Skip the PR/issue when compiling release notes v7.13.0 v8.0.0 labels Mar 10, 2021
@stratoula
Copy link
Contributor

@elasticmachine run elasticsearch-ci/docs

Copy link
Contributor

@stratoula stratoula left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It seems fine my dear @sulemanof, thank you so much!

@sulemanof sulemanof merged commit 77fe83b into elastic:master Mar 11, 2021
@sulemanof sulemanof deleted the feat/tsvb_type_public branch March 11, 2021 09:15
sulemanof pushed a commit to sulemanof/kibana that referenced this pull request Mar 11, 2021
* Remove request facade and update search strategies

* Use typescript

* Type files

* Update structure

* Update tests

* Type annotations

* Fix type for infra

* Type editor_controller

* Type vis_editor

* Type vis_picker

* Fix types

* Type panel_config

* Fix vis data type

* Enhance types

* Remove generics

* Use constant

* Update docs

* Use empty object as default data

* Fix merge conflict
jloleysens added a commit that referenced this pull request Mar 11, 2021
…-action

* 'master' of github.com:elastic/kibana: (43 commits)
  [Console] Update copy when showing warnings in response headers (#94270)
  [TSVB] Type public code. Step 1 (#93231)
  [ML] Functional tests - stabilize slider value selection (#94313)
  skip another suite blocking es promotion (#94367)
  [Security Solution] Eliminates a redundant external link icon (#94194)
  skip another suite blocking es promotion (#94367)
  [App Search] Role mappings migration part 1 (#94346)
  [Security Solution][Detections] Fix flaky indicator enrichment tests (#94241)
  [Workplace Search] Deduplicate icons (#94359)
  [ML] Add latest transform to intro text (#94039)
  skip test failing es promotion (#94367)
  [Maps] convert elasticsearch_utils to TS (#93984)
  [Security_Solution][Telemetry] - Update endpoint usage to use agentService (#93829)
  [Security Solution][Exceptions] Fixes OS adding method for exception enrichment (#94343)
  [ILM] Add support for frozen phase (#93068)
  [App Search] Fixed 2 relevance tuning bugs (#94312)
  remove `try` auth mode (#94287)
  Removing resolver functional tests (#94331)
  migrate warning mixin to core (#94273)
  [App Search] Add routes for Role Mappings (#94221)
  ...

# Conflicts:
#	x-pack/plugins/index_lifecycle_management/public/application/sections/edit_policy/components/phases/cold_phase/cold_phase.tsx
#	x-pack/plugins/index_lifecycle_management/public/application/sections/edit_policy/components/phases/phase/phase.tsx
#	x-pack/plugins/index_lifecycle_management/public/application/sections/edit_policy/components/phases/shared_fields/searchable_snapshot_field/searchable_snapshot_field.tsx
#	x-pack/plugins/index_lifecycle_management/public/application/sections/edit_policy/edit_policy.tsx
#	x-pack/plugins/index_lifecycle_management/public/application/sections/edit_policy/form/configuration_issues_context.tsx
sulemanof pushed a commit that referenced this pull request Mar 11, 2021
* Remove request facade and update search strategies

* Use typescript

* Type files

* Update structure

* Update tests

* Type annotations

* Fix type for infra

* Type editor_controller

* Type vis_editor

* Type vis_picker

* Fix types

* Type panel_config

* Fix vis data type

* Enhance types

* Remove generics

* Use constant

* Update docs

* Use empty object as default data

* Fix merge conflict
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature:TSVB TSVB (Time Series Visual Builder) release_note:skip Skip the PR/issue when compiling release notes v7.13.0 v8.0.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants