Skip to content
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

[Dashboard] Hover actions for panels #182535

Merged
merged 133 commits into from
Oct 25, 2024
Merged
Show file tree
Hide file tree
Changes from 53 commits
Commits
Show all changes
133 commits
Select commit Hold shift + click to select a range
c28f6c7
Add floating actions to dashboard panel
cqliu1 May 2, 2024
cbd6ef1
Fix filter notifications tests
cqliu1 Aug 26, 2024
b7751bd
Fix expectMissingPanelAction
cqliu1 Aug 27, 2024
5d4f1bb
Rename clickContextMenuItem to clickPanelAction
cqliu1 Aug 27, 2024
1a9c8f5
Remove exclusive suite
cqliu1 Aug 27, 2024
9af57e4
Fix position in fullscreen mode
cqliu1 Aug 27, 2024
99c2b72
enable allowHidden
cqliu1 Aug 27, 2024
6d8203a
Merge branch 'main' of https://github.com/elastic/kibana into dashboa…
cqliu1 Aug 27, 2024
7566b4e
Fix findContextMenu
cqliu1 Aug 27, 2024
37f1d30
Merge branch 'main' of https://github.com/elastic/kibana into dashboa…
cqliu1 Aug 28, 2024
048d176
Merge branch 'main' of https://github.com/elastic/kibana into dashboa…
cqliu1 Aug 30, 2024
eac3b29
Update cases group ID
cqliu1 Sep 9, 2024
cf1830e
Merge branch 'main' of https://github.com/elastic/kibana into dashboa…
cqliu1 Sep 9, 2024
69ab6d4
Hide hover actions when overlay open
cqliu1 Sep 9, 2024
5415398
Hide hover actions when overlay exists
cqliu1 Sep 9, 2024
a6ebb1a
Merge branch 'main' of https://github.com/elastic/kibana into dashboa…
cqliu1 Sep 9, 2024
f15336a
Fix ts error
cqliu1 Sep 10, 2024
25f350f
Update panel actions
cqliu1 Sep 10, 2024
0c73e5f
Delete clickContextMenuItem
cqliu1 Sep 10, 2024
d2dc3f5
Variable rename
cqliu1 Sep 10, 2024
985143c
Fix download csv tests
cqliu1 Sep 10, 2024
fe2383f
Remove openContextMenu usage
cqliu1 Sep 10, 2024
f0a2ec4
Add panelExists
cqliu1 Sep 10, 2024
a9e5ef3
Fix drilldown actions
cqliu1 Sep 10, 2024
2603358
Update padding and fix drag handle cursor
cqliu1 Sep 11, 2024
0d27b31
Fix scrolling
cqliu1 Sep 11, 2024
c467d57
Remove exclusive suites
cqliu1 Sep 11, 2024
c0c829e
Adjust scroll handler
cqliu1 Sep 13, 2024
4c4943a
Remove exclusive suite
cqliu1 Sep 13, 2024
621aec6
Fix scrollPanelIntoView
cqliu1 Sep 16, 2024
344837d
Merge branch 'main' of https://github.com/elastic/kibana into dashboa…
cqliu1 Sep 16, 2024
589a244
Remove exclusive suite
cqliu1 Sep 16, 2024
59b87c6
Hide drag handle when panel is maximized
cqliu1 Sep 16, 2024
546ddab
Fix lint issues
cqliu1 Sep 16, 2024
0cbc7c8
Merge branch 'main' of https://github.com/elastic/kibana into dashboa…
cqliu1 Sep 16, 2024
ea35435
Fix clickPanelActionByTitle
cqliu1 Sep 16, 2024
8047cfb
Move function
cqliu1 Sep 16, 2024
eb7b4a3
Fix hover actions transitions
cqliu1 Sep 16, 2024
8d918a4
Remove transitions
cqliu1 Sep 16, 2024
4667a2f
Restore original transitions on presentation panel
cqliu1 Sep 16, 2024
00aa3c5
Update src/plugins/ui_actions/public/context_menu/build_eui_context_m…
cqliu1 Sep 16, 2024
be63450
Fix spacing
cqliu1 Sep 16, 2024
b5358bd
Remove whitespace
cqliu1 Sep 16, 2024
0bfa5e8
Fix toggleContextMenu
cqliu1 Sep 17, 2024
4434300
fix dashboard tests
cqliu1 Sep 17, 2024
387ce17
Delete more menu helpers
cqliu1 Sep 17, 2024
d27e210
Show hover actions on selected element
cqliu1 Sep 17, 2024
a1d0d96
Update sample data report snapshot
cqliu1 Sep 17, 2024
96fd7e9
Merge branch 'main' of https://github.com/elastic/kibana into dashboa…
cqliu1 Sep 17, 2024
7ed4103
Fix saved query management test
cqliu1 Sep 17, 2024
79c28e9
Update dashboard snapshot
cqliu1 Sep 17, 2024
d24ee64
Fix linked to library checks
cqliu1 Sep 17, 2024
6a7982c
Switch to emotion in hover actions
cqliu1 Sep 17, 2024
67807fb
Remove empty line
cqliu1 Sep 17, 2024
93aec7e
Fix panel actions
cqliu1 Sep 17, 2024
923dc06
Update area chart snapshot
cqliu1 Sep 17, 2024
79e275b
Fix more tests
cqliu1 Sep 17, 2024
5de6704
Merge branch 'main' of https://github.com/elastic/kibana into dashboa…
cqliu1 Sep 17, 2024
5f64570
Remove unused service
cqliu1 Sep 17, 2024
fe3bb82
Remove panel loader prop changes
cqliu1 Sep 23, 2024
47c1879
Merge branch 'main' of https://github.com/elastic/kibana into dashboa…
cqliu1 Sep 23, 2024
e96efb2
Rename DASHBOARD_ACTION_GROUP
cqliu1 Sep 23, 2024
4b569fe
Revert "Switch to emotion in hover actions"
cqliu1 Sep 23, 2024
4170c6d
Update notifications const
cqliu1 Sep 23, 2024
33c4171
Fix dashboard viewport
cqliu1 Sep 24, 2024
d9a2ad9
Fix canvas test
cqliu1 Sep 25, 2024
129b958
Remove exclusive suite
cqliu1 Sep 25, 2024
002827f
Merge branch 'main' of https://github.com/elastic/kibana into dashboa…
cqliu1 Sep 25, 2024
11e8cde
Fix drilldown tests
cqliu1 Sep 25, 2024
d1f19a7
Fix import
cqliu1 Sep 25, 2024
0a223b3
Merge branch 'main' of https://github.com/elastic/kibana into dashboa…
cqliu1 Sep 30, 2024
e714d58
Fix types
cqliu1 Oct 1, 2024
645f599
Fix tsvb test
cqliu1 Oct 1, 2024
1119d7a
Fix lens test
cqliu1 Oct 1, 2024
dd4aa01
[CI] Auto-commit changed files from 'node scripts/eslint --no-cache -…
kibanamachine Oct 1, 2024
aece599
Fix linting
cqliu1 Oct 1, 2024
c65adb8
Remove exclusive suite
cqliu1 Oct 1, 2024
eb42ecf
Fix security test
cqliu1 Oct 1, 2024
4eeb40c
Merge branch 'dashboard/floating-actions-for-panels' of https://githu…
cqliu1 Oct 1, 2024
f2dc308
Unskip reporting test
cqliu1 Oct 1, 2024
fcfff41
Fix action orders and comments
cqliu1 Oct 1, 2024
490b228
Apply suggestions from code review
cqliu1 Oct 1, 2024
f699272
Fix hover actions loading
cqliu1 Oct 1, 2024
c42b03a
Merge branch 'main' of https://github.com/elastic/kibana into dashboa…
cqliu1 Oct 1, 2024
2bc6252
fix expand panel action test
cqliu1 Oct 1, 2024
b13fa2d
fix i18n
cqliu1 Oct 1, 2024
476f4c3
Fix linting
cqliu1 Oct 1, 2024
9214d49
Merge branch 'main' of https://github.com/elastic/kibana into dashboa…
cqliu1 Oct 1, 2024
c8fca47
[CI] Auto-commit changed files from 'node scripts/eslint --no-cache -…
kibanamachine Oct 1, 2024
03fbbb6
Fix panel actions test
cqliu1 Oct 2, 2024
0e637fc
Merge branch 'dashboard/floating-actions-for-panels' of https://githu…
cqliu1 Oct 2, 2024
02158cf
Merge branch 'main' of https://github.com/elastic/kibana into dashboa…
cqliu1 Oct 2, 2024
073389d
Fix hover actions icons vertical alignment
cqliu1 Oct 2, 2024
70901a6
[CI] Auto-commit changed files from 'node scripts/eslint --no-cache -…
kibanamachine Oct 2, 2024
de534f8
Remove unused import
cqliu1 Oct 2, 2024
be44fea
Merge branch 'main' of https://github.com/elastic/kibana into dashboa…
cqliu1 Oct 3, 2024
d1a0ac5
Refactor hover actions component
cqliu1 Oct 3, 2024
424b7a9
Merge branch 'dashboard/floating-actions-for-panels' of https://githu…
cqliu1 Oct 4, 2024
d19bbb5
Always scroll panel into view
cqliu1 Oct 5, 2024
4de2d91
Lock hover actions for actions that open a popover
cqliu1 Oct 7, 2024
9d1d044
Fix locked hover actions for lens (legacy) embeddables
cqliu1 Oct 7, 2024
4ea0297
Merge branch 'main' of https://github.com/elastic/kibana into dashboa…
cqliu1 Oct 8, 2024
27c7efb
Fix disappearing move handle
cqliu1 Oct 8, 2024
872ccb8
Fix security test
cqliu1 Oct 9, 2024
9c94292
Merge branch 'main' of https://github.com/elastic/kibana into dashboa…
cqliu1 Oct 10, 2024
6fee0e4
Remove console log
cqliu1 Oct 11, 2024
13347e9
Fix react embeddable system jest test
cqliu1 Oct 12, 2024
f524345
Fix jest test
cqliu1 Oct 12, 2024
897af0a
Fix scroll margin top for panels with inline edit open
cqliu1 Oct 14, 2024
62dbe60
Add topOffsetOrOptions to web element wrapper moveMouseTo
cqliu1 Oct 15, 2024
f94c95b
Merge branch 'main' of https://github.com/elastic/kibana into dashboa…
cqliu1 Oct 15, 2024
545c38d
Clean up panel actions
cqliu1 Oct 15, 2024
8abbf12
Fix ts errors
cqliu1 Oct 15, 2024
ca77b43
Merge branch 'main' of https://github.com/elastic/kibana into dashboa…
cqliu1 Oct 15, 2024
c2b69dd
Merge branch 'main' of https://github.com/elastic/kibana into dashboa…
cqliu1 Oct 16, 2024
30a7ed2
Fix await in expect not linked to library
cqliu1 Oct 16, 2024
fbf644d
Fix copy panel to test
cqliu1 Oct 21, 2024
6067107
Merge branch 'main' of https://github.com/elastic/kibana into dashboa…
cqliu1 Oct 21, 2024
67e4a6b
Merge branch 'main' of https://github.com/elastic/kibana into dashboa…
cqliu1 Oct 21, 2024
d429c69
Hide Edit filters in view mode
cqliu1 Oct 22, 2024
664aec4
Make DASHBOARD_ACTION_GROUP immutable
cqliu1 Oct 22, 2024
41611f0
Remove empty footer in filter notification
cqliu1 Oct 22, 2024
a46f023
Blur hover actions on click to prevent tooltip from losing anchor
cqliu1 Oct 22, 2024
152122f
Calculate global nav height for panel scroll-margin-top
cqliu1 Oct 22, 2024
9d849c2
Merge branch 'main' into dashboard/floating-actions-for-panels
cqliu1 Oct 22, 2024
0a3e3a7
Fix filters notification popover tests
cqliu1 Oct 22, 2024
3ec25a0
Merge branch 'dashboard/floating-actions-for-panels' of https://githu…
cqliu1 Oct 22, 2024
13e899f
Merge branch 'main' into dashboard/floating-actions-for-panels
cqliu1 Oct 22, 2024
d68dec7
Merge branch 'main' into dashboard/floating-actions-for-panels
cqliu1 Oct 23, 2024
6590f5c
Merge branch 'main' into dashboard/floating-actions-for-panels
cqliu1 Oct 23, 2024
5a02661
Merge branch 'main' into dashboard/floating-actions-for-panels
shahzad31 Oct 24, 2024
4994f4b
Update dashboard bundle size limit
cqliu1 Oct 24, 2024
98a7323
Merge branch 'dashboard/floating-actions-for-panels' of https://githu…
cqliu1 Oct 24, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions packages/kbn-panel-loader/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,11 @@ export const PanelLoader = (props: {
showShadow?: boolean;
showBorder?: boolean;
dataTestSubj?: string;
className?: string;
}) => {
return (
<EuiPanel
className={props.className}
Heenawter marked this conversation as resolved.
Show resolved Hide resolved
css={css`
z-index: auto;
flex: 1;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ import { Action, IncompatibleActionError } from '@kbn/ui-actions-plugin/public';
import { PresentationContainer } from '@kbn/presentation-containers';
import { pluginServices } from '../services/plugin_services';
import { dashboardAddToLibraryActionStrings } from './_dashboard_actions_strings';
import { dashboardActionGroup } from '.';

export const ACTION_ADD_TO_LIBRARY = 'saveToLibrary';

Expand All @@ -61,6 +62,7 @@ export class AddToLibraryAction implements Action<EmbeddableApiContext> {
public readonly type = ACTION_ADD_TO_LIBRARY;
public readonly id = ACTION_ADD_TO_LIBRARY;
public order = 8;
public grouping = [dashboardActionGroup];

private toastsService;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ import {
HasUniqueId,
} from '@kbn/presentation-publishing';
import { Action, IncompatibleActionError } from '@kbn/ui-actions-plugin/public';
import { dashboardActionGroup } from '.';
import { dashboardClonePanelActionStrings } from './_dashboard_actions_strings';

export const ACTION_CLONE_PANEL = 'clonePanel';
Expand All @@ -41,6 +42,7 @@ export class ClonePanelAction implements Action<EmbeddableApiContext> {
public readonly type = ACTION_CLONE_PANEL;
public readonly id = ACTION_CLONE_PANEL;
public order = 45;
public grouping = [dashboardActionGroup];

constructor() {}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ import { DashboardPluginInternalFunctions } from '../dashboard_container/externa
import { pluginServices } from '../services/plugin_services';
import { CopyToDashboardModal } from './copy_to_dashboard_modal';
import { dashboardCopyToDashboardActionStrings } from './_dashboard_actions_strings';
import { dashboardActionGroup } from '.';

export const ACTION_COPY_TO_DASHBOARD = 'copyToDashboard';

Expand Down Expand Up @@ -57,6 +58,7 @@ export class CopyToDashboardAction implements Action<EmbeddableApiContext> {
public readonly type = ACTION_COPY_TO_DASHBOARD;
public readonly id = ACTION_COPY_TO_DASHBOARD;
public order = 1;
public grouping = [dashboardActionGroup];

private dashboardCapabilities;
private openModal;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,18 @@ describe('Expand panel action', () => {
let action: ExpandPanelAction;
let context: { embeddable: ExpandPanelActionApi };

let updateExpandPanelId: (id?: string) => void;

beforeEach(() => {
const expandPanelIdSubject = new BehaviorSubject<string | undefined>(undefined);
updateExpandPanelId = (id) => expandPanelIdSubject.next(id);
action = new ExpandPanelAction();
context = {
embeddable: {
uuid: 'superId',
parentApi: {
expandPanel: jest.fn(),
expandedPanelId: new BehaviorSubject<string | undefined>(undefined),
expandedPanelId: expandPanelIdSubject,
Heenawter marked this conversation as resolved.
Show resolved Hide resolved
},
},
};
Expand All @@ -38,19 +42,22 @@ describe('Expand panel action', () => {
expect(await action.isCompatible(emptyContext)).toBe(false);
});

it('calls onChange when expandedPanelId changes', async () => {
const onChange = jest.fn();
updateExpandPanelId('superPanelId');
action.subscribeToCompatibilityChanges(context, onChange);
expect(onChange).toHaveBeenCalledWith(true, action);
});
Heenawter marked this conversation as resolved.
Show resolved Hide resolved

it('returns the correct icon based on expanded panel id', async () => {
expect(await action.getIconType(context)).toBe('expand');
context.embeddable.parentApi.expandedPanelId = new BehaviorSubject<string | undefined>(
'superPanelId'
);
updateExpandPanelId('superPanelId');
expect(await action.getIconType(context)).toBe('minimize');
});

it('returns the correct display name based on expanded panel id', async () => {
expect(await action.getDisplayName(context)).toBe('Maximize');
context.embeddable.parentApi.expandedPanelId = new BehaviorSubject<string | undefined>(
'superPanelId'
);
updateExpandPanelId('superPanelId');
expect(await action.getDisplayName(context)).toBe('Minimize');
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import {
HasUniqueId,
} from '@kbn/presentation-publishing';
import { Action, IncompatibleActionError } from '@kbn/ui-actions-plugin/public';
import { dashboardActionGroup } from '.';

import { dashboardExpandPanelActionStrings } from './_dashboard_actions_strings';

Expand All @@ -29,7 +30,8 @@ const isApiCompatible = (api: unknown | null): api is ExpandPanelActionApi =>
export class ExpandPanelAction implements Action<EmbeddableApiContext> {
public readonly type = ACTION_EXPAND_PANEL;
public readonly id = ACTION_EXPAND_PANEL;
public order = 7;
public order = 9;
public grouping = [dashboardActionGroup];

constructor() {}

Expand All @@ -49,6 +51,20 @@ export class ExpandPanelAction implements Action<EmbeddableApiContext> {
return isApiCompatible(embeddable);
}

public couldBecomeCompatible({ embeddable }: EmbeddableApiContext) {
return apiHasParentApi(embeddable) && apiCanExpandPanels(embeddable.parentApi);
}

public subscribeToCompatibilityChanges(
{ embeddable }: EmbeddableApiContext,
onChange: (isCompatible: boolean, action: ExpandPanelAction) => void
) {
if (!isApiCompatible(embeddable)) return;
return embeddable.parentApi.expandedPanelId.subscribe(() => {
onChange(isApiCompatible(embeddable), this);
});
cqliu1 marked this conversation as resolved.
Show resolved Hide resolved
}

public async execute({ embeddable }: EmbeddableApiContext) {
if (!isApiCompatible(embeddable)) throw new IncompatibleActionError();
embeddable.parentApi.expandPanel(embeddable.uuid);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ const isApiCompatible = (api: unknown | null): api is ExportCsvActionApi =>
export class ExportCSVAction implements Action<ExportContext> {
public readonly id = ACTION_EXPORT_CSV;
public readonly type = ACTION_EXPORT_CSV;
public readonly order = 18; // right after Export in discover which is 19
public readonly order = 17; // right after Export in discover which is 19
Heenawter marked this conversation as resolved.
Show resolved Hide resolved

private fieldFormats;
private uiSettings;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@

import { Filter, FilterStateStore, type AggregateQuery, type Query } from '@kbn/es-query';

import { ViewMode } from '@kbn/presentation-publishing';
import { BehaviorSubject } from 'rxjs';
import {
FiltersNotificationAction,
Expand Down Expand Up @@ -42,22 +41,17 @@ describe('filters notification action', () => {

let updateFilters: (filters: Filter[]) => void;
let updateQuery: (query: Query | AggregateQuery | undefined) => void;
let updateViewMode: (viewMode: ViewMode) => void;

beforeEach(() => {
const filtersSubject = new BehaviorSubject<Filter[] | undefined>(undefined);
updateFilters = (filters) => filtersSubject.next(filters);
const querySubject = new BehaviorSubject<Query | AggregateQuery | undefined>(undefined);
updateQuery = (query) => querySubject.next(query);

const viewModeSubject = new BehaviorSubject<ViewMode>('edit');
updateViewMode = (viewMode) => viewModeSubject.next(viewMode);

action = new FiltersNotificationAction();
context = {
embeddable: {
uuid: 'testId',
viewMode: viewModeSubject,
parentApi: {
getAllDataViews: jest.fn(),
getDashboardPanelFromId: jest.fn(),
Expand Down Expand Up @@ -87,22 +81,6 @@ describe('filters notification action', () => {
expect(await action.isCompatible(context)).toBe(true);
});

it('is incompatible when api is in view mode', async () => {
updateFilters([getMockPhraseFilter('SuperField', 'SuperValue')]);
updateQuery({ esql: 'FROM test_dataview' } as AggregateQuery);
updateViewMode('view');
expect(await action.isCompatible(context)).toBe(false);
});

it('calls onChange when view mode changes', () => {
const onChange = jest.fn();
updateFilters([getMockPhraseFilter('SuperField', 'SuperValue')]);
updateQuery({ esql: 'FROM test_dataview' } as AggregateQuery);
action.subscribeToCompatibilityChanges(context, onChange);
updateViewMode('view');
expect(onChange).toHaveBeenCalledWith(false, action);
});

it('calls onChange when filters change', async () => {
const onChange = jest.fn();
action.subscribeToCompatibilityChanges(context, onChange);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,9 @@ import { createKibanaReactContext } from '@kbn/kibana-react-plugin/public';
import { Action, IncompatibleActionError } from '@kbn/ui-actions-plugin/public';

import {
apiCanAccessViewMode,
apiPublishesPartialUnifiedSearch,
apiHasUniqueId,
CanAccessViewMode,
EmbeddableApiContext,
getInheritedViewMode,
getViewModeSubject,
HasParentApi,
PublishesUnifiedSearch,
HasUniqueId,
Expand All @@ -34,17 +30,14 @@ import { dashboardFilterNotificationActionStrings } from './_dashboard_actions_s
export const BADGE_FILTERS_NOTIFICATION = 'ACTION_FILTERS_NOTIFICATION';

export type FiltersNotificationActionApi = HasUniqueId &
CanAccessViewMode &
Partial<PublishesUnifiedSearch> &
HasParentApi<DashboardPluginInternalFunctions>;

const isApiCompatible = (api: unknown | null): api is FiltersNotificationActionApi =>
Boolean(
apiHasUniqueId(api) && apiCanAccessViewMode(api) && apiPublishesPartialUnifiedSearch(api)
);
Boolean(apiHasUniqueId(api) && apiPublishesPartialUnifiedSearch(api));

const compatibilityCheck = (api: EmbeddableApiContext['embeddable']) => {
if (!isApiCompatible(api) || getInheritedViewMode(api) !== 'edit') return false;
if (!isApiCompatible(api)) return false;
const query = api.query$?.value;
return (
(api.filters$?.value ?? []).length > 0 ||
Expand Down Expand Up @@ -103,9 +96,7 @@ export class FiltersNotificationAction implements Action<EmbeddableApiContext> {
) {
if (!isApiCompatible(embeddable)) return;
return merge(
...[embeddable.query$, embeddable.filters$, getViewModeSubject(embeddable)].filter((value) =>
Boolean(value)
)
...[embeddable.query$, embeddable.filters$].filter((value) => Boolean(value))
Heenawter marked this conversation as resolved.
Show resolved Hide resolved
).subscribe(() => onChange(compatibilityCheck(embeddable), this));
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
import { AggregateQuery, Filter, FilterStateStore, Query } from '@kbn/es-query';
import { I18nProvider } from '@kbn/i18n-react';
import { waitForEuiPopoverOpen } from '@elastic/eui/lib/test/rtl';
import { ViewMode } from '@kbn/presentation-publishing';
import { render, screen } from '@testing-library/react';
import userEvent from '@testing-library/user-event';
import React from 'react';
Expand Down Expand Up @@ -59,7 +58,6 @@ describe('filters notification popover', () => {

api = {
uuid: 'testId',
viewMode: new BehaviorSubject<ViewMode>('edit'),
parentApi: {
getAllDataViews: jest.fn(),
getDashboardPanelFromId: jest.fn(),
Expand Down
2 changes: 2 additions & 0 deletions src/plugins/dashboard/public/dashboard_actions/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ interface BuildAllDashboardActionsProps {
plugins: DashboardStartDependencies;
}

export const dashboardActionGroup = { id: 'dashboard_actions', order: 10 };
cqliu1 marked this conversation as resolved.
Show resolved Hide resolved

export const buildAllDashboardActions = async ({
core,
plugins,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ import {
HasLegacyLibraryTransforms,
} from '@kbn/presentation-publishing';
import { Action, IncompatibleActionError } from '@kbn/ui-actions-plugin/public';
import { dashboardActionGroup } from '.';
import { pluginServices } from '../services/plugin_services';
import { dashboardAddToLibraryActionStrings } from './_dashboard_actions_strings';

Expand All @@ -34,6 +35,7 @@ export class LegacyAddToLibraryAction implements Action<EmbeddableApiContext> {
public readonly type = ACTION_LEGACY_ADD_TO_LIBRARY;
public readonly id = ACTION_LEGACY_ADD_TO_LIBRARY;
public order = 15;
public grouping = [dashboardActionGroup];

private toastsService;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ import {
} from '@kbn/presentation-publishing';
import { pluginServices } from '../services/plugin_services';
import { dashboardUnlinkFromLibraryActionStrings } from './_dashboard_actions_strings';
import { dashboardActionGroup } from '.';

export const ACTION_LEGACY_UNLINK_FROM_LIBRARY = 'legacyUnlinkFromLibrary';

Expand All @@ -37,6 +38,7 @@ export class LegacyUnlinkFromLibraryAction implements Action<EmbeddableApiContex
public readonly type = ACTION_LEGACY_UNLINK_FROM_LIBRARY;
public readonly id = ACTION_LEGACY_UNLINK_FROM_LIBRARY;
public order = 15;
public grouping = [dashboardActionGroup];

private toastsService;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ import {
import { PresentationContainer } from '@kbn/presentation-containers';
import { pluginServices } from '../services/plugin_services';
import { dashboardUnlinkFromLibraryActionStrings } from './_dashboard_actions_strings';
import { dashboardActionGroup } from '.';

export const ACTION_UNLINK_FROM_LIBRARY = 'unlinkFromLibrary';

Expand All @@ -54,6 +55,7 @@ export class UnlinkFromLibraryAction implements Action<EmbeddableApiContext> {
public readonly type = ACTION_UNLINK_FROM_LIBRARY;
public readonly id = ACTION_UNLINK_FROM_LIBRARY;
public order = 15;
public grouping = [dashboardActionGroup];

private toastsService;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
.dshLayout--editing {
.react-resizable-handle {
@include size($euiSizeL);
z-index: $euiZLevel1; /* 1 */
z-index: $euiZLevel2; /* 1 */
right: 0;
bottom: 0;
padding-right: $euiSizeS;
Expand All @@ -33,15 +33,18 @@
*/
.dshLayout-isMaximizedPanel {
height: 100% !important; /* 1. */

.embPanel__hoverActionsLeft {
visibility: hidden;
}
}

/**
* When a single panel is expanded, all the other panels moved offscreen.
* Shifting the rendered panels offscreen prevents a quick flash when redrawing the panels on minimize
*/
.dshDashboardGrid__item--hidden {
top: -9999px;
left: -9999px;
transform: translate(-9999px, -9999px);
}

/**
Expand Down Expand Up @@ -98,13 +101,25 @@
*/
&.resizing,
&.react-draggable-dragging {
z-index: $euiZLevel2 !important;
z-index: $euiZLevel3 !important;
}

&.react-draggable-dragging {
transition: box-shadow $euiAnimSpeedFast $euiAnimSlightResistance;
@include euiBottomShadowLarge;
border-radius: $euiBorderRadius; // keeps shadow within bounds

.embPanel__hoverActionsWrapper {
top: -$euiSizeXL;
}

.embPanel__hoverActionsLeft {
opacity: 1 !important;
}

.embPanel__hoverActionsRight {
opacity: 0 !important;
}
cqliu1 marked this conversation as resolved.
Show resolved Hide resolved
}

/**
Expand Down
Loading