From 49ab828edeb4f44dd95f26c5f16b9397f6a3aa5c Mon Sep 17 00:00:00 2001 From: Anton Dosov Date: Tue, 9 Jun 2020 11:46:27 +0200 Subject: [PATCH] better defaults for example --- .../public/by_value/embeddable.tsx | 71 ++++++++++++++++--- 1 file changed, 62 insertions(+), 9 deletions(-) diff --git a/examples/dashboard_embeddable_examples/public/by_value/embeddable.tsx b/examples/dashboard_embeddable_examples/public/by_value/embeddable.tsx index c7e958535cd1d..25fa24b83ba47 100644 --- a/examples/dashboard_embeddable_examples/public/by_value/embeddable.tsx +++ b/examples/dashboard_embeddable_examples/public/by_value/embeddable.tsx @@ -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: { @@ -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, }, };