-
Notifications
You must be signed in to change notification settings - Fork 8.2k
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
Redesign the "Add Panel" Experience #183764
Merged
Merged
Changes from 39 commits
Commits
Show all changes
70 commits
Select commit
Hold shift + click to select a range
08bb84a
Remove quick buttons
cqliu1 f71278f
Create add panel component
cqliu1 0e1b2f2
[CI] Auto-commit changed files from 'node scripts/precommit_hook.js -…
kibanamachine 31143b6
initial scaffold
eokoneyo 8bbcd0d
start on grouping panel items
eokoneyo fd1521e
leverage toMountPoint for addPanelflyout method
eokoneyo 092d490
save progress
eokoneyo 3777727
refactor show new vis method
eokoneyo bd22c60
refactor aggregation selection modal to support root mode
eokoneyo b554bff
use appropriate name for panel selection file
eokoneyo 5a7ed7c
create single reference point for add panel trigger ui action
eokoneyo a59334a
create common group for emmbeddables, that correlate to visualization…
eokoneyo 151832b
leverage previously setup grouping to render for panel flyout
eokoneyo 3baa30c
add panel action for handling picking aggregation based visualizations
eokoneyo 20b8274
cleanup
eokoneyo db94c6b
add missing icons for ml panels
eokoneyo aaf02af
visual cleanup of panel render list
eokoneyo 35aa870
try out placement priority idea for panel group sorting
eokoneyo 79d5a8f
naive search implementation for add panel
eokoneyo f823b95
start on fixing tests
eokoneyo 65c9d8b
accesibility changes so screen reader gets description for panel items
eokoneyo 103cfe9
promote search matches to top
eokoneyo 8fac5b4
fix i18n related issues
eokoneyo a920747
accomodation for test expectations
eokoneyo 1691232
invoke vis type method with flyout close handler
eokoneyo 2e0d4d7
add data-test-subj for embeddable groups
eokoneyo fbe4e2c
exclude observability panels from showing in serverless
eokoneyo 81f224c
more test fixes
eokoneyo b2808c7
[CI] Auto-commit changed files from 'node scripts/eslint --no-cache -…
kibanamachine 2360668
fix unit tests
eokoneyo 364776d
handle unintended sideeffect in canvas
eokoneyo e9451bb
add expect error for type issue
eokoneyo 75cbd21
include compatibility check for selecting agg based visualization, al…
eokoneyo 8453c7d
leverage preexisting order property to compute placementPriority
eokoneyo f1eb0df
move add panel trigger constant to ui-action-browser package
eokoneyo a55acef
change machine learning app name
eokoneyo fada17b
add fallback group for registered actions without group
eokoneyo 56cff97
improve accesibility for panel selection items navigation
eokoneyo 73c959f
include group item sort ordering
eokoneyo d706682
Wrap panel labels with EuiToolTip for panel type description
cqliu1 fe15987
Merge remote-tracking branch 'upstream' into feat/resolve-144418
cqliu1 da7e80f
Merge branch 'main' into feat/resolve-144418
cqliu1 aaa5777
Fix maps by value test
cqliu1 ac0ba4f
Merge remote-tracking branch 'upstream' into feat/resolve-144418
cqliu1 f5292e6
Add offset for add panel search field
cqliu1 d9b41bc
Remove unnecessary import
cqliu1 a0b22fc
Scroll to visType before clicking
cqliu1 87a0f52
Attempt to fix scrolling on failing map test
cqliu1 f923bc6
Hide sections that don't match search text
cqliu1 51194fe
Fix maps by value test
cqliu1 73356f3
Remove offset
cqliu1 25ea4e6
Change how hidden sections are handled
cqliu1 cab3de3
Add message when no panel types match search string
cqliu1 3720409
Merge remote-tracking branch 'upstream' into feat/resolve-144418
cqliu1 3291e62
Merge branch 'main' into feat/resolve-144418
cqliu1 910065f
Remove all references to placementPriority
cqliu1 48bef80
Move addAggVisAction to visualizations plugin
cqliu1 be9021e
Remove unused import
cqliu1 677377e
[CI] Auto-commit changed files from 'node scripts/lint_ts_projects --…
kibanamachine 3a0c698
Fix i18n id
cqliu1 4ee460f
Merge remote-tracking branch 'upstream' into feat/resolve-144418
cqliu1 de6d165
Fix add agg based vis action originatingApp
cqliu1 5337820
Add type for COMMON_EMBEDDABLE_GROUPING
cqliu1 68c1afa
Update compatibility logic for add_agg_vis_action
cqliu1 f78c1be
Merge remote-tracking branch 'upstream' into feat/resolve-144418
cqliu1 56a4697
Check for appContext in add_agg_vis_action
cqliu1 79ea2e8
Fix type errors
cqliu1 947b2c9
Merge branch 'main' into feat/resolve-144418
cqliu1 ca83f0c
Change ml options order
cqliu1 882b7dd
Merge branch 'main' into feat/resolve-144418
cqliu1 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
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
67 changes: 67 additions & 0 deletions
67
src/plugins/dashboard/public/dashboard_actions/add_agg_vis_action.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,67 @@ | ||
/* | ||
* 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. | ||
*/ | ||
|
||
import { i18n } from '@kbn/i18n'; | ||
import { EmbeddableApiContext, apiHasType, type HasType } from '@kbn/presentation-publishing'; | ||
import { COMMON_EMBEDDABLE_GROUPING } from '@kbn/embeddable-plugin/public'; | ||
import { Action, IncompatibleActionError } from '@kbn/ui-actions-plugin/public'; | ||
import { DASHBOARD_APP_ID } from '../dashboard_constants'; | ||
import { pluginServices } from '../services/plugin_services'; | ||
|
||
const ADD_AGG_VIS_ACTION_ID = 'ADD_AGG_VIS'; | ||
|
||
type AddAggVisualizationPanelActionApi = HasType; | ||
|
||
const isApiCompatible = (api: unknown | null): api is AddAggVisualizationPanelActionApi => { | ||
return apiHasType(api) && api.type === 'dashboard'; | ||
}; | ||
|
||
export class AddAggVisualizationPanelAction implements Action<EmbeddableApiContext> { | ||
public readonly type = ADD_AGG_VIS_ACTION_ID; | ||
public readonly id = ADD_AGG_VIS_ACTION_ID; | ||
public readonly grouping = [COMMON_EMBEDDABLE_GROUPING.legacy]; | ||
|
||
public readonly order = 20; | ||
|
||
private showNewVisModal; | ||
|
||
constructor() { | ||
({ | ||
visualizations: { showNewVisModal: this.showNewVisModal }, | ||
} = pluginServices.getServices()); | ||
} | ||
|
||
public getIconType() { | ||
return 'visualizeApp'; | ||
} | ||
|
||
public getDisplayName() { | ||
return i18n.translate('dashboard.uiAction.addAggVis.displayName', { | ||
defaultMessage: 'Aggregation based', | ||
}); | ||
} | ||
|
||
public async isCompatible({ embeddable }: EmbeddableApiContext) { | ||
return isApiCompatible(embeddable); | ||
} | ||
|
||
public execute({ embeddable }: EmbeddableApiContext): Promise<void> { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. nit: why not use an async function here? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Addressed in 48bef80 |
||
return new Promise((resolve, reject) => { | ||
if (!isApiCompatible(embeddable)) { | ||
return reject(new IncompatibleActionError()); | ||
} | ||
|
||
this.showNewVisModal({ | ||
originatingApp: DASHBOARD_APP_ID, | ||
outsideVisualizeApp: true, | ||
showAggsSelection: true, | ||
onClose: resolve, | ||
}); | ||
}); | ||
} | ||
} |
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
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.
Any reason this action is in the Dashboard plugin and not in the Visualize plugin?
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.
I moved this to the visualizations plugin in 48bef80