Skip to content

Share modal re-architecture#211665

Merged
eokoneyo merged 26 commits intoelastic:mainfrom
eokoneyo:feat/share-rearchitecture
Apr 23, 2025
Merged

Share modal re-architecture#211665
eokoneyo merged 26 commits intoelastic:mainfrom
eokoneyo:feat/share-rearchitecture

Conversation

@eokoneyo
Copy link
Copy Markdown
Contributor

@eokoneyo eokoneyo commented Feb 18, 2025

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.

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.

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.

@eokoneyo eokoneyo added the Team:SharedUX Platform AppEx-SharedUX (formerly Global Experience) t// label Feb 18, 2025
@eokoneyo eokoneyo force-pushed the feat/share-rearchitecture branch from 1db5b72 to d4162c9 Compare February 18, 2025 23:00
@eokoneyo eokoneyo changed the title [] Share modal re-work Share modal re-architecture Feb 18, 2025
@eokoneyo eokoneyo changed the title Share modal re-architecture [WiP] Share modal re-architecture Feb 19, 2025
@eokoneyo eokoneyo force-pushed the feat/share-rearchitecture branch 8 times, most recently from 333f34a to cc0566a Compare February 21, 2025 16:28
@eokoneyo eokoneyo self-assigned this Feb 21, 2025
@eokoneyo eokoneyo added the release_note:skip Skip the PR/issue when compiling release notes label Feb 21, 2025
@eokoneyo eokoneyo force-pushed the feat/share-rearchitecture branch 2 times, most recently from 75afcd9 to 715606a Compare March 3, 2025 11:04
@eokoneyo
Copy link
Copy Markdown
Contributor Author

eokoneyo commented Mar 5, 2025

/ci

1 similar comment
@eokoneyo
Copy link
Copy Markdown
Contributor Author

eokoneyo commented Mar 5, 2025

/ci

@eokoneyo eokoneyo force-pushed the feat/share-rearchitecture branch from fdcb6ed to 3a0a171 Compare March 7, 2025 12:20
@eokoneyo
Copy link
Copy Markdown
Contributor Author

eokoneyo commented Mar 7, 2025

/ci

@eokoneyo eokoneyo force-pushed the feat/share-rearchitecture branch from 3a0a171 to 85b2418 Compare March 7, 2025 15:37
@eokoneyo
Copy link
Copy Markdown
Contributor Author

eokoneyo commented Mar 7, 2025

/ci

@eokoneyo eokoneyo force-pushed the feat/share-rearchitecture branch from 85b2418 to 5fbdad0 Compare March 7, 2025 16:19
@eokoneyo
Copy link
Copy Markdown
Contributor Author

eokoneyo commented Mar 7, 2025

/ci

@eokoneyo eokoneyo force-pushed the feat/share-rearchitecture branch 2 times, most recently from 0e31025 to 51eb479 Compare March 10, 2025 08:30
@eokoneyo
Copy link
Copy Markdown
Contributor Author

/ci

@eokoneyo eokoneyo force-pushed the feat/share-rearchitecture branch from 51eb479 to 74ea7d7 Compare March 18, 2025 09:47
@eokoneyo
Copy link
Copy Markdown
Contributor Author

/ci

@eokoneyo eokoneyo force-pushed the feat/share-rearchitecture branch from 74ea7d7 to d72488b Compare March 19, 2025 12:45
Copy link
Copy Markdown
Contributor

@pmuellr pmuellr left a comment

Choose a reason for hiding this comment

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

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),
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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()

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

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.

@eokoneyo
Copy link
Copy Markdown
Contributor Author

@elasticmachine merge upstream

@elasticmachine
Copy link
Copy Markdown
Contributor

💛 Build succeeded, but was flaky

Failed CI Steps

Metrics [docs]

Public APIs missing comments

Total count of every public API that lacks a comment. Target amount is 0. Run node scripts/build_api_docs --plugin [yourplugin] --stats comments for more detailed information.

id before after diff
share 73 53 -20

Async chunks

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

id before after diff
dashboard 550.2KB 550.2KB -73.0B
discover 958.6KB 958.6KB +15.0B
lens 1.4MB 1.4MB -56.0B
visualizations 340.2KB 340.2KB -14.0B
total -128.0B

Public APIs missing exports

Total count of every type that is part of your API that should be exported but is not. This will cause broken links in the API documentation system. Target amount is 0. Run node scripts/build_api_docs --plugin [yourplugin] --stats exports for more detailed information.

id before after diff
share 16 15 -1

Page load bundle

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

id before after diff
lens 57.7KB 57.8KB +73.0B
reporting 48.9KB 49.4KB +541.0B
share 54.2KB 56.1KB +1.9KB
total +2.5KB
Unknown metric groups

API count

id before after diff
share 136 118 -18

References to deprecated APIs

id before after diff
@kbn/reporting-public 1 2 +1
discover 8 7 -1
lens 77 76 -1
total -1

History

cc @eokoneyo

@eokoneyo eokoneyo merged commit 37afbb5 into elastic:main Apr 23, 2025
9 checks passed
@eokoneyo eokoneyo deleted the feat/share-rearchitecture branch April 23, 2025 11:34
akowalska622 pushed a commit to akowalska622/kibana that referenced this pull request May 29, 2025
## 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>
eokoneyo added a commit that referenced this pull request Jun 2, 2025
## 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>
zacharyparikh pushed a commit to zacharyparikh/kibana that referenced this pull request Jun 4, 2025
## 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>
nickpeihl pushed a commit to nickpeihl/kibana that referenced this pull request Jun 12, 2025
## 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>
@eokoneyo
Copy link
Copy Markdown
Contributor Author

💚 All backports created successfully

Status Branch Result
8.19

Note: Successful backport PRs will be merged automatically after passing CI.

Questions ?

Please refer to the Backport tool documentation

eokoneyo added a commit to eokoneyo/kibana that referenced this pull request Jun 24, 2025
## 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
eokoneyo added a commit to eokoneyo/kibana that referenced this pull request Jun 24, 2025
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)
eokoneyo added a commit to eokoneyo/kibana that referenced this pull request Jun 24, 2025
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)
eokoneyo added a commit to eokoneyo/kibana that referenced this pull request Jun 24, 2025
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)
eokoneyo added a commit to eokoneyo/kibana that referenced this pull request Jun 24, 2025
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)
eokoneyo added a commit that referenced this pull request Jun 25, 2025
# 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>
eokoneyo added a commit to eokoneyo/kibana that referenced this pull request Jun 25, 2025
## 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
eokoneyo added a commit to eokoneyo/kibana that referenced this pull request Jun 25, 2025
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)
eokoneyo added a commit to eokoneyo/kibana that referenced this pull request Jun 25, 2025
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)
eokoneyo added a commit that referenced this pull request Jun 25, 2025
# 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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport:skip This PR does not require backporting release_note:skip Skip the PR/issue when compiling release notes Team:SharedUX Platform AppEx-SharedUX (formerly Global Experience) t// v8.19.0 v9.1.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants