diff --git a/src/plugins/share/public/plugin.test.ts b/src/plugins/share/public/plugin.test.ts index ece207a67aa40..878c285b3a1a1 100644 --- a/src/plugins/share/public/plugin.test.ts +++ b/src/plugins/share/public/plugin.test.ts @@ -54,6 +54,7 @@ describe('SharePlugin', () => { expect.objectContaining({ getShareMenuItems: expect.any(Function), }), + true, // disableEmbed - true because buildFlavor === 'serverless' undefined ); expect(start.toggleShareContextMenu).toBeDefined(); @@ -73,6 +74,7 @@ describe('SharePlugin', () => { expect.objectContaining({ getShareMenuItems: expect.any(Function), }), + true, // disableEmbed - true because buildFlavor === 'serverless' anonymousAccessServiceProvider ); expect(start.toggleShareContextMenu).toBeDefined(); diff --git a/src/plugins/share/public/plugin.ts b/src/plugins/share/public/plugin.ts index 792e0dae0b986..11aa38600d98b 100644 --- a/src/plugins/share/public/plugin.ts +++ b/src/plugins/share/public/plugin.ts @@ -120,10 +120,12 @@ export class SharePlugin implements Plugin { } public start(core: CoreStart): SharePluginStart { + const disableEmbed = this.initializerContext.env.packageInfo.buildFlavor === 'serverless'; const sharingContextMenuStart = this.shareContextMenu.start( core, this.url!, this.shareMenuRegistry.start(), + disableEmbed, this.anonymousAccessServiceProvider ); diff --git a/src/plugins/share/public/services/share_menu_manager.tsx b/src/plugins/share/public/services/share_menu_manager.tsx index 45720157d93df..658d01063b1ea 100644 --- a/src/plugins/share/public/services/share_menu_manager.tsx +++ b/src/plugins/share/public/services/share_menu_manager.tsx @@ -28,6 +28,7 @@ export class ShareMenuManager { core: CoreStart, urlService: BrowserUrlService, shareRegistry: ShareMenuRegistryStart, + disableEmbed: boolean, anonymousAccessServiceProvider?: () => AnonymousAccessServiceContract ) { return { @@ -45,6 +46,7 @@ export class ShareMenuManager { const anonymousAccess = anonymousAccessServiceProvider?.(); this.toggleShareContextMenu({ ...options, + allowEmbed: disableEmbed ? false : options.allowEmbed, onClose, menuItems, urlService,