[Reporting] Clean Up TypeScript Definitions#76566
Conversation
6528dd2 to
0acf89a
Compare
0acf89a to
d90df7a
Compare
d90df7a to
ff9d552
Compare
There was a problem hiding this comment.
headers comes from req - the encrypted header string was not used.
There was a problem hiding this comment.
the get_csv_job module is only used for immediate csv download
d02b367 to
f4eaff9
Compare
There was a problem hiding this comment.
the argument types of addReport changed to take a single report instead of 3 separate parts of a report
There was a problem hiding this comment.
Which is why applying jobSettings has moved to this file
There was a problem hiding this comment.
"print" layout does not have the dimension fields but is still a LayoutInstance
c86351e to
49eaeef
Compare
There was a problem hiding this comment.
removed this, as it was duplicate with ReportDocument
2287b01 to
2197898
Compare
There was a problem hiding this comment.
I created a new directory for these, because more code is coming soon
| _source: { | ||
| status: 'completed', | ||
| output: { max_size_reached: false, csv_contains_formulas: false }, | ||
| payload: { type: 'spectacular', title: 'specimen' }, |
There was a problem hiding this comment.
This is why we should not have had .type on JobSummary
| id: src._id, | ||
| status: src._source.status, | ||
| title: src._source.payload.title, | ||
| type: src._source.payload.type, |
There was a problem hiding this comment.
There is no type field of payload
|
Pinging @elastic/kibana-app-arch (Team:AppArch) |
|
@elasticmachine merge upstream |
|
@elasticmachine merge upstream |
streamich
left a comment
There was a problem hiding this comment.
Changes LGTM, ran it on Mac/Chrome all seems to work.
While looking at this PR, I also looked at the reporting plugin in general to learn it better, bellow are few things that caught my attention.
Maybe we should retire the dashboard sharing API share.register and use there UI Actions instead, where dashboard would have its own trigger, say DASHBOARD_MENU_TRIGGER:
uiActions.addTriggerAction(DASHBOARD_MENU_TRIGGER, action);To reduce bundle sizes, ideally we want to load apps and management app section asynchronously, so would be nice to load the management app section using a dynamic import, and maybe even the UI parts of registered dashboard menu actions.
I liked the .stop$ observable, I'm thinking maybe we could even change how we write Kibana plugins, to something like this:
const {plugin, setup$, start$, stop$} = createPlugin();
export {plugin};
setup$
.pipe(
tap((core, plugins) => { /* ... */ }),
)
.subscribe();
start$
.pipe(
tap((core, plugins) => { /* ... */ }),
)
.subscribe();
💛 Build succeeded, but was flaky
Test FailuresChrome X-Pack UI Functional Tests.x-pack/test/functional/apps/lens/smokescreen·ts.lens app lens smokescreen tests should create an xy visualization with filters aggregationStandard OutStack TraceBuild metricspage load bundle size
distributable file count
History
To update your PR or re-run it, just comment with: |
* [Reporting] Simplify Export Type Definitions, use defaults for generics, refactor * ReportApiJSON interface for common * rename JobSummary to JobStatusBucket for clarity * revert unneeded create mock changes * clean up the diff * revert changes to worker.js * rewrite comment * rename type to jobtype in JobStatusBucket * allow type inference * JobSummarySet * remove odd comment * Reflect that browser timezone may be undefined in the BaseParams * comment about optional browserTimezone * revert unecessary es archive change Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
* [Reporting] Clean Up TypeScript Definitions (#76566) * [Reporting] Simplify Export Type Definitions, use defaults for generics, refactor * ReportApiJSON interface for common * rename JobSummary to JobStatusBucket for clarity * revert unneeded create mock changes * clean up the diff * revert changes to worker.js * rewrite comment * rename type to jobtype in JobStatusBucket * allow type inference * JobSummarySet * remove odd comment * Reflect that browser timezone may be undefined in the BaseParams * comment about optional browserTimezone * revert unecessary es archive change Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com> * fix ts Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
|
@streamich Thanks for taking the time to review this and offer those suggestions. I think each one of them should stay tracked, so I am filing separate ER issues.
I'm not sure I follow this one specifically. I think it is about a cleanup for App Arch in code that I'm not that familiar with. Feel free to ping me and we can talk about it more.
++ Reducing bundle sizes is hugely important for Reporting as a feature because lower bundle sizes means faster load in the headless browser that captures the screenshots. Of course we don't care about any management features in that use case, so if we can avoid having the browser parse the code altogether, that is great. Filed: #78242
This reminded me that we need to monitor Filed: #78243 |

Summary
Pull work out of the PR to switch Reporting to Task Manager
LayoutParamsand is converted toLayoutInstanceon the serverside, withcreateLayoutexport_types/commonJobSource/ (ReportDocument)basePathfrom job params, since it is looked up at execution timeChecklist
Delete any items that are not applicable to this PR.
For maintainers