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

[Feature Anywhere] Add view events flyout #3415

Merged
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
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
1 change: 0 additions & 1 deletion src/plugins/vis_augmenter/public/plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,6 @@ export class VisAugmenterPlugin
{ expressions }: VisAugmenterSetupDeps
): VisAugmenterSetup {
expressions.registerType(visLayers);
setUISettings(core.uiSettings);
return {};
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,14 @@
$vis-description-width: 150px;
$event-vis-height: 55px;
$timeline-panel-height: 100px;
$content-padding-top: 110px; // Padding needed within view events flyout content to sit comfortably below flyout header
$date-range-height: 45px; // Static height we want for the date range picker component
$error-icon-padding-right: -8px; // This is so the error icon is aligned consistent with the event count icons
$base-vis-min-height: 25vh; // Visualizations require the container to have a valid width and height to render
ohltyler marked this conversation as resolved.
Show resolved Hide resolved

.view-events-flyout {
&__baseVis {
min-height: 25vh; // Visualizations require the container to have a valid width and height to render
min-height: $base-vis-min-height;
}

&__eventVis {
Expand All @@ -22,7 +26,7 @@ $timeline-panel-height: 100px;

&__content {
position: absolute;
top: 110px;
top: $content-padding-top;
right: $euiSizeM;
bottom: $euiSizeM;
left: $euiSizeM;
Expand All @@ -46,13 +50,13 @@ $timeline-panel-height: 100px;
}

.date-range-panel-height {
height: 45px;
height: $date-range-height;
}

.timeline-panel-height {
height: $timeline-panel-height;
}

.error-icon-padding {
margin-right: -8px;
margin-right: $error-icon-padding-right;
}
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import {
EuiTitle,
EuiFlexGroup,
EuiFlexItem,
EuiLoadingContent,
} from '@elastic/eui';
import './styles.scss';
import { VisualizeEmbeddable } from '../../../../visualizations/public';
Expand Down Expand Up @@ -56,7 +57,9 @@ export function ViewEventsFlyout(props: Props) {

useEffect(() => {
fetchVisEmbeddable(props.savedObjectId, setTimeRange, setVisEmbeddable, setErrorMessage);
/* eslint-disable */
// adding all of the values to the deps array cause a circular re-render. we don't want
// to keep re-fetching the visEmbeddable after it is set.
/* eslint-disable react-hooks/exhaustive-deps */
}, [props.savedObjectId]);

useEffect(() => {
Expand Down Expand Up @@ -92,7 +95,15 @@ export function ViewEventsFlyout(props: Props) {
<EuiFlyout size="l" onClose={props.onClose}>
<EuiFlyoutHeader hasBorder>
<EuiTitle size="m">
<h1>{isLoading || errorMessage ? <>&nbsp;</> : `${visEmbeddable?.getTitle()}`}</h1>
<h1>
{isLoading ? (
<EuiLoadingContent lines={1} />
) : errorMessage ? (
'Error fetching events'
) : (
`${visEmbeddable?.getTitle()}`
)}
</h1>
</EuiTitle>
</EuiFlyoutHeader>
{errorMessage ? (
Expand Down
1 change: 0 additions & 1 deletion src/plugins/vis_type_vislib/public/line_to_expression.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@ export const toExpressionAst = async (vis: Vis, params: any) => {
const ast = buildExpression([opensearchaggsFn, vislib]);
return ast.toAst();
} else {
const dimensions = await buildVislibDimensions(vis, params);
const visAugmenterConfig = get(
params,
'visAugmenterConfig',
Expand Down