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

[Vis] Move Timelion Vis to vis_type_timelion #52069

Merged
merged 83 commits into from
Jan 17, 2020

Conversation

maryia-lapata
Copy link
Contributor

@maryia-lapata maryia-lapata commented Dec 3, 2019

Summary

Moving Timelion Vis to a separate plugin vis_type_timelion.
Converting chart code to React.

Checklist

Use strikethroughs to remove checklist items you don't feel are applicable to this PR.

For maintainers

# Conflicts:
#	src/legacy/ui/public/directives/paginate.js
#	src/legacy/ui/public/directives/watch_multi/watch_multi.js
@maryia-lapata maryia-lapata added Feature:Timelion Timelion app and visualization Feature:Visualizations Generic visualization features (in case no more specific feature label is available) v8.0.0 release_note:skip Skip the PR/issue when compiling release notes Feature:NP Migration v7.6.0 labels Dec 3, 2019
@elasticmachine

This comment has been minimized.

@elasticmachine

This comment has been minimized.

@maryia-lapata maryia-lapata changed the title [Vis] Timelion Vis uses local angular [WIP] [Vis] Timelion Vis uses local angular Dec 12, 2019
@maryia-lapata
Copy link
Contributor Author

@elasticmachine merge upstream

Copy link
Contributor

@cchaos cchaos left a comment

Choose a reason for hiding this comment

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

Thanks for those SASS changes 👍


export interface Sheet {
list: Series[];
render: {
Copy link
Contributor

Choose a reason for hiding this comment

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

Looks like this type isn't correct - this is what the API returns:
Screenshot 2020-01-15 at 10 56 18

Copy link
Contributor Author

Choose a reason for hiding this comment

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

But according to this code

$scope.seriesList.render = $scope.seriesList.render || {
the API can return render too, or it will be set by default. Yeah, render definitely should be an optional property.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Okay, after resolving this #52069 (comment) we don't need type from render, but grid property is still used

@flash1293
Copy link
Contributor

@maryia-lapata Answered to some of the comment threads. Best look through the comments starting from #52069 (review)

@maryia-lapata
Copy link
Contributor Author

@elasticmachine merge upstream

function(vals, units) {
const normal = moment.normalizeUnits(units[0]);
] as any,
// @ts-ignore
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I disabled TS here because transform accepts accumulator as an array, but in this case an object used. And to show the real types (Values) I had to disable TS.

image

Copy link
Contributor

Choose a reason for hiding this comment

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

Using transform is unnecessary here, this code is just iterating over the static input array and is putting stuff into an object. You can also write it like this:

const unitMappings = [
  ['ms', 'milliseconds', 'millisecond'],
  ['s', 'seconds', 'second', 'sec'],
  ['m', 'minutes', 'minute', 'min'],
  ['h', 'hours', 'hour'],
  ['d', 'days', 'day'],
  ['w', 'weeks', 'week'],
  ['M', 'months', 'month'],
  ['quarter'],
  ['y', 'years', 'year'],
] as Units[][];
const vals = {} as Values;
unitMappings.forEach(units => {
  const normal = moment.normalizeUnits(units[0]) as Units;
  const val = moment.duration(1, normal).asMilliseconds();
  ([] as Units[]).concat(normal, units).forEach((unit: Units) => {
    vals[unit] = val;
  });
});

Copy link
Contributor

@flash1293 flash1293 left a comment

Choose a reason for hiding this comment

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

LGTM, didn't find anything else 👍 Tested in Chrome

@kibanamachine
Copy link
Contributor

💚 Build Succeeded

History

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

@maryia-lapata maryia-lapata merged commit 9e07a42 into elastic:master Jan 17, 2020
@maryia-lapata maryia-lapata deleted the timelion-shim branch January 17, 2020 12:30
jloleysens added a commit to jloleysens/kibana that referenced this pull request Jan 17, 2020
…t-of-legacy

* 'master' of github.com:elastic/kibana: (142 commits)
  [Vis] Move Timelion Vis to vis_type_timelion (elastic#52069)
  Deprecate `chrome.navlinks.update` and add documentation (elastic#54893)
  [ML] Single Metric Viewer: Fix time bounds with custom strings. (elastic#55045)
  [Vis: Default editor] EUIficate and Reactify the sidebar (elastic#49864)
  [Mappings editor] Fix cannot set boolean value for "null_value" param (elastic#55015)
  [SIEM] Adds support for apm-* to the network map (elastic#54876)
  [Reporting] Define shims of legacy dependencies (elastic#54082)
  Resolver is overflow: hidden to prevent obscured elements from showing up (elastic#55076)
  Upgraded EUI to 18.2.1 (elastic#55090)
  [Maps] Support styles on agg fields with _of_ in name (elastic#54965)
  Remove xpack_main requirement, it's no longer in use (elastic#55060)
  Fix Snapshots Policies Alignment Issue in IE11 (elastic#54866)
  first rule cuts (elastic#54990)
  [DOCS] Adds geocentroid note to coordinate map (elastic#54389)
  [Canvas] Fixes the Copy Post Url link (elastic#54831)
  Fixes bugs with full screen filters (elastic#54792)
  [ML] Fix decoding in the URL state  (elastic#54915)
  Remove redundant `x-pack/typings`. (elastic#55042)
  [SIEM][Detection Engine] Adds critical missing status route to prepackaged rules
  Generate legacy vars when rendering all applications (elastic#54768)
  ...

# Conflicts:
#	x-pack/plugins/translations/translations/ja-JP.json
#	x-pack/plugins/translations/translations/zh-CN.json
maryia-lapata added a commit that referenced this pull request Jan 17, 2020
* Deangularize timelion vis

* Refactoring

* Fix path

* Update timelion_controller.ts

* Remove unused deps

* Create vis_type_timelion

* Create ChartComponent

* Render chart in react

* Reactify timelion editor

* Change translation ids

* Use hooks

* Add @types/pegjs into renovate.json5

* Add validation, add hover suggestions

* Style fixes

* Change plugin setup, use kibana context

* Update

* Fix ticks

* Fix plotselected listener

* Fix plothover handler

* Add TS for options

* Update TS

* Restructuring

* Change plugin start

* Remove vis from timelion plugin

* Rename class

* Mock services

* Fix other comments

* Remove duplicate files

* Convert test to jest

* Remove kibana_services from timelion

* Delete visualize_app.ts.~LOCAL

* Refactoring

* Fix TS

* Refactoring, TS

* Import eui variables

* Import styling constants

* Move react components to vis_type_timelion

* Fix TS

* Move ui imports to legacy_imports.ts

* Move chain.peg to vis_type_timelion

* Fix path

* Use KibanaContext instead kibana_services.ts

* Refactoring

* Refactoring

* Add @types/flot

* Fix issue with hovered series color

* Update renovate.json5

* Pass timelionPanels as dependencies

* Move common folder to vis_type_timelion

* Move back tick_formatters.ts

* Rename styles file

* Refactoring

* Update _index.scss

* Move to_milliseconds to common

* Revert yaxes formatting

* Refactoring

* Refactoring

* Use Panel directly

* Refactoring of to_milliseconds.ts

Co-authored-by: Daniil Suleiman <31325372+sulemanof@users.noreply.github.com>
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>

Co-authored-by: Daniil Suleiman <31325372+sulemanof@users.noreply.github.com>
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
jkelastic pushed a commit to jkelastic/kibana that referenced this pull request Jan 17, 2020
* Deangularize timelion vis

* Refactoring

* Fix path

* Update timelion_controller.ts

* Remove unused deps

* Create vis_type_timelion

* Create ChartComponent

* Render chart in react

* Reactify timelion editor

* Change translation ids

* Use hooks

* Add @types/pegjs into renovate.json5

* Add validation, add hover suggestions

* Style fixes

* Change plugin setup, use kibana context

* Update

* Fix ticks

* Fix plotselected listener

* Fix plothover handler

* Add TS for options

* Update TS

* Restructuring

* Change plugin start

* Remove vis from timelion plugin

* Rename class

* Mock services

* Fix other comments

* Remove duplicate files

* Convert test to jest

* Remove kibana_services from timelion

* Delete visualize_app.ts.~LOCAL

* Refactoring

* Fix TS

* Refactoring, TS

* Import eui variables

* Import styling constants

* Move react components to vis_type_timelion

* Fix TS

* Move ui imports to legacy_imports.ts

* Move chain.peg to vis_type_timelion

* Fix path

* Use KibanaContext instead kibana_services.ts

* Refactoring

* Refactoring

* Add @types/flot

* Fix issue with hovered series color

* Update renovate.json5

* Pass timelionPanels as dependencies

* Move common folder to vis_type_timelion

* Move back tick_formatters.ts

* Rename styles file

* Refactoring

* Update _index.scss

* Move to_milliseconds to common

* Revert yaxes formatting

* Refactoring

* Refactoring

* Use Panel directly

* Refactoring of to_milliseconds.ts

Co-authored-by: Daniil Suleiman <31325372+sulemanof@users.noreply.github.com>
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
gmmorris added a commit to gmmorris/kibana that referenced this pull request Jan 20, 2020
* upstream/master: (83 commits)
  [Reporting] Fix map tiles not loading by using Chrome's Remote Protocol (elastic#55137)
  [Data Plugin] combine autocomplete provider and suggestions provider (elastic#54451)
  resolves elastic#53038 - remove references to specific license levels (elastic#53858)
  highlighting rules should still know about url parts when in sql state (elastic#55200)
  [Metric] convert mocha tests to jest (elastic#54054)
  [skip-ci] Update vector styling docs for 7.6 UI changes and new features (elastic#55087)
  Fix enable API to schedule task after alert is updated (elastic#55095)
  chore(NA): add 7.6 branch to the list of backport branches (elastic#54998)
  Convert tests to jest in vis_type_timeseries/public & common folders (elastic#55023)
  [ML] Accessibility fix for structural markup on table rows (elastic#55075)
  [Mappings editor] include/exclude fields only support custom options (elastic#54949)
  [Vis] Move Timelion Vis to vis_type_timelion (elastic#52069)
  Deprecate `chrome.navlinks.update` and add documentation (elastic#54893)
  [ML] Single Metric Viewer: Fix time bounds with custom strings. (elastic#55045)
  [Vis: Default editor] EUIficate and Reactify the sidebar (elastic#49864)
  [Mappings editor] Fix cannot set boolean value for "null_value" param (elastic#55015)
  [SIEM] Adds support for apm-* to the network map (elastic#54876)
  [Reporting] Define shims of legacy dependencies (elastic#54082)
  Resolver is overflow: hidden to prevent obscured elements from showing up (elastic#55076)
  Upgraded EUI to 18.2.1 (elastic#55090)
  ...
@maryia-lapata maryia-lapata added the Team:Visualizations Visualization editors, elastic-charts and infrastructure label Feb 10, 2020
@elasticmachine
Copy link
Contributor

Pinging @elastic/kibana-app (Team:KibanaApp)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backported Feature:NP Migration Feature:Timelion Timelion app and visualization Feature:Visualizations Generic visualization features (in case no more specific feature label is available) release_note:skip Skip the PR/issue when compiling release notes Team:Visualizations Visualization editors, elastic-charts and infrastructure v7.7.0 v8.0.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants