From 273bb3bedff189c5c5a67a31eeba0596641c6335 Mon Sep 17 00:00:00 2001 From: Hiroki Terashima Date: Thu, 20 Jun 2024 18:09:19 -0700 Subject: [PATCH] refactor(HelpIconComponent): Convert to standalone (#1841) --- .../components/component/component-student.module.ts | 4 ++-- .../components/component/component.component.html | 2 +- .../themeComponents/helpIcon/help-icon.component.ts | 11 +++++++---- .../themeComponents/helpIcon/help-icon.module.ts | 12 ------------ src/assets/wise5/vle/node/node.component.html | 2 +- src/assets/wise5/vle/node/node.module.ts | 4 ++-- src/messages.xlf | 2 +- 7 files changed, 14 insertions(+), 23 deletions(-) delete mode 100644 src/assets/wise5/themes/default/themeComponents/helpIcon/help-icon.module.ts diff --git a/src/assets/wise5/components/component/component-student.module.ts b/src/assets/wise5/components/component/component-student.module.ts index 369052fcfbc..04f82f870d8 100644 --- a/src/assets/wise5/components/component/component-student.module.ts +++ b/src/assets/wise5/components/component/component-student.module.ts @@ -2,7 +2,6 @@ import { CommonModule } from '@angular/common'; import { NgModule } from '@angular/core'; import { HighchartsChartModule } from 'highcharts-angular'; import { StudentComponentModule } from '../../../../app/student/student.component.module'; -import { HelpIconModule } from '../../themes/default/themeComponents/helpIcon/help-icon.module'; import { PreviewComponentComponent } from '../../authoringTool/components/preview-component/preview-component.component'; import { StudentAssetsDialogModule } from '../../vle/studentAsset/student-assets-dialog/student-assets-dialog.module'; import { AnimationStudentModule } from '../animation/animation-student/animation-student.module'; @@ -26,6 +25,7 @@ import { SummaryStudentModule } from '../summary/summary-student/summary-student import { TableStudentModule } from '../table/table-student/table-student.module'; import { ComponentComponent } from './component.component'; import { AiChatStudentModule } from '../aiChat/ai-chat-student/ai-chat-student.module'; +import { HelpIconComponent } from '../../themes/default/themeComponents/helpIcon/help-icon.component'; @NgModule({ declarations: [ComponentComponent], @@ -40,7 +40,7 @@ import { AiChatStudentModule } from '../aiChat/ai-chat-student/ai-chat-student.m DrawStudentModule, EmbeddedStudentModule, GraphStudentModule, - HelpIconModule, + HelpIconComponent, HighchartsChartModule, HtmlStudentComponent, LabelStudentModule, diff --git a/src/assets/wise5/components/component/component.component.html b/src/assets/wise5/components/component/component.component.html index 22b8a907ce6..f95c4c9820c 100644 --- a/src/assets/wise5/components/component/component.component.html +++ b/src/assets/wise5/components/component/component.component.html @@ -1,5 +1,5 @@
- +
diff --git a/src/assets/wise5/themes/default/themeComponents/helpIcon/help-icon.component.ts b/src/assets/wise5/themes/default/themeComponents/helpIcon/help-icon.component.ts index c8d606fb31d..e0580b78e6f 100644 --- a/src/assets/wise5/themes/default/themeComponents/helpIcon/help-icon.component.ts +++ b/src/assets/wise5/themes/default/themeComponents/helpIcon/help-icon.component.ts @@ -1,14 +1,17 @@ -'use strict'; - import { Component, Input } from '@angular/core'; import { MatDialog } from '@angular/material/dialog'; import { DialogWithCloseComponent } from '../../../../directives/dialog-with-close/dialog-with-close.component'; import { WiseLinkService } from '../../../../../../app/services/wiseLinkService'; import { VLEProjectService } from '../../../../vle/vleProjectService'; +import { CommonModule } from '@angular/common'; +import { MatButtonModule } from '@angular/material/button'; +import { MatIconModule } from '@angular/material/icon'; @Component({ + imports: [CommonModule, MatButtonModule, MatIconModule], selector: 'help-icon', - styleUrls: ['help-icon.component.scss'], + standalone: true, + styleUrl: 'help-icon.component.scss', templateUrl: 'help-icon.component.html' }) export class HelpIconComponent { @@ -24,7 +27,7 @@ export class HelpIconComponent { private wiseLinkService: WiseLinkService ) {} - showRubric() { + protected showRubric(): void { this.dialog.open(DialogWithCloseComponent, { data: { content: this.wiseLinkService.generateHtmlWithWiseLink( diff --git a/src/assets/wise5/themes/default/themeComponents/helpIcon/help-icon.module.ts b/src/assets/wise5/themes/default/themeComponents/helpIcon/help-icon.module.ts deleted file mode 100644 index 91aa70a7e93..00000000000 --- a/src/assets/wise5/themes/default/themeComponents/helpIcon/help-icon.module.ts +++ /dev/null @@ -1,12 +0,0 @@ -import { CommonModule } from '@angular/common'; -import { NgModule } from '@angular/core'; -import { MatButtonModule } from '@angular/material/button'; -import { MatIconModule } from '@angular/material/icon'; -import { HelpIconComponent } from './help-icon.component'; - -@NgModule({ - declarations: [HelpIconComponent], - imports: [CommonModule, MatButtonModule, MatIconModule], - exports: [HelpIconComponent] -}) -export class HelpIconModule {} diff --git a/src/assets/wise5/vle/node/node.component.html b/src/assets/wise5/vle/node/node.component.html index fb41668e9c8..73a48c4db1e 100644 --- a/src/assets/wise5/vle/node/node.component.html +++ b/src/assets/wise5/vle/node/node.component.html @@ -10,7 +10,7 @@ fxLayout="row" fxLayoutAlign="center center" > - +
Rubric src/assets/wise5/themes/default/themeComponents/helpIcon/help-icon.component.ts - 33 + 36