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

[Drilldowns] Dashboard to dashboard drilldown #63108

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
116 commits
Select commit Hold shift + click to select a range
813a896
partial progress on async loading / searching of dashboard titles
mattkime Mar 13, 2020
65ff148
feat: 🎸 make combobox full width
streamich Mar 13, 2020
d46fcf0
filtering combobox polish
mattkime Mar 16, 2020
6e11bc2
Merge branch 'drilldowns_load_dashboard_list' of github.com:mattkime/…
mattkime Mar 16, 2020
699d853
storybook fix
mattkime Mar 16, 2020
d3ac7ad
implement navigating to dashboard, seems like a type problem
mattkime Mar 17, 2020
a5ee274
Merge branch 'drilldowns' into drilldowns_load_dashboard_list
mattkime Mar 17, 2020
4369399
try navToApp
mattkime Mar 17, 2020
94b08ae
Merge branch 'drilldowns' into drilldowns_load_dashboard_list
mattkime Mar 17, 2020
86f9768
Merge remote-tracking branch 'upstream/drilldowns' into drilldowns_lo…
mattkime Mar 17, 2020
a276b96
filter out current dashboard
mattkime Mar 17, 2020
a112732
Merge branch 'drilldowns' into drilldowns_load_dashboard_list
mattkime Mar 17, 2020
3b39dcd
rough draft linking to a dashboard
mattkime Mar 18, 2020
0bbf360
remove note
mattkime Mar 18, 2020
636d9ab
typefix
mattkime Mar 18, 2020
6ea19aa
fix navigation from dashboard to dashboard
Dosant Mar 18, 2020
0178ff5
Merge branch 'drilldowns' into drilldowns_load_dashboard_list
mattkime Mar 19, 2020
a431e86
partial progress getting filters from action data
mattkime Mar 20, 2020
4217b18
fix issue with getIndexPatterns undefined
Dosant Mar 20, 2020
177822f
fix filter / time passing into url
Dosant Mar 20, 2020
8bcbc1b
Merge branch 'drilldowns' into drilldowns_load_dashboard_list
mattkime Mar 21, 2020
f7b7add
typefix
mattkime Mar 21, 2020
346dc40
Merge branch 'drilldowns_load_dashboard_list' of github.com:mattkime/…
mattkime Mar 21, 2020
bd7a91c
dashboard to dashboard drilldown functional test and back button fix
Dosant Mar 21, 2020
5ea7818
documentation update
mattkime Mar 21, 2020
8297b55
Merge branch 'drilldowns' into drilldowns_load_dashboard_list
mattkime Mar 22, 2020
feccdfc
Merge branch 'drilldowns' into drilldowns_load_dashboard_list
mattkime Mar 22, 2020
29e885c
Merge branch 'drilldowns' of github.com:elastic/kibana into dev/drill…
Dosant Mar 23, 2020
100c4f0
chore clean-ups
Dosant Mar 23, 2020
340fd89
basic unit test for dashboard drilldown
Dosant Mar 23, 2020
406facd
remove test todos
Dosant Mar 23, 2020
d894574
Merge branch 'drilldowns' of github.com:elastic/kibana into dev/drill…
Dosant Mar 23, 2020
bf9e505
remove config
Dosant Mar 23, 2020
a24e29a
Merge branch 'drilldowns' into drilldowns_load_dashboard_list
mattkime Mar 23, 2020
d7633b3
improve back button with filter comparison tweak
Dosant Mar 23, 2020
59101ef
dashboard filters/date option off by default
Dosant Mar 23, 2020
9fdb358
Merge branch 'drilldowns_load_dashboard_list' of github.com:mattkime/…
mattkime Mar 23, 2020
bb308d6
revert change to config/kibana.yml
mattkime Mar 23, 2020
8d10133
Merge branch 'drilldowns' into drilldowns_load_dashboard_list
streamich Mar 23, 2020
31e28a3
remove unneeded comments
mattkime Mar 23, 2020
38ec7a0
use default time range as appropriate
mattkime Mar 24, 2020
c3708ca
Merge branch 'drilldowns' into drilldowns_load_dashboard_list
mattkime Mar 24, 2020
4a8d4a1
fix type, add filter icon, add text
mattkime Mar 24, 2020
0deb6b4
fix test
mattkime Mar 24, 2020
6a78486
change how time range is restored and improve back button for drilldowns
Dosant Mar 24, 2020
bc3fdd4
Merge branch 'drilldowns' into drilldowns_load_dashboard_list
mattkime Apr 3, 2020
8deeaa9
Merge branch 'drilldowns' of github.com:elastic/kibana into drilldown…
Dosant Apr 7, 2020
514561b
resolve conflicts
Dosant Apr 7, 2020
40e396c
fix async compile issue
mattkime Apr 8, 2020
a9b86a9
remove redundant test
Dosant Apr 8, 2020
af4a20f
wip
Dosant Apr 8, 2020
f391fb6
Merge branch 'drilldowns' of github.com:elastic/kibana into dev/drill…
Dosant Apr 9, 2020
2c070b8
wip
Dosant Apr 9, 2020
520b3b0
fix
Dosant Apr 9, 2020
5ef56b8
temp skip tests
Dosant Apr 9, 2020
07bee63
fix
Dosant Apr 9, 2020
a14439e
handle missing dashboard edge case
Dosant Apr 9, 2020
155cce3
Merge branch 'drilldowns' of github.com:elastic/kibana into dev/drill…
Dosant Apr 9, 2020
af1ab76
fix api
Dosant Apr 9, 2020
f911f43
Merge branch 'drilldowns' of github.com:elastic/kibana into dev/drill…
Dosant Apr 9, 2020
baf61ba
refactor action filter creation utils
ppisljar Apr 8, 2020
4d57fcc
updating
ppisljar Apr 14, 2020
66c9906
updating docs
ppisljar Apr 14, 2020
1627839
Merge branch 'master' of github.com:elastic/kibana into dev/drilldown…
Dosant Apr 14, 2020
451f2a8
improve
Dosant Apr 14, 2020
4cd3c23
fix storybook
Dosant Apr 14, 2020
0733762
Merge branch 'drilldowns' of github.com:elastic/kibana into dev/drill…
Dosant Apr 16, 2020
08597a1
post merge fixes
Dosant Apr 16, 2020
bc6d22f
fix payload emitted in brush event
Dosant Apr 16, 2020
ede5e98
properly export createRange action
Dosant Apr 16, 2020
c2aed7a
improve tests
Dosant Apr 16, 2020
75d6725
Merge branch 'drilldowns' of github.com:elastic/kibana into dev/drill…
Dosant Apr 16, 2020
e4be53a
Merge branch 'master' of github.com:elastic/kibana into cleanup/visev…
Dosant Apr 16, 2020
84f653b
add test
Dosant Apr 16, 2020
b3e45ba
Merge branch 'drilldowns' of github.com:elastic/kibana into dev/drill…
Dosant Apr 16, 2020
4ce982a
Merge branch 'cleanup/visevents' of github.com:ppisljar/kibana into d…
Dosant Apr 16, 2020
ba458c7
post merge fixes
Dosant Apr 16, 2020
8a00d65
improve
Dosant Apr 16, 2020
73a1566
fix
Dosant Apr 16, 2020
952d6cd
improve
Dosant Apr 16, 2020
d686351
fix build
Dosant Apr 17, 2020
2455d93
Merge branch 'drilldowns' of github.com:elastic/kibana into dev/drill…
Dosant Apr 17, 2020
cac9633
wip getHref support
Dosant Apr 17, 2020
b4837a3
implement getHref()
Dosant Apr 17, 2020
0825062
give proper name to a story
Dosant Apr 17, 2020
98251da
use sync start services
Dosant Apr 17, 2020
7010b18
update text
Dosant Apr 17, 2020
ed71dc5
fix types
Dosant Apr 17, 2020
6ca0d93
fix ts
Dosant Apr 17, 2020
930fd2a
Merge branch 'drilldowns' of github.com:elastic/kibana into dev/drill…
Dosant Apr 21, 2020
1ac52d0
fix docs
Dosant Apr 21, 2020
bb7f7d3
move clone below drilldowns (near replace)
Dosant Apr 21, 2020
8c4e836
remove redundant comments
Dosant Apr 21, 2020
73eadb0
refactor action filter creation utils
ppisljar Apr 8, 2020
810c5d5
updating
ppisljar Apr 14, 2020
974527f
updating docs
ppisljar Apr 14, 2020
f1f4666
fix payload emitted in brush event
Dosant Apr 16, 2020
997aad6
properly export createRange action
Dosant Apr 16, 2020
fee20fc
some more updates
ppisljar Apr 21, 2020
0553da9
fixing types
ppisljar Apr 21, 2020
6c223c3
...
ppisljar Apr 21, 2020
fc972f1
inline EventData
Dosant Apr 21, 2020
d7cf94e
fix typescript in lens and update docs
Dosant Apr 21, 2020
2d81b0c
Merge branch 'drilldowns' of github.com:elastic/kibana into dev/drill…
Dosant Apr 21, 2020
043e498
Merge branch 'cleanup/visevents' of github.com:ppisljar/kibana into d…
Dosant Apr 21, 2020
4c9816e
improve filters types
Dosant Apr 21, 2020
99327a8
docs
Dosant Apr 21, 2020
1076f12
Merge branch 'drilldowns' of github.com:elastic/kibana into dev/drill…
Dosant Apr 22, 2020
aca9c8a
merge
Dosant Apr 22, 2020
6e1d768
Merge branch 'drilldowns' of github.com:elastic/kibana into dev/drill…
Dosant Apr 22, 2020
b83ee56
merge
Dosant Apr 22, 2020
8566cbc
@mdefazio review
Dosant Apr 22, 2020
218d66f
adjust actions order
Dosant Apr 22, 2020
0785dc6
Merge branch 'drilldowns' of github.com:elastic/kibana into dev/drill…
Dosant Apr 23, 2020
0997398
docs
Dosant Apr 23, 2020
8ec37f5
@stacey-gammon review
Dosant Apr 24, 2020
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
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ esFilters: {
generateFilters: typeof generateFilters;
onlyDisabledFiltersChanged: (newFilters?: import("../common").Filter[] | undefined, oldFilters?: import("../common").Filter[] | undefined) => boolean;
changeTimeFilter: typeof changeTimeFilter;
convertRangeFilterToTimeRangeString: typeof convertRangeFilterToTimeRangeString;
mapAndFlattenFilters: (filters: import("../common").Filter[]) => import("../common").Filter[];
extractTimeFilter: typeof extractTimeFilter;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ export interface ClonePanelActionContext {
export class ClonePanelAction implements ActionByType<typeof ACTION_CLONE_PANEL> {
public readonly type = ACTION_CLONE_PANEL;
public readonly id = ACTION_CLONE_PANEL;
public order = 11;
public order = 45;
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Adjusted to follow: #60138 (comment)


constructor(private core: CoreStart) {}

Expand Down
1 change: 1 addition & 0 deletions src/plugins/data/public/actions/apply_filter_action.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ export function createFilterAction(
return createAction<typeof ACTION_GLOBAL_APPLY_FILTER>({
type: ACTION_GLOBAL_APPLY_FILTER,
id: ACTION_GLOBAL_APPLY_FILTER,
getIconType: () => 'filter',
getDisplayName: () => {
return i18n.translate('data.filter.applyFilterActionTitle', {
defaultMessage: 'Apply filter to current view',
Expand Down
2 changes: 2 additions & 0 deletions src/plugins/data/public/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ import {
changeTimeFilter,
mapAndFlattenFilters,
extractTimeFilter,
convertRangeFilterToTimeRangeString,
} from './query';

// Filter helpers namespace:
Expand Down Expand Up @@ -96,6 +97,7 @@ export const esFilters = {
onlyDisabledFiltersChanged,

changeTimeFilter,
convertRangeFilterToTimeRangeString,
mapAndFlattenFilters,
extractTimeFilter,
};
Expand Down
98 changes: 50 additions & 48 deletions src/plugins/data/public/public.api.md

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion src/plugins/data/public/query/timefilter/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,5 +23,5 @@ export * from './types';
export { Timefilter, TimefilterContract } from './timefilter';
export { TimeHistory, TimeHistoryContract } from './time_history';
export { getTime } from './get_time';
export { changeTimeFilter } from './lib/change_time_filter';
export { changeTimeFilter, convertRangeFilterToTimeRangeString } from './lib/change_time_filter';
export { extractTimeFilter } from './lib/extract_time_filter';
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
import moment from 'moment';
import { keys } from 'lodash';
import { TimefilterContract } from '../../timefilter';
import { RangeFilter } from '../../../../common';
import { RangeFilter, TimeRange } from '../../../../common';

export function convertRangeFilterToTimeRange(filter: RangeFilter) {
const key = keys(filter.range)[0];
Expand All @@ -32,6 +32,14 @@ export function convertRangeFilterToTimeRange(filter: RangeFilter) {
};
}

export function convertRangeFilterToTimeRangeString(filter: RangeFilter): TimeRange {
const { from, to } = convertRangeFilterToTimeRange(filter);
return {
from: from?.toISOString(),
to: to?.toISOString(),
};
}

export function changeTimeFilter(timeFilter: TimefilterContract, filter: RangeFilter) {
timeFilter.setTime(convertRangeFilterToTimeRange(filter));
}
2 changes: 2 additions & 0 deletions src/plugins/embeddable/public/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,8 @@ export {
withEmbeddableSubscription,
SavedObjectEmbeddableInput,
isSavedObjectEmbeddableInput,
isRangeSelectTriggerContext,
isValueClickTriggerContext,
} from './lib';

export function plugin(initializerContext: PluginInitializerContext) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ function renderNotifications(
) {
return notifications.map(notification => (
<EuiNotificationBadge
data-test-subj={`embeddablePanelNotification-${notification.id}`}
key={notification.id}
style={{ marginTop: '4px', marginRight: '4px' }}
onClick={() => notification.execute({ embeddable })}
Expand Down
18 changes: 13 additions & 5 deletions src/plugins/embeddable/public/lib/triggers/triggers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,16 +17,16 @@
* under the License.
*/

import { Trigger } from '../../../../ui_actions/public';
import { KibanaDatatable } from '../../../../expressions';
import { Trigger } from '../../../../ui_actions/public';
import { IEmbeddable } from '..';

export interface EmbeddableContext {
embeddable: IEmbeddable;
}

export interface ValueClickTriggerContext {
embeddable?: IEmbeddable;
export interface ValueClickTriggerContext<T extends IEmbeddable = IEmbeddable> {
embeddable?: T;
timeFieldName?: string;
data: {
data: Array<{
Expand All @@ -39,8 +39,12 @@ export interface ValueClickTriggerContext {
};
}

export interface RangeSelectTriggerContext {
embeddable?: IEmbeddable;
export const isValueClickTriggerContext = (
context: ValueClickTriggerContext | RangeSelectTriggerContext
): context is ValueClickTriggerContext => context.data && 'data' in context.data;

export interface RangeSelectTriggerContext<T extends IEmbeddable = IEmbeddable> {
embeddable?: T;
timeFieldName?: string;
data: {
table: KibanaDatatable;
Expand All @@ -49,6 +53,10 @@ export interface RangeSelectTriggerContext {
};
}

export const isRangeSelectTriggerContext = (
context: ValueClickTriggerContext | RangeSelectTriggerContext
): context is RangeSelectTriggerContext => context.data && 'range' in context.data;

export const CONTEXT_MENU_TRIGGER = 'CONTEXT_MENU_TRIGGER';
export const contextMenuTrigger: Trigger<'CONTEXT_MENU_TRIGGER'> = {
id: CONTEXT_MENU_TRIGGER,
Expand Down
1 change: 1 addition & 0 deletions src/plugins/kibana_utils/public/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ export {
} from './state_sync';
export { removeQueryParam, redirectWhenMissing, ensureDefaultIndexPattern } from './history';
export { applyDiff } from './state_management/utils/diff_object';
export { createStartServicesGetter } from './core/create_start_service_getter';

/** dummy plugin, we just want kibanaUtils to have its own bundle */
export function plugin() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,11 @@ export function openContextMenu(
anchorPosition="downRight"
withTitle
>
<EuiContextMenu initialPanelId="mainMenu" panels={panels} />
<EuiContextMenu
initialPanelId="mainMenu"
panels={panels}
data-test-subj={props['data-test-subj']}
/>
</EuiPopover>,
container
);
Expand Down
4 changes: 3 additions & 1 deletion src/plugins/ui_actions/public/triggers/trigger_internal.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,8 @@ export class TriggerInternal<T extends TriggerId> {
title: this.trigger.title,
closeMenu: () => session.close(),
});
const session = openContextMenu([panel]);
const session = openContextMenu([panel], {
'data-test-subj': 'multipleActionsContextMenu',
});
}
}
2 changes: 1 addition & 1 deletion src/plugins/ui_actions/public/util/configurable.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
* under the License.
*/

import { UiComponent } from 'src/plugins/kibana_utils/common';
import { UiComponent } from 'src/plugins/kibana_utils/public';

/**
* Represents something that can be configured by user using UI.
Expand Down
27 changes: 23 additions & 4 deletions test/functional/page_objects/dashboard_page.ts
Original file line number Diff line number Diff line change
Expand Up @@ -104,16 +104,21 @@ export function DashboardPageProvider({ getService, getPageObjects }: FtrProvide

public async getDashboardIdFromCurrentUrl() {
const currentUrl = await browser.getCurrentUrl();
const urlSubstring = 'kibana#/dashboard/';
const startOfIdIndex = currentUrl.indexOf(urlSubstring) + urlSubstring.length;
const endIndex = currentUrl.indexOf('?');
const id = currentUrl.substring(startOfIdIndex, endIndex < 0 ? currentUrl.length : endIndex);
const id = this.getDashboardIdFromUrl(currentUrl);

log.debug(`Dashboard id extracted from ${currentUrl} is ${id}`);

return id;
}

public getDashboardIdFromUrl(url: string) {
const urlSubstring = 'kibana#/dashboard/';
const startOfIdIndex = url.indexOf(urlSubstring) + urlSubstring.length;
const endIndex = url.indexOf('?');
const id = url.substring(startOfIdIndex, endIndex < 0 ? url.length : endIndex);
return id;
}

/**
* Returns true if already on the dashboard landing page (that page doesn't have a link to itself).
* @returns {Promise<boolean>}
Expand Down Expand Up @@ -512,6 +517,20 @@ export function DashboardPageProvider({ getService, getPageObjects }: FtrProvide

return checkList.filter(viz => viz.isPresent === false).map(viz => viz.name);
}

public async getPanelDrilldownCount(panelIndex = 0): Promise<number> {
log.debug('getPanelDrilldownCount');
const panel = (await this.getDashboardPanels())[panelIndex];
try {
const count = await panel.findByTestSubject(
'embeddablePanelNotification-ACTION_PANEL_NOTIFICATIONS'
);
return Number.parseInt(await count.getVisibleText(), 10);
} catch (e) {
// if not found then this is 0 (we don't show badge with 0)
return 0;
}
}
}

return new DashboardPage();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ test('Pick and configure action', () => {
const screen = render(<Demo actionFactories={[dashboardFactory, urlFactory]} />);

// check that all factories are displayed to pick
expect(screen.getAllByTestId(TEST_SUBJ_ACTION_FACTORY_ITEM)).toHaveLength(2);
expect(screen.getAllByTestId(new RegExp(TEST_SUBJ_ACTION_FACTORY_ITEM))).toHaveLength(2);

// select URL one
fireEvent.click(screen.getByText(/Go to URL/i));
Expand All @@ -43,8 +43,8 @@ test('If only one actions factory is available then actionFactory selection is e
const screen = render(<Demo actionFactories={[urlFactory]} />);

// check that no factories are displayed to pick from
expect(screen.queryByTestId(TEST_SUBJ_ACTION_FACTORY_ITEM)).not.toBeInTheDocument();
expect(screen.queryByTestId(TEST_SUBJ_SELECTED_ACTION_FACTORY)).toBeInTheDocument();
expect(screen.queryByTestId(new RegExp(TEST_SUBJ_ACTION_FACTORY_ITEM))).not.toBeInTheDocument();
expect(screen.queryByTestId(new RegExp(TEST_SUBJ_SELECTED_ACTION_FACTORY))).toBeInTheDocument();

// Input url
const URL = 'https://elastic.co';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ interface SelectedActionFactoryProps {
onDeselect: () => void;
}

export const TEST_SUBJ_SELECTED_ACTION_FACTORY = 'selected-action-factory';
export const TEST_SUBJ_SELECTED_ACTION_FACTORY = 'selectedActionFactory';

const SelectedActionFactory: React.FC<SelectedActionFactoryProps> = ({
actionFactory,
Expand All @@ -118,7 +118,7 @@ const SelectedActionFactory: React.FC<SelectedActionFactoryProps> = ({
return (
<div
className="auaActionWizard__selectedActionFactoryContainer"
data-test-subj={TEST_SUBJ_SELECTED_ACTION_FACTORY}
data-test-subj={`${TEST_SUBJ_SELECTED_ACTION_FACTORY}-${actionFactory.id}`}
>
<header>
<EuiFlexGroup alignItems="center" gutterSize="s">
Expand Down Expand Up @@ -159,7 +159,7 @@ interface ActionFactorySelectorProps {
onActionFactorySelected: (actionFactory: ActionFactory) => void;
}

export const TEST_SUBJ_ACTION_FACTORY_ITEM = 'action-factory-item';
export const TEST_SUBJ_ACTION_FACTORY_ITEM = 'actionFactoryItem';

const ActionFactorySelector: React.FC<ActionFactorySelectorProps> = ({
actionFactories,
Expand All @@ -181,7 +181,7 @@ const ActionFactorySelector: React.FC<ActionFactorySelectorProps> = ({
<EuiKeyPadMenuItem
className="auaActionWizard__actionFactoryItem"
label={actionFactory.getDisplayName(context)}
data-test-subj={TEST_SUBJ_ACTION_FACTORY_ITEM}
data-test-subj={`${TEST_SUBJ_ACTION_FACTORY_ITEM}-${actionFactory.id}`}
onClick={() => onActionFactorySelected(actionFactory)}
>
{actionFactory.getIconType(context) && (
Expand Down
2 changes: 1 addition & 1 deletion x-pack/plugins/dashboard_enhanced/kibana.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@
"version": "kibana",
"server": false,
"ui": true,
"requiredPlugins": ["uiActions", "embeddable", "dashboard", "drilldowns"],
"requiredPlugins": ["data","uiActions", "embeddable", "dashboard", "drilldowns", "share"],
"configPath": ["xpack", "dashboardEnhanced"]
}
5 changes: 0 additions & 5 deletions x-pack/plugins/dashboard_enhanced/public/components/README.md

This file was deleted.

5 changes: 5 additions & 0 deletions x-pack/plugins/dashboard_enhanced/public/plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,21 +5,26 @@
*/

import { CoreStart, CoreSetup, Plugin, PluginInitializerContext } from 'src/core/public';
import { SharePluginStart, SharePluginSetup } from '../../../../src/plugins/share/public';
import { UiActionsSetup, UiActionsStart } from '../../../../src/plugins/ui_actions/public';
import { EmbeddableSetup, EmbeddableStart } from '../../../../src/plugins/embeddable/public';
import { DashboardDrilldownsService } from './services';
import { DataPublicPluginStart } from '../../../../src/plugins/data/public';
import { DrilldownsSetup, DrilldownsStart } from '../../drilldowns/public';

export interface SetupDependencies {
drilldowns: DrilldownsSetup;
embeddable: EmbeddableSetup;
uiActions: UiActionsSetup;
share: SharePluginSetup;
}

export interface StartDependencies {
drilldowns: DrilldownsStart;
embeddable: EmbeddableStart;
uiActions: UiActionsStart;
share: SharePluginStart;
data: DataPublicPluginStart;
}

// eslint-disable-next-line
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ const drilldowns = drilldownsPluginMock.createStartContract();
const uiActions = uiActionsPluginMock.createStartContract();

const actionParams: OpenFlyoutAddDrilldownParams = {
drilldowns: () => Promise.resolve(drilldowns),
overlays: () => Promise.resolve(overlays),
drilldowns: () => drilldowns,
overlays: () => overlays,
};

test('should create', () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ import { EmbeddableContext } from '../../../../../../../../src/plugins/embeddabl
export const OPEN_FLYOUT_ADD_DRILLDOWN = 'OPEN_FLYOUT_ADD_DRILLDOWN';

export interface OpenFlyoutAddDrilldownParams {
overlays: () => Promise<CoreStart['overlays']>;
drilldowns: () => Promise<DrilldownsStart>;
overlays: () => CoreStart['overlays'];
drilldowns: () => DrilldownsStart;
}

export class FlyoutCreateDrilldownAction implements ActionByType<typeof OPEN_FLYOUT_ADD_DRILLDOWN> {
Expand Down Expand Up @@ -50,8 +50,8 @@ export class FlyoutCreateDrilldownAction implements ActionByType<typeof OPEN_FLY
}

public async execute(context: EmbeddableContext) {
const overlays = await this.params.overlays();
const drilldowns = await this.params.drilldowns();
const overlays = this.params.overlays();
const drilldowns = this.params.drilldowns();
const { embeddable } = context;

if (!isEnhancedEmbeddable(embeddable)) {
Expand All @@ -71,6 +71,7 @@ export class FlyoutCreateDrilldownAction implements ActionByType<typeof OPEN_FLY
),
{
ownFocus: true,
'data-test-subj': 'createDrilldownFlyout',
}
);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@ uiActionsPlugin.setup.registerActionFactory({
});

const actionParams: FlyoutEditDrilldownParams = {
drilldowns: () => Promise.resolve(drilldowns),
overlays: () => Promise.resolve(overlays),
drilldowns: () => drilldowns,
overlays: () => overlays,
};

test('should create', () => {
Expand Down
Loading