Skip to content

Commit 2384782

Browse files
author
Maja Grubic
committed
[Lens] Expression type on document can be null
1 parent 650fcda commit 2384782

File tree

3 files changed

+4
-3
lines changed

3 files changed

+4
-3
lines changed

x-pack/legacy/plugins/lens/public/app_plugin/app.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -152,6 +152,7 @@ export function App({
152152

153153
const isSaveable =
154154
lastKnownDoc &&
155+
lastKnownDoc.expression &&
155156
lastKnownDoc.expression.length > 0 &&
156157
core.application.capabilities.visualize.save;
157158

x-pack/legacy/plugins/lens/public/editor_frame_plugin/embeddable/expression_wrapper.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ import { ExpressionRenderer } from 'src/plugins/expressions/public';
1313

1414
export interface ExpressionWrapperProps {
1515
ExpressionRenderer: ExpressionRenderer;
16-
expression: string;
16+
expression: string | null;
1717
context: {
1818
timeRange?: TimeRange;
1919
query?: Query;
@@ -29,7 +29,7 @@ export function ExpressionWrapper({
2929
}: ExpressionWrapperProps) {
3030
return (
3131
<I18nProvider>
32-
{expression === '' ? (
32+
{expression === null || expression === '' ? (
3333
<EuiFlexGroup direction="column" alignItems="center" justifyContent="center">
3434
<EuiFlexItem>
3535
<EuiIcon type="alert" color="danger" />

x-pack/legacy/plugins/lens/public/persistence/saved_object_store.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ export interface Document {
1313
type?: string;
1414
visualizationType: string | null;
1515
title: string;
16-
expression: string;
16+
expression: string | null;
1717
state: {
1818
datasourceMetaData: {
1919
filterableIndexPatterns: Array<{ id: string; title: string }>;

0 commit comments

Comments
 (0)