Share modal re-architecture#211665
Conversation
1db5b72 to
d4162c9
Compare
333f34a to
cc0566a
Compare
75afcd9 to
715606a
Compare
|
/ci |
1 similar comment
|
/ci |
fdcb6ed to
3a0a171
Compare
|
/ci |
3a0a171 to
85b2418
Compare
|
/ci |
85b2418 to
5fbdad0
Compare
|
/ci |
0e31025 to
51eb479
Compare
|
/ci |
51eb479 to
74ea7d7
Compare
|
/ci |
74ea7d7 to
d72488b
Compare
pmuellr
left a comment
There was a problem hiding this comment.
LGTM. Tested generating CSV, PNG, PDF, PDF for printing, all worked fine.
I noticed a change to a param used to generate the "search source", so thought I would comment on it. Seems like it could change the time frame of the CSV report
| const capabilityHasCsvReporting = application.capabilities.discover_v2?.generateCsv === true; | ||
| const { reportType, decoratedJobParams } = getSearchCsvJobParams({ | ||
| apiClient, | ||
| searchModeParams: getSearchModeParams(true), |
There was a problem hiding this comment.
Is it intentional to change the parm for getSearchModeParams() from false previously, to true in this PR? It looks like it changes the absoluteTime param of getSearchSource()
There was a problem hiding this comment.
it was... however I'd be reverting to the previous implementation because there's another body of work that actually takes care of providing the user a choice on wether they'd like to use absolute or relative time when choosing to share, instead of forcing it.
|
@elasticmachine merge upstream |
💛 Build succeeded, but was flaky
Failed CI StepsMetrics [docs]Public APIs missing comments
Async chunks
Public APIs missing exports
Page load bundle
Unknown metric groupsAPI count
References to deprecated APIs
History
cc @eokoneyo |
## Summary
This PR attempts to rework the internals for how the share plugin works,
and brings with it a slight modification to how configs are registered
to the share plugin, with this PR the share plugin now defines the
following share types i.e. `links`, `embeds` and `integrations`. As such
native implementations (i.e. copy link and embed) provided by sharedUX
remain internal to the share plugin.
One might then ask what happens to the existing export functionality
provided by the reporting plugin, in this PR the export functionality is
now modelled as an integration that's simply grouped as an export, see
the type definition for the Export type. Accompanying this change, a new
method has been introduced `registerShareIntegration` that's similar to
the previous method `register`, with a slight difference, in that now
registered integrations can be scoped to a specific object type like so.
```ts
share.registerShareIntegration('lens', {
...
config: () => ({
someValue: 'This integration value can only be retrieved within the lens objectType scope'
})
})
```
The expected return type for config is defined by the user, as such the
export integration type defines it's own expected type that suits the
current implementation of the share modal.
<!-- These aforementioned configs would then be automatically be made
available under the property `shareMenuItems` by providing the object
type value to the `useShareTabsContext`, like so;
```ts
const { objectTypeMeta, shareMenuItems } = useShareTabsContext('integration', 'export')
```
because the share type of `integration` is provided alongside its
`groupId`, `useShareTabsContext` will only provide data and config that
applies specifically to the specific share type. The same would apply
for `link` and `embed` with passing in the second option. -->
Furthermore there's been a clean up with the config options that
typically would be passed to the `toggleShareMenu` method, properties
that are specific to a specific share type are now expected to be
provided within the config property for that specific share type.
## How to test
- This change is transparent to the user with all share functionality
working as should, regardless respective teams should verify that all
share behaviour work as expected.
<!--
### Checklist
Check the PR satisfies following conditions.
Reviewers should verify this PR satisfies this list as well.
- [ ] Any text added follows [EUI's writing
guidelines](https://elastic.github.io/eui/#/guidelines/writing), uses
sentence case text and includes [i18n
support](https://github.com/elastic/kibana/blob/main/src/platform/packages/shared/kbn-i18n/README.md)
- [ ]
[Documentation](https://www.elastic.co/guide/en/kibana/master/development-documentation.html)
was added for features that require explanation or tutorials
- [ ] [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
- [ ] If a plugin configuration key changed, check if it needs to be
allowlisted in the cloud and added to the [docker
list](https://github.com/elastic/kibana/blob/main/src/dev/build/tasks/os_packages/docker_generator/resources/base/bin/kibana-docker)
- [ ] This was checked for breaking HTTP API changes, and any breaking
changes have been approved by the breaking-change committee. The
`release_note:breaking` label should be applied in these situations.
- [ ] [Flaky Test
Runner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1) was
used on any tests changed
- [ ] The PR description includes the appropriate Release Notes section,
and the correct `release_note:*` label is applied per the
[guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)
### Identify risks
Does this PR introduce any risks? For example, consider risks like hard
to test bugs, performance regression, potential of data loss.
Describe the risk, its severity, and mitigation for each identified
risk. Invite stakeholders and evaluate how to proceed before merging.
- [ ] [See some risk
examples](https://github.com/elastic/kibana/blob/main/RISK_MATRIX.mdx)
- [ ] ...
-->
---------
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
## Summary Closes #205805 This PR extracts the share export functionality into a standalone triggered UI action, and builds mostly off of the work that's been done in #211665 as such any share integration type that's registered under the groupId `export` will show up within the afore mentioned standalone export type. Registering a new export type would happen like so; ```js share.registerShareIntegration({ groupId: 'export', ... config: () => ({ ... }), prerequisiteCheck({ license, capabilities, objectType }) { // The prerequisiteCheck callback will get passed the license, app capabilities and the objectType // of the current caller, this can then be used to determine if this integration should be available, // returning false in here disables the integration, } }) ``` *P.S.* This registration can also be scoped to a particular object type (i.e. lens, dashboard etc.) if said integration is intended to only be available for only a particular object type. ## Visuals for new export experience #### _visualize_ ##### (_lens_) <img width="768" alt="Screenshot 2025-04-24 at 10 53 25" src="https://github.com/user-attachments/assets/31966ded-b1f7-417e-840e-4596b310d6bc" /> ##### (_others_) <img width="1720" alt="Screenshot 2025-04-25 at 09 04 50" src="https://github.com/user-attachments/assets/8b675974-9a4b-4dcc-9aca-77cea5a25654" /> #### _dashboard_ ##### _(user with all reporting permissions)_ <img width="640" alt="Screenshot 2025-04-24 at 10 53 40" src="https://github.com/user-attachments/assets/d16da148-3c25-4a58-a847-d4d5a3736106" /> ##### _(user with no pdf, png, csv privileges doesn't have the export button visible)_ <img width="1728" alt="Screenshot 2025-05-02 at 13 11 21" src="https://github.com/user-attachments/assets/e47426fb-db5b-4c2a-bee5-557fefbb40ec" /> #### _discover_ <img width="626" alt="Screenshot 2025-04-04 at 20 18 50" src="https://github.com/user-attachments/assets/f4bdd2a3-2527-4334-b253-7686e4131d87" /> <img width="1728" alt="Screenshot 2025-05-02 at 13 11 43" src="https://github.com/user-attachments/assets/9a6e7fa2-260d-4b68-a1ae-61c499849fb8" /> ### Test scenarios - Pull this PR and run it locally, or test in the provision environment linked to this PR. - Navigate to the dashboard, discover, and visualize app. The nav menu should display icon buttons for sharing and export. - Clicking the "Share" icon (up arrow) opens the familiar share modal without export. The "Export" icon (down arrow) opens a new popover with available options. - Export Functionality Test; - Single Export Option: When there's only one export option, the flyout opens automatically. - Disabled Reporting Features: Create a new role with reporting subPrivileges and test it by creating a user assigned to that role. Log in as the user, and the export popover should reflect the limited reporting features. - In the case where the current user has no registered integrations available to them, the export functionality will not be displayed <!-- ### Checklist Check the PR satisfies following conditions. Reviewers should verify this PR satisfies this list as well. - [ ] Any text added follows [EUI's writing guidelines](https://elastic.github.io/eui/#/guidelines/writing), uses sentence case text and includes [i18n support](https://github.com/elastic/kibana/blob/main/src/platform/packages/shared/kbn-i18n/README.md) - [ ] [Documentation](https://www.elastic.co/guide/en/kibana/master/development-documentation.html) was added for features that require explanation or tutorials - [ ] [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 - [ ] If a plugin configuration key changed, check if it needs to be allowlisted in the cloud and added to the [docker list](https://github.com/elastic/kibana/blob/main/src/dev/build/tasks/os_packages/docker_generator/resources/base/bin/kibana-docker) - [ ] This was checked for breaking HTTP API changes, and any breaking changes have been approved by the breaking-change committee. The `release_note:breaking` label should be applied in these situations. - [ ] [Flaky Test Runner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1) was used on any tests changed - [ ] The PR description includes the appropriate Release Notes section, and the correct `release_note:*` label is applied per the [guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process) ### Identify risks Does this PR introduce any risks? For example, consider risks like hard to test bugs, performance regression, potential of data loss. Describe the risk, its severity, and mitigation for each identified risk. Invite stakeholders and evaluate how to proceed before merging. - [ ] [See some risk examples](https://github.com/elastic/kibana/blob/main/RISK_MATRIX.mdx) - [ ] ... --> --------- Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
## Summary Closes elastic#205805 This PR extracts the share export functionality into a standalone triggered UI action, and builds mostly off of the work that's been done in elastic#211665 as such any share integration type that's registered under the groupId `export` will show up within the afore mentioned standalone export type. Registering a new export type would happen like so; ```js share.registerShareIntegration({ groupId: 'export', ... config: () => ({ ... }), prerequisiteCheck({ license, capabilities, objectType }) { // The prerequisiteCheck callback will get passed the license, app capabilities and the objectType // of the current caller, this can then be used to determine if this integration should be available, // returning false in here disables the integration, } }) ``` *P.S.* This registration can also be scoped to a particular object type (i.e. lens, dashboard etc.) if said integration is intended to only be available for only a particular object type. ## Visuals for new export experience #### _visualize_ ##### (_lens_) <img width="768" alt="Screenshot 2025-04-24 at 10 53 25" src="https://github.com/user-attachments/assets/31966ded-b1f7-417e-840e-4596b310d6bc" /> ##### (_others_) <img width="1720" alt="Screenshot 2025-04-25 at 09 04 50" src="https://github.com/user-attachments/assets/8b675974-9a4b-4dcc-9aca-77cea5a25654" /> #### _dashboard_ ##### _(user with all reporting permissions)_ <img width="640" alt="Screenshot 2025-04-24 at 10 53 40" src="https://github.com/user-attachments/assets/d16da148-3c25-4a58-a847-d4d5a3736106" /> ##### _(user with no pdf, png, csv privileges doesn't have the export button visible)_ <img width="1728" alt="Screenshot 2025-05-02 at 13 11 21" src="https://github.com/user-attachments/assets/e47426fb-db5b-4c2a-bee5-557fefbb40ec" /> #### _discover_ <img width="626" alt="Screenshot 2025-04-04 at 20 18 50" src="https://github.com/user-attachments/assets/f4bdd2a3-2527-4334-b253-7686e4131d87" /> <img width="1728" alt="Screenshot 2025-05-02 at 13 11 43" src="https://github.com/user-attachments/assets/9a6e7fa2-260d-4b68-a1ae-61c499849fb8" /> ### Test scenarios - Pull this PR and run it locally, or test in the provision environment linked to this PR. - Navigate to the dashboard, discover, and visualize app. The nav menu should display icon buttons for sharing and export. - Clicking the "Share" icon (up arrow) opens the familiar share modal without export. The "Export" icon (down arrow) opens a new popover with available options. - Export Functionality Test; - Single Export Option: When there's only one export option, the flyout opens automatically. - Disabled Reporting Features: Create a new role with reporting subPrivileges and test it by creating a user assigned to that role. Log in as the user, and the export popover should reflect the limited reporting features. - In the case where the current user has no registered integrations available to them, the export functionality will not be displayed <!-- ### Checklist Check the PR satisfies following conditions. Reviewers should verify this PR satisfies this list as well. - [ ] Any text added follows [EUI's writing guidelines](https://elastic.github.io/eui/#/guidelines/writing), uses sentence case text and includes [i18n support](https://github.com/elastic/kibana/blob/main/src/platform/packages/shared/kbn-i18n/README.md) - [ ] [Documentation](https://www.elastic.co/guide/en/kibana/master/development-documentation.html) was added for features that require explanation or tutorials - [ ] [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 - [ ] If a plugin configuration key changed, check if it needs to be allowlisted in the cloud and added to the [docker list](https://github.com/elastic/kibana/blob/main/src/dev/build/tasks/os_packages/docker_generator/resources/base/bin/kibana-docker) - [ ] This was checked for breaking HTTP API changes, and any breaking changes have been approved by the breaking-change committee. The `release_note:breaking` label should be applied in these situations. - [ ] [Flaky Test Runner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1) was used on any tests changed - [ ] The PR description includes the appropriate Release Notes section, and the correct `release_note:*` label is applied per the [guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process) ### Identify risks Does this PR introduce any risks? For example, consider risks like hard to test bugs, performance regression, potential of data loss. Describe the risk, its severity, and mitigation for each identified risk. Invite stakeholders and evaluate how to proceed before merging. - [ ] [See some risk examples](https://github.com/elastic/kibana/blob/main/RISK_MATRIX.mdx) - [ ] ... --> --------- Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
## Summary Closes elastic#205805 This PR extracts the share export functionality into a standalone triggered UI action, and builds mostly off of the work that's been done in elastic#211665 as such any share integration type that's registered under the groupId `export` will show up within the afore mentioned standalone export type. Registering a new export type would happen like so; ```js share.registerShareIntegration({ groupId: 'export', ... config: () => ({ ... }), prerequisiteCheck({ license, capabilities, objectType }) { // The prerequisiteCheck callback will get passed the license, app capabilities and the objectType // of the current caller, this can then be used to determine if this integration should be available, // returning false in here disables the integration, } }) ``` *P.S.* This registration can also be scoped to a particular object type (i.e. lens, dashboard etc.) if said integration is intended to only be available for only a particular object type. ## Visuals for new export experience #### _visualize_ ##### (_lens_) <img width="768" alt="Screenshot 2025-04-24 at 10 53 25" src="https://github.com/user-attachments/assets/31966ded-b1f7-417e-840e-4596b310d6bc" /> ##### (_others_) <img width="1720" alt="Screenshot 2025-04-25 at 09 04 50" src="https://github.com/user-attachments/assets/8b675974-9a4b-4dcc-9aca-77cea5a25654" /> #### _dashboard_ ##### _(user with all reporting permissions)_ <img width="640" alt="Screenshot 2025-04-24 at 10 53 40" src="https://github.com/user-attachments/assets/d16da148-3c25-4a58-a847-d4d5a3736106" /> ##### _(user with no pdf, png, csv privileges doesn't have the export button visible)_ <img width="1728" alt="Screenshot 2025-05-02 at 13 11 21" src="https://github.com/user-attachments/assets/e47426fb-db5b-4c2a-bee5-557fefbb40ec" /> #### _discover_ <img width="626" alt="Screenshot 2025-04-04 at 20 18 50" src="https://github.com/user-attachments/assets/f4bdd2a3-2527-4334-b253-7686e4131d87" /> <img width="1728" alt="Screenshot 2025-05-02 at 13 11 43" src="https://github.com/user-attachments/assets/9a6e7fa2-260d-4b68-a1ae-61c499849fb8" /> ### Test scenarios - Pull this PR and run it locally, or test in the provision environment linked to this PR. - Navigate to the dashboard, discover, and visualize app. The nav menu should display icon buttons for sharing and export. - Clicking the "Share" icon (up arrow) opens the familiar share modal without export. The "Export" icon (down arrow) opens a new popover with available options. - Export Functionality Test; - Single Export Option: When there's only one export option, the flyout opens automatically. - Disabled Reporting Features: Create a new role with reporting subPrivileges and test it by creating a user assigned to that role. Log in as the user, and the export popover should reflect the limited reporting features. - In the case where the current user has no registered integrations available to them, the export functionality will not be displayed <!-- ### Checklist Check the PR satisfies following conditions. Reviewers should verify this PR satisfies this list as well. - [ ] Any text added follows [EUI's writing guidelines](https://elastic.github.io/eui/#/guidelines/writing), uses sentence case text and includes [i18n support](https://github.com/elastic/kibana/blob/main/src/platform/packages/shared/kbn-i18n/README.md) - [ ] [Documentation](https://www.elastic.co/guide/en/kibana/master/development-documentation.html) was added for features that require explanation or tutorials - [ ] [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 - [ ] If a plugin configuration key changed, check if it needs to be allowlisted in the cloud and added to the [docker list](https://github.com/elastic/kibana/blob/main/src/dev/build/tasks/os_packages/docker_generator/resources/base/bin/kibana-docker) - [ ] This was checked for breaking HTTP API changes, and any breaking changes have been approved by the breaking-change committee. The `release_note:breaking` label should be applied in these situations. - [ ] [Flaky Test Runner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1) was used on any tests changed - [ ] The PR description includes the appropriate Release Notes section, and the correct `release_note:*` label is applied per the [guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process) ### Identify risks Does this PR introduce any risks? For example, consider risks like hard to test bugs, performance regression, potential of data loss. Describe the risk, its severity, and mitigation for each identified risk. Invite stakeholders and evaluate how to proceed before merging. - [ ] [See some risk examples](https://github.com/elastic/kibana/blob/main/RISK_MATRIX.mdx) - [ ] ... --> --------- Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
💚 All backports created successfully
Note: Successful backport PRs will be merged automatically after passing CI. Questions ?Please refer to the Backport tool documentation |
## Summary
This PR attempts to rework the internals for how the share plugin works,
and brings with it a slight modification to how configs are registered
to the share plugin, with this PR the share plugin now defines the
following share types i.e. `links`, `embeds` and `integrations`. As such
native implementations (i.e. copy link and embed) provided by sharedUX
remain internal to the share plugin.
One might then ask what happens to the existing export functionality
provided by the reporting plugin, in this PR the export functionality is
now modelled as an integration that's simply grouped as an export, see
the type definition for the Export type. Accompanying this change, a new
method has been introduced `registerShareIntegration` that's similar to
the previous method `register`, with a slight difference, in that now
registered integrations can be scoped to a specific object type like so.
```ts
share.registerShareIntegration('lens', {
...
config: () => ({
someValue: 'This integration value can only be retrieved within the lens objectType scope'
})
})
```
The expected return type for config is defined by the user, as such the
export integration type defines it's own expected type that suits the
current implementation of the share modal.
<!-- These aforementioned configs would then be automatically be made
available under the property `shareMenuItems` by providing the object
type value to the `useShareTabsContext`, like so;
```ts
const { objectTypeMeta, shareMenuItems } = useShareTabsContext('integration', 'export')
```
because the share type of `integration` is provided alongside its
`groupId`, `useShareTabsContext` will only provide data and config that
applies specifically to the specific share type. The same would apply
for `link` and `embed` with passing in the second option. -->
Furthermore there's been a clean up with the config options that
typically would be passed to the `toggleShareMenu` method, properties
that are specific to a specific share type are now expected to be
provided within the config property for that specific share type.
## How to test
- This change is transparent to the user with all share functionality
working as should, regardless respective teams should verify that all
share behaviour work as expected.
<!--
### Checklist
Check the PR satisfies following conditions.
Reviewers should verify this PR satisfies this list as well.
- [ ] Any text added follows [EUI's writing
guidelines](https://elastic.github.io/eui/#/guidelines/writing), uses
sentence case text and includes [i18n
support](https://github.com/elastic/kibana/blob/main/src/platform/packages/shared/kbn-i18n/README.md)
- [ ]
[Documentation](https://www.elastic.co/guide/en/kibana/master/development-documentation.html)
was added for features that require explanation or tutorials
- [ ] [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
- [ ] If a plugin configuration key changed, check if it needs to be
allowlisted in the cloud and added to the [docker
list](https://github.com/elastic/kibana/blob/main/src/dev/build/tasks/os_packages/docker_generator/resources/base/bin/kibana-docker)
- [ ] This was checked for breaking HTTP API changes, and any breaking
changes have been approved by the breaking-change committee. The
`release_note:breaking` label should be applied in these situations.
- [ ] [Flaky Test
Runner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1) was
used on any tests changed
- [ ] The PR description includes the appropriate Release Notes section,
and the correct `release_note:*` label is applied per the
[guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)
### Identify risks
Does this PR introduce any risks? For example, consider risks like hard
to test bugs, performance regression, potential of data loss.
Describe the risk, its severity, and mitigation for each identified
risk. Invite stakeholders and evaluate how to proceed before merging.
- [ ] [See some risk
examples](https://github.com/elastic/kibana/blob/main/RISK_MATRIX.mdx)
- [ ] ...
-->
---------
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
(cherry picked from commit 37afbb5)
# Conflicts:
# src/platform/packages/private/kbn-reporting/public/share/share_context_menu/register_csv_modal_reporting.tsx
# src/platform/plugins/shared/dashboard/public/dashboard_app/top_nav/share/show_share_modal.tsx
# src/platform/plugins/shared/discover/public/application/main/components/top_nav/app_menu_actions/get_share.tsx
# src/platform/plugins/shared/share/public/components/context/index.tsx
# src/platform/plugins/shared/share/public/components/share_tabs.test.tsx
# src/platform/plugins/shared/share/public/components/tabs/link/link_content.tsx
# src/platform/plugins/shared/share/public/services/share_menu_manager.tsx
# src/platform/plugins/shared/share/public/types.ts
This PR attempts to rework the internals for how the share plugin works,
and brings with it a slight modification to how configs are registered
to the share plugin, with this PR the share plugin now defines the
following share types i.e. `links`, `embeds` and `integrations`. As such
native implementations (i.e. copy link and embed) provided by sharedUX
remain internal to the share plugin.
One might then ask what happens to the existing export functionality
provided by the reporting plugin, in this PR the export functionality is
now modelled as an integration that's simply grouped as an export, see
the type definition for the Export type. Accompanying this change, a new
method has been introduced `registerShareIntegration` that's similar to
the previous method `register`, with a slight difference, in that now
registered integrations can be scoped to a specific object type like so.
```ts
share.registerShareIntegration('lens', {
...
config: () => ({
someValue: 'This integration value can only be retrieved within the lens objectType scope'
})
})
```
The expected return type for config is defined by the user, as such the
export integration type defines it's own expected type that suits the
current implementation of the share modal.
<!-- These aforementioned configs would then be automatically be made
available under the property `shareMenuItems` by providing the object
type value to the `useShareTabsContext`, like so;
```ts
const { objectTypeMeta, shareMenuItems } = useShareTabsContext('integration', 'export')
```
because the share type of `integration` is provided alongside its
`groupId`, `useShareTabsContext` will only provide data and config that
applies specifically to the specific share type. The same would apply
for `link` and `embed` with passing in the second option. -->
Furthermore there's been a clean up with the config options that
typically would be passed to the `toggleShareMenu` method, properties
that are specific to a specific share type are now expected to be
provided within the config property for that specific share type.
- This change is transparent to the user with all share functionality
working as should, regardless respective teams should verify that all
share behaviour work as expected.
<!--
Check the PR satisfies following conditions.
Reviewers should verify this PR satisfies this list as well.
- [ ] Any text added follows [EUI's writing
guidelines](https://elastic.github.io/eui/#/guidelines/writing), uses
sentence case text and includes [i18n
support](https://github.com/elastic/kibana/blob/main/src/platform/packages/shared/kbn-i18n/README.md)
- [ ]
[Documentation](https://www.elastic.co/guide/en/kibana/master/development-documentation.html)
was added for features that require explanation or tutorials
- [ ] [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
- [ ] If a plugin configuration key changed, check if it needs to be
allowlisted in the cloud and added to the [docker
list](https://github.com/elastic/kibana/blob/main/src/dev/build/tasks/os_packages/docker_generator/resources/base/bin/kibana-docker)
- [ ] This was checked for breaking HTTP API changes, and any breaking
changes have been approved by the breaking-change committee. The
`release_note:breaking` label should be applied in these situations.
- [ ] [Flaky Test
Runner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1) was
used on any tests changed
- [ ] The PR description includes the appropriate Release Notes section,
and the correct `release_note:*` label is applied per the
[guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)
Does this PR introduce any risks? For example, consider risks like hard
to test bugs, performance regression, potential of data loss.
Describe the risk, its severity, and mitigation for each identified
risk. Invite stakeholders and evaluate how to proceed before merging.
- [ ] [See some risk
examples](https://github.com/elastic/kibana/blob/main/RISK_MATRIX.mdx)
- [ ] ...
-->
---------
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
(cherry picked from commit 37afbb5)
This PR attempts to rework the internals for how the share plugin works,
and brings with it a slight modification to how configs are registered
to the share plugin, with this PR the share plugin now defines the
following share types i.e. `links`, `embeds` and `integrations`. As such
native implementations (i.e. copy link and embed) provided by sharedUX
remain internal to the share plugin.
One might then ask what happens to the existing export functionality
provided by the reporting plugin, in this PR the export functionality is
now modelled as an integration that's simply grouped as an export, see
the type definition for the Export type. Accompanying this change, a new
method has been introduced `registerShareIntegration` that's similar to
the previous method `register`, with a slight difference, in that now
registered integrations can be scoped to a specific object type like so.
```ts
share.registerShareIntegration('lens', {
...
config: () => ({
someValue: 'This integration value can only be retrieved within the lens objectType scope'
})
})
```
The expected return type for config is defined by the user, as such the
export integration type defines it's own expected type that suits the
current implementation of the share modal.
<!-- These aforementioned configs would then be automatically be made
available under the property `shareMenuItems` by providing the object
type value to the `useShareTabsContext`, like so;
```ts
const { objectTypeMeta, shareMenuItems } = useShareTabsContext('integration', 'export')
```
because the share type of `integration` is provided alongside its
`groupId`, `useShareTabsContext` will only provide data and config that
applies specifically to the specific share type. The same would apply
for `link` and `embed` with passing in the second option. -->
Furthermore there's been a clean up with the config options that
typically would be passed to the `toggleShareMenu` method, properties
that are specific to a specific share type are now expected to be
provided within the config property for that specific share type.
- This change is transparent to the user with all share functionality
working as should, regardless respective teams should verify that all
share behaviour work as expected.
<!--
Check the PR satisfies following conditions.
Reviewers should verify this PR satisfies this list as well.
- [ ] Any text added follows [EUI's writing
guidelines](https://elastic.github.io/eui/#/guidelines/writing), uses
sentence case text and includes [i18n
support](https://github.com/elastic/kibana/blob/main/src/platform/packages/shared/kbn-i18n/README.md)
- [ ]
[Documentation](https://www.elastic.co/guide/en/kibana/master/development-documentation.html)
was added for features that require explanation or tutorials
- [ ] [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
- [ ] If a plugin configuration key changed, check if it needs to be
allowlisted in the cloud and added to the [docker
list](https://github.com/elastic/kibana/blob/main/src/dev/build/tasks/os_packages/docker_generator/resources/base/bin/kibana-docker)
- [ ] This was checked for breaking HTTP API changes, and any breaking
changes have been approved by the breaking-change committee. The
`release_note:breaking` label should be applied in these situations.
- [ ] [Flaky Test
Runner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1) was
used on any tests changed
- [ ] The PR description includes the appropriate Release Notes section,
and the correct `release_note:*` label is applied per the
[guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)
Does this PR introduce any risks? For example, consider risks like hard
to test bugs, performance regression, potential of data loss.
Describe the risk, its severity, and mitigation for each identified
risk. Invite stakeholders and evaluate how to proceed before merging.
- [ ] [See some risk
examples](https://github.com/elastic/kibana/blob/main/RISK_MATRIX.mdx)
- [ ] ...
-->
---------
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
(cherry picked from commit 37afbb5)
This PR attempts to rework the internals for how the share plugin works,
and brings with it a slight modification to how configs are registered
to the share plugin, with this PR the share plugin now defines the
following share types i.e. `links`, `embeds` and `integrations`. As such
native implementations (i.e. copy link and embed) provided by sharedUX
remain internal to the share plugin.
One might then ask what happens to the existing export functionality
provided by the reporting plugin, in this PR the export functionality is
now modelled as an integration that's simply grouped as an export, see
the type definition for the Export type. Accompanying this change, a new
method has been introduced `registerShareIntegration` that's similar to
the previous method `register`, with a slight difference, in that now
registered integrations can be scoped to a specific object type like so.
```ts
share.registerShareIntegration('lens', {
...
config: () => ({
someValue: 'This integration value can only be retrieved within the lens objectType scope'
})
})
```
The expected return type for config is defined by the user, as such the
export integration type defines it's own expected type that suits the
current implementation of the share modal.
<!-- These aforementioned configs would then be automatically be made
available under the property `shareMenuItems` by providing the object
type value to the `useShareTabsContext`, like so;
```ts
const { objectTypeMeta, shareMenuItems } = useShareTabsContext('integration', 'export')
```
because the share type of `integration` is provided alongside its
`groupId`, `useShareTabsContext` will only provide data and config that
applies specifically to the specific share type. The same would apply
for `link` and `embed` with passing in the second option. -->
Furthermore there's been a clean up with the config options that
typically would be passed to the `toggleShareMenu` method, properties
that are specific to a specific share type are now expected to be
provided within the config property for that specific share type.
- This change is transparent to the user with all share functionality
working as should, regardless respective teams should verify that all
share behaviour work as expected.
<!--
Check the PR satisfies following conditions.
Reviewers should verify this PR satisfies this list as well.
- [ ] Any text added follows [EUI's writing
guidelines](https://elastic.github.io/eui/#/guidelines/writing), uses
sentence case text and includes [i18n
support](https://github.com/elastic/kibana/blob/main/src/platform/packages/shared/kbn-i18n/README.md)
- [ ]
[Documentation](https://www.elastic.co/guide/en/kibana/master/development-documentation.html)
was added for features that require explanation or tutorials
- [ ] [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
- [ ] If a plugin configuration key changed, check if it needs to be
allowlisted in the cloud and added to the [docker
list](https://github.com/elastic/kibana/blob/main/src/dev/build/tasks/os_packages/docker_generator/resources/base/bin/kibana-docker)
- [ ] This was checked for breaking HTTP API changes, and any breaking
changes have been approved by the breaking-change committee. The
`release_note:breaking` label should be applied in these situations.
- [ ] [Flaky Test
Runner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1) was
used on any tests changed
- [ ] The PR description includes the appropriate Release Notes section,
and the correct `release_note:*` label is applied per the
[guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)
Does this PR introduce any risks? For example, consider risks like hard
to test bugs, performance regression, potential of data loss.
Describe the risk, its severity, and mitigation for each identified
risk. Invite stakeholders and evaluate how to proceed before merging.
- [ ] [See some risk
examples](https://github.com/elastic/kibana/blob/main/RISK_MATRIX.mdx)
- [ ] ...
-->
---------
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
(cherry picked from commit 37afbb5)
This PR attempts to rework the internals for how the share plugin works,
and brings with it a slight modification to how configs are registered
to the share plugin, with this PR the share plugin now defines the
following share types i.e. `links`, `embeds` and `integrations`. As such
native implementations (i.e. copy link and embed) provided by sharedUX
remain internal to the share plugin.
One might then ask what happens to the existing export functionality
provided by the reporting plugin, in this PR the export functionality is
now modelled as an integration that's simply grouped as an export, see
the type definition for the Export type. Accompanying this change, a new
method has been introduced `registerShareIntegration` that's similar to
the previous method `register`, with a slight difference, in that now
registered integrations can be scoped to a specific object type like so.
```ts
share.registerShareIntegration('lens', {
...
config: () => ({
someValue: 'This integration value can only be retrieved within the lens objectType scope'
})
})
```
The expected return type for config is defined by the user, as such the
export integration type defines it's own expected type that suits the
current implementation of the share modal.
<!-- These aforementioned configs would then be automatically be made
available under the property `shareMenuItems` by providing the object
type value to the `useShareTabsContext`, like so;
```ts
const { objectTypeMeta, shareMenuItems } = useShareTabsContext('integration', 'export')
```
because the share type of `integration` is provided alongside its
`groupId`, `useShareTabsContext` will only provide data and config that
applies specifically to the specific share type. The same would apply
for `link` and `embed` with passing in the second option. -->
Furthermore there's been a clean up with the config options that
typically would be passed to the `toggleShareMenu` method, properties
that are specific to a specific share type are now expected to be
provided within the config property for that specific share type.
- This change is transparent to the user with all share functionality
working as should, regardless respective teams should verify that all
share behaviour work as expected.
<!--
Check the PR satisfies following conditions.
Reviewers should verify this PR satisfies this list as well.
- [ ] Any text added follows [EUI's writing
guidelines](https://elastic.github.io/eui/#/guidelines/writing), uses
sentence case text and includes [i18n
support](https://github.com/elastic/kibana/blob/main/src/platform/packages/shared/kbn-i18n/README.md)
- [ ]
[Documentation](https://www.elastic.co/guide/en/kibana/master/development-documentation.html)
was added for features that require explanation or tutorials
- [ ] [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
- [ ] If a plugin configuration key changed, check if it needs to be
allowlisted in the cloud and added to the [docker
list](https://github.com/elastic/kibana/blob/main/src/dev/build/tasks/os_packages/docker_generator/resources/base/bin/kibana-docker)
- [ ] This was checked for breaking HTTP API changes, and any breaking
changes have been approved by the breaking-change committee. The
`release_note:breaking` label should be applied in these situations.
- [ ] [Flaky Test
Runner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1) was
used on any tests changed
- [ ] The PR description includes the appropriate Release Notes section,
and the correct `release_note:*` label is applied per the
[guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)
Does this PR introduce any risks? For example, consider risks like hard
to test bugs, performance regression, potential of data loss.
Describe the risk, its severity, and mitigation for each identified
risk. Invite stakeholders and evaluate how to proceed before merging.
- [ ] [See some risk
examples](https://github.com/elastic/kibana/blob/main/RISK_MATRIX.mdx)
- [ ] ...
-->
---------
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
(cherry picked from commit 37afbb5)
# Backport This will backport the following commits from `main` to `8.19`: - [Share modal re-architecture (#211665)](#211665) <!--- Backport version: 10.0.1 --> ### Questions ? Please refer to the [Backport tool documentation](https://github.com/sorenlouv/backport) <!--BACKPORT [{"author":{"name":"Eyo O. Eyo","email":"7893459+eokoneyo@users.noreply.github.com"},"sourceCommit":{"committedDate":"2025-04-23T11:34:18Z","message":"Share modal re-architecture (#211665)\n\n## Summary\n\nThis PR attempts to rework the internals for how the share plugin works,\nand brings with it a slight modification to how configs are registered\nto the share plugin, with this PR the share plugin now defines the\nfollowing share types i.e. `links`, `embeds` and `integrations`. As such\nnative implementations (i.e. copy link and embed) provided by sharedUX\nremain internal to the share plugin.\n\nOne might then ask what happens to the existing export functionality\nprovided by the reporting plugin, in this PR the export functionality is\nnow modelled as an integration that's simply grouped as an export, see\nthe type definition for the Export type. Accompanying this change, a new\nmethod has been introduced `registerShareIntegration` that's similar to\nthe previous method `register`, with a slight difference, in that now\nregistered integrations can be scoped to a specific object type like so.\n\n```ts\nshare.registerShareIntegration('lens', {\n\t...\n\tconfig: () => ({\n\t\tsomeValue: 'This integration value can only be retrieved within the lens objectType scope'\n\t})\n})\n```\n\nThe expected return type for config is defined by the user, as such the\nexport integration type defines it's own expected type that suits the\ncurrent implementation of the share modal.\n\n\n\nFurthermore there's been a clean up with the config options that\ntypically would be passed to the `toggleShareMenu` method, properties\nthat are specific to a specific share type are now expected to be\nprovided within the config property for that specific share type.\n\n## How to test\n\n- This change is transparent to the user with all share functionality\nworking as should, regardless respective teams should verify that all\nshare behaviour work as expected.\n\n\n\n---------\n\nCo-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>","sha":"37afbb56d807a75d148fc509be82c140be8cb0c8","branchLabelMapping":{"^v9.1.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:skip","backport:skip","Team:SharedUX","v9.1.0"],"title":"Share modal re-architecture","number":211665,"url":"https://github.com/elastic/kibana/pull/211665","mergeCommit":{"message":"Share modal re-architecture (#211665)\n\n## Summary\n\nThis PR attempts to rework the internals for how the share plugin works,\nand brings with it a slight modification to how configs are registered\nto the share plugin, with this PR the share plugin now defines the\nfollowing share types i.e. `links`, `embeds` and `integrations`. As such\nnative implementations (i.e. copy link and embed) provided by sharedUX\nremain internal to the share plugin.\n\nOne might then ask what happens to the existing export functionality\nprovided by the reporting plugin, in this PR the export functionality is\nnow modelled as an integration that's simply grouped as an export, see\nthe type definition for the Export type. Accompanying this change, a new\nmethod has been introduced `registerShareIntegration` that's similar to\nthe previous method `register`, with a slight difference, in that now\nregistered integrations can be scoped to a specific object type like so.\n\n```ts\nshare.registerShareIntegration('lens', {\n\t...\n\tconfig: () => ({\n\t\tsomeValue: 'This integration value can only be retrieved within the lens objectType scope'\n\t})\n})\n```\n\nThe expected return type for config is defined by the user, as such the\nexport integration type defines it's own expected type that suits the\ncurrent implementation of the share modal.\n\n\n\nFurthermore there's been a clean up with the config options that\ntypically would be passed to the `toggleShareMenu` method, properties\nthat are specific to a specific share type are now expected to be\nprovided within the config property for that specific share type.\n\n## How to test\n\n- This change is transparent to the user with all share functionality\nworking as should, regardless respective teams should verify that all\nshare behaviour work as expected.\n\n\n\n---------\n\nCo-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>","sha":"37afbb56d807a75d148fc509be82c140be8cb0c8"}},"sourceBranch":"main","suggestedTargetBranches":[],"targetPullRequestStates":[{"branch":"main","label":"v9.1.0","branchLabelMappingKey":"^v9.1.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/211665","number":211665,"mergeCommit":{"message":"Share modal re-architecture (#211665)\n\n## Summary\n\nThis PR attempts to rework the internals for how the share plugin works,\nand brings with it a slight modification to how configs are registered\nto the share plugin, with this PR the share plugin now defines the\nfollowing share types i.e. `links`, `embeds` and `integrations`. As such\nnative implementations (i.e. copy link and embed) provided by sharedUX\nremain internal to the share plugin.\n\nOne might then ask what happens to the existing export functionality\nprovided by the reporting plugin, in this PR the export functionality is\nnow modelled as an integration that's simply grouped as an export, see\nthe type definition for the Export type. Accompanying this change, a new\nmethod has been introduced `registerShareIntegration` that's similar to\nthe previous method `register`, with a slight difference, in that now\nregistered integrations can be scoped to a specific object type like so.\n\n```ts\nshare.registerShareIntegration('lens', {\n\t...\n\tconfig: () => ({\n\t\tsomeValue: 'This integration value can only be retrieved within the lens objectType scope'\n\t})\n})\n```\n\nThe expected return type for config is defined by the user, as such the\nexport integration type defines it's own expected type that suits the\ncurrent implementation of the share modal.\n\n\n\nFurthermore there's been a clean up with the config options that\ntypically would be passed to the `toggleShareMenu` method, properties\nthat are specific to a specific share type are now expected to be\nprovided within the config property for that specific share type.\n\n## How to test\n\n- This change is transparent to the user with all share functionality\nworking as should, regardless respective teams should verify that all\nshare behaviour work as expected.\n\n\n\n---------\n\nCo-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>","sha":"37afbb56d807a75d148fc509be82c140be8cb0c8"}}]}] BACKPORT--> Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
## Summary Closes elastic#205805 This PR extracts the share export functionality into a standalone triggered UI action, and builds mostly off of the work that's been done in elastic#211665 as such any share integration type that's registered under the groupId `export` will show up within the afore mentioned standalone export type. Registering a new export type would happen like so; ```js share.registerShareIntegration({ groupId: 'export', ... config: () => ({ ... }), prerequisiteCheck({ license, capabilities, objectType }) { // The prerequisiteCheck callback will get passed the license, app capabilities and the objectType // of the current caller, this can then be used to determine if this integration should be available, // returning false in here disables the integration, } }) ``` *P.S.* This registration can also be scoped to a particular object type (i.e. lens, dashboard etc.) if said integration is intended to only be available for only a particular object type. ## Visuals for new export experience #### _visualize_ ##### (_lens_) <img width="768" alt="Screenshot 2025-04-24 at 10 53 25" src="https://github.com/user-attachments/assets/31966ded-b1f7-417e-840e-4596b310d6bc" /> ##### (_others_) <img width="1720" alt="Screenshot 2025-04-25 at 09 04 50" src="https://github.com/user-attachments/assets/8b675974-9a4b-4dcc-9aca-77cea5a25654" /> #### _dashboard_ ##### _(user with all reporting permissions)_ <img width="640" alt="Screenshot 2025-04-24 at 10 53 40" src="https://github.com/user-attachments/assets/d16da148-3c25-4a58-a847-d4d5a3736106" /> ##### _(user with no pdf, png, csv privileges doesn't have the export button visible)_ <img width="1728" alt="Screenshot 2025-05-02 at 13 11 21" src="https://github.com/user-attachments/assets/e47426fb-db5b-4c2a-bee5-557fefbb40ec" /> #### _discover_ <img width="626" alt="Screenshot 2025-04-04 at 20 18 50" src="https://github.com/user-attachments/assets/f4bdd2a3-2527-4334-b253-7686e4131d87" /> <img width="1728" alt="Screenshot 2025-05-02 at 13 11 43" src="https://github.com/user-attachments/assets/9a6e7fa2-260d-4b68-a1ae-61c499849fb8" /> ### Test scenarios - Pull this PR and run it locally, or test in the provision environment linked to this PR. - Navigate to the dashboard, discover, and visualize app. The nav menu should display icon buttons for sharing and export. - Clicking the "Share" icon (up arrow) opens the familiar share modal without export. The "Export" icon (down arrow) opens a new popover with available options. - Export Functionality Test; - Single Export Option: When there's only one export option, the flyout opens automatically. - Disabled Reporting Features: Create a new role with reporting subPrivileges and test it by creating a user assigned to that role. Log in as the user, and the export popover should reflect the limited reporting features. - In the case where the current user has no registered integrations available to them, the export functionality will not be displayed <!-- ### Checklist Check the PR satisfies following conditions. Reviewers should verify this PR satisfies this list as well. - [ ] Any text added follows [EUI's writing guidelines](https://elastic.github.io/eui/#/guidelines/writing), uses sentence case text and includes [i18n support](https://github.com/elastic/kibana/blob/main/src/platform/packages/shared/kbn-i18n/README.md) - [ ] [Documentation](https://www.elastic.co/guide/en/kibana/master/development-documentation.html) was added for features that require explanation or tutorials - [ ] [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 - [ ] If a plugin configuration key changed, check if it needs to be allowlisted in the cloud and added to the [docker list](https://github.com/elastic/kibana/blob/main/src/dev/build/tasks/os_packages/docker_generator/resources/base/bin/kibana-docker) - [ ] This was checked for breaking HTTP API changes, and any breaking changes have been approved by the breaking-change committee. The `release_note:breaking` label should be applied in these situations. - [ ] [Flaky Test Runner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1) was used on any tests changed - [ ] The PR description includes the appropriate Release Notes section, and the correct `release_note:*` label is applied per the [guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process) ### Identify risks Does this PR introduce any risks? For example, consider risks like hard to test bugs, performance regression, potential of data loss. Describe the risk, its severity, and mitigation for each identified risk. Invite stakeholders and evaluate how to proceed before merging. - [ ] [See some risk examples](https://github.com/elastic/kibana/blob/main/RISK_MATRIX.mdx) - [ ] ... --> --------- Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com> (cherry picked from commit a887cd6) # Conflicts: # src/platform/packages/private/kbn-reporting/public/share/share_context_menu/index.ts # src/platform/packages/private/kbn-reporting/public/share/share_context_menu/register_csv_modal_reporting.tsx # src/platform/packages/private/kbn-reporting/public/share/share_context_menu/register_pdf_png_modal_reporting.tsx # src/platform/plugins/shared/discover/public/application/main/components/top_nav/app_menu_actions/get_share.tsx # src/platform/plugins/shared/share/kibana.jsonc # src/platform/plugins/shared/share/public/services/share_menu_manager.tsx # src/platform/plugins/shared/share/public/types.ts # src/platform/plugins/shared/share/tsconfig.json # src/platform/plugins/shared/visualizations/public/visualize_app/utils/get_top_nav_config.tsx # x-pack/platform/plugins/private/reporting/public/plugin.ts # x-pack/platform/plugins/private/translations/translations/fr-FR.json # x-pack/platform/plugins/private/translations/translations/ja-JP.json # x-pack/platform/plugins/private/translations/translations/zh-CN.json # x-pack/platform/plugins/shared/lens/public/app_plugin/lens_top_nav.tsx
Closes elastic#205805 This PR extracts the share export functionality into a standalone triggered UI action, and builds mostly off of the work that's been done in elastic#211665 as such any share integration type that's registered under the groupId `export` will show up within the afore mentioned standalone export type. Registering a new export type would happen like so; ```js share.registerShareIntegration({ groupId: 'export', ... config: () => ({ ... }), prerequisiteCheck({ license, capabilities, objectType }) { // The prerequisiteCheck callback will get passed the license, app capabilities and the objectType // of the current caller, this can then be used to determine if this integration should be available, // returning false in here disables the integration, } }) ``` *P.S.* This registration can also be scoped to a particular object type (i.e. lens, dashboard etc.) if said integration is intended to only be available for only a particular object type. <img width="768" alt="Screenshot 2025-04-24 at 10 53 25" src="https://github.com/user-attachments/assets/31966ded-b1f7-417e-840e-4596b310d6bc" /> <img width="1720" alt="Screenshot 2025-04-25 at 09 04 50" src="https://github.com/user-attachments/assets/8b675974-9a4b-4dcc-9aca-77cea5a25654" /> <img width="640" alt="Screenshot 2025-04-24 at 10 53 40" src="https://github.com/user-attachments/assets/d16da148-3c25-4a58-a847-d4d5a3736106" /> button visible)_ <img width="1728" alt="Screenshot 2025-05-02 at 13 11 21" src="https://github.com/user-attachments/assets/e47426fb-db5b-4c2a-bee5-557fefbb40ec" /> <img width="626" alt="Screenshot 2025-04-04 at 20 18 50" src="https://github.com/user-attachments/assets/f4bdd2a3-2527-4334-b253-7686e4131d87" /> <img width="1728" alt="Screenshot 2025-05-02 at 13 11 43" src="https://github.com/user-attachments/assets/9a6e7fa2-260d-4b68-a1ae-61c499849fb8" /> - Pull this PR and run it locally, or test in the provision environment linked to this PR. - Navigate to the dashboard, discover, and visualize app. The nav menu should display icon buttons for sharing and export. - Clicking the "Share" icon (up arrow) opens the familiar share modal without export. The "Export" icon (down arrow) opens a new popover with available options. - Export Functionality Test; - Single Export Option: When there's only one export option, the flyout opens automatically. - Disabled Reporting Features: Create a new role with reporting subPrivileges and test it by creating a user assigned to that role. Log in as the user, and the export popover should reflect the limited reporting features. - In the case where the current user has no registered integrations available to them, the export functionality will not be displayed <!-- Check the PR satisfies following conditions. Reviewers should verify this PR satisfies this list as well. - [ ] Any text added follows [EUI's writing guidelines](https://elastic.github.io/eui/#/guidelines/writing), uses sentence case text and includes [i18n support](https://github.com/elastic/kibana/blob/main/src/platform/packages/shared/kbn-i18n/README.md) - [ ] [Documentation](https://www.elastic.co/guide/en/kibana/master/development-documentation.html) was added for features that require explanation or tutorials - [ ] [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 - [ ] If a plugin configuration key changed, check if it needs to be allowlisted in the cloud and added to the [docker list](https://github.com/elastic/kibana/blob/main/src/dev/build/tasks/os_packages/docker_generator/resources/base/bin/kibana-docker) - [ ] This was checked for breaking HTTP API changes, and any breaking changes have been approved by the breaking-change committee. The `release_note:breaking` label should be applied in these situations. - [ ] [Flaky Test Runner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1) was used on any tests changed - [ ] The PR description includes the appropriate Release Notes section, and the correct `release_note:*` label is applied per the [guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process) Does this PR introduce any risks? For example, consider risks like hard to test bugs, performance regression, potential of data loss. Describe the risk, its severity, and mitigation for each identified risk. Invite stakeholders and evaluate how to proceed before merging. - [ ] [See some risk examples](https://github.com/elastic/kibana/blob/main/RISK_MATRIX.mdx) - [ ] ... --> --------- Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com> (cherry picked from commit a887cd6)
Closes elastic#205805 This PR extracts the share export functionality into a standalone triggered UI action, and builds mostly off of the work that's been done in elastic#211665 as such any share integration type that's registered under the groupId `export` will show up within the afore mentioned standalone export type. Registering a new export type would happen like so; ```js share.registerShareIntegration({ groupId: 'export', ... config: () => ({ ... }), prerequisiteCheck({ license, capabilities, objectType }) { // The prerequisiteCheck callback will get passed the license, app capabilities and the objectType // of the current caller, this can then be used to determine if this integration should be available, // returning false in here disables the integration, } }) ``` *P.S.* This registration can also be scoped to a particular object type (i.e. lens, dashboard etc.) if said integration is intended to only be available for only a particular object type. <img width="768" alt="Screenshot 2025-04-24 at 10 53 25" src="https://github.com/user-attachments/assets/31966ded-b1f7-417e-840e-4596b310d6bc" /> <img width="1720" alt="Screenshot 2025-04-25 at 09 04 50" src="https://github.com/user-attachments/assets/8b675974-9a4b-4dcc-9aca-77cea5a25654" /> <img width="640" alt="Screenshot 2025-04-24 at 10 53 40" src="https://github.com/user-attachments/assets/d16da148-3c25-4a58-a847-d4d5a3736106" /> button visible)_ <img width="1728" alt="Screenshot 2025-05-02 at 13 11 21" src="https://github.com/user-attachments/assets/e47426fb-db5b-4c2a-bee5-557fefbb40ec" /> <img width="626" alt="Screenshot 2025-04-04 at 20 18 50" src="https://github.com/user-attachments/assets/f4bdd2a3-2527-4334-b253-7686e4131d87" /> <img width="1728" alt="Screenshot 2025-05-02 at 13 11 43" src="https://github.com/user-attachments/assets/9a6e7fa2-260d-4b68-a1ae-61c499849fb8" /> - Pull this PR and run it locally, or test in the provision environment linked to this PR. - Navigate to the dashboard, discover, and visualize app. The nav menu should display icon buttons for sharing and export. - Clicking the "Share" icon (up arrow) opens the familiar share modal without export. The "Export" icon (down arrow) opens a new popover with available options. - Export Functionality Test; - Single Export Option: When there's only one export option, the flyout opens automatically. - Disabled Reporting Features: Create a new role with reporting subPrivileges and test it by creating a user assigned to that role. Log in as the user, and the export popover should reflect the limited reporting features. - In the case where the current user has no registered integrations available to them, the export functionality will not be displayed <!-- Check the PR satisfies following conditions. Reviewers should verify this PR satisfies this list as well. - [ ] Any text added follows [EUI's writing guidelines](https://elastic.github.io/eui/#/guidelines/writing), uses sentence case text and includes [i18n support](https://github.com/elastic/kibana/blob/main/src/platform/packages/shared/kbn-i18n/README.md) - [ ] [Documentation](https://www.elastic.co/guide/en/kibana/master/development-documentation.html) was added for features that require explanation or tutorials - [ ] [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 - [ ] If a plugin configuration key changed, check if it needs to be allowlisted in the cloud and added to the [docker list](https://github.com/elastic/kibana/blob/main/src/dev/build/tasks/os_packages/docker_generator/resources/base/bin/kibana-docker) - [ ] This was checked for breaking HTTP API changes, and any breaking changes have been approved by the breaking-change committee. The `release_note:breaking` label should be applied in these situations. - [ ] [Flaky Test Runner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1) was used on any tests changed - [ ] The PR description includes the appropriate Release Notes section, and the correct `release_note:*` label is applied per the [guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process) Does this PR introduce any risks? For example, consider risks like hard to test bugs, performance regression, potential of data loss. Describe the risk, its severity, and mitigation for each identified risk. Invite stakeholders and evaluate how to proceed before merging. - [ ] [See some risk examples](https://github.com/elastic/kibana/blob/main/RISK_MATRIX.mdx) - [ ] ... --> --------- Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com> (cherry picked from commit a887cd6)
# Backport This will backport the following commits from `main` to `8.19`: - [Separate export menu from share (#217109)](#217109) <!--- Backport version: 10.0.1 --> ### Questions ? Please refer to the [Backport tool documentation](https://github.com/sorenlouv/backport) <!--BACKPORT [{"author":{"name":"Eyo O. Eyo","email":"7893459+eokoneyo@users.noreply.github.com"},"sourceCommit":{"committedDate":"2025-06-02T15:54:38Z","message":"Separate export menu from share (#217109)\n\n## Summary\n\nCloses https://github.com/elastic/kibana/issues/205805\n\nThis PR extracts the share export functionality into a standalone\ntriggered UI action, and builds mostly off of the work that's been done\nin #211665 as such any share\nintegration type that's registered under the groupId `export` will show\nup within the afore mentioned standalone export type.\n\nRegistering a new export type would happen like so; \n\n```js\nshare.registerShareIntegration({\n\tgroupId: 'export',\n\t...\n\tconfig: () => ({\n\t\t...\n\t}),\n\tprerequisiteCheck({ license, capabilities, objectType }) {\n\t\t// The prerequisiteCheck callback will get passed the license, app capabilities and the objectType\n\t\t// of the current caller, this can then be used to determine if this integration should be available,\n\t\t// returning false in here disables the integration, \n\t}\n})\n```\n\n*P.S.* This registration can also be scoped to a particular object type\n(i.e. lens, dashboard etc.) if said integration is intended to only be\navailable for only a particular object type.\n\n\n## Visuals for new export experience\n\n#### _visualize_\n\n##### (_lens_)\n<img width=\"768\" alt=\"Screenshot 2025-04-24 at 10 53 25\"\nsrc=\"https://github.com/user-attachments/assets/31966ded-b1f7-417e-840e-4596b310d6bc\"\n/>\n\n##### (_others_)\n<img width=\"1720\" alt=\"Screenshot 2025-04-25 at 09 04 50\"\nsrc=\"https://github.com/user-attachments/assets/8b675974-9a4b-4dcc-9aca-77cea5a25654\"\n/>\n\n\n#### _dashboard_\n##### _(user with all reporting permissions)_\n<img width=\"640\" alt=\"Screenshot 2025-04-24 at 10 53 40\"\nsrc=\"https://github.com/user-attachments/assets/d16da148-3c25-4a58-a847-d4d5a3736106\"\n/>\n\n##### _(user with no pdf, png, csv privileges doesn't have the export\nbutton visible)_\n<img width=\"1728\" alt=\"Screenshot 2025-05-02 at 13 11 21\"\nsrc=\"https://github.com/user-attachments/assets/e47426fb-db5b-4c2a-bee5-557fefbb40ec\"\n/>\n\n#### _discover_\n<img width=\"626\" alt=\"Screenshot 2025-04-04 at 20 18 50\"\nsrc=\"https://github.com/user-attachments/assets/f4bdd2a3-2527-4334-b253-7686e4131d87\"\n/>\n<img width=\"1728\" alt=\"Screenshot 2025-05-02 at 13 11 43\"\nsrc=\"https://github.com/user-attachments/assets/9a6e7fa2-260d-4b68-a1ae-61c499849fb8\"\n/>\n\n\n### Test scenarios\n\n- Pull this PR and run it locally, or test in the provision environment\nlinked to this PR.\n- Navigate to the dashboard, discover, and visualize app. The nav menu\nshould display icon buttons for sharing and export.\n- Clicking the \"Share\" icon (up arrow) opens the familiar share modal\nwithout export. The \"Export\" icon (down arrow) opens a new popover with\navailable options.\n- Export Functionality Test;\n- Single Export Option: When there's only one export option, the flyout\nopens automatically.\n- Disabled Reporting Features: Create a new role with reporting\nsubPrivileges and test it by creating a user assigned to that role. Log\nin as the user, and the export popover should reflect the limited\nreporting features.\n- In the case where the current user has no registered integrations\navailable to them, the export functionality will not be displayed\n\n\n\n\n---------\n\nCo-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>","sha":"a887cd687b705c163149742cb7c16d3a2a63d607","branchLabelMapping":{"^v9.1.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:skip","backport:skip","Team:SharedUX","ci:cloud-deploy","ci:cloud-redeploy","v9.1.0"],"title":"Separate export menu from share","number":217109,"url":"https://github.com/elastic/kibana/pull/217109","mergeCommit":{"message":"Separate export menu from share (#217109)\n\n## Summary\n\nCloses https://github.com/elastic/kibana/issues/205805\n\nThis PR extracts the share export functionality into a standalone\ntriggered UI action, and builds mostly off of the work that's been done\nin #211665 as such any share\nintegration type that's registered under the groupId `export` will show\nup within the afore mentioned standalone export type.\n\nRegistering a new export type would happen like so; \n\n```js\nshare.registerShareIntegration({\n\tgroupId: 'export',\n\t...\n\tconfig: () => ({\n\t\t...\n\t}),\n\tprerequisiteCheck({ license, capabilities, objectType }) {\n\t\t// The prerequisiteCheck callback will get passed the license, app capabilities and the objectType\n\t\t// of the current caller, this can then be used to determine if this integration should be available,\n\t\t// returning false in here disables the integration, \n\t}\n})\n```\n\n*P.S.* This registration can also be scoped to a particular object type\n(i.e. lens, dashboard etc.) if said integration is intended to only be\navailable for only a particular object type.\n\n\n## Visuals for new export experience\n\n#### _visualize_\n\n##### (_lens_)\n<img width=\"768\" alt=\"Screenshot 2025-04-24 at 10 53 25\"\nsrc=\"https://github.com/user-attachments/assets/31966ded-b1f7-417e-840e-4596b310d6bc\"\n/>\n\n##### (_others_)\n<img width=\"1720\" alt=\"Screenshot 2025-04-25 at 09 04 50\"\nsrc=\"https://github.com/user-attachments/assets/8b675974-9a4b-4dcc-9aca-77cea5a25654\"\n/>\n\n\n#### _dashboard_\n##### _(user with all reporting permissions)_\n<img width=\"640\" alt=\"Screenshot 2025-04-24 at 10 53 40\"\nsrc=\"https://github.com/user-attachments/assets/d16da148-3c25-4a58-a847-d4d5a3736106\"\n/>\n\n##### _(user with no pdf, png, csv privileges doesn't have the export\nbutton visible)_\n<img width=\"1728\" alt=\"Screenshot 2025-05-02 at 13 11 21\"\nsrc=\"https://github.com/user-attachments/assets/e47426fb-db5b-4c2a-bee5-557fefbb40ec\"\n/>\n\n#### _discover_\n<img width=\"626\" alt=\"Screenshot 2025-04-04 at 20 18 50\"\nsrc=\"https://github.com/user-attachments/assets/f4bdd2a3-2527-4334-b253-7686e4131d87\"\n/>\n<img width=\"1728\" alt=\"Screenshot 2025-05-02 at 13 11 43\"\nsrc=\"https://github.com/user-attachments/assets/9a6e7fa2-260d-4b68-a1ae-61c499849fb8\"\n/>\n\n\n### Test scenarios\n\n- Pull this PR and run it locally, or test in the provision environment\nlinked to this PR.\n- Navigate to the dashboard, discover, and visualize app. The nav menu\nshould display icon buttons for sharing and export.\n- Clicking the \"Share\" icon (up arrow) opens the familiar share modal\nwithout export. The \"Export\" icon (down arrow) opens a new popover with\navailable options.\n- Export Functionality Test;\n- Single Export Option: When there's only one export option, the flyout\nopens automatically.\n- Disabled Reporting Features: Create a new role with reporting\nsubPrivileges and test it by creating a user assigned to that role. Log\nin as the user, and the export popover should reflect the limited\nreporting features.\n- In the case where the current user has no registered integrations\navailable to them, the export functionality will not be displayed\n\n\n\n\n---------\n\nCo-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>","sha":"a887cd687b705c163149742cb7c16d3a2a63d607"}},"sourceBranch":"main","suggestedTargetBranches":[],"targetPullRequestStates":[{"branch":"main","label":"v9.1.0","branchLabelMappingKey":"^v9.1.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/217109","number":217109,"mergeCommit":{"message":"Separate export menu from share (#217109)\n\n## Summary\n\nCloses https://github.com/elastic/kibana/issues/205805\n\nThis PR extracts the share export functionality into a standalone\ntriggered UI action, and builds mostly off of the work that's been done\nin #211665 as such any share\nintegration type that's registered under the groupId `export` will show\nup within the afore mentioned standalone export type.\n\nRegistering a new export type would happen like so; \n\n```js\nshare.registerShareIntegration({\n\tgroupId: 'export',\n\t...\n\tconfig: () => ({\n\t\t...\n\t}),\n\tprerequisiteCheck({ license, capabilities, objectType }) {\n\t\t// The prerequisiteCheck callback will get passed the license, app capabilities and the objectType\n\t\t// of the current caller, this can then be used to determine if this integration should be available,\n\t\t// returning false in here disables the integration, \n\t}\n})\n```\n\n*P.S.* This registration can also be scoped to a particular object type\n(i.e. lens, dashboard etc.) if said integration is intended to only be\navailable for only a particular object type.\n\n\n## Visuals for new export experience\n\n#### _visualize_\n\n##### (_lens_)\n<img width=\"768\" alt=\"Screenshot 2025-04-24 at 10 53 25\"\nsrc=\"https://github.com/user-attachments/assets/31966ded-b1f7-417e-840e-4596b310d6bc\"\n/>\n\n##### (_others_)\n<img width=\"1720\" alt=\"Screenshot 2025-04-25 at 09 04 50\"\nsrc=\"https://github.com/user-attachments/assets/8b675974-9a4b-4dcc-9aca-77cea5a25654\"\n/>\n\n\n#### _dashboard_\n##### _(user with all reporting permissions)_\n<img width=\"640\" alt=\"Screenshot 2025-04-24 at 10 53 40\"\nsrc=\"https://github.com/user-attachments/assets/d16da148-3c25-4a58-a847-d4d5a3736106\"\n/>\n\n##### _(user with no pdf, png, csv privileges doesn't have the export\nbutton visible)_\n<img width=\"1728\" alt=\"Screenshot 2025-05-02 at 13 11 21\"\nsrc=\"https://github.com/user-attachments/assets/e47426fb-db5b-4c2a-bee5-557fefbb40ec\"\n/>\n\n#### _discover_\n<img width=\"626\" alt=\"Screenshot 2025-04-04 at 20 18 50\"\nsrc=\"https://github.com/user-attachments/assets/f4bdd2a3-2527-4334-b253-7686e4131d87\"\n/>\n<img width=\"1728\" alt=\"Screenshot 2025-05-02 at 13 11 43\"\nsrc=\"https://github.com/user-attachments/assets/9a6e7fa2-260d-4b68-a1ae-61c499849fb8\"\n/>\n\n\n### Test scenarios\n\n- Pull this PR and run it locally, or test in the provision environment\nlinked to this PR.\n- Navigate to the dashboard, discover, and visualize app. The nav menu\nshould display icon buttons for sharing and export.\n- Clicking the \"Share\" icon (up arrow) opens the familiar share modal\nwithout export. The \"Export\" icon (down arrow) opens a new popover with\navailable options.\n- Export Functionality Test;\n- Single Export Option: When there's only one export option, the flyout\nopens automatically.\n- Disabled Reporting Features: Create a new role with reporting\nsubPrivileges and test it by creating a user assigned to that role. Log\nin as the user, and the export popover should reflect the limited\nreporting features.\n- In the case where the current user has no registered integrations\navailable to them, the export functionality will not be displayed\n\n\n\n\n---------\n\nCo-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>","sha":"a887cd687b705c163149742cb7c16d3a2a63d607"}}]}] BACKPORT--> Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
Summary
This PR attempts to rework the internals for how the share plugin works, and brings with it a slight modification to how configs are registered to the share plugin, with this PR the share plugin now defines the following share types i.e.
links,embedsandintegrations. As such native implementations (i.e. copy link and embed) provided by sharedUX remain internal to the share plugin.One might then ask what happens to the existing export functionality provided by the reporting plugin, in this PR the export functionality is now modelled as an integration that's simply grouped as an export, see the type definition for the Export type. Accompanying this change, a new method has been introduced
registerShareIntegrationthat's similar to the previous methodregister, with a slight difference, in that now registered integrations can be scoped to a specific object type like so.The expected return type for config is defined by the user, as such the export integration type defines it's own expected type that suits the current implementation of the share modal.
Furthermore there's been a clean up with the config options that typically would be passed to the
toggleShareMenumethod, properties that are specific to a specific share type are now expected to be provided within the config property for that specific share type.How to test