From edd0ab8db25886f9cf2d133980e2cdc3ac0ac909 Mon Sep 17 00:00:00 2001 From: Hiroki Terashima Date: Mon, 5 Apr 2021 11:52:03 -0700 Subject: [PATCH 1/2] Add structure choose location now properly displays number and title. This was happening because don't have projectController anymore in the child pages. Also removed step background color because it doesn't matter in group selection. #40 --- .../authoringTool/structure/chooseStructureLocation.html | 7 +++---- .../structure/chooseStructureLocationController.ts | 8 ++++++++ 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/src/assets/wise5/authoringTool/structure/chooseStructureLocation.html b/src/assets/wise5/authoringTool/structure/chooseStructureLocation.html index b4ba22058e..b0f8b4bb33 100644 --- a/src/assets/wise5/authoringTool/structure/chooseStructureLocation.html +++ b/src/assets/wise5/authoringTool/structure/chooseStructureLocation.html @@ -5,13 +5,12 @@
{{ ::'chooseStructureLocation' | translate }}
+ ng-class="groupHeader">
- {{::projectController.getNodePositionById(group.$key)}}: - {{::projectController.getNodeTitleByNodeId(group.$key)}} + {{::chooseStructureLocationController.getNodePositionById(group.$key)}}: + {{::chooseStructureLocationController.getNodeTitleByNodeId(group.$key)}}
diff --git a/src/assets/wise5/authoringTool/structure/chooseStructureLocationController.ts b/src/assets/wise5/authoringTool/structure/chooseStructureLocationController.ts index 89db2ff52b..870a857402 100644 --- a/src/assets/wise5/authoringTool/structure/chooseStructureLocationController.ts +++ b/src/assets/wise5/authoringTool/structure/chooseStructureLocationController.ts @@ -96,6 +96,14 @@ class ChooseStructureLocationController { }); } + getNodeTitleByNodeId(nodeId: string): string { + return this.ProjectService.getNodeTitleByNodeId(nodeId); + } + + getNodePositionById(nodeId: string): string { + return this.ProjectService.getNodePositionById(nodeId); + } + cancel() { this.$state.go('root.at.project'); } From ccee1ee4cafc77f7684f1293cbd171912aa6bd03 Mon Sep 17 00:00:00 2001 From: Geoffrey Kwan Date: Tue, 6 Apr 2021 11:17:23 -0400 Subject: [PATCH 2/2] Fix a problem with HTML component not rendering styling. #48 --- .../html/html-student/html-student.component.ts | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/src/assets/wise5/components/html/html-student/html-student.component.ts b/src/assets/wise5/components/html/html-student/html-student.component.ts index aa632b8648..985adae66f 100644 --- a/src/assets/wise5/components/html/html-student/html-student.component.ts +++ b/src/assets/wise5/components/html/html-student/html-student.component.ts @@ -1,4 +1,5 @@ import { Component } from '@angular/core'; +import { DomSanitizer, SafeHtml } from '@angular/platform-browser'; import { NodeService } from '../../../services/nodeService'; import { UtilService } from '../../../services/utilService'; import { ComponentStudent } from '../../component-student.component'; @@ -8,15 +9,21 @@ import { ComponentStudent } from '../../component-student.component'; templateUrl: 'html-student.component.html' }) export class HtmlStudent extends ComponentStudent { - html: string = ''; + html: SafeHtml = ''; - constructor(protected NodeService: NodeService, protected UtilService: UtilService) { + constructor( + protected NodeService: NodeService, + private sanitizer: DomSanitizer, + protected UtilService: UtilService + ) { super(NodeService); } ngOnInit() { super.ngOnInit(); - this.html = this.UtilService.replaceWISELinks(this.componentContent.html); + this.html = this.sanitizer.bypassSecurityTrustHtml( + this.UtilService.replaceWISELinks(this.componentContent.html) + ); this.broadcastDoneRenderingComponent(); } }