From 8c1076453f23908c456ee9f7d1260a3fa8a3d78e Mon Sep 17 00:00:00 2001 From: Alejandro Gallardo Escobar Date: Mon, 1 Apr 2019 11:50:30 +0200 Subject: [PATCH] Visual Console Refactor: added the events history item to the visual console container Former-commit-id: 0105d2cc1a93a24e0d53df8fe057ef233d8a2843 --- visual_console/src/VisualConsole.ts | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/visual_console/src/VisualConsole.ts b/visual_console/src/VisualConsole.ts index 3f627790c3..51cfa6543f 100644 --- a/visual_console/src/VisualConsole.ts +++ b/visual_console/src/VisualConsole.ts @@ -15,6 +15,9 @@ import Box, { boxPropsDecoder } from "./items/Box"; import Line, { linePropsDecoder } from "./items/Line"; import Label, { labelPropsDecoder } from "./items/Label"; import SimpleValue, { simpleValuePropsDecoder } from "./items/SimpleValue"; +import EventsHistory, { + eventsHistoryPropsDecoder +} from "./items/EventsHistory"; // Base properties. export interface VisualConsoleProps extends Size { @@ -101,7 +104,7 @@ function itemInstanceFrom(data: UnknownObject) { case ItemType.LINE_ITEM: return new Line(linePropsDecoder(data)); case ItemType.AUTO_SLA_GRAPH: - throw new TypeError("item not found"); + return new EventsHistory(eventsHistoryPropsDecoder(data)); case ItemType.CIRCULAR_PROGRESS_BAR: case ItemType.CIRCULAR_INTERIOR_PROGRESS_BAR: case ItemType.DONUT_GRAPH: @@ -247,6 +250,7 @@ export default class VisualConsole { public remove(): void { this.elements.forEach(e => e.remove()); // Arrow function. this.elements = []; - // TODO: Clean container. + // Clean container. + this.containerRef.innerHTML = ""; } }