From 36787d228e37d554e699d951e7ee416c6e6e3749 Mon Sep 17 00:00:00 2001 From: Hiroki Terashima Date: Mon, 11 Sep 2023 09:57:02 -0700 Subject: [PATCH] feat(AT): Go back to project view after adding new node #1406 (#1407) --- .../choose-new-node-location.component.ts | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/assets/wise5/authoringTool/addNode/choose-new-node-location/choose-new-node-location.component.ts b/src/assets/wise5/authoringTool/addNode/choose-new-node-location/choose-new-node-location.component.ts index 0c4a5373af4..551065edd17 100644 --- a/src/assets/wise5/authoringTool/addNode/choose-new-node-location/choose-new-node-location.component.ts +++ b/src/assets/wise5/authoringTool/addNode/choose-new-node-location/choose-new-node-location.component.ts @@ -35,9 +35,9 @@ export class ChooseNewNodeLocation { } private addInitialComponents(nodeId: string, components: any[]): void { - for (const component of components.reverse()) { - this.projectService.createComponent(nodeId, component.type); - } + components + .reverse() + .forEach((component) => this.projectService.createComponent(nodeId, component.type)); } private save(): any { @@ -47,9 +47,9 @@ export class ChooseNewNodeLocation { } private goToNode(node: any): void { - this.router.navigate(['../../node', node.id], { + this.router.navigate(['../..'], { relativeTo: this.route, - state: { newComponents: node.components } + state: { newNodes: [node] } }); }