Skip to content

Commit

Permalink
[dashboard] remove legacy section from 'Add panel' flyout (elastic#20…
Browse files Browse the repository at this point in the history
…8116)

Users should use Lens to visualize data. Users should not use TSVB or
aggregation based panels. To this end, "easy button" UIs, such as
dashboard's "Add panel" flyout, should guide users to lens and not guide
them to legacy applications.

This PR removes `legacy` section from dashboard "Add panel" flyout.
Users can still add legacy panels to dashboards via "visualize"
application. The path is more steps, but this is as intended. Using old
stuff should be painful and require extra work as a caret to move users
to new stuff.

<img width="500" alt="Screenshot 2025-01-23 at 1 08 41 PM"
src="https://github.com/user-attachments/assets/e142cba9-a880-4ad6-a3f8-a981a03daaec"
/>

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
  • Loading branch information
3 people authored Jan 30, 2025
1 parent 2212a19 commit 7587681
Show file tree
Hide file tree
Showing 20 changed files with 108 additions and 407 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ import { VisGroups } from '@kbn/visualizations-plugin/public';
import { ADD_PANEL_TRIGGER } from '@kbn/ui-actions-plugin/public';
import {
ADD_PANEL_ANNOTATION_GROUP,
ADD_PANEL_LEGACY_GROUP,
ADD_PANEL_OTHER_GROUP,
ADD_PANEL_VISUALIZATION_GROUP,
} from '@kbn/embeddable-plugin/public';
Expand All @@ -23,11 +22,9 @@ import { uiActionsService, visualizationsService } from '../../../services/kiban
import { navigateToVisEditor } from './navigate_to_vis_editor';
import type { MenuItem, MenuItemGroup } from './types';

const VIS_GROUP_TO_ADD_PANEL_GROUP: Record<VisGroups, undefined | PresentableGroup> = {
[VisGroups.AGGBASED]: undefined,
const VIS_GROUP_TO_ADD_PANEL_GROUP: Record<string, PresentableGroup> = {
[VisGroups.PROMOTED]: ADD_PANEL_VISUALIZATION_GROUP,
[VisGroups.TOOLS]: ADD_PANEL_ANNOTATION_GROUP,
[VisGroups.LEGACY]: ADD_PANEL_LEGACY_GROUP,
};

export async function getMenuItemGroups(
Expand Down
1 change: 0 additions & 1 deletion src/platform/plugins/shared/embeddable/public/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,5 @@ export function plugin(initializerContext: PluginInitializerContext) {
export {
ADD_PANEL_ANNOTATION_GROUP,
ADD_PANEL_OTHER_GROUP,
ADD_PANEL_LEGACY_GROUP,
ADD_PANEL_VISUALIZATION_GROUP,
} from './ui_actions/add_panel_groups';
Original file line number Diff line number Diff line change
Expand Up @@ -39,12 +39,3 @@ export const ADD_PANEL_OTHER_GROUP = {
getIconType: () => 'empty',
order: -1, // Given an item that doesn't specify a group is assigned zero, this forces other to come after all intentionally grouped section
};

export const ADD_PANEL_LEGACY_GROUP = {
id: 'legacy',
getDisplayName: () =>
i18n.translate('embeddableApi.common.constants.grouping.legacy', {
defaultMessage: 'Legacy',
}),
order: -2, // Given an item that doesn't specify a group is assigned zero, this forces it to the bottom of the list
};

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,4 @@
* License v3.0 only", or the "Server Side Public License, v 1".
*/

export const ADD_AGG_VIS_ACTION_ID = 'ADD_AGG_VIS';
export const ACTION_EDIT_IN_LENS = 'ACTION_EDIT_IN_LENS';
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@

import { DataPublicPluginStart } from '@kbn/data-plugin/public';
import { CONTEXT_MENU_TRIGGER } from '@kbn/embeddable-plugin/public';
import { ADD_PANEL_TRIGGER, type UiActionsStart } from '@kbn/ui-actions-plugin/public';
import { ACTION_EDIT_IN_LENS, ADD_AGG_VIS_ACTION_ID } from './constants';
import type { UiActionsStart } from '@kbn/ui-actions-plugin/public';
import { ACTION_EDIT_IN_LENS } from './constants';
import { TypesStart } from '../vis_types/types_service';

export function registerActions(
Expand All @@ -22,9 +22,4 @@ export function registerActions(
const { EditInLensAction } = await import('./edit_in_lens_action');
return new EditInLensAction(data.query.timefilter.timefilter);
});

uiActions.addTriggerActionAsync(ADD_PANEL_TRIGGER, ADD_AGG_VIS_ACTION_ID, async () => {
const { AddAggVisualizationPanelAction } = await import('./add_agg_vis_action');
return new AddAggVisualizationPanelAction(types);
});
}
114 changes: 0 additions & 114 deletions test/functional/apps/dashboard/group1/create_and_add_embeddables.ts

This file was deleted.

Loading

0 comments on commit 7587681

Please sign in to comment.