-
Notifications
You must be signed in to change notification settings - Fork 8.3k
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
[Reporting] fix dashboard "Copy Post URL" action #192530
[Reporting] fix dashboard "Copy Post URL" action #192530
Conversation
a75979a
to
9b9d2d1
Compare
5375442
to
5f6a531
Compare
*/ | ||
export const reportingScreenshotShareProvider = ({ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The Canvas integration doesn't use this export, and doesn't use the Sharing services for its menu. See x-pack/plugins/canvas/public/components/workpad_header/share_menu/share_menu.tsx
interface ShareMenuProviderLegacy { | ||
readonly id: string; | ||
getShareMenuItemsLegacy: (context: ShareContext) => ShareMenuItemLegacy[]; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
After untangling ShareMenuItemLegacy
from this area of code, it appears that nothing is actually using the legacy interface except for example code and test code. This should probably be cleaned up in a later PR.
3f98ee0
to
76a0386
Compare
Flaky Test Runner Stats🎉 All tests passed! - kibana-flaky-test-suite-runner#6986[✅] x-pack/test/functional/apps/dashboard/group3/config.ts: 50/50 tests passed. |
const el = document.querySelector('[data-shared-items-container]'); | ||
const { height, width } = el ? el.getBoundingClientRect() : { height: 768, width: 1024 }; | ||
const dimensions = { height, width }; | ||
const layoutId = optimizedForPrinting ? ('print' as const) : ('preserve_layout' as const); | ||
const layout = { id: layoutId, dimensions }; | ||
const baseParams = { objectType, layout, title }; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for consolidating this logic!
@@ -36,7 +36,7 @@ export class ShareMenuRegistry { | |||
return { | |||
getShareMenuItems: (context: ShareContext) => | |||
Array.from(this.shareMenuProviders.values()).flatMap((shareActionProvider) => | |||
shareActionProvider.getShareMenuItems(context) | |||
(shareActionProvider as ShareMenuProviderV2).getShareMenuItems(context) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This causes an error to be thrown when kibana is started with the --run-examples
arg in dev, because the share menu of the demo plugin is registered to be retrieved using getShareMenuItemsLegacy
, So maybe the following would be more appropriate
(shareActionProvider as ShareMenuProviderV2).getShareMenuItems(context) | |
(shareActionProvider.getShareMenuItems ?? shareActionProvider.getShareMenuItemsLegacy).call(shareActionProvider, context) |
this way we are inclusive of the fact that some menu item might be defined still using the legacy method
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
💚 Build Succeeded
Metrics [docs]Public APIs missing comments
Public APIs missing exports
Page load bundle
Unknown metric groupsAPI count
References to deprecated APIs
History
To update your PR or re-run it, just comment with: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tested locally, code also LGTM
Starting backport for target branches: 8.15, 8.x |
💚 Build Succeeded
Metrics [docs]Public APIs missing comments
Public APIs missing exports
Page load bundle
|
## Summary Closes elastic#191673 Closes elastic#183566 Fixes the ability for the POST URL used to automate generation of reports by adding a `generateExportUrl` function to the ShareMenuItemV2 interface. This function returns a dynamic export URL for PDF generation by using the selected layout option. Other changes: provides more strictness in type definitions by: * splitting the types that define `ShareMenuProvider`: * `ShareMenuProviderV2` provides the `getShareMenuItems` function * `ShareMenuProviderLegacy` provides the `getShareMenuItemsLegacy` function ### Release note Fixed an issue with the export options for PNG/PDF reports in a dashboard. ### Checklist Delete any items that are not applicable to this PR. - [x] Use the `generateExportUrl` function inputs to return a POST URL that is aware of the layout mode (`print` or `preserve_layout`) and screen dimensions - [x] [Unit or functional tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html) were updated or added to match the most common scenarios - [x] Flaky test runner: https://buildkite.com/elastic/kibana-flaky-test-suite-runner/builds/6986 (cherry picked from commit 38407ae)
💔 Some backports could not be created
Note: Successful backport PRs will be merged automatically after passing CI. Manual backportTo create the backport manually run:
Questions ?Please refer to the Backport tool documentation |
…2530) (#195334) # Backport This will backport the following commits from `main` to `8.x`: - [[Reporting] fix dashboard "Copy Post URL" action (#192530)](#192530) <!--- Backport version: 9.4.3 --> ### Questions ? Please refer to the [Backport tool documentation](https://github.com/sqren/backport) <!--BACKPORT [{"author":{"name":"Tim Sullivan","email":"[email protected]"},"sourceCommit":{"committedDate":"2024-10-07T23:54:21Z","message":"[Reporting] fix dashboard \"Copy Post URL\" action (#192530)\n\n## Summary\r\n\r\nCloses https://github.com/elastic/kibana/issues/191673\r\nCloses https://github.com/elastic/kibana/issues/183566\r\n\r\nFixes the ability for the POST URL used to automate generation of\r\nreports by adding a `generateExportUrl` function to the ShareMenuItemV2\r\ninterface. This function returns a dynamic export URL for PDF generation\r\nby using the selected layout option.\r\n\r\nOther changes: provides more strictness in type definitions by:\r\n * splitting the types that define `ShareMenuProvider`:\r\n * `ShareMenuProviderV2` provides the `getShareMenuItems` function\r\n* `ShareMenuProviderLegacy` provides the `getShareMenuItemsLegacy`\r\nfunction\r\n\r\n### Release note\r\nFixed an issue with the export options for PNG/PDF reports in a\r\ndashboard.\r\n\r\n### Checklist\r\n\r\nDelete any items that are not applicable to this PR.\r\n\r\n- [x] Use the `generateExportUrl` function inputs to return a POST URL\r\nthat is aware of the layout mode (`print` or `preserve_layout`) and\r\nscreen dimensions\r\n- [x] [Unit or functional\r\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\r\nwere updated or added to match the most common scenarios\r\n- [x] Flaky test runner:\r\nhttps://buildkite.com/elastic/kibana-flaky-test-suite-runner/builds/6986","sha":"38407ae6b01e071757083fe358116b6dd75c4422","branchLabelMapping":{"^v9.0.0$":"main","^v8.16.0$":"8.x","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:fix","v9.0.0","v8.16.0","backport:version","v8.15.2"],"title":"[Reporting] fix dashboard \"Copy Post URL\" action","number":192530,"url":"https://github.com/elastic/kibana/pull/192530","mergeCommit":{"message":"[Reporting] fix dashboard \"Copy Post URL\" action (#192530)\n\n## Summary\r\n\r\nCloses https://github.com/elastic/kibana/issues/191673\r\nCloses https://github.com/elastic/kibana/issues/183566\r\n\r\nFixes the ability for the POST URL used to automate generation of\r\nreports by adding a `generateExportUrl` function to the ShareMenuItemV2\r\ninterface. This function returns a dynamic export URL for PDF generation\r\nby using the selected layout option.\r\n\r\nOther changes: provides more strictness in type definitions by:\r\n * splitting the types that define `ShareMenuProvider`:\r\n * `ShareMenuProviderV2` provides the `getShareMenuItems` function\r\n* `ShareMenuProviderLegacy` provides the `getShareMenuItemsLegacy`\r\nfunction\r\n\r\n### Release note\r\nFixed an issue with the export options for PNG/PDF reports in a\r\ndashboard.\r\n\r\n### Checklist\r\n\r\nDelete any items that are not applicable to this PR.\r\n\r\n- [x] Use the `generateExportUrl` function inputs to return a POST URL\r\nthat is aware of the layout mode (`print` or `preserve_layout`) and\r\nscreen dimensions\r\n- [x] [Unit or functional\r\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\r\nwere updated or added to match the most common scenarios\r\n- [x] Flaky test runner:\r\nhttps://buildkite.com/elastic/kibana-flaky-test-suite-runner/builds/6986","sha":"38407ae6b01e071757083fe358116b6dd75c4422"}},"sourceBranch":"main","suggestedTargetBranches":["8.x","8.15"],"targetPullRequestStates":[{"branch":"main","label":"v9.0.0","branchLabelMappingKey":"^v9.0.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/192530","number":192530,"mergeCommit":{"message":"[Reporting] fix dashboard \"Copy Post URL\" action (#192530)\n\n## Summary\r\n\r\nCloses https://github.com/elastic/kibana/issues/191673\r\nCloses https://github.com/elastic/kibana/issues/183566\r\n\r\nFixes the ability for the POST URL used to automate generation of\r\nreports by adding a `generateExportUrl` function to the ShareMenuItemV2\r\ninterface. This function returns a dynamic export URL for PDF generation\r\nby using the selected layout option.\r\n\r\nOther changes: provides more strictness in type definitions by:\r\n * splitting the types that define `ShareMenuProvider`:\r\n * `ShareMenuProviderV2` provides the `getShareMenuItems` function\r\n* `ShareMenuProviderLegacy` provides the `getShareMenuItemsLegacy`\r\nfunction\r\n\r\n### Release note\r\nFixed an issue with the export options for PNG/PDF reports in a\r\ndashboard.\r\n\r\n### Checklist\r\n\r\nDelete any items that are not applicable to this PR.\r\n\r\n- [x] Use the `generateExportUrl` function inputs to return a POST URL\r\nthat is aware of the layout mode (`print` or `preserve_layout`) and\r\nscreen dimensions\r\n- [x] [Unit or functional\r\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\r\nwere updated or added to match the most common scenarios\r\n- [x] Flaky test runner:\r\nhttps://buildkite.com/elastic/kibana-flaky-test-suite-runner/builds/6986","sha":"38407ae6b01e071757083fe358116b6dd75c4422"}},{"branch":"8.x","label":"v8.16.0","branchLabelMappingKey":"^v8.16.0$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"8.15","label":"v8.15.2","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"}]}] BACKPORT--> Co-authored-by: Tim Sullivan <[email protected]>
💚 All backports created successfully
Note: Successful backport PRs will be merged automatically after passing CI. Questions ?Please refer to the Backport tool documentation |
## Summary Closes elastic#191673 Closes elastic#183566 Fixes the ability for the POST URL used to automate generation of reports by adding a `generateExportUrl` function to the ShareMenuItemV2 interface. This function returns a dynamic export URL for PDF generation by using the selected layout option. Other changes: provides more strictness in type definitions by: * splitting the types that define `ShareMenuProvider`: * `ShareMenuProviderV2` provides the `getShareMenuItems` function * `ShareMenuProviderLegacy` provides the `getShareMenuItemsLegacy` function ### Release note Fixed an issue with the export options for PNG/PDF reports in a dashboard. ### Checklist Delete any items that are not applicable to this PR. - [x] Use the `generateExportUrl` function inputs to return a POST URL that is aware of the layout mode (`print` or `preserve_layout`) and screen dimensions - [x] [Unit or functional tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html) were updated or added to match the most common scenarios - [x] Flaky test runner: https://buildkite.com/elastic/kibana-flaky-test-suite-runner/builds/6986 (cherry picked from commit 38407ae) # Conflicts: # src/plugins/share/public/components/share_tabs.test.tsx # src/plugins/share/public/services/share_menu_manager.tsx
…96928) # Backport This will backport the following commits from `main` to `8.15`: - [[Reporting] fix dashboard "Copy Post URL" action (#192530)](#192530) <!--- Backport version: 8.9.8 --> ### Questions ? Please refer to the [Backport tool documentation](https://github.com/sqren/backport) <!--BACKPORT [{"author":{"name":"Tim Sullivan","email":"[email protected]"},"sourceCommit":{"committedDate":"2024-10-07T23:54:21Z","message":"[Reporting] fix dashboard \"Copy Post URL\" action (#192530)\n\n## Summary\r\n\r\nCloses https://github.com/elastic/kibana/issues/191673\r\nCloses https://github.com/elastic/kibana/issues/183566\r\n\r\nFixes the ability for the POST URL used to automate generation of\r\nreports by adding a `generateExportUrl` function to the ShareMenuItemV2\r\ninterface. This function returns a dynamic export URL for PDF generation\r\nby using the selected layout option.\r\n\r\nOther changes: provides more strictness in type definitions by:\r\n * splitting the types that define `ShareMenuProvider`:\r\n * `ShareMenuProviderV2` provides the `getShareMenuItems` function\r\n* `ShareMenuProviderLegacy` provides the `getShareMenuItemsLegacy`\r\nfunction\r\n\r\n### Release note\r\nFixed an issue with the export options for PNG/PDF reports in a\r\ndashboard.\r\n\r\n### Checklist\r\n\r\nDelete any items that are not applicable to this PR.\r\n\r\n- [x] Use the `generateExportUrl` function inputs to return a POST URL\r\nthat is aware of the layout mode (`print` or `preserve_layout`) and\r\nscreen dimensions\r\n- [x] [Unit or functional\r\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\r\nwere updated or added to match the most common scenarios\r\n- [x] Flaky test runner:\r\nhttps://buildkite.com/elastic/kibana-flaky-test-suite-runner/builds/6986","sha":"38407ae6b01e071757083fe358116b6dd75c4422","branchLabelMapping":{"^v9.0.0$":"main","^v8.16.0$":"8.x","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:fix","v9.0.0","v8.16.0","backport:version","v8.15.2"],"number":192530,"url":"https://github.com/elastic/kibana/pull/192530","mergeCommit":{"message":"[Reporting] fix dashboard \"Copy Post URL\" action (#192530)\n\n## Summary\r\n\r\nCloses https://github.com/elastic/kibana/issues/191673\r\nCloses https://github.com/elastic/kibana/issues/183566\r\n\r\nFixes the ability for the POST URL used to automate generation of\r\nreports by adding a `generateExportUrl` function to the ShareMenuItemV2\r\ninterface. This function returns a dynamic export URL for PDF generation\r\nby using the selected layout option.\r\n\r\nOther changes: provides more strictness in type definitions by:\r\n * splitting the types that define `ShareMenuProvider`:\r\n * `ShareMenuProviderV2` provides the `getShareMenuItems` function\r\n* `ShareMenuProviderLegacy` provides the `getShareMenuItemsLegacy`\r\nfunction\r\n\r\n### Release note\r\nFixed an issue with the export options for PNG/PDF reports in a\r\ndashboard.\r\n\r\n### Checklist\r\n\r\nDelete any items that are not applicable to this PR.\r\n\r\n- [x] Use the `generateExportUrl` function inputs to return a POST URL\r\nthat is aware of the layout mode (`print` or `preserve_layout`) and\r\nscreen dimensions\r\n- [x] [Unit or functional\r\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\r\nwere updated or added to match the most common scenarios\r\n- [x] Flaky test runner:\r\nhttps://buildkite.com/elastic/kibana-flaky-test-suite-runner/builds/6986","sha":"38407ae6b01e071757083fe358116b6dd75c4422"}},"sourceBranch":"main","suggestedTargetBranches":["8.15"],"targetPullRequestStates":[{"branch":"main","label":"v9.0.0","labelRegex":"^v9.0.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/192530","number":192530,"mergeCommit":{"message":"[Reporting] fix dashboard \"Copy Post URL\" action (#192530)\n\n## Summary\r\n\r\nCloses https://github.com/elastic/kibana/issues/191673\r\nCloses https://github.com/elastic/kibana/issues/183566\r\n\r\nFixes the ability for the POST URL used to automate generation of\r\nreports by adding a `generateExportUrl` function to the ShareMenuItemV2\r\ninterface. This function returns a dynamic export URL for PDF generation\r\nby using the selected layout option.\r\n\r\nOther changes: provides more strictness in type definitions by:\r\n * splitting the types that define `ShareMenuProvider`:\r\n * `ShareMenuProviderV2` provides the `getShareMenuItems` function\r\n* `ShareMenuProviderLegacy` provides the `getShareMenuItemsLegacy`\r\nfunction\r\n\r\n### Release note\r\nFixed an issue with the export options for PNG/PDF reports in a\r\ndashboard.\r\n\r\n### Checklist\r\n\r\nDelete any items that are not applicable to this PR.\r\n\r\n- [x] Use the `generateExportUrl` function inputs to return a POST URL\r\nthat is aware of the layout mode (`print` or `preserve_layout`) and\r\nscreen dimensions\r\n- [x] [Unit or functional\r\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\r\nwere updated or added to match the most common scenarios\r\n- [x] Flaky test runner:\r\nhttps://buildkite.com/elastic/kibana-flaky-test-suite-runner/builds/6986","sha":"38407ae6b01e071757083fe358116b6dd75c4422"}},{"branch":"8.x","label":"v8.16.0","labelRegex":"^v8.16.0$","isSourceBranch":false,"url":"https://github.com/elastic/kibana/pull/195334","number":195334,"state":"MERGED","mergeCommit":{"sha":"c6cb2f710e58fb2ea3908735d27653602fdf16ec","message":"[8.x] [Reporting] fix dashboard "Copy Post URL" action (#192530) (#195334)\n\n# Backport\n\nThis will backport the following commits from `main` to `8.x`:\n- [[Reporting] fix dashboard "Copy Post URL" action\n(#192530)](https://github.com/elastic/kibana/pull/192530)\n\n<!--- Backport version: 9.4.3 -->\n\n### Questions ?\nPlease refer to the [Backport tool\ndocumentation](https://github.com/sqren/backport)\n\n<!--BACKPORT [{\"author\":{\"name\":\"Tim\nSullivan\",\"email\":\"[email protected]\"},\"sourceCommit\":{\"committedDate\":\"2024-10-07T23:54:21Z\",\"message\":\"[Reporting]\nfix dashboard \\\"Copy Post URL\\\" action (#192530)\\n\\n##\nSummary\\r\\n\\r\\nCloses\nhttps://github.com//issues/191673\\r\\nCloses\nhttps://github.com//issues/183566\\r\\n\\r\\nFixes the ability\nfor the POST URL used to automate generation of\\r\\nreports by adding a\n`generateExportUrl` function to the ShareMenuItemV2\\r\\ninterface. This\nfunction returns a dynamic export URL for PDF generation\\r\\nby using the\nselected layout option.\\r\\n\\r\\nOther changes: provides more strictness\nin type definitions by:\\r\\n * splitting the types that define\n`ShareMenuProvider`:\\r\\n * `ShareMenuProviderV2` provides the\n`getShareMenuItems` function\\r\\n* `ShareMenuProviderLegacy` provides the\n`getShareMenuItemsLegacy`\\r\\nfunction\\r\\n\\r\\n### Release note\\r\\nFixed\nan issue with the export options for PNG/PDF reports in\na\\r\\ndashboard.\\r\\n\\r\\n### Checklist\\r\\n\\r\\nDelete any items that are\nnot applicable to this PR.\\r\\n\\r\\n- [x] Use the `generateExportUrl`\nfunction inputs to return a POST URL\\r\\nthat is aware of the layout mode\n(`print` or `preserve_layout`) and\\r\\nscreen dimensions\\r\\n- [x] [Unit\nor\nfunctional\\r\\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\\r\\nwere\nupdated or added to match the most common scenarios\\r\\n- [x] Flaky test\nrunner:\\r\\nhttps://buildkite.com/elastic/kibana-flaky-test-suite-runner/builds/6986\",\"sha\":\"38407ae6b01e071757083fe358116b6dd75c4422\",\"branchLabelMapping\":{\"^v9.0.0$\":\"main\",\"^v8.16.0$\":\"8.x\",\"^v(\\\\d+).(\\\\d+).\\\\d+$\":\"$1.$2\"}},\"sourcePullRequest\":{\"labels\":[\"release_note:fix\",\"v9.0.0\",\"v8.16.0\",\"backport:version\",\"v8.15.2\"],\"title\":\"[Reporting]\nfix dashboard \\\"Copy Post URL\\\"\naction\",\"number\":192530,\"url\":\"https://github.com/elastic/kibana/pull/192530\",\"mergeCommit\":{\"message\":\"[Reporting]\nfix dashboard \\\"Copy Post URL\\\" action (#192530)\\n\\n##\nSummary\\r\\n\\r\\nCloses\nhttps://github.com//issues/191673\\r\\nCloses\nhttps://github.com//issues/183566\\r\\n\\r\\nFixes the ability\nfor the POST URL used to automate generation of\\r\\nreports by adding a\n`generateExportUrl` function to the ShareMenuItemV2\\r\\ninterface. This\nfunction returns a dynamic export URL for PDF generation\\r\\nby using the\nselected layout option.\\r\\n\\r\\nOther changes: provides more strictness\nin type definitions by:\\r\\n * splitting the types that define\n`ShareMenuProvider`:\\r\\n * `ShareMenuProviderV2` provides the\n`getShareMenuItems` function\\r\\n* `ShareMenuProviderLegacy` provides the\n`getShareMenuItemsLegacy`\\r\\nfunction\\r\\n\\r\\n### Release note\\r\\nFixed\nan issue with the export options for PNG/PDF reports in\na\\r\\ndashboard.\\r\\n\\r\\n### Checklist\\r\\n\\r\\nDelete any items that are\nnot applicable to this PR.\\r\\n\\r\\n- [x] Use the `generateExportUrl`\nfunction inputs to return a POST URL\\r\\nthat is aware of the layout mode\n(`print` or `preserve_layout`) and\\r\\nscreen dimensions\\r\\n- [x] [Unit\nor\nfunctional\\r\\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\\r\\nwere\nupdated or added to match the most common scenarios\\r\\n- [x] Flaky test\nrunner:\\r\\nhttps://buildkite.com/elastic/kibana-flaky-test-suite-runner/builds/6986\",\"sha\":\"38407ae6b01e071757083fe358116b6dd75c4422\"}},\"sourceBranch\":\"main\",\"suggestedTargetBranches\":[\"8.x\",\"8.15\"],\"targetPullRequestStates\":[{\"branch\":\"main\",\"label\":\"v9.0.0\",\"branchLabelMappingKey\":\"^v9.0.0$\",\"isSourceBranch\":true,\"state\":\"MERGED\",\"url\":\"https://github.com/elastic/kibana/pull/192530\",\"number\":192530,\"mergeCommit\":{\"message\":\"[Reporting]\nfix dashboard \\\"Copy Post URL\\\" action (#192530)\\n\\n##\nSummary\\r\\n\\r\\nCloses\nhttps://github.com//issues/191673\\r\\nCloses\nhttps://github.com//issues/183566\\r\\n\\r\\nFixes the ability\nfor the POST URL used to automate generation of\\r\\nreports by adding a\n`generateExportUrl` function to the ShareMenuItemV2\\r\\ninterface. This\nfunction returns a dynamic export URL for PDF generation\\r\\nby using the\nselected layout option.\\r\\n\\r\\nOther changes: provides more strictness\nin type definitions by:\\r\\n * splitting the types that define\n`ShareMenuProvider`:\\r\\n * `ShareMenuProviderV2` provides the\n`getShareMenuItems` function\\r\\n* `ShareMenuProviderLegacy` provides the\n`getShareMenuItemsLegacy`\\r\\nfunction\\r\\n\\r\\n### Release note\\r\\nFixed\nan issue with the export options for PNG/PDF reports in\na\\r\\ndashboard.\\r\\n\\r\\n### Checklist\\r\\n\\r\\nDelete any items that are\nnot applicable to this PR.\\r\\n\\r\\n- [x] Use the `generateExportUrl`\nfunction inputs to return a POST URL\\r\\nthat is aware of the layout mode\n(`print` or `preserve_layout`) and\\r\\nscreen dimensions\\r\\n- [x] [Unit\nor\nfunctional\\r\\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\\r\\nwere\nupdated or added to match the most common scenarios\\r\\n- [x] Flaky test\nrunner:\\r\\nhttps://buildkite.com/elastic/kibana-flaky-test-suite-runner/builds/6986\",\"sha\":\"38407ae6b01e071757083fe358116b6dd75c4422\"}},{\"branch\":\"8.x\",\"label\":\"v8.16.0\",\"branchLabelMappingKey\":\"^v8.16.0$\",\"isSourceBranch\":false,\"state\":\"NOT_CREATED\"},{\"branch\":\"8.15\",\"label\":\"v8.15.2\",\"branchLabelMappingKey\":\"^v(\\\\d+).(\\\\d+).\\\\d+$\",\"isSourceBranch\":false,\"state\":\"NOT_CREATED\"}]}]\nBACKPORT-->\n\nCo-authored-by: Tim Sullivan <[email protected]>"}},{"branch":"8.15","label":"v8.15.2","labelRegex":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"}]}] BACKPORT--> --------- Co-authored-by: kibanamachine <[email protected]>
Summary
Closes #191673
Closes #183566
Fixes the ability for the POST URL used to automate generation of reports by adding a
generateExportUrl
function to the ShareMenuItemV2 interface. This function returns a dynamic export URL for PDF generation by using the selected layout option.Other changes: provides more strictness in type definitions by:
ShareMenuProvider
:ShareMenuProviderV2
provides thegetShareMenuItems
functionShareMenuProviderLegacy
provides thegetShareMenuItemsLegacy
functionRelease note
Fixed an issue with the export options for PNG/PDF reports in a dashboard.
Checklist
Delete any items that are not applicable to this PR.
generateExportUrl
function inputs to return a POST URL that is aware of the layout mode (print
orpreserve_layout
) and screen dimensions