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

[AppServices/Examples] Add the example for Reporting integration #82091

Merged
merged 8 commits into from
Dec 29, 2020

Conversation

tsullivan
Copy link
Member

@tsullivan tsullivan commented Oct 29, 2020

Summary

First step for #19914

This PR creates an area for developers to learn how to add a "Generate PDF" button to a page and make it reportable using the Reporting framework.

Over time, this area will change and demonstrate how the generate button can be made available depending on user privileges: the example app should define Reporting as a sub-feature privilege of the page.

Having feature controls implemented around Reporting integrations is an important step for deprecating the reporting_user custom role definition.

image

!!!

This PR changes a few parts of Reporting code to allow the example plugin to import shared variables from Reporting. The example plugin is all UI code, and it needs to import UI helpers like constants and helper functions from Reporting. I tried to minimize the number of things that got moved around, and I was able to limit it to just moving the constants and the getDefaultLayout function, which are in common now, but were originally in `server.

These changes move closer to giving an API to other plugins to use Reporting.

TODO

  • Add alternate URL to turn off controls for screenshot

@tsullivan tsullivan force-pushed the reporting/feature-control-example branch 14 times, most recently from 03a5c6a to a765dbc Compare November 4, 2020 23:49
@@ -107,9 +106,9 @@ export class ReportingNotifierStreamHandler {
_source: { status: jobStatus },
} = job;
if (storedJobs.includes(jobId)) {
if (jobStatus === JOB_STATUS_COMPLETED || jobStatus === JOB_STATUS_WARNINGS) {
Copy link
Member Author

@tsullivan tsullivan Nov 4, 2020

Choose a reason for hiding this comment

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

Cleaned up duplicated constants here: JOB_STATUS_COMPLETED / JOB_STATUSES.COMPLETED, etc

@tsullivan tsullivan force-pushed the reporting/feature-control-example branch 9 times, most recently from 7d65351 to 7741a11 Compare November 6, 2020 23:20
@tsullivan tsullivan force-pushed the reporting/feature-control-example branch 4 times, most recently from 9d23bcb to 5d06833 Compare November 13, 2020 00:12
@tsullivan tsullivan force-pushed the reporting/feature-control-example branch from 5d06833 to c0a4eb1 Compare December 1, 2020 23:36
@tsullivan tsullivan requested review from mikecote and ppisljar and removed request for nreese and mikecote December 9, 2020 17:52
@tsullivan
Copy link
Member Author

@elasticmachine merge upstream

@tsullivan tsullivan force-pushed the reporting/feature-control-example branch from e566b93 to ec849c5 Compare December 14, 2020 16:51
Copy link
Contributor

@joelgriffith joelgriffith left a comment

Choose a reason for hiding this comment

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

Nitpicks, but also saw deltas in our reporting plugin. Wanted to verify that's intentional -- I'm guessing so.

x-pack/examples/reporting_example/public/plugin.ts Outdated Show resolved Hide resolved
x-pack/plugins/reporting/common/index.ts Show resolved Hide resolved
Copy link
Member

@ppisljar ppisljar left a comment

Choose a reason for hiding this comment

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

i like the simplicity of example but i think it would be nice to provide some more information about what's expected from the app to provide (and what reporting won't)

x-pack/examples/reporting_example/README.md Outdated Show resolved Hide resolved
@tsullivan
Copy link
Member Author

@elasticmachine merge upstream

Copy link
Contributor

@joelgriffith joelgriffith left a comment

Choose a reason for hiding this comment

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

This is so great! Thanks for doing this, will be super helpful in the future.

@tsullivan
Copy link
Member Author

@elasticmachine merge upstream

@kibanamachine
Copy link
Contributor

💚 Build Succeeded

Metrics [docs]

Module Count

Fewer modules leads to a faster build time

id before after diff
reporting 49 51 +2

Async chunks

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

id before after diff
reporting 46.9KB 45.0KB -1.9KB

Distributable file count

id before after diff
default 47267 48027 +760

Page load bundle

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

id before after diff
reporting 99.7KB 106.8KB +7.1KB

History

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

@tsullivan tsullivan merged commit b120cb3 into elastic:master Dec 29, 2020
@tsullivan tsullivan deleted the reporting/feature-control-example branch December 29, 2020 16:55
tsullivan added a commit to tsullivan/kibana that referenced this pull request Dec 29, 2020
…stic#82091)

* Add developer example for Reporting

Refactor Reporting plugin to have shareable services

* Update plugin.ts

* use constant

* add more description to using reporting as a service

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
tsullivan added a commit to tsullivan/kibana that referenced this pull request Dec 29, 2020
…stic#82091)

* Add developer example for Reporting

Refactor Reporting plugin to have shareable services

* Update plugin.ts

* use constant

* add more description to using reporting as a service

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
tsullivan added a commit that referenced this pull request Dec 29, 2020
) (#87000)

* Add developer example for Reporting

Refactor Reporting plugin to have shareable services

* Update plugin.ts

* use constant

* add more description to using reporting as a service

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
tsullivan added a commit that referenced this pull request Dec 29, 2020
) (#86999)

* Add developer example for Reporting

Refactor Reporting plugin to have shareable services

* Update plugin.ts

* use constant

* add more description to using reporting as a service

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
gmmorris added a commit to gmmorris/kibana that referenced this pull request Dec 30, 2020
* master: (108 commits)
  [DOCS] Refreshes Data Visualizer screenshot (elastic#87017)
  [Security Solution] Change 'anti-virus' text to 'antivirus' (elastic#87001)
  [securitySolution/cypress] temporarily limit to PRs
  [AppServices/Examples] Add the example for Reporting integration (elastic#82091)
  [Build Chromium] Improve git checkout (elastic#83225)
  Deprecate `services.callCluster` in alerts and actions executors (elastic#86474)
  [Security Solution] Use system node version for Cypress and increase exec command timeout (elastic#86985)
  [Lens] Add more chart editor tests based on the debug state (elastic#86750)
  [Lens] Integrate searchSessionId into Lens app (elastic#86297)
  skip "pagination updates results and page number" elastic#86975
  skip "Custom detection rules" elastic#83772
  [logging/json] use merge from kbn/std (elastic#86330)
  skip network and timeline inspection. elastic#85677, elastic#85678
  skip "adds correctly a filter to the global search bar" elastic#86552
  [ftr/flags] improve help text (elastic#86971)
  skip "Fields Browser rendering. elastic#60209
  skip "Closes and opens alerts" elastic#83773
  [Security Solution] Skip failing Cypress tests (elastic#86967)
  Removes archives (elastic#86537)
  [ML] Fix charts grid on the Anomaly Explorer page (elastic#86904)
  ...
gmmorris added a commit to gmmorris/kibana that referenced this pull request Dec 30, 2020
* master: (72 commits)
  [DOCS] Refreshes Data Visualizer screenshot (elastic#87017)
  [Security Solution] Change 'anti-virus' text to 'antivirus' (elastic#87001)
  [securitySolution/cypress] temporarily limit to PRs
  [AppServices/Examples] Add the example for Reporting integration (elastic#82091)
  [Build Chromium] Improve git checkout (elastic#83225)
  Deprecate `services.callCluster` in alerts and actions executors (elastic#86474)
  [Security Solution] Use system node version for Cypress and increase exec command timeout (elastic#86985)
  [Lens] Add more chart editor tests based on the debug state (elastic#86750)
  [Lens] Integrate searchSessionId into Lens app (elastic#86297)
  skip "pagination updates results and page number" elastic#86975
  skip "Custom detection rules" elastic#83772
  [logging/json] use merge from kbn/std (elastic#86330)
  skip network and timeline inspection. elastic#85677, elastic#85678
  skip "adds correctly a filter to the global search bar" elastic#86552
  [ftr/flags] improve help text (elastic#86971)
  skip "Fields Browser rendering. elastic#60209
  skip "Closes and opens alerts" elastic#83773
  [Security Solution] Skip failing Cypress tests (elastic#86967)
  Removes archives (elastic#86537)
  [ML] Fix charts grid on the Anomaly Explorer page (elastic#86904)
  ...
@sophiec20 sophiec20 added the (Deprecated) Feature:Reporting Use Reporting:Screenshot, Reporting:CSV, or Reporting:Framework instead label Aug 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
(Deprecated) Feature:Reporting Use Reporting:Screenshot, Reporting:CSV, or Reporting:Framework instead dev release_note:skip Skip the PR/issue when compiling release notes v7.11.0 v7.12.0 v8.0.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants