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

[ui/agg_response/tabify] -> TypeScript & Jest & Shim #57394

Closed
5 tasks
lukeelmers opened this issue Feb 11, 2020 · 3 comments
Closed
5 tasks

[ui/agg_response/tabify] -> TypeScript & Jest & Shim #57394

lukeelmers opened this issue Feb 11, 2020 · 3 comments
Assignees
Labels
Feature:Aggregations Aggregation infrastructure (AggConfig, esaggs, ...) Feature:NP Migration

Comments

@lukeelmers
Copy link
Member

lukeelmers commented Feb 11, 2020

In the legacy world, we had multiple response handlers. Their job is basically to take the output from a request handler and convert the data into a shape that is useful for a visualization. Visualization developers could register their own request/response handlers, and specify which ones the vis should use.

With the move to an expressions-backed visualizations infrastructure, our internal usage of request/response handlers has been greatly simplified: everything uses the esaggs function, which comes with the courier (default) request handler baked in, and the tabify (default) response handler. Vis developers can still register custom request/response handlers, but there is no need for us to provide these out of the box in kibana anymore.

tabify (like courier) is just a legacy name for a response handler that transforms a response into tabular data. Something along these lines:

const tabified = {
  columns: [
    { id: 'name', name: 'Name' },
    { id: 'age', name: 'Age' }
  ],
  rows: [
    { name: 'Bob', age: 80 },
    { name: 'Sue', age: 50 },
    { name: 'Joe', age: 20 },
  ],
};

Steps to migrate src/legacy/ui/public/agg_response/tabify:

  • convert remaining files to TS
  • update old prototype based classes to use ES6 class syntax
  • convert tests to Jest & TS
  • relocate to data shim plugin src/legacy/core_plugins/data/public/search/aggs/agg_response
    • we only need to move the tabify portion, the rest can stay behind
  • re-export contract from ui/agg_response/tabify (we can update imports later once it moves to NP along with the rest of agg_types)
@lukeelmers lukeelmers added Feature:Aggregations Aggregation infrastructure (AggConfig, esaggs, ...) Team:AppArch Feature:NP Migration labels Feb 11, 2020
@elasticmachine
Copy link
Contributor

Pinging @elastic/kibana-app-arch (Team:AppArch)

alexwizp added a commit to alexwizp/kibana that referenced this issue Feb 16, 2020
[ui/agg_response/tabify] -> TypeScript & Jest & Shim

Part of elastic#57394
@lizozom
Copy link
Contributor

lizozom commented Feb 19, 2020

@lukeelmers @alexwizp Would you mind adding, for the record, a short description to this issue of what tabify is?

@lukeelmers
Copy link
Member Author

@lizozom Sure thing, just updated the description -- let me know if this helps. Most people know what tabified data looks like, but perhaps just don't know that the name "tabify" was attached to it :)

alexwizp added a commit that referenced this issue Feb 20, 2020
* [ui/agg_response/tabify] -> TypeScript & Jest & Shim

[ui/agg_response/tabify] -> TypeScript & Jest & Shim

Part of #57394

* fix CI

* move tabify into new folder

* TypeScript _bucket.js

* rename _buckets -> bucket

* fix CI

* tabify.test.js -> tabify.test.ts

* tabify.js -> tabify.ts

* fix JEST

* Update src/legacy/core_plugins/data/public/search/tabify/types.ts

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

* fake_hierarchical_data.js -> fake_hierarchical_data.ts

* TimeRange -> TabbedRangeFilterParams

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
Co-authored-by: Luke Elmers <lukeelmers@gmail.com>
alexwizp added a commit to alexwizp/kibana that referenced this issue Feb 20, 2020
* [ui/agg_response/tabify] -> TypeScript & Jest & Shim

[ui/agg_response/tabify] -> TypeScript & Jest & Shim

Part of elastic#57394

* fix CI

* move tabify into new folder

* TypeScript _bucket.js

* rename _buckets -> bucket

* fix CI

* tabify.test.js -> tabify.test.ts

* tabify.js -> tabify.ts

* fix JEST

* Update src/legacy/core_plugins/data/public/search/tabify/types.ts

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

* fake_hierarchical_data.js -> fake_hierarchical_data.ts

* TimeRange -> TabbedRangeFilterParams

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
Co-authored-by: Luke Elmers <lukeelmers@gmail.com>
alexwizp added a commit to alexwizp/kibana that referenced this issue Feb 21, 2020
* [ui/agg_response/tabify] -> TypeScript & Jest & Shim

[ui/agg_response/tabify] -> TypeScript & Jest & Shim

Part of elastic#57394

* fix CI

* move tabify into new folder

* TypeScript _bucket.js

* rename _buckets -> bucket

* fix CI

* tabify.test.js -> tabify.test.ts

* tabify.js -> tabify.ts

* fix JEST

* Update src/legacy/core_plugins/data/public/search/tabify/types.ts

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

* fake_hierarchical_data.js -> fake_hierarchical_data.ts

* TimeRange -> TabbedRangeFilterParams

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
Co-authored-by: Luke Elmers <lukeelmers@gmail.com>
alexwizp added a commit that referenced this issue Feb 21, 2020
* [ui/agg_response/tabify] -> TypeScript & Jest & Shim

[ui/agg_response/tabify] -> TypeScript & Jest & Shim

Part of #57394

* fix CI

* move tabify into new folder

* TypeScript _bucket.js

* rename _buckets -> bucket

* fix CI

* tabify.test.js -> tabify.test.ts

* tabify.js -> tabify.ts

* fix JEST

* Update src/legacy/core_plugins/data/public/search/tabify/types.ts

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

* fake_hierarchical_data.js -> fake_hierarchical_data.ts

* TimeRange -> TabbedRangeFilterParams

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

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
Co-authored-by: Luke Elmers <lukeelmers@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature:Aggregations Aggregation infrastructure (AggConfig, esaggs, ...) Feature:NP Migration
Projects
None yet
Development

No branches or pull requests

4 participants