forked from elastic/kibana
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Links] Migrate Links panel to the React embeddable framework (elasti…
…c#178670) Fixes elastic#174970 Fixes elastic#186044 ## Summary Migrates the legacy Links embeddable to the React embeddable framework. Additionally, the new embeddable factory now resolves the dashboards info prior to rendering the Links component. Prior to this change, the `DashboardLinkComponent` would be responsible for asynchronously loading dashboards info and rendering a loading icon. This change reduces the complexity of the `DashboardLinkComponent` as the resolved state is now passed in as props. --------- Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com> Co-authored-by: Hannah Mudge <Heenawter@users.noreply.github.com>
- Loading branch information
1 parent
7968b14
commit 6bb0e7c
Showing
60 changed files
with
1,770 additions
and
1,626 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
30 changes: 30 additions & 0 deletions
30
src/plugins/embeddable/public/lib/embeddable_placement/embeddable_placement_registry.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
/* | ||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
* or more contributor license agreements. Licensed under the Elastic License | ||
* 2.0 and the Server Side Public License, v 1; you may not use this file except | ||
* in compliance with, at your election, the Elastic License 2.0 or the Server | ||
* Side Public License, v 1. | ||
*/ | ||
|
||
type GetPanelPlacementSettings<StateType> = (serializedState: StateType) => { | ||
width?: number; | ||
height?: number; | ||
strategy?: string; | ||
}; | ||
|
||
const registry: Map<string, GetPanelPlacementSettings<any>> = new Map(); | ||
|
||
export const registerEmbeddablePlacementStrategy = <StateType>( | ||
panelType: string, | ||
getPanelPlacementSettings: GetPanelPlacementSettings<StateType> | ||
) => { | ||
if (registry.has(panelType)) { | ||
throw new Error(`Embeddable placement for embeddable type ${panelType} already exists`); | ||
} | ||
|
||
registry.set(panelType, getPanelPlacementSettings); | ||
}; | ||
|
||
export const getEmbeddablePlacementStrategy = (panelType: string) => { | ||
return registry.get(panelType); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.