Commit 8587289
committed
Hide side-nav during report generation (#234675)
Fixes: #227187
When we request a report we send the target element's width and use it
to create a browser window.
Therefore the element's width becomes the window width. When the
side-nav is visible on the page, it pushes the dashboard to the right
and makes it smaller. As we take only the target element's screenshot
and use the width we passed as param as image width in the pdf, it
becomes skewed.
This PR removes the side-nav from the page during the report generation.
So the dashboard uses the full window width which is the original number
we passed initially.
## To verify:
Add `Sample web logs` data.
Change the solution view in the Space to something other than Classic.
Go to `Dashboards > Sample Logs Data` and generate a PDF report.
The screenshot should not be skewed.
Add the below config to your kibana.yml
```
feature_flags.overrides:
core.chrome.projectSideNav: 'v2'
```
Go to `Dashboards > Sample Logs Data` and generate a PDF report.
The fix should be working with the new side-nav as well.
(cherry picked from commit fa3bcdf)
# Conflicts:
# src/core/packages/chrome/browser-internal/src/ui/project/navigation.tsx
# src/core/packages/chrome/browser-internal/src/ui/project/sidenav_v2/fixed_layout_sidenav.tsx1 parent f5645ee commit 8587289
File tree
1 file changed
+12
-5
lines changed- src/core/packages/chrome/browser-internal/src/ui/project
1 file changed
+12
-5
lines changedLines changed: 12 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
15 | 18 | | |
16 | 19 | | |
17 | 20 | | |
| |||
26 | 29 | | |
27 | 30 | | |
28 | 31 | | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
29 | 40 | | |
30 | 41 | | |
31 | 42 | | |
| |||
36 | 47 | | |
37 | 48 | | |
38 | 49 | | |
39 | | - | |
40 | | - | |
41 | | - | |
42 | | - | |
43 | | - | |
| 50 | + | |
44 | 51 | | |
45 | 52 | | |
46 | 53 | | |
| |||
0 commit comments