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

[Lens] Expression type on document can be null #53883

Merged
merged 2 commits into from
Jan 5, 2020
Merged
Show file tree
Hide file tree
Changes from 1 commit
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: 1 addition & 0 deletions x-pack/legacy/plugins/lens/public/app_plugin/app.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,7 @@ export function App({

const isSaveable =
lastKnownDoc &&
lastKnownDoc.expression &&
lastKnownDoc.expression.length > 0 &&
core.application.capabilities.visualize.save;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import { ExpressionRenderer } from 'src/plugins/expressions/public';

export interface ExpressionWrapperProps {
ExpressionRenderer: ExpressionRenderer;
expression: string;
expression: string | null;
context: {
timeRange?: TimeRange;
query?: Query;
Expand All @@ -29,7 +29,7 @@ export function ExpressionWrapper({
}: ExpressionWrapperProps) {
return (
<I18nProvider>
{expression === '' ? (
{expression === null || expression === '' ? (
<EuiFlexGroup direction="column" alignItems="center" justifyContent="center">
<EuiFlexItem>
<EuiIcon type="alert" color="danger" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ export interface Document {
type?: string;
visualizationType: string | null;
title: string;
expression: string;
expression: string | null;
state: {
datasourceMetaData: {
filterableIndexPatterns: Array<{ id: string; title: string }>;
Expand Down