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

[Controls] [Reporting] Remove controls from reports #134240

Merged
merged 2 commits into from
Jun 15, 2022

Conversation

Heenawter
Copy link
Contributor

@Heenawter Heenawter commented Jun 13, 2022

Closes #133547

Summary

Before this change, controls were not included in print optimized reports, but they were included in non-print-optimized reports. However, this caused a bug where sometimes the reporting states didn't match - more context can be found here.

To fix this, I removed the data-shared-items-count from the control_group_component, because it was found that this was causing the ambiguous state for Reporting since it only expects a single data-shared-items-count for the entire page. This solution removes controls from non-print-optimized reports entirely.

Note that, if we wanted to include controls in reports in the future, we would have to pull the dashboard-shared-items-container class outside to include both the control_group and the DashboardGrid, with something like:

    return (
      <div data-shared-items-container data-title={title} data-description={description}>
        {controlsEnabled && container.getInput().viewMode !== ViewMode.PRINT ? (
          <>
            {isEditMode && panelCount !== 0 && controlGroup?.getPanelCount() === 0 ? (
            ...
        ) : null}
        <div
          data-shared-items-count={panelCount}
          className={useMargins ? 'dshDashboardViewport-withMargins' : 'dshDashboardViewport'}
        >
         ...
        </div>
      </div>
    );

However, since we don't have a strong preference for whether or not controls should be visible in non-print-optimized reports anyway, the simplest and most reliable solution is to simply to not include them at all for now.

How to test:

  1. Create a new dashboard
  2. Add at least one control
  3. Don't save the dashboard
  4. Generate a non-print-optimized PDF report
  5. Ensure that the report is generated without errors and that controls are not visible in the report

Checklist

@Heenawter Heenawter added release_note:fix Feature:Reporting Reporting (PDF, CSV, ..) feature Team:Presentation Presentation Team for Dashboard, Input Controls, and Canvas loe:small Small Level of Effort impact:medium Addressing this issue will have a medium level of impact on the quality/strength of our product. (Deprecated) Team:Reporting Services Use Team:Global Experiance and Feature:Reporting instead. v8.3.0 labels Jun 13, 2022
@Heenawter Heenawter self-assigned this Jun 13, 2022
@Heenawter Heenawter marked this pull request as ready for review June 13, 2022 17:02
@Heenawter Heenawter requested a review from a team as a code owner June 13, 2022 17:02
@elasticmachine
Copy link
Contributor

Pinging @elastic/kibana-presentation (Team:Presentation)

@elasticmachine
Copy link
Contributor

Pinging @elastic/kibana-reporting-services (Team:Reporting Services)

@kibana-ci
Copy link
Collaborator

💚 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
controls 426.5KB 426.4KB -35.0B

History

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

cc @Heenawter

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.

LGTM

Thanks for the details notes - I agree with everything you stated!

Copy link
Contributor

@ThomThomson ThomThomson left a comment

Choose a reason for hiding this comment

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

As we discussed, this fix looks good! I just wonder if the title of the PR reflects what it's actually doing, left a comment to that effect. LGTM!

@@ -115,7 +115,6 @@ export const ControlGroup = () => {
responsive={false}
alignItems="center"
data-test-subj="controls-group"
data-shared-items-count={idsInOrder.length}
Copy link
Contributor

Choose a reason for hiding this comment

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

Does this change actually "Remove controls from reports"? Or does it simply fix the loading issue we were encountering before?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I mean, it does remove controls from reports (specifically, non-print-optimized reports) - they used to be screen captured and included in these reports, and now they are not and the reports only include the graphs on the dashboard. I could change the title to reflect that this only impacts non-print-optimized reports?

Copy link
Contributor

Choose a reason for hiding this comment

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

Oh! I didn't realise that simply removing the data-shared-items-count would actually remove the Controls from the report! In that case the title makes total sense. Thanks for the response!

@Heenawter Heenawter merged commit 5c8b8be into elastic:main Jun 15, 2022
@kibanamachine kibanamachine added the backport missing Added to PRs automatically when the are determined to be missing a backport. label Jun 17, 2022
@kibanamachine
Copy link
Contributor

Friendly reminder: Looks like this PR hasn’t been backported yet.
To create automatically backports add the label auto-backport or prevent reminders by adding the backport:skip label.
You can also create backports manually by running node scripts/backport --pr 134240 locally

@Heenawter Heenawter added backport:skip This commit does not require backporting and removed backport missing Added to PRs automatically when the are determined to be missing a backport. labels Jun 17, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport:skip This commit does not require backporting (Deprecated) Team:Reporting Services Use Team:Global Experiance and Feature:Reporting instead. Feature:Reporting Reporting (PDF, CSV, ..) feature impact:medium Addressing this issue will have a medium level of impact on the quality/strength of our product. loe:small Small Level of Effort release_note:fix Team:Presentation Presentation Team for Dashboard, Input Controls, and Canvas v8.3.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Controls] [Reporting] Warnings when generating some reports with controls
6 participants