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 #59632

Merged
merged 109 commits into from
Mar 24, 2020
Merged
Changes from 1 commit
Commits
Show all changes
109 commits
Select commit Hold shift + click to select a range
502a60a
Add drilldown wizard components
Dosant Mar 9, 2020
a7ed6ab
Dynamic actions (#58216)
streamich Mar 9, 2020
43583c2
Drilldown context menu (#59638)
streamich Mar 9, 2020
e145241
Add basic ActionFactoryService. Pass data from it into components ins…
Dosant Mar 9, 2020
81e6bcb
Dashboard x pack (#59653)
streamich Mar 9, 2020
1f2cc4c
feat: 🎸 "implement" registerDrilldown() method
streamich Mar 9, 2020
86885c4
fix ConfigurableBaseConfig type
Dosant Mar 9, 2020
6463118
Implement connected flyout_manage_drilldowns component
Dosant Mar 9, 2020
dcacf10
Merge branch 'master' of github.com:elastic/kibana into drilldowns
Dosant Mar 9, 2020
26dfa30
Merge branch 'master' of github.com:elastic/kibana into drilldowns
Dosant Mar 10, 2020
d3cd9e8
Simplify connected flyout manage drilldowns component. Remove interme…
Dosant Mar 10, 2020
1077518
Merge branch 'master' of github.com:elastic/kibana into drilldowns
Dosant Mar 10, 2020
840e873
clean up data-testid workaround in new components
Dosant Mar 10, 2020
f057979
Connect welcome message to storage
Dosant Mar 10, 2020
d60fc96
require `context` in Presentable. drill context down through wizard c…
Dosant Mar 10, 2020
140c5dc
Drilldown factory (#59823)
streamich Mar 10, 2020
b8cf696
Drilldown registration (#59834)
streamich Mar 10, 2020
2e65fd0
Drilldown events 3 (#59854)
streamich Mar 11, 2020
beb053b
Drilldown events 4 (#59876)
streamich Mar 11, 2020
ab6fb4b
Drilldown events 5 (#59885)
streamich Mar 11, 2020
12b8a3f
Merge remote-tracking branch 'upstream/master' into drilldowns
streamich Mar 11, 2020
27b1854
Merge branch 'master' into drilldowns
elasticmachine Mar 11, 2020
0f3ff3e
basic integration of components with dynamicActionManager
Dosant Mar 11, 2020
5009f71
Merge branch 'drilldowns' of github.com:elastic/kibana into drilldowns
Dosant Mar 11, 2020
f176550
fix: 🐛 don't overwrite explicitInput with combined input (#59938)
streamich Mar 11, 2020
4a4766e
display drilldown count in embeddable edit mode
mattkime Mar 11, 2020
0c14ff0
display drilldown count in embeddable edit mode
mattkime Mar 11, 2020
0d4bee2
improve wizard components. more tests.
Dosant Mar 12, 2020
ae98c6b
partial progress, dashboard drilldowns (#59977)
mattkime Mar 12, 2020
3200151
Manage drilldowns toasts. Add basic error handling.
Dosant Mar 12, 2020
ff4e9ad
support order in action factory selector
Dosant Mar 12, 2020
c7d4aa6
fix column order in manage drilldowns list
Dosant Mar 12, 2020
c731afa
remove accidental debug info
Dosant Mar 12, 2020
7d47d9f
Merge branch 'master' into drilldowns
elasticmachine Mar 12, 2020
f2d9056
bunch of nit ui fixes
Dosant Mar 13, 2020
8ad5cd4
Drilldowns reactive action manager (#60099)
streamich Mar 13, 2020
3c94332
Merge branch 'master' into drilldowns
elasticmachine Mar 13, 2020
6f59d1a
Drilldowns various 2 (#60103)
streamich Mar 13, 2020
66e791e
test: 💍 stub DynamicActionManager tests (#60104)
streamich Mar 13, 2020
1f238fe
Drilldowns review 1 (#60139)
streamich Mar 13, 2020
a772987
chore: 🤖 catch up with master
streamich Mar 16, 2020
e66513c
fix: 🐛 correct merge
streamich Mar 16, 2020
6efef2b
Drilldowns various 4 (#60264)
streamich Mar 16, 2020
537f8ee
workaround issue with closing flyout when navigating away
Dosant Mar 16, 2020
0ad8933
fix react key issue in action_wizard
Dosant Mar 16, 2020
94894c1
don’t open 2 flyouts
Dosant Mar 16, 2020
65f5414
fix action order
Dosant Mar 16, 2020
d3487ab
Merge branch 'master' into drilldowns
elasticmachine Mar 16, 2020
a405f83
Drilldowns reload stored (#60336)
streamich Mar 16, 2020
894aec7
chore: 🤖 catch up with master
streamich Mar 16, 2020
cfdab22
Drilldowns triggers (#60339)
streamich Mar 16, 2020
e96f815
Merge branch 'master' into drilldowns
elasticmachine Mar 16, 2020
62edd23
fix: 🐛 stop infinite re-rendering
streamich Mar 17, 2020
7a7beeb
Drilldowns multitrigger (#60357)
streamich Mar 17, 2020
5418305
"Create drilldown" flyout - design cleanup (#60309)
andreadelrio Mar 17, 2020
45f6f4d
basic unit tests for flyout_create_drildown action
Dosant Mar 17, 2020
ceb5cfe
Drilldowns finalize (#60371)
streamich Mar 17, 2020
4646ad2
Merge branch 'master' into drilldowns
elasticmachine Mar 17, 2020
6d0b8cb
basic unit tests for drilldown actions
Dosant Mar 17, 2020
ab3f4bf
Merge branch 'drilldowns' of github.com:elastic/kibana into drilldowns
Dosant Mar 17, 2020
5b4434b
Merge branch 'master' of github.com:elastic/kibana into drilldowns
mattkime Mar 17, 2020
65fae5e
Merge branch 'master' into drilldowns
mattkime Mar 17, 2020
6229d4f
Merge branch 'drilldowns' of github.com:elastic/kibana into drilldowns
mattkime Mar 17, 2020
1252f37
Drilldowns finalize 2 (#60510)
streamich Mar 18, 2020
243e5ce
Merge branch 'master' into drilldowns
elasticmachine Mar 19, 2020
469250f
feat: 🎸 don't show "OPTIONS" title on drilldown context menus
streamich Mar 19, 2020
c73319a
feat: 🎸 add server-side for x-pack dashboard plugin
streamich Mar 19, 2020
2280fdf
feat: 🎸 disable Drilldowns for TSVB
streamich Mar 19, 2020
adcb0a3
feat: 🎸 enable drilldowns on kibana.yml feature flag
streamich Mar 19, 2020
9e22e55
feat: 🎸 add feature flag comment to kibana.yml
streamich Mar 19, 2020
c3e6a61
Merge branch 'master' into drilldowns
elasticmachine Mar 19, 2020
ed8580a
feat: 🎸 remove places from drilldown interface
streamich Mar 20, 2020
73a91f3
refactor: 💡 remove place in factory context
streamich Mar 20, 2020
4d500b5
chore: 🤖 remove doExecute
streamich Mar 20, 2020
054fc8f
remove not needed now error_configure_action component
Dosant Mar 20, 2020
1e9efde
remove workaround for storybook
Dosant Mar 20, 2020
1a3e67b
feat: 🎸 improve DrilldownDefinition interface
streamich Mar 20, 2020
d1666ca
style: 💄 replace any by unknown
streamich Mar 20, 2020
32466a5
chore: 🤖 remove any
streamich Mar 20, 2020
df10920
chore: 🤖 make isConfigValid return type a boolean
streamich Mar 20, 2020
fb3bde9
Merge remote-tracking branch 'upstream/drilldowns' into drilldowns
streamich Mar 20, 2020
ce39459
Merge branch 'master' into drilldowns
elasticmachine Mar 20, 2020
d480655
refactor: 💡 move getDisplayName to factory, remove deprecated
streamich Mar 20, 2020
eb24e41
style: 💄 remove any
streamich Mar 20, 2020
930b695
feat: 🎸 improve ActionFactoryDefinition
streamich Mar 20, 2020
6a98f45
refactor: 💡 change visualize_embeddable params
streamich Mar 20, 2020
da49052
feat: 🎸 add dashboard dependency to dashboard_enhanced
streamich Mar 20, 2020
baf0f5e
style: 💄 rename drilldown plugin life-cycle contracts
streamich Mar 20, 2020
a5d7a38
refactor: 💡 do naming adjustments for dashboard drilldown
streamich Mar 20, 2020
36fb629
Merge branch 'master' into drilldowns
elasticmachine Mar 20, 2020
e68dcfb
fix: 🐛 fix Type error
streamich Mar 20, 2020
fcecc9a
Merge branch 'master' into drilldowns
elasticmachine Mar 20, 2020
47f1095
fix: 🐛 fix TypeScript type errors
streamich Mar 20, 2020
e678e06
test: 💍 fix test after refactor
streamich Mar 21, 2020
1604ab5
refactor: 💡 rename context -> placeContext in React component
streamich Mar 21, 2020
e14cf4a
Merge branch 'master' into drilldowns
elasticmachine Mar 21, 2020
03b2b37
Merge branch 'master' into drilldowns
elasticmachine Mar 22, 2020
d10aa7b
Merge branch 'master' into drilldowns
elasticmachine Mar 23, 2020
0d076d7
Merge branch 'master' into drilldowns
elasticmachine Mar 23, 2020
0dafa57
chore: 🤖 remove setting from kibana.yml
streamich Mar 23, 2020
29ee51c
refactor: 💡 change return type of getAction as per review
streamich Mar 23, 2020
2b162e8
remove custom css per review
Dosant Mar 23, 2020
de6c6b1
refactor: 💡 rename drilldownCount to eventCount
streamich Mar 23, 2020
88a81e2
style: 💄 remove any
streamich Mar 23, 2020
af3777c
Merge remote-tracking branch 'upstream/drilldowns' into drilldowns
streamich Mar 23, 2020
e29030f
refactor: 💡 change how uiActions are passed to vis embeddable
streamich Mar 23, 2020
78e64d6
Merge branch 'master' into drilldowns
elasticmachine Mar 23, 2020
00c42c4
chore: 🤖 catch up with master
streamich Mar 23, 2020
6cd07c5
style: 💄 remove unused import
streamich Mar 23, 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
Prev Previous commit
Next Next commit
Drilldown factory (#59823)
* refactor: 💡 import storage interface from ui_actions plugin

* refactor: 💡 make actions not-dynamic

* feat: 🎸 fix TypeScript errors, reshuffle types and code

* fix: 🐛 fix more TypeScript errors

* fix: 🐛 fix TypeScript import error
  • Loading branch information
streamich authored Mar 10, 2020
commit 140c5dc1bc817801cfe8de37059156c9167858f9
Original file line number Diff line number Diff line change
@@ -20,7 +20,8 @@
import { Embeddable } from './embeddable';
import { EmbeddableInput } from './i_embeddable';
import { ViewMode } from '../types';
import { EmbeddableActionStorage, SerializedEvent } from './embeddable_action_storage';
import { EmbeddableActionStorage } from './embeddable_action_storage';
import { UiActionsSerializedEvent } from '../../../../ui_actions/public';
import { of } from '../../../../kibana_utils/common';

class TestEmbeddable extends Embeddable<EmbeddableInput> {
@@ -42,7 +43,7 @@ describe('EmbeddableActionStorage', () => {
test('can add event to embeddable', async () => {
const embeddable = new TestEmbeddable();
const storage = new EmbeddableActionStorage(embeddable);
const event: SerializedEvent = {
const event: UiActionsSerializedEvent = {
eventId: 'EVENT_ID',
triggerId: 'TRIGGER-ID',
action: {} as any,
@@ -61,17 +62,17 @@ describe('EmbeddableActionStorage', () => {
const embeddable = new TestEmbeddable();
const storage = new EmbeddableActionStorage(embeddable);

const event1: SerializedEvent = {
const event1: UiActionsSerializedEvent = {
eventId: 'EVENT_ID1',
triggerId: 'TRIGGER-ID',
action: {} as any,
};
const event2: SerializedEvent = {
const event2: UiActionsSerializedEvent = {
eventId: 'EVENT_ID2',
triggerId: 'TRIGGER-ID',
action: {} as any,
};
const event3: SerializedEvent = {
const event3: UiActionsSerializedEvent = {
eventId: 'EVENT_ID3',
triggerId: 'TRIGGER-ID',
action: {} as any,
@@ -95,7 +96,7 @@ describe('EmbeddableActionStorage', () => {
test('throws when creating an event with the same ID', async () => {
const embeddable = new TestEmbeddable();
const storage = new EmbeddableActionStorage(embeddable);
const event: SerializedEvent = {
const event: UiActionsSerializedEvent = {
eventId: 'EVENT_ID',
triggerId: 'TRIGGER-ID',
action: {} as any,
@@ -122,14 +123,14 @@ describe('EmbeddableActionStorage', () => {
const embeddable = new TestEmbeddable();
const storage = new EmbeddableActionStorage(embeddable);

const event1: SerializedEvent = {
const event1: UiActionsSerializedEvent = {
eventId: 'EVENT_ID',
triggerId: 'TRIGGER-ID',
action: {
name: 'foo',
} as any,
};
const event2: SerializedEvent = {
const event2: UiActionsSerializedEvent = {
eventId: 'EVENT_ID',
triggerId: 'TRIGGER-ID',
action: {
@@ -148,28 +149,28 @@ describe('EmbeddableActionStorage', () => {
const embeddable = new TestEmbeddable();
const storage = new EmbeddableActionStorage(embeddable);

const event1: SerializedEvent = {
const event1: UiActionsSerializedEvent = {
eventId: 'EVENT_ID1',
triggerId: 'TRIGGER-ID',
action: {
name: 'foo',
} as any,
};
const event2: SerializedEvent = {
const event2: UiActionsSerializedEvent = {
eventId: 'EVENT_ID2',
triggerId: 'TRIGGER-ID',
action: {
name: 'bar',
} as any,
};
const event22: SerializedEvent = {
const event22: UiActionsSerializedEvent = {
eventId: 'EVENT_ID2',
triggerId: 'TRIGGER-ID',
action: {
name: 'baz',
} as any,
};
const event3: SerializedEvent = {
const event3: UiActionsSerializedEvent = {
eventId: 'EVENT_ID3',
triggerId: 'TRIGGER-ID',
action: {
@@ -199,7 +200,7 @@ describe('EmbeddableActionStorage', () => {
const embeddable = new TestEmbeddable();
const storage = new EmbeddableActionStorage(embeddable);

const event: SerializedEvent = {
const event: UiActionsSerializedEvent = {
eventId: 'EVENT_ID',
triggerId: 'TRIGGER-ID',
action: {} as any,
@@ -217,12 +218,12 @@ describe('EmbeddableActionStorage', () => {
const embeddable = new TestEmbeddable();
const storage = new EmbeddableActionStorage(embeddable);

const event1: SerializedEvent = {
const event1: UiActionsSerializedEvent = {
eventId: 'EVENT_ID1',
triggerId: 'TRIGGER-ID',
action: {} as any,
};
const event2: SerializedEvent = {
const event2: UiActionsSerializedEvent = {
eventId: 'EVENT_ID2',
triggerId: 'TRIGGER-ID',
action: {} as any,
@@ -249,7 +250,7 @@ describe('EmbeddableActionStorage', () => {
const embeddable = new TestEmbeddable();
const storage = new EmbeddableActionStorage(embeddable);

const event: SerializedEvent = {
const event: UiActionsSerializedEvent = {
eventId: 'EVENT_ID',
triggerId: 'TRIGGER-ID',
action: {} as any,
@@ -266,21 +267,21 @@ describe('EmbeddableActionStorage', () => {
const embeddable = new TestEmbeddable();
const storage = new EmbeddableActionStorage(embeddable);

const event1: SerializedEvent = {
const event1: UiActionsSerializedEvent = {
eventId: 'EVENT_ID1',
triggerId: 'TRIGGER-ID',
action: {
name: 'foo',
} as any,
};
const event2: SerializedEvent = {
const event2: UiActionsSerializedEvent = {
eventId: 'EVENT_ID2',
triggerId: 'TRIGGER-ID',
action: {
name: 'bar',
} as any,
};
const event3: SerializedEvent = {
const event3: UiActionsSerializedEvent = {
eventId: 'EVENT_ID3',
triggerId: 'TRIGGER-ID',
action: {
@@ -327,7 +328,7 @@ describe('EmbeddableActionStorage', () => {
const embeddable = new TestEmbeddable();
const storage = new EmbeddableActionStorage(embeddable);

const event: SerializedEvent = {
const event: UiActionsSerializedEvent = {
eventId: 'EVENT_ID',
triggerId: 'TRIGGER-ID',
action: {} as any,
@@ -355,7 +356,7 @@ describe('EmbeddableActionStorage', () => {
const embeddable = new TestEmbeddable();
const storage = new EmbeddableActionStorage(embeddable);

const event: SerializedEvent = {
const event: UiActionsSerializedEvent = {
eventId: 'EVENT_ID',
triggerId: 'TRIGGER-ID',
action: {} as any,
@@ -383,7 +384,7 @@ describe('EmbeddableActionStorage', () => {
const embeddable = new TestEmbeddable();
const storage = new EmbeddableActionStorage(embeddable);

const event: SerializedEvent = {
const event: UiActionsSerializedEvent = {
eventId: 'EVENT_ID',
triggerId: 'TRIGGER-ID',
action: {} as any,
@@ -402,17 +403,17 @@ describe('EmbeddableActionStorage', () => {
const embeddable = new TestEmbeddable();
const storage = new EmbeddableActionStorage(embeddable);

const event1: SerializedEvent = {
const event1: UiActionsSerializedEvent = {
eventId: 'EVENT_ID1',
triggerId: 'TRIGGER-ID1',
action: {} as any,
};
const event2: SerializedEvent = {
const event2: UiActionsSerializedEvent = {
eventId: 'EVENT_ID2',
triggerId: 'TRIGGER-ID2',
action: {} as any,
};
const event3: SerializedEvent = {
const event3: UiActionsSerializedEvent = {
eventId: 'EVENT_ID3',
triggerId: 'TRIGGER-ID3',
action: {} as any,
@@ -502,13 +503,13 @@ describe('EmbeddableActionStorage', () => {
const embeddable = new TestEmbeddable();
const storage = new EmbeddableActionStorage(embeddable);

const event1: SerializedEvent = {
const event1: UiActionsSerializedEvent = {
eventId: 'EVENT_ID1',
triggerId: 'TRIGGER-ID1',
action: {} as any,
};

const event2: SerializedEvent = {
const event2: UiActionsSerializedEvent = {
eventId: 'EVENT_ID2',
triggerId: 'TRIGGER-ID1',
action: {} as any,
Original file line number Diff line number Diff line change
@@ -17,32 +17,15 @@
* under the License.
*/

import { UiActionsActionStorage, UiActionsSerializedEvent } from '../../../../ui_actions/public';
import { Embeddable } from '..';

/**
* Below two interfaces are here temporarily, they will move to `ui_actions`
* plugin once #58216 is merged.
*/
export interface SerializedEvent {
eventId: string;
triggerId: string;
action: unknown;
}
export interface ActionStorage {
create(event: SerializedEvent): Promise<void>;
update(event: SerializedEvent): Promise<void>;
remove(eventId: string): Promise<void>;
read(eventId: string): Promise<SerializedEvent>;
count(): Promise<number>;
list(): Promise<SerializedEvent[]>;
}

export class EmbeddableActionStorage implements ActionStorage {
export class EmbeddableActionStorage implements UiActionsActionStorage {
constructor(private readonly embbeddable: Embeddable<any, any>) {}
streamich marked this conversation as resolved.
Show resolved Hide resolved

async create(event: SerializedEvent) {
async create(event: UiActionsSerializedEvent) {
const input = this.embbeddable.getInput();
const events = (input.events || []) as SerializedEvent[];
const events = (input.events || []) as UiActionsSerializedEvent[];
const exists = !!events.find(({ eventId }) => eventId === event.eventId);

if (exists) {
@@ -58,9 +41,9 @@ export class EmbeddableActionStorage implements ActionStorage {
});
}

async update(event: SerializedEvent) {
async update(event: UiActionsSerializedEvent) {
const input = this.embbeddable.getInput();
const events = (input.events || []) as SerializedEvent[];
const events = (input.events || []) as UiActionsSerializedEvent[];
const index = events.findIndex(({ eventId }) => eventId === event.eventId);

if (index === -1) {
@@ -79,7 +62,7 @@ export class EmbeddableActionStorage implements ActionStorage {

async remove(eventId: string) {
const input = this.embbeddable.getInput();
const events = (input.events || []) as SerializedEvent[];
const events = (input.events || []) as UiActionsSerializedEvent[];
const index = events.findIndex(event => eventId === event.eventId);

if (index === -1) {
@@ -96,9 +79,9 @@ export class EmbeddableActionStorage implements ActionStorage {
});
}

async read(eventId: string): Promise<SerializedEvent> {
async read(eventId: string): Promise<UiActionsSerializedEvent> {
const input = this.embbeddable.getInput();
const events = (input.events || []) as SerializedEvent[];
const events = (input.events || []) as UiActionsSerializedEvent[];
const event = events.find(ev => eventId === ev.eventId);

if (!event) {
@@ -113,14 +96,14 @@ export class EmbeddableActionStorage implements ActionStorage {

private __list() {
const input = this.embbeddable.getInput();
return (input.events || []) as SerializedEvent[];
return (input.events || []) as UiActionsSerializedEvent[];
}

async count(): Promise<number> {
return this.__list().length;
}

async list(): Promise<SerializedEvent[]> {
async list(): Promise<UiActionsSerializedEvent[]> {
return this.__list();
}
}
33 changes: 4 additions & 29 deletions src/plugins/ui_actions/public/actions/action.ts
Original file line number Diff line number Diff line change
@@ -64,11 +64,6 @@ export interface Action<Context extends {} = {}, T = ActionType>
*/
isCompatible(context: Context): Promise<boolean>;

/**
* If this returns something truthy, this is used in addition to the `execute` method when clicked.
*/
getHref?(context: Context): string | undefined;

/**
* Executes the action.
*/
@@ -78,10 +73,8 @@ export interface Action<Context extends {} = {}, T = ActionType>
/**
* A convenience interface used to register an action.
*/
export interface ActionDefinition<
Context extends object = object,
Config extends object | undefined = undefined
> extends Partial<Presentable<Context>> {
export interface ActionDefinition<Context extends object = object>
extends Partial<Presentable<Context>> {
/**
* ID of the action that uniquely identifies this action in the actions registry.
*/
@@ -92,29 +85,11 @@ export interface ActionDefinition<
*/
readonly type?: ActionType;

getHref?(context: Context): string | undefined;

/**
* Executes the action.
*/
execute(context: Context): Promise<void>;
}

export type AnyActionDefinition = ActionDefinition<any, any>;
export type ActionContext<A> = A extends ActionDefinition<infer Context, any> ? Context : never;
export type ActionConfig<A> = A extends ActionDefinition<any, infer Config> ? Config : never;

/**
* A convenience interface used to register a dynamic action.
*
* A dynamic action is one that can be create by user and registered into the
* actions registry at runtime. User can also provide custom config for this
* action. And dynamic actions can be serialized for storage and deserialized
* back.
*/
export type DynamicActionDefinition<
Context extends object = object,
Config extends object | undefined = undefined
> = ActionDefinition<Context, Config>;

export type AnyDynamicActionDefinition = DynamicActionDefinition<any, any>;
export type AnyActionDefinition = ActionDefinition<any>;
export type ActionContext<A> = A extends ActionDefinition<infer Context> ? Context : never;
Loading