Skip to content

Commit

Permalink
refactor(HelpIconComponent): Convert to standalone (#1841)
Browse files Browse the repository at this point in the history
  • Loading branch information
hirokiterashima authored Jun 21, 2024
1 parent c58dad8 commit 273bb3b
Show file tree
Hide file tree
Showing 7 changed files with 14 additions and 23 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand All @@ -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],
Expand All @@ -40,7 +40,7 @@ import { AiChatStudentModule } from '../aiChat/ai-chat-student/ai-chat-student.m
DrawStudentModule,
EmbeddedStudentModule,
GraphStudentModule,
HelpIconModule,
HelpIconComponent,
HighchartsChartModule,
HtmlStudentComponent,
LabelStudentModule,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<div *ngIf="showRubric" class="component__rubric">
<help-icon [content]="rubric" label="Teaching Tips" i18n-label icon="info"></help-icon>
<help-icon [content]="rubric" label="Teaching Tips" i18n-label icon="info" />
</div>
<div class="component__wrapper">
<div #component></div>
Expand Down
Original file line number Diff line number Diff line change
@@ -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 {
Expand All @@ -24,7 +27,7 @@ export class HelpIconComponent {
private wiseLinkService: WiseLinkService
) {}

showRubric() {
protected showRubric(): void {
this.dialog.open(DialogWithCloseComponent, {
data: {
content: this.wiseLinkService.generateHtmlWithWiseLink(
Expand Down

This file was deleted.

2 changes: 1 addition & 1 deletion src/assets/wise5/vle/node/node.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
fxLayout="row"
fxLayoutAlign="center center"
>
<help-icon [content]="rubric" label="Step Info" i18n-label icon="info"> </help-icon>
<help-icon [content]="rubric" label="Step Info" i18n-label icon="info" />
</div>
<div
*ngFor="let component of components"
Expand Down
4 changes: 2 additions & 2 deletions src/assets/wise5/vle/node/node.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { FlexLayoutModule } from '@angular/flex-layout';
import { MatButtonModule } from '@angular/material/button';
import { MatIconModule } from '@angular/material/icon';
import { NodeComponent } from './node.component';
import { HelpIconModule } from '../../themes/default/themeComponents/helpIcon/help-icon.module';
import { HelpIconComponent } from '../../themes/default/themeComponents/helpIcon/help-icon.component';
import { ComponentStudentModule } from '../../components/component/component-student.module';
import { MatTooltipModule } from '@angular/material/tooltip';
import { ComponentStateInfoComponent } from '../../common/component-state-info/component-state-info.component';
Expand All @@ -16,7 +16,7 @@ import { ComponentStateInfoComponent } from '../../common/component-state-info/c
ComponentStateInfoComponent,
ComponentStudentModule,
FlexLayoutModule,
HelpIconModule,
HelpIconComponent,
MatButtonModule,
MatIconModule,
MatTooltipModule
Expand Down
2 changes: 1 addition & 1 deletion src/messages.xlf
Original file line number Diff line number Diff line change
Expand Up @@ -21939,7 +21939,7 @@ If this problem continues, let your teacher know and move on to the next activit
<source>Rubric</source>
<context-group purpose="location">
<context context-type="sourcefile">src/assets/wise5/themes/default/themeComponents/helpIcon/help-icon.component.ts</context>
<context context-type="linenumber">33</context>
<context context-type="linenumber">36</context>
</context-group>
</trans-unit>
<trans-unit id="2e1aeaf8d183e6846a0463a08c784f472184fcf0" datatype="html">
Expand Down

0 comments on commit 273bb3b

Please sign in to comment.