Skip to content

[Reporting] Fix - show diagnostic only when image reporting is enabled#164336

Merged
rshen91 merged 11 commits intoelastic:mainfrom
rshen91:serverless-no-diag-report-link
Aug 22, 2023
Merged

[Reporting] Fix - show diagnostic only when image reporting is enabled#164336
rshen91 merged 11 commits intoelastic:mainfrom
rshen91:serverless-no-diag-report-link

Conversation

@rshen91
Copy link
Copy Markdown
Contributor

@rshen91 rshen91 commented Aug 21, 2023

Summary

Closes #164363
In serverless, pdf and png reports are not possible. I don't think it makes a lot of sense for the screenshotting diagnostic to appear to users since it's misleading.

Screenshot 2023-08-21 at 10 20 05 AM

If pdf and pngs are disabled by the config then the screenshotting diagnostic link will not be shown on the reporting management page like in serverless:
Screenshot 2023-08-21 at 10 22 01 AM

Checklist

@rshen91 rshen91 self-assigned this Aug 21, 2023
@rshen91 rshen91 added the zDeprecated Feature:Reporting Use Reporting:Screenshot, Reporting:CSV, or Reporting:Framework instead label Aug 21, 2023
@rshen91 rshen91 added the Team:SharedUX Platform AppEx-SharedUX (formerly Global Experience) t// label Aug 21, 2023
Copy link
Copy Markdown
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.

This is great and thank you so much for catching this!

I left comments about keeping the top-level entry point of Reporting front-end more generic, and getting the specifics out of the config object closer to the point of code where we need it. Let me know if you have other ideas :)

Comment on lines +158 to +159
const configAllowsImages =
this.config.export_types.pdf.enabled || this.config.export_types.png.enabled;
Copy link
Copy Markdown
Member

@tsullivan tsullivan Aug 21, 2023

Choose a reason for hiding this comment

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

Since this is the top-level entry point for the front-end of Reporting, we should probably consider creating this boolean elsewhere in the code where it's specifically needed. I recommend passing this.config.export_types in the call to mountManagementSection. See below

Edit: changed the wording of my suggestion

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Cool thanks I think I'm following the guidance please see c7adb54

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Yes, indeed!

share.url,
params
params,
configAllowsImages
Copy link
Copy Markdown
Member

@tsullivan tsullivan Aug 21, 2023

Choose a reason for hiding this comment

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

This is up to you, but we have some options to use more generic/intuitive parameters when calling mountManagementSection:

        const umountAppCallback = await mountManagementSection(
          core,
          start,
          license$,
          this.config.poll,
          this.config.export_types,
          apiClient,
          share.url,
          params
        );

or more simply (but impacts other code):

        const umountAppCallback = await mountManagementSection(
          core,
          start,
          license$,
          this.config,
          apiClient,
          share.url,
          params
        );

};

export const ReportDiagnostic = ({ apiClient }: Props) => {
export const ReportDiagnostic = ({ apiClient, configAllowsImages }: Props) => {
Copy link
Copy Markdown
Member

@tsullivan tsullivan Aug 21, 2023

Choose a reason for hiding this comment

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

Following the previous comments, this seems like the best place unwrap a generic config object and create a boolean called configAllowsImages .

Suggested change
export const ReportDiagnostic = ({ apiClient, configAllowsImages }: Props) => {
export const ReportDiagnostic = ({ apiClient, clientConfig }: Props) => {
configAllowsImages = clientConfig.export_types.pdf.enabled || clientConfig.export_types.png.enabled;

@rshen91 rshen91 marked this pull request as ready for review August 22, 2023 15:43
@rshen91 rshen91 requested a review from a team as a code owner August 22, 2023 15:43
@elasticmachine
Copy link
Copy Markdown
Contributor

Pinging @elastic/appex-sharedux (Team:SharedUX)

@rshen91 rshen91 added the release_note:skip Skip the PR/issue when compiling release notes label Aug 22, 2023
@rshen91 rshen91 requested a review from tsullivan August 22, 2023 15:46
Copy link
Copy Markdown
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.

LGTM! This is awesome! So happy to see the test updates!

@rshen91 rshen91 enabled auto-merge (squash) August 22, 2023 22:40
@rshen91 rshen91 merged commit af45072 into elastic:main Aug 22, 2023
@kibana-ci
Copy link
Copy Markdown

💚 Build Succeeded

Metrics [docs]

Async chunks

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

id before after diff
reporting 57.9KB 58.1KB +157.0B

Page load bundle

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

id before after diff
reporting 43.1KB 43.1KB -5.0B

History

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

cc @rshen91

@kibanamachine kibanamachine added v8.11.0 backport:skip This PR does not require backporting labels Aug 22, 2023
@rshen91 rshen91 deleted the serverless-no-diag-report-link branch August 23, 2023 13:19
jloleysens added a commit to jloleysens/kibana that referenced this pull request Aug 23, 2023
* main: (150 commits)
  Fixes unnecessary autocompletes on HTTP methods (elastic#163233)
  [Defend Workflows] Convert filterQuery to kql  (elastic#161806)
  [Fleet] copy `inactivity_timeout` when duplicating agent policy (elastic#164544)
  Fix 7.17 forward compatibility with 8.2+ (elastic#164274)
  [ML] Fixes dark mode in flyouts and modals (elastic#164399)
  [Defend Workflows]Changes to policy settings are not persistent until a refresh (elastic#164403)
  [Security Solution][Endpoint] Fixes kibana crash when going back to policy details page (elastic#164329)
  Prepare the Security domain HTTP APIs for Serverless (elastic#162087)
  skip failing test suite (elastic#160986)
  [Security Solution] Fix flaky Event Filters test (elastic#164473)
  [EDR workflows] Osquery serverless tests (elastic#163795)
  [Fleet] Only show agent dashboard links if there is more than one non-server agent and if the dashboards exist (elastic#164469)
  [Chrome UI] Fix background color in serverless (elastic#164419)
  [DOCS] Saved objects - resolve import errors API (elastic#162825)
  Remove 'Create Rule' button from Rule Group page (elastic#164167)
  [Security Solution] expandable flyout - fix infinite loop in correlations (elastic#163450)
  [Remote Clusters] Update copy about port help text (elastic#164442)
  [api-docs] 2023-08-23 Daily api_docs build (elastic#164524)
  [data views] Disable scripted fields in serverless environment (elastic#163228)
  [Reporting] Fix - show diagnostic only when image reporting is enabled (elastic#164336)
  ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport:skip This PR does not require backporting release_note:skip Skip the PR/issue when compiling release notes Team:SharedUX Platform AppEx-SharedUX (formerly Global Experience) t// v8.11.0 zDeprecated Feature:Reporting Use Reporting:Screenshot, Reporting:CSV, or Reporting:Framework instead

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Remove diagnostic tool link in reporting management for serverless

5 participants