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.
Create the concept of embeddableHandlers (elastic#12146)
* Move dashboard panel rendering logic to each registered type. * Remove dashboard knowledge of click and brush handlers for visualizations Move it to the VisualizeEmbeddableHandler. * merge master with manual changes * No need to use lodash * Add EmbeddableHandler base class * Use correct path to embeddable_handlers_registry * clean up * Set visualize scope uiState that is of type PersistedState, otherwise it won't actually be set. * add retry to loading saved search data * Fix handleError param and remove unnecessary private param * Rename savePanelState updatePanel and return the new object rather than mutating the original * Make ContainerAPI a base class and move the dashboard specific functionality into a new class * Make api's async and clean up documentation * Fix panel tests * Fix bug which broke tests - need to pass container-api to dashboard-panel * Address code comments - Rename onFilter to addFilter - Use angular promises instead of async/await - fix jsdoc - rename createChildUiState to getInitialState * changed the wrong variable name * no need for async or Promise.reject on interface * add tests that will fail due to spy pane issue in this PR * Fix logic with spy pane toggle There is still a bit of a bug here as mentioned in elastic#13340 but it will be fixed separately as it’s also an issue in master * Fix failing test
- Loading branch information
1 parent
0698088
commit b8350ea
Showing
25 changed files
with
448 additions
and
289 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
34 changes: 34 additions & 0 deletions
34
src/core_plugins/kibana/public/dashboard/dashboard_container_api.js
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,34 @@ | ||
import { ContainerAPI } from 'ui/embeddable'; | ||
|
||
export class DashboardContainerAPI extends ContainerAPI { | ||
constructor(dashboardState, queryManager) { | ||
super(); | ||
this.dashboardState = dashboardState; | ||
this.queryManager = queryManager; | ||
} | ||
|
||
addFilter(field, value, operator, index) { | ||
this.queryManager.add(field, value, operator, index); | ||
} | ||
|
||
updatePanel(panelIndex, panelAttributes) { | ||
const panelToUpdate = this.dashboardState.getPanels().find((panel) => panel.panelIndex === panelIndex); | ||
Object.assign(panelToUpdate, panelAttributes); | ||
this.dashboardState.saveState(); | ||
return panelToUpdate; | ||
} | ||
|
||
getAppState() { | ||
return this.dashboardState.appState; | ||
} | ||
|
||
createChildUistate(path, initialState) { | ||
return this.dashboardState.uiState.createChild(path, initialState, true); | ||
} | ||
|
||
registerPanelIndexPattern(panelIndex, pattern) { | ||
this.dashboardState.registerPanelIndexPatternMap(panelIndex, pattern); | ||
this.dashboardState.saveState(); | ||
} | ||
|
||
} |
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.