-
Notifications
You must be signed in to change notification settings - Fork 8.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* feat: ๐ธ annotate with comments Trigger and add createContext( * feat: ๐ธ add TriggerContext<T> type * feat: ๐ธ improve trigger setup in embeddable plugin * feat: ๐ธ export trigger vars and types from embeddable * feat: ๐ธ add internal representation of Trigger * feat: ๐ธ use new trigger interface to execute in vis embeddable * feat: ๐ธ add TriggerContextMapping interface * feat: ๐ธ improve trigger types * refactor: ๐ก remove trigger ID getter * chore: ๐ค remove commented out line * chore: ๐ค re-export more trigger stuff * refactor: ๐ก simplify Trigger interface * suggestions * Remove unused type Co-authored-by: Stacey Gammon <[email protected]>
- Loading branch information
1 parent
96000fa
commit 68e79e4
Showing
13 changed files
with
321 additions
and
111 deletions.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
/* | ||
* Licensed to Elasticsearch B.V. under one or more contributor | ||
* license agreements. See the NOTICE file distributed with | ||
* this work for additional information regarding copyright | ||
* ownership. Elasticsearch B.V. licenses this file to you under | ||
* the Apache License, Version 2.0 (the "License"); you may | ||
* not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, | ||
* software distributed under the License is distributed on an | ||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
* KIND, either express or implied. See the License for the | ||
* specific language governing permissions and limitations | ||
* under the License. | ||
*/ | ||
|
||
import { Trigger } from '../../../../ui_actions/public'; | ||
import { IEmbeddable } from '..'; | ||
|
||
export interface EmbeddableVisTriggerContext { | ||
embeddable: IEmbeddable; | ||
timeFieldName: string; | ||
data: { | ||
e: MouseEvent; | ||
data: unknown; | ||
}; | ||
} | ||
|
||
export const SELECT_RANGE_TRIGGER = 'SELECT_RANGE_TRIGGER'; | ||
export const selectRangeTrigger: Trigger<'SELECT_RANGE_TRIGGER'> = { | ||
id: SELECT_RANGE_TRIGGER, | ||
title: 'Select range', | ||
description: 'Applies a range filter', | ||
}; | ||
|
||
export const VALUE_CLICK_TRIGGER = 'VALUE_CLICK_TRIGGER'; | ||
export const valueClickTrigger: Trigger<'VALUE_CLICK_TRIGGER'> = { | ||
id: VALUE_CLICK_TRIGGER, | ||
title: 'Value clicked', | ||
description: 'Value was clicked', | ||
}; | ||
|
||
export const CONTEXT_MENU_TRIGGER = 'CONTEXT_MENU_TRIGGER'; | ||
export const contextMenuTrigger: Trigger<'CONTEXT_MENU_TRIGGER'> = { | ||
id: CONTEXT_MENU_TRIGGER, | ||
title: 'Context menu', | ||
description: 'Triggered on top-right corner context-menu select.', | ||
}; | ||
|
||
export const APPLY_FILTER_TRIGGER = 'FILTER_TRIGGER'; | ||
export const applyFilterTrigger: Trigger<'FILTER_TRIGGER'> = { | ||
id: APPLY_FILTER_TRIGGER, | ||
title: 'Filter click', | ||
description: 'Triggered when user applies filter to an embeddable.', | ||
}; | ||
|
||
export const PANEL_BADGE_TRIGGER = 'PANEL_BADGE_TRIGGER'; | ||
export const panelBadgeTrigger: Trigger<'PANEL_BADGE_TRIGGER'> = { | ||
id: PANEL_BADGE_TRIGGER, | ||
title: 'Panel badges', | ||
description: 'Actions appear in title bar when an embeddable loads in a panel', | ||
}; |
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
Oops, something went wrong.