From b5047a4fef3d3fb97bfdbed3961accaaac56b3f8 Mon Sep 17 00:00:00 2001 From: Hiroki Terashima Date: Mon, 13 May 2024 16:19:59 -0700 Subject: [PATCH] refactor(StudentHtmlComponent): Convert to standalone (#1793) --- src/assets/wise5/components/Components.ts | 4 +-- .../component/component-student.module.ts | 4 +-- .../html-student/html-student.component.ts | 35 ++++++++++--------- .../html/html-student/html-student.module.ts | 11 ------ 4 files changed, 22 insertions(+), 32 deletions(-) delete mode 100644 src/assets/wise5/components/html/html-student/html-student.module.ts diff --git a/src/assets/wise5/components/Components.ts b/src/assets/wise5/components/Components.ts index 43075616b3f..c67173c717f 100644 --- a/src/assets/wise5/components/Components.ts +++ b/src/assets/wise5/components/Components.ts @@ -26,7 +26,7 @@ import { GraphAuthoring } from './graph/graph-authoring/graph-authoring.componen import { GraphGradingComponent } from './graph/graph-grading/graph-grading.component'; import { GraphStudent } from './graph/graph-student/graph-student.component'; import { HtmlAuthoring } from './html/html-authoring/html-authoring.component'; -import { HtmlStudent } from './html/html-student/html-student.component'; +import { HtmlStudentComponent } from './html/html-student/html-student.component'; import { LabelAuthoring } from './label/label-authoring/label-authoring.component'; import { LabelGradingComponent } from './label/label-grading/label-grading.component'; import { LabelStudent } from './label/label-student/label-student.component'; @@ -94,7 +94,7 @@ export const components = { student: EmbeddedStudent }, Graph: { authoring: GraphAuthoring, grading: GraphGradingComponent, student: GraphStudent }, - HTML: { authoring: HtmlAuthoring, student: HtmlStudent }, + HTML: { authoring: HtmlAuthoring, student: HtmlStudentComponent }, Label: { authoring: LabelAuthoring, grading: LabelGradingComponent, student: LabelStudent }, Match: { authoring: MatchAuthoring, grading: MatchGradingComponent, student: MatchStudent }, MultipleChoice: { diff --git a/src/assets/wise5/components/component/component-student.module.ts b/src/assets/wise5/components/component/component-student.module.ts index 28e1701da57..d347f44fda0 100644 --- a/src/assets/wise5/components/component/component-student.module.ts +++ b/src/assets/wise5/components/component/component-student.module.ts @@ -13,7 +13,7 @@ import { DiscussionStudentModule } from '../discussion/discussion-student/discus import { DrawStudentModule } from '../draw/draw-student/draw-student-module'; import { EmbeddedStudentModule } from '../embedded/embedded-student/embedded-student.module'; import { GraphStudentModule } from '../graph/graph-student/graph-student.module'; -import { HtmlStudentModule } from '../html/html-student/html-student.module'; +import { HtmlStudentComponent } from '../html/html-student/html-student.component'; import { LabelStudentModule } from '../label/label-student/label-student.module'; import { MatchStudentModule } from '../match/match-student/match-student.module'; import { MultipleChoiceStudentModule } from '../multipleChoice/multiple-choice-student/multiple-choice-student.module'; @@ -42,7 +42,7 @@ import { AiChatStudentModule } from '../aiChat/ai-chat-student/ai-chat-student.m GraphStudentModule, HelpIconModule, HighchartsChartModule, - HtmlStudentModule, + HtmlStudentComponent, LabelStudentModule, MatchStudentModule, MultipleChoiceStudentModule, 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 3961181cb1f..9a90ed71c9b 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 @@ -13,32 +13,33 @@ import { ComponentService } from '../../componentService'; @Component({ selector: 'html-student', - styleUrls: ['html-student.component.scss'], + standalone: true, + styleUrl: 'html-student.component.scss', templateUrl: 'html-student.component.html' }) -export class HtmlStudent extends ComponentStudent { - html: SafeHtml = ''; +export class HtmlStudentComponent extends ComponentStudent { + protected html: SafeHtml = ''; constructor( - protected AnnotationService: AnnotationService, - protected ComponentService: ComponentService, - protected ConfigService: ConfigService, + protected annotationService: AnnotationService, + protected componentService: ComponentService, + protected configService: ConfigService, protected dialog: MatDialog, - protected NodeService: NodeService, - protected NotebookService: NotebookService, - protected StudentAssetService: StudentAssetService, - protected StudentDataService: StudentDataService, + protected nodeService: NodeService, + protected notebookService: NotebookService, + protected studentAssetService: StudentAssetService, + protected studentDataService: StudentDataService, private wiseLinkService: WiseLinkService ) { super( - AnnotationService, - ComponentService, - ConfigService, + annotationService, + componentService, + configService, dialog, - NodeService, - NotebookService, - StudentAssetService, - StudentDataService + nodeService, + notebookService, + studentAssetService, + studentDataService ); } diff --git a/src/assets/wise5/components/html/html-student/html-student.module.ts b/src/assets/wise5/components/html/html-student/html-student.module.ts deleted file mode 100644 index d22dff4897b..00000000000 --- a/src/assets/wise5/components/html/html-student/html-student.module.ts +++ /dev/null @@ -1,11 +0,0 @@ -import { NgModule } from '@angular/core'; -import { StudentTeacherCommonModule } from '../../../../../app/student-teacher-common.module'; -import { StudentComponentModule } from '../../../../../app/student/student.component.module'; -import { HtmlStudent } from './html-student.component'; - -@NgModule({ - declarations: [HtmlStudent], - imports: [StudentTeacherCommonModule, StudentComponentModule], - exports: [HtmlStudent] -}) -export class HtmlStudentModule {}