Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[WiP] Share modal re-architecture #211665

Draft
wants to merge 16 commits into
base: main
Choose a base branch
from

Conversation

eokoneyo
Copy link
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'
	})
})

Also 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.

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;

const { objectTypeMeta, shareMenuItems } = useShareTabsContext('link')

because the share type of link is provided, useShareTabsContext will only provide data and config that applies specifically to the link share type.

@eokoneyo eokoneyo added the Team:SharedUX Team label for AppEx-SharedUX (formerly Global Experience) label Feb 18, 2025
@elasticmachine
Copy link
Contributor

🤖 Jobs for this PR can be triggered through checkboxes. 🚧

ℹ️ To trigger the CI, please tick the checkbox below 👇

  • Click to trigger kibana-pull-request for this PR!
  • Click to trigger kibana-deploy-project-from-pr for this PR!
  • Click to trigger kibana-deploy-cloud-from-pr for this PR!

@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 from cc0566a to 75afcd9 Compare February 26, 2025 15:20
@eokoneyo eokoneyo force-pushed the feat/share-rearchitecture branch from 75afcd9 to 715606a Compare March 3, 2025 11:04
@eokoneyo
Copy link
Contributor Author

eokoneyo commented Mar 5, 2025

/ci

@eokoneyo
Copy link
Contributor Author

eokoneyo commented Mar 5, 2025

/ci

@elasticmachine
Copy link
Contributor

elasticmachine commented Mar 5, 2025

💔 Build Failed

Failed CI Steps

History

cc @eokoneyo

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
release_note:skip Skip the PR/issue when compiling release notes Team:SharedUX Team label for AppEx-SharedUX (formerly Global Experience)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants