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

cleaning up tabify to return Datatable #89857

Merged
merged 6 commits into from
Feb 3, 2021

Conversation

ppisljar
Copy link
Member

@ppisljar ppisljar commented Feb 1, 2021

Summary

resolves #84050

Checklist

Delete any items that are not applicable to this PR.

For maintainers

@ppisljar ppisljar requested a review from a team as a code owner February 1, 2021 12:56
@ppisljar ppisljar added release_note:skip Skip the PR/issue when compiling release notes Team:AppServices v7.12.0 v8.0.0 labels Feb 1, 2021
@elasticmachine
Copy link
Contributor

Pinging @elastic/kibana-app-services (Team:AppServices)

@ppisljar ppisljar added the review label Feb 2, 2021
Copy link
Contributor

@streamich streamich left a comment

Choose a reason for hiding this comment

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

Checked on Mac/Chrome. The only concern I have is I don't understand how iedriver is related to this PR, otherwise LGTM.

@@ -28,5 +28,3 @@ export const tabify = (

export { tabifyAggResponse } from './tabify';
export { tabifyGetColumns } from './get_columns';

export { TabbedTable, TabbedAggRow, TabbedAggColumn } from './types';
Copy link
Contributor

Choose a reason for hiding this comment

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

Not 100%, but looks like TabbedTable interface in types.ts can be removed?

package.json Outdated
@@ -681,7 +681,7 @@
"http-proxy": "^1.18.1",
"i18n-iso-countries": "^4.3.1",
"icalendar": "0.7.1",
"iedriver": "^3.14.2",

Copy link
Contributor

Choose a reason for hiding this comment

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

Why is iedriver removed? How is Selenium driver related to this PR?

Copy link
Member Author

Choose a reason for hiding this comment

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

ups, my mistake .... i had problems yarn kbn bootstraping ... need to revert this

Comment on lines -109 to -110
const [{ elasticsearch, savedObjects, uiSettings }, , self] = await getStartServices();
const { fieldFormats, indexPatterns, search } = self;
Copy link
Contributor

Choose a reason for hiding this comment

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

nice

@@ -65,9 +65,37 @@ export class TabbedAggResponseWriter {
}
}

response(): TabbedTable {
response(): Datatable {
Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe worth adding a couple of unit tests for the new implementation of this response() method.

# Conflicts:
#	src/plugins/data/server/server.api.md
Copy link
Member

@tsullivan tsullivan left a comment

Choose a reason for hiding this comment

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

Left a nit comment to try to make the code more readable, and a question that arose out of trying to understand the code.

++ to add more unit testing to ResponseWriter

to: this.params.timeRange?.to?.toISOString(),
}
: undefined,
...column.aggConfig.serialize(),
Copy link
Member

Choose a reason for hiding this comment

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

Is it possible for different columns to have different appliedTimeRange? It seems that way from the code

Copy link
Member Author

Choose a reason for hiding this comment

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

not different (as this.params.timeRange doesn't change) but some columns will have it and some won't. also on the datatable level there could actually be dfferent timeranges on different columns, but that's not in the scope of tabify.

@@ -28,19 +29,18 @@ export class TabbedAggResponseWriter {
metricBuffer: BufferColumn[] = [];

private readonly partialRows: boolean;
private readonly params: Partial<TabbedResponseWriterOptions>;
Copy link
Member

Choose a reason for hiding this comment

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

Can params be called something else that is more meaningful?

Copy link
Member Author

Choose a reason for hiding this comment

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

open for suggestions, but as this it not our public API i wouldn't spend too much time on it.

@kibanamachine
Copy link
Contributor

💚 Build Succeeded

Metrics [docs]

Module Count

Fewer modules leads to a faster build time

id before after diff
data 615 614 -1

Async chunks

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

id before after diff
data 236.1KB 236.1KB -2.0B

Page load bundle

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

id before after diff
data 798.4KB 796.9KB -1.5KB

History

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

@ppisljar ppisljar merged commit 8f70c52 into elastic:master Feb 3, 2021
@ppisljar ppisljar deleted the tabify/cleanup branch February 3, 2021 10:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
release_note:skip Skip the PR/issue when compiling release notes review v7.12.0 v8.0.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

cleanup tabify
5 participants