Skip to content

Commit

Permalink
refactor(ComponentComponent): Convert to standalone (#1845)
Browse files Browse the repository at this point in the history
  • Loading branch information
hirokiterashima authored Jun 26, 2024
1 parent 9062004 commit 71a65f0
Show file tree
Hide file tree
Showing 6 changed files with 20 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,12 @@ import { AiChatStudentModule } from '../aiChat/ai-chat-student/ai-chat-student.m
import { HelpIconComponent } from '../../themes/default/themeComponents/helpIcon/help-icon.component';

@NgModule({
declarations: [ComponentComponent],
imports: [
AiChatStudentModule,
AnimationStudentModule,
AudioOscillatorStudentModule,
CommonModule,
ComponentComponent,
ConceptMapStudentModule,
DialogGuidanceStudentModule,
DiscussionStudentModule,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
<div *ngIf="showRubric" class="component__rubric">
<help-icon [content]="rubric" label="Teaching Tips" i18n-label icon="info" />
</div>
@if (showRubric) {
<div class="component__rubric">
<help-icon [content]="rubric" label="Teaching Tips" i18n-label icon="info" />
</div>
}
<div class="component__wrapper">
<div #component></div>
</div>
10 changes: 7 additions & 3 deletions src/assets/wise5/components/component/component.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,13 @@ import { StudentDataService } from '../../services/studentDataService';
import { Component as WISEComponent } from '../../common/Component';
import { ComponentFactory } from '../../common/ComponentFactory';
import { components } from '../Components';
import { HelpIconComponent } from '../../themes/default/themeComponents/helpIcon/help-icon.component';
import { CommonModule } from '@angular/common';

@Component({
imports: [CommonModule, HelpIconComponent],
selector: 'component',
standalone: true,
templateUrl: 'component.component.html'
})
export class ComponentComponent {
Expand All @@ -39,15 +43,15 @@ export class ComponentComponent {
private applicationRef: ApplicationRef,
private clickToSnipImageService: ClickToSnipImageService,
private configService: ConfigService,
private dataService: StudentDataService,
private injector: EnvironmentInjector,
private notebookService: NotebookService,
private projectService: ProjectService,
private studentDataService: StudentDataService
private projectService: ProjectService
) {}

ngOnInit() {
if (this.componentState == null || this.componentState === '') {
this.componentState = this.studentDataService.getLatestComponentStateByNodeIdAndComponentId(
this.componentState = this.dataService.getLatestComponentStateByNodeIdAndComponentId(
this.nodeId,
this.componentId
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,4 @@
[nodeId]="componentState.nodeId"
[componentId]="componentState.componentId"
[componentState]="componentState"
></component>
/>
3 changes: 1 addition & 2 deletions src/assets/wise5/vle/node/node.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,7 @@
[componentState]="getComponentStateByComponentId(component.id)"
[workgroupId]="workgroupId"
(saveComponentStateEvent)="saveComponentState($event)"
>
</component>
/>
</div>
<div
class="node-content__actions"
Expand Down
10 changes: 5 additions & 5 deletions src/messages.xlf
Original file line number Diff line number Diff line change
Expand Up @@ -1588,7 +1588,7 @@ Click &quot;Cancel&quot; to keep the invalid JSON open so you can fix it.</sourc
</context-group>
<context-group purpose="location">
<context context-type="sourcefile">src/assets/wise5/vle/node/node.component.html</context>
<context context-type="linenumber">56</context>
<context context-type="linenumber">55</context>
</context-group>
</trans-unit>
<trans-unit id="dc834df3c90c7b9021cfa37b2be737c2134249a5" datatype="html">
Expand Down Expand Up @@ -6370,7 +6370,7 @@ Click &quot;Cancel&quot; to keep the invalid JSON open so you can fix it.</sourc
</context-group>
<context-group purpose="location">
<context context-type="sourcefile">src/assets/wise5/vle/node/node.component.html</context>
<context context-type="linenumber">47,49</context>
<context context-type="linenumber">46,48</context>
</context-group>
</trans-unit>
<trans-unit id="70cfd60f574a2e5b823237ac05381d8d488e4c7c" datatype="html">
Expand Down Expand Up @@ -15025,7 +15025,7 @@ Are you sure you want to proceed?</source>
</context-group>
<context-group purpose="location">
<context context-type="sourcefile">src/assets/wise5/vle/node/node.component.html</context>
<context context-type="linenumber">44</context>
<context context-type="linenumber">43</context>
</context-group>
</trans-unit>
<trans-unit id="5760105370370371133" datatype="html">
Expand Down Expand Up @@ -16552,7 +16552,7 @@ Are you ready to receive feedback on this answer?</source>
<source>Teaching Tips</source>
<context-group purpose="location">
<context context-type="sourcefile">src/assets/wise5/components/component/component.component.html</context>
<context context-type="linenumber">2</context>
<context context-type="linenumber">3</context>
</context-group>
</trans-unit>
<trans-unit id="687454984939780519" datatype="html">
Expand Down Expand Up @@ -22086,7 +22086,7 @@ If this problem continues, let your teacher know and move on to the next activit
<source> Submit </source>
<context-group purpose="location">
<context context-type="sourcefile">src/assets/wise5/vle/node/node.component.html</context>
<context context-type="linenumber">59,61</context>
<context context-type="linenumber">58,60</context>
</context-group>
</trans-unit>
<trans-unit id="e4c201ad39e5fa4658b22a707c94012bc30e0846" datatype="html">
Expand Down

0 comments on commit 71a65f0

Please sign in to comment.