From 8764a417d3314f1982cdb15fdd568cad858385d5 Mon Sep 17 00:00:00 2001 From: Piotr Pekala Date: Mon, 30 Sep 2019 04:48:01 -0700 Subject: [PATCH 1/2] Action available from context menu --- src/app/app.module.ts | 4 +- .../draggable-selection.component.ts | 132 +++++++++--------- .../map/drawing-to-map-drawing-converter.ts | 1 + .../map/map-drawing-to-drawing-converter.ts | 1 + .../map/map-node-to-node-converter.ts | 1 + .../map/node-to-map-node-converter.ts | 1 + src/app/cartography/models/drawing.ts | 1 + src/app/cartography/models/map/map-drawing.ts | 1 + src/app/cartography/models/map/map-node.ts | 1 + src/app/cartography/models/node.ts | 1 + .../lock-action/lock-action.component.html | 4 + .../lock-action/lock-action.component.ts | 48 +++++++ .../context-menu/context-menu.component.html | 6 + src/app/services/drawing.service.ts | 1 + src/app/services/node.service.ts | 1 + 15 files changed, 138 insertions(+), 66 deletions(-) create mode 100644 src/app/components/project-map/context-menu/actions/lock-action/lock-action.component.html create mode 100644 src/app/components/project-map/context-menu/actions/lock-action/lock-action.component.ts diff --git a/src/app/app.module.ts b/src/app/app.module.ts index 2fb9f713..d7da9ede 100644 --- a/src/app/app.module.ts +++ b/src/app/app.module.ts @@ -238,6 +238,7 @@ import { QemuImageCreatorComponent } from './components/project-map/node-editors import { ChooseNameDialogComponent } from './components/projects/choose-name-dialog/choose-name-dialog.component'; import { PacketCaptureService } from './services/packet-capture.service'; import { StartCaptureOnStartedLinkActionComponent } from './components/project-map/context-menu/actions/start-capture-on-started-link/start-capture-on-started-link.component'; +import { LockActionComponent } from './components/project-map/context-menu/actions/lock-action/lock-action.component'; if (environment.production) { Raven.config('https://b2b1cfd9b043491eb6b566fd8acee358@sentry.io/842726', { @@ -401,7 +402,8 @@ if (environment.production) { TracengTemplateDetailsComponent, QemuImageCreatorComponent, ChooseNameDialogComponent, - StartCaptureOnStartedLinkActionComponent + StartCaptureOnStartedLinkActionComponent, + LockActionComponent ], imports: [ BrowserModule, diff --git a/src/app/cartography/components/draggable-selection/draggable-selection.component.ts b/src/app/cartography/components/draggable-selection/draggable-selection.component.ts index 867d2e40..09e17069 100644 --- a/src/app/cartography/components/draggable-selection/draggable-selection.component.ts +++ b/src/app/cartography/components/draggable-selection/draggable-selection.component.ts @@ -94,8 +94,9 @@ export class DraggableSelectionComponent implements OnInit, OnDestroy { ).subscribe((evt: DraggableDrag) => { if (!this.isMapLocked) { const selected = this.selectionManager.getSelected(); - const selectedNodes = selected.filter(item => item instanceof MapNode); // update nodes + let mapNodes = selected.filter(item => item instanceof MapNode); + const selectedNodes = mapNodes.filter((item: MapNode) => !item.locked); selectedNodes.forEach((node: MapNode) => { node.x += evt.dx; node.y += evt.dy; @@ -116,52 +117,52 @@ export class DraggableSelectionComponent implements OnInit, OnDestroy { }); // update drawings - selected - .filter(item => item instanceof MapDrawing) - .forEach((drawing: MapDrawing) => { - drawing.x += evt.dx; - drawing.y += evt.dy; - this.drawingsWidget.redrawDrawing(svg, drawing); - }); + let mapDrawings = selected.filter(item => item instanceof MapDrawing); + const selectedDrawings = mapDrawings.filter((item: MapDrawing) => !item.locked); + selectedDrawings.forEach((drawing: MapDrawing) => { + drawing.x += evt.dx; + drawing.y += evt.dy; + this.drawingsWidget.redrawDrawing(svg, drawing); + }); // update labels - selected - .filter(item => item instanceof MapLabel) - .forEach((label: MapLabel) => { - const isParentNodeSelected = selectedNodes.filter(node => node.id === label.nodeId).length > 0; - if (isParentNodeSelected) { - return; - } + let mapLabels = selected.filter(item => item instanceof MapLabel); + const selectedLabels = mapLabels.filter((item: MapLabel) => selectedNodes.filter((node) => node.id === item.nodeId).length > 0); + selectedLabels.forEach((label: MapLabel) => { + const isParentNodeSelected = selectedNodes.filter(node => node.id === label.nodeId).length > 0; + if (isParentNodeSelected) { + return; + } - const node = this.graphDataManager.getNodes().filter(node => node.id === label.nodeId)[0]; - node.label.x += evt.dx; - node.label.y += evt.dy; - this.labelWidget.redrawLabel(svg, label); - }); + const node = this.graphDataManager.getNodes().filter(node => node.id === label.nodeId)[0]; + node.label.x += evt.dx; + node.label.y += evt.dy; + this.labelWidget.redrawLabel(svg, label); + }); // update interface labels - selected - .filter(item => item instanceof MapLinkNode) - .forEach((interfaceLabel: MapLinkNode) => { - const isParentNodeSelected = selectedNodes.filter(node => node.id === interfaceLabel.nodeId).length > 0; - if (isParentNodeSelected) { - return; - } + let mapLinkNodes = selected.filter(item => item instanceof MapLinkNode); + const selectedLinkNodes = mapLinkNodes.filter((item: MapLinkNode) => selectedNodes.filter((node) => node.id === item.nodeId).length > 0); + selectedLinkNodes.forEach((interfaceLabel: MapLinkNode) => { + const isParentNodeSelected = selectedNodes.filter(node => node.id === interfaceLabel.nodeId).length > 0; + if (isParentNodeSelected) { + return; + } - const link = this.graphDataManager - .getLinks() - .filter(link => link.nodes[0].id === interfaceLabel.id || link.nodes[1].id === interfaceLabel.id)[0]; - if (link.nodes[0].id === interfaceLabel.id) { - link.nodes[0].label.x += evt.dx; - link.nodes[0].label.y += evt.dy; - } - if (link.nodes[1].id === interfaceLabel.id) { - link.nodes[1].label.x += evt.dx; - link.nodes[1].label.y += evt.dy; - } + const link = this.graphDataManager + .getLinks() + .filter(link => link.nodes[0].id === interfaceLabel.id || link.nodes[1].id === interfaceLabel.id)[0]; + if (link.nodes[0].id === interfaceLabel.id) { + link.nodes[0].label.x += evt.dx; + link.nodes[0].label.y += evt.dy; + } + if (link.nodes[1].id === interfaceLabel.id) { + link.nodes[1].label.x += evt.dx; + link.nodes[1].label.y += evt.dy; + } - this.linksWidget.redrawLink(svg, link); - }); + this.linksWidget.redrawLink(svg, link); + }); } }); @@ -173,39 +174,40 @@ export class DraggableSelectionComponent implements OnInit, OnDestroy { ).subscribe((evt: DraggableEnd) => { if (!this.isMapLocked) { const selected = this.selectionManager.getSelected(); - const selectedNodes = selected.filter(item => item instanceof MapNode); + let mapNodes = selected.filter(item => item instanceof MapNode); + const selectedNodes = mapNodes.filter((item: MapNode) => !item.locked); selectedNodes.forEach((item: MapNode) => { this.nodesEventSource.dragged.emit(new DraggedDataEvent(item, evt.dx, evt.dy)); }); - selected - .filter(item => item instanceof MapDrawing) - .forEach((item: MapDrawing) => { - this.drawingsEventSource.dragged.emit(new DraggedDataEvent(item, evt.dx, evt.dy)); - }); + let mapDrawings = selected.filter(item => item instanceof MapDrawing); + const selectedDrawings = mapDrawings.filter((item: MapDrawing) => !item.locked); + selectedDrawings.forEach((item: MapDrawing) => { + this.drawingsEventSource.dragged.emit(new DraggedDataEvent(item, evt.dx, evt.dy)); + }); - selected - .filter(item => item instanceof MapLabel) - .forEach((label: MapLabel) => { - const isParentNodeSelected = selectedNodes.filter(node => node.id === label.nodeId).length > 0; - if (isParentNodeSelected) { - return; - } + let mapLabels = selected.filter(item => item instanceof MapLabel); + const selectedLabels = mapLabels.filter((item: MapLabel) => selectedNodes.filter((node) => node.id === item.nodeId).length > 0); + selectedLabels.forEach((label: MapLabel) => { + const isParentNodeSelected = selectedNodes.filter(node => node.id === label.nodeId).length > 0; + if (isParentNodeSelected) { + return; + } - this.nodesEventSource.labelDragged.emit(new DraggedDataEvent(label, evt.dx, evt.dy)); - }); + this.nodesEventSource.labelDragged.emit(new DraggedDataEvent(label, evt.dx, evt.dy)); + }); - selected - .filter(item => item instanceof MapLinkNode) - .forEach((label: MapLinkNode) => { - const isParentNodeSelected = selectedNodes.filter(node => node.id === label.nodeId).length > 0; - if (isParentNodeSelected) { - return; - } - this.linksEventSource.interfaceDragged.emit(new DraggedDataEvent(label, evt.dx, evt.dy)); - }); - } + let mapLinkNodes = selected.filter(item => item instanceof MapLinkNode); + const selectedLinkNodes = mapLinkNodes.filter((item: MapLinkNode) => selectedNodes.filter((node) => node.id === item.nodeId).length > 0); + selectedLinkNodes.forEach((label: MapLinkNode) => { + const isParentNodeSelected = selectedNodes.filter(node => node.id === label.nodeId).length > 0; + if (isParentNodeSelected) { + return; + } + this.linksEventSource.interfaceDragged.emit(new DraggedDataEvent(label, evt.dx, evt.dy)); + }); + } }); } diff --git a/src/app/cartography/converters/map/drawing-to-map-drawing-converter.ts b/src/app/cartography/converters/map/drawing-to-map-drawing-converter.ts index 2c43cf80..a45ebd29 100644 --- a/src/app/cartography/converters/map/drawing-to-map-drawing-converter.ts +++ b/src/app/cartography/converters/map/drawing-to-map-drawing-converter.ts @@ -14,6 +14,7 @@ export class DrawingToMapDrawingConverter implements Converter { node.first_port_name = mapNode.firstPortName; node.height = mapNode.height; node.label = mapNode.label ? this.mapLabelToLabel.convert(mapNode.label) : undefined; + node.locked = mapNode.locked; node.name = mapNode.name; node.node_directory = mapNode.nodeDirectory; node.node_type = mapNode.nodeType; diff --git a/src/app/cartography/converters/map/node-to-map-node-converter.ts b/src/app/cartography/converters/map/node-to-map-node-converter.ts index 1a739069..419c938f 100644 --- a/src/app/cartography/converters/map/node-to-map-node-converter.ts +++ b/src/app/cartography/converters/map/node-to-map-node-converter.ts @@ -29,6 +29,7 @@ export class NodeToMapNodeConverter implements Converter { mapNode.firstPortName = node.first_port_name; mapNode.height = node.height; mapNode.label = this.labelToMapLabel.convert(node.label, { node_id: node.node_id }); + mapNode.locked = node.locked; mapNode.name = node.name; mapNode.nodeDirectory = node.node_directory; mapNode.nodeType = node.node_type; diff --git a/src/app/cartography/models/drawing.ts b/src/app/cartography/models/drawing.ts index 984617c5..e3eda3d6 100644 --- a/src/app/cartography/models/drawing.ts +++ b/src/app/cartography/models/drawing.ts @@ -5,6 +5,7 @@ export class Drawing { project_id: string; rotation: number; svg: string; + locked: boolean; x: number; y: number; z: number; diff --git a/src/app/cartography/models/map/map-drawing.ts b/src/app/cartography/models/map/map-drawing.ts index 685fee93..3510125b 100644 --- a/src/app/cartography/models/map/map-drawing.ts +++ b/src/app/cartography/models/map/map-drawing.ts @@ -6,6 +6,7 @@ export class MapDrawing implements Indexed { projectId: string; rotation: number; svg: string; + locked: boolean; x: number; y: number; z: number; diff --git a/src/app/cartography/models/map/map-node.ts b/src/app/cartography/models/map/map-node.ts index ae08ccf7..fda84783 100644 --- a/src/app/cartography/models/map/map-node.ts +++ b/src/app/cartography/models/map/map-node.ts @@ -12,6 +12,7 @@ export class MapNode implements Indexed { firstPortName: string; height: number; label: MapLabel; + locked: boolean; name: string; nodeDirectory: string; nodeType: string; diff --git a/src/app/cartography/models/node.ts b/src/app/cartography/models/node.ts index 86d0fa33..c5960ae2 100644 --- a/src/app/cartography/models/node.ts +++ b/src/app/cartography/models/node.ts @@ -69,6 +69,7 @@ export class Node { first_port_name: string; height: number; label: Label; + locked: boolean; name: string; node_directory: string; node_id: string; diff --git a/src/app/components/project-map/context-menu/actions/lock-action/lock-action.component.html b/src/app/components/project-map/context-menu/actions/lock-action/lock-action.component.html new file mode 100644 index 00000000..7a34bc63 --- /dev/null +++ b/src/app/components/project-map/context-menu/actions/lock-action/lock-action.component.html @@ -0,0 +1,4 @@ + diff --git a/src/app/components/project-map/context-menu/actions/lock-action/lock-action.component.ts b/src/app/components/project-map/context-menu/actions/lock-action/lock-action.component.ts new file mode 100644 index 00000000..5b75c63e --- /dev/null +++ b/src/app/components/project-map/context-menu/actions/lock-action/lock-action.component.ts @@ -0,0 +1,48 @@ +import { Component, OnInit, Input } from '@angular/core'; +import { Server } from '../../../../../models/server'; +import { Node } from '../../../../../cartography/models/node'; +import { NodesDataSource } from '../../../../../cartography/datasources/nodes-datasource'; +import { NodeService } from '../../../../../services/node.service'; +import { Drawing } from '../../../../../cartography/models/drawing'; +import { DrawingsDataSource } from '../../../../../cartography/datasources/drawings-datasource'; +import { DrawingService } from '../../../../../services/drawing.service'; + +@Component({ + selector: 'app-lock-action', + templateUrl: './lock-action.component.html' +}) +export class LockActionComponent implements OnInit { + @Input() server: Server; + @Input() nodes: Node[]; + @Input() drawings: Drawing[]; + command: string; + + constructor( + private nodesDataSource: NodesDataSource, + private drawingsDataSource: DrawingsDataSource, + private nodeService: NodeService, + private drawingService: DrawingService + ) {} + + ngOnInit() { + if (this.nodes.length === 1 && this.drawings.length === 0) { + this.command = this.nodes[0].locked ? 'Unlock item' : 'Lock item'; + } else if (this.nodes.length === 0 && this.drawings.length === 1) { + this.command = this.drawings[0].locked ? 'Unlock item' : 'Lock item'; + } else { + this.command = 'Lock/unlock items'; + } + } + + lock() { + this.nodes.forEach((node) => { + node.locked = !node.locked; + this.nodeService.updateNode(this.server, node).subscribe((node) => { this.nodesDataSource.update(node) }); + }); + + this.drawings.forEach((drawing) => { + drawing.locked = ! drawing.locked; + this.drawingService.update(this.server, drawing).subscribe((drawing) => { this.drawingsDataSource.update(drawing) }); + }); + } +} diff --git a/src/app/components/project-map/context-menu/context-menu.component.html b/src/app/components/project-map/context-menu/context-menu.component.html index 24916844..49904db0 100644 --- a/src/app/components/project-map/context-menu/context-menu.component.html +++ b/src/app/components/project-map/context-menu/context-menu.component.html @@ -121,6 +121,12 @@ [server]="server" [link]="links[0]" > + { return this.httpServer.put(server, `/projects/${drawing.project_id}/drawings/${drawing.drawing_id}`, { + locked: drawing.locked, svg: drawing.svg, rotation: drawing.rotation, x: Math.round(drawing.x), diff --git a/src/app/services/node.service.ts b/src/app/services/node.service.ts index 9e877555..e3ca7f4b 100644 --- a/src/app/services/node.service.ts +++ b/src/app/services/node.service.ts @@ -90,6 +90,7 @@ export class NodeService { return this.httpServer.put(server, `/projects/${node.project_id}/nodes/${node.node_id}`, { console_type: node.console_type, console_auto_start: node.console_auto_start, + locked: node.locked, name: node.name, properties: node.properties }); From a242c1c66fa0d3a430866cb09bae5f739eab2bbc Mon Sep 17 00:00:00 2001 From: Piotr Pekala Date: Mon, 30 Sep 2019 05:53:30 -0700 Subject: [PATCH 2/2] Unit tests fixed --- .../draggable-selection.component.ts | 10 ++++++---- .../drawing-dragged/drawing-dragged.component.spec.ts | 1 + .../drawing-resized/drawing-resized.component.spec.ts | 1 + .../link-created/link-created.component.spec.ts | 1 + .../node-dragged/node-dragged.component.spec.ts | 1 + .../actions/lock-action/lock-action.component.html | 2 +- src/app/services/drawing.service.spec.ts | 4 +++- 7 files changed, 14 insertions(+), 6 deletions(-) diff --git a/src/app/cartography/components/draggable-selection/draggable-selection.component.ts b/src/app/cartography/components/draggable-selection/draggable-selection.component.ts index 09e17069..ffb73210 100644 --- a/src/app/cartography/components/draggable-selection/draggable-selection.component.ts +++ b/src/app/cartography/components/draggable-selection/draggable-selection.component.ts @@ -96,6 +96,7 @@ export class DraggableSelectionComponent implements OnInit, OnDestroy { const selected = this.selectionManager.getSelected(); // update nodes let mapNodes = selected.filter(item => item instanceof MapNode); + const lockedNodes = mapNodes.filter((item: MapNode) => item.locked); const selectedNodes = mapNodes.filter((item: MapNode) => !item.locked); selectedNodes.forEach((node: MapNode) => { node.x += evt.dx; @@ -127,7 +128,7 @@ export class DraggableSelectionComponent implements OnInit, OnDestroy { // update labels let mapLabels = selected.filter(item => item instanceof MapLabel); - const selectedLabels = mapLabels.filter((item: MapLabel) => selectedNodes.filter((node) => node.id === item.nodeId).length > 0); + const selectedLabels = mapLabels.filter((item: MapLabel) => lockedNodes.filter((node) => node.id === item.nodeId).length === 0); selectedLabels.forEach((label: MapLabel) => { const isParentNodeSelected = selectedNodes.filter(node => node.id === label.nodeId).length > 0; if (isParentNodeSelected) { @@ -142,7 +143,7 @@ export class DraggableSelectionComponent implements OnInit, OnDestroy { // update interface labels let mapLinkNodes = selected.filter(item => item instanceof MapLinkNode); - const selectedLinkNodes = mapLinkNodes.filter((item: MapLinkNode) => selectedNodes.filter((node) => node.id === item.nodeId).length > 0); + const selectedLinkNodes = mapLinkNodes.filter((item: MapLinkNode) => lockedNodes.filter((node) => node.id === item.nodeId).length === 0); selectedLinkNodes.forEach((interfaceLabel: MapLinkNode) => { const isParentNodeSelected = selectedNodes.filter(node => node.id === interfaceLabel.nodeId).length > 0; if (isParentNodeSelected) { @@ -176,6 +177,7 @@ export class DraggableSelectionComponent implements OnInit, OnDestroy { const selected = this.selectionManager.getSelected(); let mapNodes = selected.filter(item => item instanceof MapNode); + const lockedNodes = mapNodes.filter((item: MapNode) => item.locked); const selectedNodes = mapNodes.filter((item: MapNode) => !item.locked); selectedNodes.forEach((item: MapNode) => { this.nodesEventSource.dragged.emit(new DraggedDataEvent(item, evt.dx, evt.dy)); @@ -188,7 +190,7 @@ export class DraggableSelectionComponent implements OnInit, OnDestroy { }); let mapLabels = selected.filter(item => item instanceof MapLabel); - const selectedLabels = mapLabels.filter((item: MapLabel) => selectedNodes.filter((node) => node.id === item.nodeId).length > 0); + const selectedLabels = mapLabels.filter((item: MapLabel) => lockedNodes.filter((node) => node.id === item.nodeId).length === 0); selectedLabels.forEach((label: MapLabel) => { const isParentNodeSelected = selectedNodes.filter(node => node.id === label.nodeId).length > 0; if (isParentNodeSelected) { @@ -199,7 +201,7 @@ export class DraggableSelectionComponent implements OnInit, OnDestroy { }); let mapLinkNodes = selected.filter(item => item instanceof MapLinkNode); - const selectedLinkNodes = mapLinkNodes.filter((item: MapLinkNode) => selectedNodes.filter((node) => node.id === item.nodeId).length > 0); + const selectedLinkNodes = mapLinkNodes.filter((item: MapLinkNode) => lockedNodes.filter((node) => node.id === item.nodeId).length === 0) selectedLinkNodes.forEach((label: MapLinkNode) => { const isParentNodeSelected = selectedNodes.filter(node => node.id === label.nodeId).length > 0; if (isParentNodeSelected) { diff --git a/src/app/components/drawings-listeners/drawing-dragged/drawing-dragged.component.spec.ts b/src/app/components/drawings-listeners/drawing-dragged/drawing-dragged.component.spec.ts index 841a1b91..cd6e6684 100644 --- a/src/app/components/drawings-listeners/drawing-dragged/drawing-dragged.component.spec.ts +++ b/src/app/components/drawings-listeners/drawing-dragged/drawing-dragged.component.spec.ts @@ -48,6 +48,7 @@ describe('DrawingDraggedComponent', () => { }; const mapDrawing: MapDrawing = { id: 'sampleId', + locked: false, projectId: 'sampleprojectId', rotation: 0, svg: 'sampleSvg', diff --git a/src/app/components/drawings-listeners/drawing-resized/drawing-resized.component.spec.ts b/src/app/components/drawings-listeners/drawing-resized/drawing-resized.component.spec.ts index bd9796f0..0af53fda 100644 --- a/src/app/components/drawings-listeners/drawing-resized/drawing-resized.component.spec.ts +++ b/src/app/components/drawings-listeners/drawing-resized/drawing-resized.component.spec.ts @@ -51,6 +51,7 @@ describe('DrawingResizedComponent', () => { }; const mapDrawing: MapDrawing = { id: 'sampleId', + locked: false, projectId: 'sampleprojectId', rotation: 0, svg: 'sampleSvg', diff --git a/src/app/components/drawings-listeners/link-created/link-created.component.spec.ts b/src/app/components/drawings-listeners/link-created/link-created.component.spec.ts index 1a8e8642..06547cb8 100644 --- a/src/app/components/drawings-listeners/link-created/link-created.component.spec.ts +++ b/src/app/components/drawings-listeners/link-created/link-created.component.spec.ts @@ -72,6 +72,7 @@ describe('LinkCreatedComponent', () => { firstPortName: 'sampleFirstPortName', height: 0, label: {} as MapLabel, + locked: false, name: 'sampleName', nodeDirectory: 'sampleNodeDirectory', nodeType: 'sampleNodeType', diff --git a/src/app/components/drawings-listeners/node-dragged/node-dragged.component.spec.ts b/src/app/components/drawings-listeners/node-dragged/node-dragged.component.spec.ts index 1965cee6..82b67ff5 100644 --- a/src/app/components/drawings-listeners/node-dragged/node-dragged.component.spec.ts +++ b/src/app/components/drawings-listeners/node-dragged/node-dragged.component.spec.ts @@ -52,6 +52,7 @@ describe('NodeDraggedComponent', () => { firstPortName: 'sampleFirstPortName', height: 0, label: {} as MapLabel, + locked: false, name: 'sampleName', nodeDirectory: 'sampleNodeDirectory', nodeType: 'sampleNodeType', diff --git a/src/app/components/project-map/context-menu/actions/lock-action/lock-action.component.html b/src/app/components/project-map/context-menu/actions/lock-action/lock-action.component.html index 7a34bc63..451af511 100644 --- a/src/app/components/project-map/context-menu/actions/lock-action/lock-action.component.html +++ b/src/app/components/project-map/context-menu/actions/lock-action/lock-action.component.html @@ -1,4 +1,4 @@ diff --git a/src/app/services/drawing.service.spec.ts b/src/app/services/drawing.service.spec.ts index 4349c94e..2377de7f 100644 --- a/src/app/services/drawing.service.spec.ts +++ b/src/app/services/drawing.service.spec.ts @@ -111,6 +111,7 @@ describe('DrawingService', () => { drawing.z = 30; drawing.rotation = 0; drawing.svg = ''; + drawing.locked = false; service.update(server, drawing).subscribe(); @@ -121,7 +122,8 @@ describe('DrawingService', () => { y: 20, z: 30, rotation: 0, - svg: '' + svg: '', + locked: false }); }));