-
Notifications
You must be signed in to change notification settings - Fork 8.3k
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
Create the concept of embeddableHandlers #12146
Merged
stacey-gammon
merged 31 commits into
elastic:master
from
stacey-gammon:embeddable-handlers
Aug 8, 2017
Merged
Changes from 23 commits
Commits
Show all changes
31 commits
Select commit
Hold shift + click to select a range
0e1e21d
Move dashboard panel rendering logic to each registered type.
stacey-gammon 2ae2d8e
Remove dashboard knowledge of click and brush handlers for visualizat…
stacey-gammon 01ba525
merge master with manual changes
stacey-gammon 3de0f34
No need to use lodash
stacey-gammon d815bfd
Add EmbeddableHandler base class
stacey-gammon 505365c
Use correct path to embeddable_handlers_registry
stacey-gammon f2c75f5
clean up
stacey-gammon e6d93b9
Merge branch 'master' of https://github.com/elastic/kibana into embed…
stacey-gammon 1acbffe
Set visualize scope uiState that is of type PersistedState, otherwise…
stacey-gammon 1c93016
Manual merge with master after new filter changes
stacey-gammon 7f775b4
add retry to loading saved search data
stacey-gammon c5b02ba
Merge branch 'master' of https://github.com/elastic/kibana into embed…
stacey-gammon 8bff9df
Merge branch 'master' of https://github.com/elastic/kibana into embed…
stacey-gammon 0f57ba5
Fix handleError param and remove unnecessary private param
stacey-gammon dd465dd
Merge branch 'master' of https://github.com/elastic/kibana into embed…
stacey-gammon cf541fb
Rename savePanelState updatePanel and return the new object rather th…
stacey-gammon 642a355
Merge with master
stacey-gammon 0a2545a
Make ContainerAPI a base class and move the dashboard specific functi…
stacey-gammon 3c9fe4e
Make api's async and clean up documentation
stacey-gammon be3afde
Fix panel tests
stacey-gammon a01b96e
Merge branch 'master' of https://github.com/elastic/kibana into embed…
stacey-gammon 6ccedd3
Fix bug which broke tests - need to pass container-api to dashboard-p…
stacey-gammon 78cce39
Address code comments
stacey-gammon 033d376
changed the wrong variable name
stacey-gammon 4ab7072
no need for async or Promise.reject on interface
stacey-gammon b29f6eb
Merge branch 'master' of https://github.com/elastic/kibana into embed…
stacey-gammon a685b47
add tests that will fail due to spy pane issue in this PR
stacey-gammon f74cc0e
Fix logic with spy pane toggle
stacey-gammon 6c46134
Merge branch 'master' of https://github.com/elastic/kibana into embed…
stacey-gammon e401b14
Merge branch 'master' of https://github.com/elastic/kibana into embed…
stacey-gammon ccfaadb
Fix failing test
stacey-gammon File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
38 changes: 38 additions & 0 deletions
38
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,38 @@ | ||
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; | ||
} | ||
|
||
getIsViewOnlyMode() { | ||
return this.dashboardState.getIsViewMode(); | ||
} | ||
|
||
getInitialState(path, uiState) { | ||
return this.dashboardState.uiState.createChild(path, uiState, 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.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Haha, I wasn't very clear, I was asking for
createChildUiState(path, initialState)
This method returns an instance of
PersistedState
, which we usually refer to asuiState
. This method also takes an argument which it callsuiState
, but it's actually just a plain object that is used as the initial state for theuiState
that is returned.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hah, okay, yea, this function is carried over from the past and I never understood much of it. Will switch to your intended version. :)