Skip to content

Commit

Permalink
better defaults for example
Browse files Browse the repository at this point in the history
  • Loading branch information
Dosant committed Jun 9, 2020
1 parent 6c94e47 commit 49ab828
Showing 1 changed file with 62 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,18 +22,11 @@ import { ViewMode } from '../../../../src/plugins/embeddable/public';
import { DashboardContainerInput, DashboardStart } from '../../../../src/plugins/dashboard/public';
import { HELLO_WORLD_EMBEDDABLE } from '../../../embeddable_examples/public/hello_world';
import { InputEditor } from './input_editor';
import { TODO_EMBEDDABLE } from '../../../embeddable_examples/public/todo';
import { TODO_REF_EMBEDDABLE } from '../../../embeddable_examples/public/todo/todo_ref_embeddable';

const initialInput: DashboardContainerInput = {
id: 'random-id',
// TODO: do we need all of this props? Looks like we can make those optional
viewMode: ViewMode.VIEW,
filters: [],
timeRange: { to: 'now', from: 'now-1d' },
useMargins: false,
title: 'test',
query: { query: '', language: 'lucene' },
isFullScreenMode: false,
refreshConfig: { pause: true, value: 15 },
panels: {
'1': {
gridData: {
Expand All @@ -48,6 +41,66 @@ const initialInput: DashboardContainerInput = {
id: '1',
},
},
'2': {
gridData: {
w: 10,
h: 10,
x: 10,
y: 0,
i: '2',
},
type: HELLO_WORLD_EMBEDDABLE,
explicitInput: {
id: '2',
},
},
'3': {
gridData: {
w: 10,
h: 10,
x: 0,
y: 10,
i: '3',
},
type: TODO_EMBEDDABLE,
explicitInput: {
id: '3',
title: 'Clean up',
task: 'Clean up the code',
icon: 'trash',
},
},
'4': {
gridData: {
w: 10,
h: 10,
x: 10,
y: 10,
i: '4',
},
type: TODO_REF_EMBEDDABLE,
explicitInput: {
id: '4',
savedObjectId: 'sample-todo-saved-object',
},
},
},
isFullScreenMode: false,
filters: [],
useMargins: false,
id: 'random-id',
timeRange: {
to: 'now',
from: 'now-1d',
},
title: 'test',
query: {
query: '',
language: 'lucene',
},
refreshConfig: {
pause: true,
value: 15,
},
};

Expand Down

0 comments on commit 49ab828

Please sign in to comment.