From d4250d390979dceb15ea177819bab2666c76a37b Mon Sep 17 00:00:00 2001 From: Hiroki Terashima Date: Mon, 9 Oct 2023 09:51:49 -0700 Subject: [PATCH] refactor(NodeService): Move authoring-specific observables to TeacherNodeService --- .../edit-advanced-component.component.ts | 4 ++-- .../components/AbstractComponentAuthoring.ts | 4 ++-- .../save-starter-state.component.ts | 4 ++-- .../node-authoring.component.spec.ts | 2 ++ .../node-authoring.component.ts | 4 ++-- .../animation-authoring.component.spec.ts | 4 ++-- .../animation-authoring.component.ts | 4 ++-- ...dio-oscillator-authoring.component.spec.ts | 3 ++- .../audio-oscillator-authoring.component.ts | 4 ++-- .../concept-map-authoring.component.ts | 4 ++-- .../concept-map-authoring.module.ts | 4 ++-- ...dit-concept-map-advanced.component.spec.ts | 3 ++- .../edit-concept-map-advanced.component.ts | 4 ++-- ...ialog-guidance-authoring.component.spec.ts | 4 +++- .../dialog-guidance-authoring.component.ts | 4 ++-- .../discussion-authoring.component.ts | 4 ++-- .../draw-authoring.component.ts | 3 ++- .../draw-authoring/draw-authoring.module.ts | 4 ++-- .../embedded-authoring.component.spec.ts | 4 +++- .../embedded-authoring.component.ts | 4 ++-- .../edit-graph-advanced.component.spec.ts | 3 ++- .../graph-authoring.component.spec.ts | 3 ++- .../graph-authoring.component.ts | 4 ++-- .../html-authoring.component.ts | 6 ++--- .../label-authoring.component.ts | 4 ++-- .../match-authoring.component.ts | 4 ++-- .../multiple-choice-authoring.component.ts | 4 ++-- ...t-open-response-advanced.component.spec.ts | 3 ++- .../edit-open-response-advanced.component.ts | 4 ++-- .../outside-url-authoring.component.ts | 4 ++-- ...-chat-advanced-component.component.spec.ts | 3 ++- ...-peer-chat-advanced-component.component.ts | 4 ++-- .../peer-chat-authoring.component.spec.ts | 4 ++-- .../peer-chat-authoring.component.ts | 4 ++-- ...how-group-work-authoring.component.spec.ts | 3 ++- .../show-group-work-authoring.component.ts | 4 ++-- .../show-my-work-authoring.component.spec.ts | 3 ++- .../show-my-work-authoring.component.ts | 4 ++-- .../summary-authoring.component.spec.ts | 4 ++-- .../summary-authoring.component.ts | 4 ++-- .../edit-table-advanced.component.spec.ts | 3 ++- .../edit-table-advanced.component.ts | 4 ++-- .../table-authoring.component.ts | 4 ++-- src/assets/wise5/services/nodeService.ts | 18 --------------- .../wise5/services/teacherNodeService.ts | 22 ++++++++++++++++++- src/messages.xlf | 20 ++++++++--------- 46 files changed, 120 insertions(+), 102 deletions(-) diff --git a/src/app/authoring-tool/edit-advanced-component/edit-advanced-component.component.ts b/src/app/authoring-tool/edit-advanced-component/edit-advanced-component.component.ts index c81bf2b2ab3..a658ba9d660 100644 --- a/src/app/authoring-tool/edit-advanced-component/edit-advanced-component.component.ts +++ b/src/app/authoring-tool/edit-advanced-component/edit-advanced-component.component.ts @@ -1,9 +1,9 @@ import { Directive, Input } from '@angular/core'; import { ComponentContent } from '../../../assets/wise5/common/ComponentContent'; import { Component } from '../../../assets/wise5/common/Component'; -import { NodeService } from '../../../assets/wise5/services/nodeService'; import { NotebookService } from '../../../assets/wise5/services/notebookService'; import { TeacherProjectService } from '../../../assets/wise5/services/teacherProjectService'; +import { TeacherNodeService } from '../../../assets/wise5/services/teacherNodeService'; @Directive() export abstract class EditAdvancedComponentComponent { @@ -13,7 +13,7 @@ export abstract class EditAdvancedComponentComponent { @Input() nodeId: string; constructor( - protected nodeService: NodeService, + protected nodeService: TeacherNodeService, protected notebookService: NotebookService, protected teacherProjectService: TeacherProjectService ) {} diff --git a/src/assets/wise5/authoringTool/components/AbstractComponentAuthoring.ts b/src/assets/wise5/authoringTool/components/AbstractComponentAuthoring.ts index 9639529f493..45baa89d086 100644 --- a/src/assets/wise5/authoringTool/components/AbstractComponentAuthoring.ts +++ b/src/assets/wise5/authoringTool/components/AbstractComponentAuthoring.ts @@ -3,8 +3,8 @@ import { Subject, Subscription } from 'rxjs'; import { debounceTime, distinctUntilChanged } from 'rxjs/operators'; import { ProjectAssetService } from '../../../../app/services/projectAssetService'; import { ConfigService } from '../../services/configService'; -import { NodeService } from '../../services/nodeService'; import { TeacherProjectService } from '../../services/teacherProjectService'; +import { TeacherNodeService } from '../../services/teacherNodeService'; @Directive() export abstract class AbstractComponentAuthoring { @@ -19,7 +19,7 @@ export abstract class AbstractComponentAuthoring { constructor( protected configService: ConfigService, - protected nodeService: NodeService, + protected nodeService: TeacherNodeService, protected projectAssetService: ProjectAssetService, protected projectService: TeacherProjectService ) {} diff --git a/src/assets/wise5/authoringTool/components/save-starter-state/save-starter-state.component.ts b/src/assets/wise5/authoringTool/components/save-starter-state/save-starter-state.component.ts index e2dd75faa3c..1769b7cdcba 100644 --- a/src/assets/wise5/authoringTool/components/save-starter-state/save-starter-state.component.ts +++ b/src/assets/wise5/authoringTool/components/save-starter-state/save-starter-state.component.ts @@ -1,6 +1,6 @@ import { Component, Input, OnInit, SimpleChanges } from '@angular/core'; import { MatDialog } from '@angular/material/dialog'; -import { NodeService } from '../../../services/nodeService'; +import { TeacherNodeService } from '../../../services/teacherNodeService'; import { Component as WISEComponent } from '../../../common/Component'; @Component({ @@ -12,7 +12,7 @@ export class SaveStarterStateComponent implements OnInit { protected isDirty: boolean; @Input() private starterState: any; - constructor(private matDialog: MatDialog, private nodeService: NodeService) {} + constructor(private matDialog: MatDialog, private nodeService: TeacherNodeService) {} ngOnInit(): void {} diff --git a/src/assets/wise5/authoringTool/node/node-authoring/node-authoring.component.spec.ts b/src/assets/wise5/authoringTool/node/node-authoring/node-authoring.component.spec.ts index c8fc3e9a2c5..1d7ee1fa57c 100644 --- a/src/assets/wise5/authoringTool/node/node-authoring/node-authoring.component.spec.ts +++ b/src/assets/wise5/authoringTool/node/node-authoring/node-authoring.component.spec.ts @@ -22,6 +22,7 @@ import { DragDropModule } from '@angular/cdk/drag-drop'; import { RouterTestingModule } from '@angular/router/testing'; import { ActivatedRoute, Router, convertToParamMap } from '@angular/router'; import { of } from 'rxjs'; +import { TeacherNodeService } from '../../../services/teacherNodeService'; let component: NodeAuthoringComponent; let component1: any; @@ -56,6 +57,7 @@ describe('NodeAuthoringComponent', () => { ClassroomStatusService, ProjectAssetService, TeacherDataService, + TeacherNodeService, TeacherProjectService, TeacherWebSocketService, { diff --git a/src/assets/wise5/authoringTool/node/node-authoring/node-authoring.component.ts b/src/assets/wise5/authoringTool/node/node-authoring/node-authoring.component.ts index 0e7ad700ecb..abdadb64818 100644 --- a/src/assets/wise5/authoringTool/node/node-authoring/node-authoring.component.ts +++ b/src/assets/wise5/authoringTool/node/node-authoring/node-authoring.component.ts @@ -2,7 +2,6 @@ import { Component, OnInit } from '@angular/core'; import { Subscription, filter } from 'rxjs'; import { TeacherDataService } from '../../../services/teacherDataService'; import { TeacherProjectService } from '../../../services/teacherProjectService'; -import { NodeService } from '../../../services/nodeService'; import { ComponentTypeService } from '../../../services/componentTypeService'; import { ComponentServiceLookupService } from '../../../services/componentServiceLookupService'; import { Node } from '../../../common/Node'; @@ -15,6 +14,7 @@ import { Component as WiseComponent } from '../../../common/Component'; import { ChooseNewComponent } from '../../../../../app/authoring-tool/add-component/choose-new-component/choose-new-component.component'; import { CdkDragDrop, moveItemInArray } from '@angular/cdk/drag-drop'; import { ActivatedRoute, Router } from '@angular/router'; +import { TeacherNodeService } from '../../../services/teacherNodeService'; @Component({ selector: 'node-authoring', @@ -39,7 +39,7 @@ export class NodeAuthoringComponent implements OnInit { private componentServiceLookupService: ComponentServiceLookupService, private componentTypeService: ComponentTypeService, private dialog: MatDialog, - private nodeService: NodeService, + private nodeService: TeacherNodeService, private projectService: TeacherProjectService, private dataService: TeacherDataService, private route: ActivatedRoute, diff --git a/src/assets/wise5/components/animation/animation-authoring/animation-authoring.component.spec.ts b/src/assets/wise5/components/animation/animation-authoring/animation-authoring.component.spec.ts index a36599154df..a7e06ef9c5b 100644 --- a/src/assets/wise5/components/animation/animation-authoring/animation-authoring.component.spec.ts +++ b/src/assets/wise5/components/animation/animation-authoring/animation-authoring.component.spec.ts @@ -11,11 +11,11 @@ import { EditComponentPrompt } from '../../../../../app/authoring-tool/edit-comp import { ProjectAssetService } from '../../../../../app/services/projectAssetService'; import { StudentTeacherCommonServicesModule } from '../../../../../app/student-teacher-common-services.module'; import { copy } from '../../../common/object/object'; -import { NodeService } from '../../../services/nodeService'; import { TeacherProjectService } from '../../../services/teacherProjectService'; import { MockNodeService } from '../../common/MockNodeService'; import { AnimationAuthoring } from './animation-authoring.component'; import { MatDialogModule } from '@angular/material/dialog'; +import { TeacherNodeService } from '../../../services/teacherNodeService'; export class MockConfigService {} @@ -39,7 +39,7 @@ describe('AnimationAuthoring', () => { ], declarations: [AnimationAuthoring, EditComponentPrompt], providers: [ - { provide: NodeService, useClass: MockNodeService }, + { provide: TeacherNodeService, useClass: MockNodeService }, ProjectAssetService, TeacherProjectService ] diff --git a/src/assets/wise5/components/animation/animation-authoring/animation-authoring.component.ts b/src/assets/wise5/components/animation/animation-authoring/animation-authoring.component.ts index bee0a240795..ef0fb3aea93 100644 --- a/src/assets/wise5/components/animation/animation-authoring/animation-authoring.component.ts +++ b/src/assets/wise5/components/animation/animation-authoring/animation-authoring.component.ts @@ -7,10 +7,10 @@ import { ProjectAssetService } from '../../../../../app/services/projectAssetSer import { AbstractComponentAuthoring } from '../../../authoringTool/components/AbstractComponentAuthoring'; import { generateRandomKey } from '../../../common/string/string'; import { ConfigService } from '../../../services/configService'; -import { NodeService } from '../../../services/nodeService'; import { TeacherProjectService } from '../../../services/teacherProjectService'; import { MatDialog } from '@angular/material/dialog'; import { AssetChooser } from '../../../authoringTool/project-asset-authoring/asset-chooser'; +import { TeacherNodeService } from '../../../services/teacherNodeService'; @Component({ selector: 'animation-authoring', @@ -26,7 +26,7 @@ export class AnimationAuthoring extends AbstractComponentAuthoring { constructor( protected ConfigService: ConfigService, private dialog: MatDialog, - protected NodeService: NodeService, + protected NodeService: TeacherNodeService, protected ProjectAssetService: ProjectAssetService, protected ProjectService: TeacherProjectService ) { diff --git a/src/assets/wise5/components/audioOscillator/audio-oscillator-authoring/audio-oscillator-authoring.component.spec.ts b/src/assets/wise5/components/audioOscillator/audio-oscillator-authoring/audio-oscillator-authoring.component.spec.ts index 68b92b6bd20..f871b11f42b 100644 --- a/src/assets/wise5/components/audioOscillator/audio-oscillator-authoring/audio-oscillator-authoring.component.spec.ts +++ b/src/assets/wise5/components/audioOscillator/audio-oscillator-authoring/audio-oscillator-authoring.component.spec.ts @@ -11,6 +11,7 @@ import { StudentTeacherCommonServicesModule } from '../../../../../app/student-t import { TeacherProjectService } from '../../../services/teacherProjectService'; import { AudioOscillatorService } from '../audioOscillatorService'; import { AudioOscillatorAuthoring } from './audio-oscillator-authoring.component'; +import { TeacherNodeService } from '../../../services/teacherNodeService'; let component: AudioOscillatorAuthoring; let fixture: ComponentFixture; @@ -30,7 +31,7 @@ describe('AudioOscillatorAuthoring', () => { StudentTeacherCommonServicesModule ], declarations: [EditComponentPrompt, AudioOscillatorAuthoring], - providers: [ProjectAssetService, TeacherProjectService] + providers: [ProjectAssetService, TeacherNodeService, TeacherProjectService] }); fixture = TestBed.createComponent(AudioOscillatorAuthoring); component = fixture.componentInstance; diff --git a/src/assets/wise5/components/audioOscillator/audio-oscillator-authoring/audio-oscillator-authoring.component.ts b/src/assets/wise5/components/audioOscillator/audio-oscillator-authoring/audio-oscillator-authoring.component.ts index 28372248d84..4d3e5b443fb 100644 --- a/src/assets/wise5/components/audioOscillator/audio-oscillator-authoring/audio-oscillator-authoring.component.ts +++ b/src/assets/wise5/components/audioOscillator/audio-oscillator-authoring/audio-oscillator-authoring.component.ts @@ -4,9 +4,9 @@ import { Component } from '@angular/core'; import { ProjectAssetService } from '../../../../../app/services/projectAssetService'; import { AbstractComponentAuthoring } from '../../../authoringTool/components/AbstractComponentAuthoring'; import { ConfigService } from '../../../services/configService'; -import { NodeService } from '../../../services/nodeService'; import { TeacherProjectService } from '../../../services/teacherProjectService'; import { AudioOscillatorService } from '../audioOscillatorService'; +import { TeacherNodeService } from '../../../services/teacherNodeService'; @Component({ selector: 'audio-oscillator-authoring', @@ -23,7 +23,7 @@ export class AudioOscillatorAuthoring extends AbstractComponentAuthoring { constructor( protected AudioOscillatorService: AudioOscillatorService, protected ConfigService: ConfigService, - protected NodeService: NodeService, + protected NodeService: TeacherNodeService, protected ProjectAssetService: ProjectAssetService, protected ProjectService: TeacherProjectService ) { diff --git a/src/assets/wise5/components/conceptMap/concept-map-authoring/concept-map-authoring.component.ts b/src/assets/wise5/components/conceptMap/concept-map-authoring/concept-map-authoring.component.ts index 780415e8b74..5c33db56052 100644 --- a/src/assets/wise5/components/conceptMap/concept-map-authoring/concept-map-authoring.component.ts +++ b/src/assets/wise5/components/conceptMap/concept-map-authoring/concept-map-authoring.component.ts @@ -4,12 +4,12 @@ import { Component } from '@angular/core'; import { ProjectAssetService } from '../../../../../app/services/projectAssetService'; import { AbstractComponentAuthoring } from '../../../authoringTool/components/AbstractComponentAuthoring'; import { ConfigService } from '../../../services/configService'; -import { NodeService } from '../../../services/nodeService'; import { TeacherProjectService } from '../../../services/teacherProjectService'; import { ConceptMapService } from '../conceptMapService'; import { MatDialog } from '@angular/material/dialog'; import { AssetChooser } from '../../../authoringTool/project-asset-authoring/asset-chooser'; import { filter } from 'rxjs/operators'; +import { TeacherNodeService } from '../../../services/teacherNodeService'; @Component({ selector: 'concept-map-authoring', @@ -24,7 +24,7 @@ export class ConceptMapAuthoring extends AbstractComponentAuthoring { private ConceptMapService: ConceptMapService, protected ConfigService: ConfigService, private dialog: MatDialog, - protected NodeService: NodeService, + protected NodeService: TeacherNodeService, protected ProjectAssetService: ProjectAssetService, protected ProjectService: TeacherProjectService ) { diff --git a/src/assets/wise5/components/conceptMap/concept-map-authoring/concept-map-authoring.module.ts b/src/assets/wise5/components/conceptMap/concept-map-authoring/concept-map-authoring.module.ts index 1db61953937..ef055fadafb 100644 --- a/src/assets/wise5/components/conceptMap/concept-map-authoring/concept-map-authoring.module.ts +++ b/src/assets/wise5/components/conceptMap/concept-map-authoring/concept-map-authoring.module.ts @@ -10,7 +10,6 @@ import { EditComponentPrompt } from '../../../../../app/authoring-tool/edit-comp import { ProjectAssetService } from '../../../../../app/services/projectAssetService'; import { AnnotationService } from '../../../services/annotationService'; import { ConfigService } from '../../../services/configService'; -import { NodeService } from '../../../services/nodeService'; import { ProjectService } from '../../../services/projectService'; import { SessionService } from '../../../services/sessionService'; import { StudentAssetService } from '../../../services/studentAssetService'; @@ -19,6 +18,7 @@ import { TagService } from '../../../services/tagService'; import { TeacherProjectService } from '../../../services/teacherProjectService'; import { ConceptMapService } from '../conceptMapService'; import { ConceptMapAuthoring } from './concept-map-authoring.component'; +import { TeacherNodeService } from '../../../services/teacherNodeService'; @NgModule({ declarations: [ConceptMapAuthoring, EditComponentPrompt], @@ -35,13 +35,13 @@ import { ConceptMapAuthoring } from './concept-map-authoring.component'; AnnotationService, ConceptMapService, ConfigService, - NodeService, ProjectAssetService, ProjectService, SessionService, StudentAssetService, StudentDataService, TagService, + TeacherNodeService, TeacherProjectService ], exports: [ConceptMapAuthoring, EditComponentPrompt] diff --git a/src/assets/wise5/components/conceptMap/edit-concept-map-advanced/edit-concept-map-advanced.component.spec.ts b/src/assets/wise5/components/conceptMap/edit-concept-map-advanced/edit-concept-map-advanced.component.spec.ts index b3860da5c9b..389ce3c26b8 100644 --- a/src/assets/wise5/components/conceptMap/edit-concept-map-advanced/edit-concept-map-advanced.component.spec.ts +++ b/src/assets/wise5/components/conceptMap/edit-concept-map-advanced/edit-concept-map-advanced.component.spec.ts @@ -24,6 +24,7 @@ import { NotebookService } from '../../../services/notebookService'; import { TeacherProjectService } from '../../../services/teacherProjectService'; import { ConceptMapContent } from '../ConceptMapContent'; import { EditConceptMapAdvancedComponent } from './edit-concept-map-advanced.component'; +import { TeacherNodeService } from '../../../services/teacherNodeService'; let component: EditConceptMapAdvancedComponent; let fixture: ComponentFixture; @@ -57,7 +58,7 @@ describe('EditConceptMapAdvancedComponent', () => { EditConnectedComponentsAddButtonComponent, EditConnectedComponentsComponent ], - providers: [TeacherProjectService], + providers: [TeacherNodeService, TeacherProjectService], schemas: [NO_ERRORS_SCHEMA] }).compileComponents(); }); diff --git a/src/assets/wise5/components/conceptMap/edit-concept-map-advanced/edit-concept-map-advanced.component.ts b/src/assets/wise5/components/conceptMap/edit-concept-map-advanced/edit-concept-map-advanced.component.ts index 38999989f10..c42db5d28ee 100644 --- a/src/assets/wise5/components/conceptMap/edit-concept-map-advanced/edit-concept-map-advanced.component.ts +++ b/src/assets/wise5/components/conceptMap/edit-concept-map-advanced/edit-concept-map-advanced.component.ts @@ -1,9 +1,9 @@ import { Component } from '@angular/core'; import { EditAdvancedComponentComponent } from '../../../../../app/authoring-tool/edit-advanced-component/edit-advanced-component.component'; -import { NodeService } from '../../../services/nodeService'; import { NotebookService } from '../../../services/notebookService'; import { TeacherProjectService } from '../../../services/teacherProjectService'; import { ConceptMapContent } from '../ConceptMapContent'; +import { TeacherNodeService } from '../../../services/teacherNodeService'; @Component({ selector: 'edit-concept-map-advanced', @@ -15,7 +15,7 @@ export class EditConceptMapAdvancedComponent extends EditAdvancedComponentCompon allowedConnectedComponentTypes = ['ConceptMap', 'Draw', 'Embedded', 'Graph', 'Label', 'Table']; constructor( - protected nodeService: NodeService, + protected nodeService: TeacherNodeService, protected notebookService: NotebookService, protected projectService: TeacherProjectService ) { diff --git a/src/assets/wise5/components/dialogGuidance/dialog-guidance-authoring/dialog-guidance-authoring.component.spec.ts b/src/assets/wise5/components/dialogGuidance/dialog-guidance-authoring/dialog-guidance-authoring.component.spec.ts index a7367c0827a..3e18f59a93e 100644 --- a/src/assets/wise5/components/dialogGuidance/dialog-guidance-authoring/dialog-guidance-authoring.component.spec.ts +++ b/src/assets/wise5/components/dialogGuidance/dialog-guidance-authoring/dialog-guidance-authoring.component.spec.ts @@ -6,6 +6,7 @@ import { copy } from '../../../common/object/object'; import { TeacherProjectService } from '../../../services/teacherProjectService'; import { DialogGuidanceAuthoringComponent } from './dialog-guidance-authoring.component'; import { DialogGuidanceAuthoringModule } from './dialog-guidance-authoring.module'; +import { TeacherNodeService } from '../../../services/teacherNodeService'; const componentContent = { id: 'i64ex48j1z', @@ -28,7 +29,8 @@ describe('DialogGuidanceAuthoringComponent', () => { DialogGuidanceAuthoringModule, HttpClientTestingModule, StudentTeacherCommonServicesModule - ] + ], + providers: [TeacherNodeService] }); fixture = TestBed.createComponent(DialogGuidanceAuthoringComponent); component = fixture.componentInstance; diff --git a/src/assets/wise5/components/dialogGuidance/dialog-guidance-authoring/dialog-guidance-authoring.component.ts b/src/assets/wise5/components/dialogGuidance/dialog-guidance-authoring/dialog-guidance-authoring.component.ts index 423c22e0dad..d3ba57b1e68 100644 --- a/src/assets/wise5/components/dialogGuidance/dialog-guidance-authoring/dialog-guidance-authoring.component.ts +++ b/src/assets/wise5/components/dialogGuidance/dialog-guidance-authoring/dialog-guidance-authoring.component.ts @@ -1,10 +1,10 @@ import { Component } from '@angular/core'; import { AbstractComponentAuthoring } from '../../../authoringTool/components/AbstractComponentAuthoring'; import { ConfigService } from '../../../services/configService'; -import { NodeService } from '../../../services/nodeService'; import { ProjectAssetService } from '../../../../../app/services/projectAssetService'; import { TeacherProjectService } from '../../../services/teacherProjectService'; import { DialogGuidanceService } from '../dialogGuidanceService'; +import { TeacherNodeService } from '../../../services/teacherNodeService'; @Component({ selector: 'dialog-guidance-authoring', @@ -15,7 +15,7 @@ export class DialogGuidanceAuthoringComponent extends AbstractComponentAuthoring constructor( protected configService: ConfigService, private dialogGuidanceService: DialogGuidanceService, - protected nodeService: NodeService, + protected nodeService: TeacherNodeService, protected projectAssetService: ProjectAssetService, protected projectService: TeacherProjectService ) { diff --git a/src/assets/wise5/components/discussion/discussion-authoring/discussion-authoring.component.ts b/src/assets/wise5/components/discussion/discussion-authoring/discussion-authoring.component.ts index 2bbee87af58..534d3758486 100644 --- a/src/assets/wise5/components/discussion/discussion-authoring/discussion-authoring.component.ts +++ b/src/assets/wise5/components/discussion/discussion-authoring/discussion-authoring.component.ts @@ -4,8 +4,8 @@ import { Component } from '@angular/core'; import { ProjectAssetService } from '../../../../../app/services/projectAssetService'; import { AbstractComponentAuthoring } from '../../../authoringTool/components/AbstractComponentAuthoring'; import { ConfigService } from '../../../services/configService'; -import { NodeService } from '../../../services/nodeService'; import { TeacherProjectService } from '../../../services/teacherProjectService'; +import { TeacherNodeService } from '../../../services/teacherNodeService'; @Component({ selector: 'discussion-authoring', @@ -15,7 +15,7 @@ import { TeacherProjectService } from '../../../services/teacherProjectService'; export class DiscussionAuthoring extends AbstractComponentAuthoring { constructor( protected ConfigService: ConfigService, - protected NodeService: NodeService, + protected NodeService: TeacherNodeService, protected ProjectAssetService: ProjectAssetService, protected ProjectService: TeacherProjectService ) { diff --git a/src/assets/wise5/components/draw/draw-authoring/draw-authoring.component.ts b/src/assets/wise5/components/draw/draw-authoring/draw-authoring.component.ts index d6a28fac831..4841efe523b 100644 --- a/src/assets/wise5/components/draw/draw-authoring/draw-authoring.component.ts +++ b/src/assets/wise5/components/draw/draw-authoring/draw-authoring.component.ts @@ -10,6 +10,7 @@ import { Subject } from 'rxjs'; import { debounceTime, distinctUntilChanged, filter } from 'rxjs/operators'; import { MatDialog } from '@angular/material/dialog'; import { AssetChooser } from '../../../authoringTool/project-asset-authoring/asset-chooser'; +import { TeacherNodeService } from '../../../services/teacherNodeService'; @Component({ selector: 'draw-authoring', @@ -48,7 +49,7 @@ export class DrawAuthoring extends AbstractComponentAuthoring { constructor( protected ConfigService: ConfigService, private dialog: MatDialog, - protected NodeService: NodeService, + protected NodeService: TeacherNodeService, protected ProjectAssetService: ProjectAssetService, protected ProjectService: TeacherProjectService ) { diff --git a/src/assets/wise5/components/draw/draw-authoring/draw-authoring.module.ts b/src/assets/wise5/components/draw/draw-authoring/draw-authoring.module.ts index ad77ecdab9f..433503f45cd 100644 --- a/src/assets/wise5/components/draw/draw-authoring/draw-authoring.module.ts +++ b/src/assets/wise5/components/draw/draw-authoring/draw-authoring.module.ts @@ -10,7 +10,6 @@ import { EditComponentPrompt } from '../../../../../app/authoring-tool/edit-comp import { ProjectAssetService } from '../../../../../app/services/projectAssetService'; import { AnnotationService } from '../../../services/annotationService'; import { ConfigService } from '../../../services/configService'; -import { NodeService } from '../../../services/nodeService'; import { ProjectService } from '../../../services/projectService'; import { SessionService } from '../../../services/sessionService'; import { StudentAssetService } from '../../../services/studentAssetService'; @@ -19,6 +18,7 @@ import { TagService } from '../../../services/tagService'; import { TeacherProjectService } from '../../../services/teacherProjectService'; import { DrawService } from '../drawService'; import { DrawAuthoring } from './draw-authoring.component'; +import { TeacherNodeService } from '../../../services/teacherNodeService'; @NgModule({ declarations: [DrawAuthoring, EditComponentPrompt], @@ -35,13 +35,13 @@ import { DrawAuthoring } from './draw-authoring.component'; AnnotationService, ConfigService, DrawService, - NodeService, ProjectAssetService, ProjectService, SessionService, StudentAssetService, StudentDataService, TagService, + TeacherNodeService, TeacherProjectService ], exports: [DrawAuthoring, EditComponentPrompt] diff --git a/src/assets/wise5/components/embedded/embedded-authoring/embedded-authoring.component.spec.ts b/src/assets/wise5/components/embedded/embedded-authoring/embedded-authoring.component.spec.ts index ece52ae96b8..615fa8f43a6 100644 --- a/src/assets/wise5/components/embedded/embedded-authoring/embedded-authoring.component.spec.ts +++ b/src/assets/wise5/components/embedded/embedded-authoring/embedded-authoring.component.spec.ts @@ -6,6 +6,7 @@ import { copy } from '../../../common/object/object'; import { TeacherProjectService } from '../../../services/teacherProjectService'; import { EmbeddedAuthoring } from './embedded-authoring.component'; import { EmbeddedAuthoringModule } from './embedded-authoring.module'; +import { TeacherNodeService } from '../../../services/teacherNodeService'; let component: EmbeddedAuthoring; let fixture: ComponentFixture; @@ -18,7 +19,8 @@ describe('EmbeddedAuthoringComponent', () => { EmbeddedAuthoringModule, HttpClientTestingModule, StudentTeacherCommonServicesModule - ] + ], + providers: [TeacherNodeService] }); fixture = TestBed.createComponent(EmbeddedAuthoring); component = fixture.componentInstance; diff --git a/src/assets/wise5/components/embedded/embedded-authoring/embedded-authoring.component.ts b/src/assets/wise5/components/embedded/embedded-authoring/embedded-authoring.component.ts index 622cf8cec14..521aaf7453a 100644 --- a/src/assets/wise5/components/embedded/embedded-authoring/embedded-authoring.component.ts +++ b/src/assets/wise5/components/embedded/embedded-authoring/embedded-authoring.component.ts @@ -4,12 +4,12 @@ import { Component } from '@angular/core'; import { ProjectAssetService } from '../../../../../app/services/projectAssetService'; import { AbstractComponentAuthoring } from '../../../authoringTool/components/AbstractComponentAuthoring'; import { ConfigService } from '../../../services/configService'; -import { NodeService } from '../../../services/nodeService'; import { TeacherProjectService } from '../../../services/teacherProjectService'; import { EmbeddedService } from '../embeddedService'; import { MatDialog } from '@angular/material/dialog'; import { AssetChooser } from '../../../authoringTool/project-asset-authoring/asset-chooser'; import { filter } from 'rxjs/operators'; +import { TeacherNodeService } from '../../../services/teacherNodeService'; @Component({ selector: 'embedded-authoring', @@ -23,7 +23,7 @@ export class EmbeddedAuthoring extends AbstractComponentAuthoring { protected ConfigService: ConfigService, private dialog: MatDialog, private EmbeddedService: EmbeddedService, - protected NodeService: NodeService, + protected NodeService: TeacherNodeService, protected ProjectAssetService: ProjectAssetService, protected ProjectService: TeacherProjectService ) { diff --git a/src/assets/wise5/components/graph/edit-graph-advanced/edit-graph-advanced.component.spec.ts b/src/assets/wise5/components/graph/edit-graph-advanced/edit-graph-advanced.component.spec.ts index 8a2284b48a2..dd2b1b66397 100644 --- a/src/assets/wise5/components/graph/edit-graph-advanced/edit-graph-advanced.component.spec.ts +++ b/src/assets/wise5/components/graph/edit-graph-advanced/edit-graph-advanced.component.spec.ts @@ -25,6 +25,7 @@ import { NotebookService } from '../../../services/notebookService'; import { TeacherProjectService } from '../../../services/teacherProjectService'; import { GraphContent } from '../GraphContent'; import { EditGraphAdvancedComponent } from './edit-graph-advanced.component'; +import { TeacherNodeService } from '../../../services/teacherNodeService'; let component: EditGraphAdvancedComponent; let fixture: ComponentFixture; @@ -58,7 +59,7 @@ describe('EditGraphAdvancedComponent', () => { EditConnectedComponentsComponent, EditGraphAdvancedComponent ], - providers: [TeacherProjectService], + providers: [TeacherNodeService, TeacherProjectService], schemas: [NO_ERRORS_SCHEMA] }).compileComponents(); }); diff --git a/src/assets/wise5/components/graph/graph-authoring/graph-authoring.component.spec.ts b/src/assets/wise5/components/graph/graph-authoring/graph-authoring.component.spec.ts index 7a0dd817bc2..2eddda1bf2a 100644 --- a/src/assets/wise5/components/graph/graph-authoring/graph-authoring.component.spec.ts +++ b/src/assets/wise5/components/graph/graph-authoring/graph-authoring.component.spec.ts @@ -17,6 +17,7 @@ import { StudentTeacherCommonServicesModule } from '../../../../../app/student-t import { copy } from '../../../common/object/object'; import { TeacherProjectService } from '../../../services/teacherProjectService'; import { GraphAuthoring } from './graph-authoring.component'; +import { TeacherNodeService } from '../../../services/teacherNodeService'; let component: GraphAuthoring; let fixture: ComponentFixture; @@ -41,7 +42,7 @@ describe('GraphAuthoringComponent', () => { StudentTeacherCommonServicesModule ], declarations: [GraphAuthoring, EditComponentPrompt], - providers: [ProjectAssetService, TeacherProjectService] + providers: [ProjectAssetService, TeacherNodeService, TeacherProjectService] }); fixture = TestBed.createComponent(GraphAuthoring); component = fixture.componentInstance; diff --git a/src/assets/wise5/components/graph/graph-authoring/graph-authoring.component.ts b/src/assets/wise5/components/graph/graph-authoring/graph-authoring.component.ts index c22c69318e8..4d0de11ce08 100644 --- a/src/assets/wise5/components/graph/graph-authoring/graph-authoring.component.ts +++ b/src/assets/wise5/components/graph/graph-authoring/graph-authoring.component.ts @@ -4,13 +4,13 @@ import { Component } from '@angular/core'; import { ProjectAssetService } from '../../../../../app/services/projectAssetService'; import { AbstractComponentAuthoring } from '../../../authoringTool/components/AbstractComponentAuthoring'; import { ConfigService } from '../../../services/configService'; -import { NodeService } from '../../../services/nodeService'; import { TeacherProjectService } from '../../../services/teacherProjectService'; import { GraphService } from '../graphService'; import { isMultipleYAxes } from '../util'; import { MatDialog } from '@angular/material/dialog'; import { AssetChooser } from '../../../authoringTool/project-asset-authoring/asset-chooser'; import { filter } from 'rxjs/operators'; +import { TeacherNodeService } from '../../../services/teacherNodeService'; @Component({ selector: 'graph-authoring', @@ -134,7 +134,7 @@ export class GraphAuthoring extends AbstractComponentAuthoring { protected ConfigService: ConfigService, private dialog: MatDialog, private GraphService: GraphService, - protected NodeService: NodeService, + protected NodeService: TeacherNodeService, protected ProjectAssetService: ProjectAssetService, protected ProjectService: TeacherProjectService ) { diff --git a/src/assets/wise5/components/html/html-authoring/html-authoring.component.ts b/src/assets/wise5/components/html/html-authoring/html-authoring.component.ts index 539f073b7bd..71dc9e3045f 100644 --- a/src/assets/wise5/components/html/html-authoring/html-authoring.component.ts +++ b/src/assets/wise5/components/html/html-authoring/html-authoring.component.ts @@ -3,8 +3,8 @@ import { ProjectAssetService } from '../../../../../app/services/projectAssetSer import { AbstractComponentAuthoring } from '../../../authoringTool/components/AbstractComponentAuthoring'; import { insertWiseLinks, replaceWiseLinks } from '../../../common/wise-link/wise-link'; import { ConfigService } from '../../../services/configService'; -import { NodeService } from '../../../services/nodeService'; import { TeacherProjectService } from '../../../services/teacherProjectService'; +import { TeacherNodeService } from '../../../services/teacherNodeService'; @Component({ selector: 'html-authoring', @@ -15,9 +15,9 @@ export class HtmlAuthoring extends AbstractComponentAuthoring { constructor( protected configService: ConfigService, - protected nodeService: NodeService, + protected nodeService: TeacherNodeService, protected projectAssetService: ProjectAssetService, - protected projectService: TeacherProjectService, + protected projectService: TeacherProjectService ) { super(configService, nodeService, projectAssetService, projectService); } diff --git a/src/assets/wise5/components/label/label-authoring/label-authoring.component.ts b/src/assets/wise5/components/label/label-authoring/label-authoring.component.ts index 9af75fb509a..175e3147939 100644 --- a/src/assets/wise5/components/label/label-authoring/label-authoring.component.ts +++ b/src/assets/wise5/components/label/label-authoring/label-authoring.component.ts @@ -3,13 +3,13 @@ import { Component } from '@angular/core'; import { AbstractComponentAuthoring } from '../../../authoringTool/components/AbstractComponentAuthoring'; import { ConfigService } from '../../../services/configService'; -import { NodeService } from '../../../services/nodeService'; import { TeacherProjectService } from '../../../services/teacherProjectService'; import { Subject } from 'rxjs'; import { debounceTime, distinctUntilChanged, filter } from 'rxjs/operators'; import { ProjectAssetService } from '../../../../../app/services/projectAssetService'; import { MatDialog } from '@angular/material/dialog'; import { AssetChooser } from '../../../authoringTool/project-asset-authoring/asset-chooser'; +import { TeacherNodeService } from '../../../services/teacherNodeService'; @Component({ selector: 'label-authoring', @@ -23,7 +23,7 @@ export class LabelAuthoring extends AbstractComponentAuthoring { constructor( protected ConfigService: ConfigService, private dialog: MatDialog, - protected NodeService: NodeService, + protected NodeService: TeacherNodeService, protected ProjectAssetService: ProjectAssetService, protected ProjectService: TeacherProjectService ) { diff --git a/src/assets/wise5/components/match/match-authoring/match-authoring.component.ts b/src/assets/wise5/components/match/match-authoring/match-authoring.component.ts index 220a1924578..2bad840af2e 100644 --- a/src/assets/wise5/components/match/match-authoring/match-authoring.component.ts +++ b/src/assets/wise5/components/match/match-authoring/match-authoring.component.ts @@ -5,11 +5,11 @@ import { ProjectAssetService } from '../../../../../app/services/projectAssetSer import { AbstractComponentAuthoring } from '../../../authoringTool/components/AbstractComponentAuthoring'; import { generateRandomKey } from '../../../common/string/string'; import { ConfigService } from '../../../services/configService'; -import { NodeService } from '../../../services/nodeService'; import { TeacherProjectService } from '../../../services/teacherProjectService'; import { MatchService } from '../matchService'; import { MatDialog } from '@angular/material/dialog'; import { AssetChooser } from '../../../authoringTool/project-asset-authoring/asset-chooser'; +import { TeacherNodeService } from '../../../services/teacherNodeService'; @Component({ selector: 'match-authoring', @@ -24,7 +24,7 @@ export class MatchAuthoring extends AbstractComponentAuthoring { protected configService: ConfigService, private dialog: MatDialog, private matchService: MatchService, - protected nodeService: NodeService, + protected nodeService: TeacherNodeService, protected projectAssetService: ProjectAssetService, protected projectService: TeacherProjectService ) { diff --git a/src/assets/wise5/components/multipleChoice/multiple-choice-authoring/multiple-choice-authoring.component.ts b/src/assets/wise5/components/multipleChoice/multiple-choice-authoring/multiple-choice-authoring.component.ts index 74034237c01..bd0c8c062aa 100644 --- a/src/assets/wise5/components/multipleChoice/multiple-choice-authoring/multiple-choice-authoring.component.ts +++ b/src/assets/wise5/components/multipleChoice/multiple-choice-authoring/multiple-choice-authoring.component.ts @@ -5,10 +5,10 @@ import { ProjectAssetService } from '../../../../../app/services/projectAssetSer import { AbstractComponentAuthoring } from '../../../authoringTool/components/AbstractComponentAuthoring'; import { generateRandomKey } from '../../../common/string/string'; import { ConfigService } from '../../../services/configService'; -import { NodeService } from '../../../services/nodeService'; import { TeacherProjectService } from '../../../services/teacherProjectService'; import { MatDialog } from '@angular/material/dialog'; import { AssetChooser } from '../../../authoringTool/project-asset-authoring/asset-chooser'; +import { TeacherNodeService } from '../../../services/teacherNodeService'; @Component({ selector: 'multiple-choice-authoring', @@ -23,7 +23,7 @@ export class MultipleChoiceAuthoring extends AbstractComponentAuthoring { constructor( protected ConfigService: ConfigService, private dialog: MatDialog, - protected NodeService: NodeService, + protected NodeService: TeacherNodeService, protected ProjectAssetService: ProjectAssetService, protected ProjectService: TeacherProjectService ) { diff --git a/src/assets/wise5/components/openResponse/edit-open-response-advanced/edit-open-response-advanced.component.spec.ts b/src/assets/wise5/components/openResponse/edit-open-response-advanced/edit-open-response-advanced.component.spec.ts index f917740810a..508386a3ee7 100644 --- a/src/assets/wise5/components/openResponse/edit-open-response-advanced/edit-open-response-advanced.component.spec.ts +++ b/src/assets/wise5/components/openResponse/edit-open-response-advanced/edit-open-response-advanced.component.spec.ts @@ -26,6 +26,7 @@ import { NotebookService } from '../../../services/notebookService'; import { TeacherProjectService } from '../../../services/teacherProjectService'; import { OpenResponseContent } from '../OpenResponseContent'; import { EditOpenResponseAdvancedComponent } from './edit-open-response-advanced.component'; +import { TeacherNodeService } from '../../../services/teacherNodeService'; let component: EditOpenResponseAdvancedComponent; let fixture: ComponentFixture; @@ -62,7 +63,7 @@ describe('EditOpenResponseAdvancedComponent', () => { EditConnectedComponentsComponent, EditOpenResponseAdvancedComponent ], - providers: [TeacherProjectService], + providers: [TeacherNodeService, TeacherProjectService], schemas: [NO_ERRORS_SCHEMA] }).compileComponents(); }); diff --git a/src/assets/wise5/components/openResponse/edit-open-response-advanced/edit-open-response-advanced.component.ts b/src/assets/wise5/components/openResponse/edit-open-response-advanced/edit-open-response-advanced.component.ts index e7bd4eaf612..c00fc31de1d 100644 --- a/src/assets/wise5/components/openResponse/edit-open-response-advanced/edit-open-response-advanced.component.ts +++ b/src/assets/wise5/components/openResponse/edit-open-response-advanced/edit-open-response-advanced.component.ts @@ -1,10 +1,10 @@ import { Component } from '@angular/core'; import { EditAdvancedComponentComponent } from '../../../../../app/authoring-tool/edit-advanced-component/edit-advanced-component.component'; import { CRaterService } from '../../../services/cRaterService'; -import { NodeService } from '../../../services/nodeService'; import { NotebookService } from '../../../services/notebookService'; import { TeacherProjectService } from '../../../services/teacherProjectService'; import { OpenResponseContent } from '../OpenResponseContent'; +import { TeacherNodeService } from '../../../services/teacherNodeService'; @Component({ selector: 'edit-open-response-advanced', @@ -28,7 +28,7 @@ export class EditOpenResponseAdvancedComponent extends EditAdvancedComponentComp constructor( protected cRaterService: CRaterService, - protected nodeService: NodeService, + protected nodeService: TeacherNodeService, protected notebookService: NotebookService, protected teacherProjectService: TeacherProjectService ) { diff --git a/src/assets/wise5/components/outsideURL/outside-url-authoring/outside-url-authoring.component.ts b/src/assets/wise5/components/outsideURL/outside-url-authoring/outside-url-authoring.component.ts index cacc912edf9..7855369ec18 100644 --- a/src/assets/wise5/components/outsideURL/outside-url-authoring/outside-url-authoring.component.ts +++ b/src/assets/wise5/components/outsideURL/outside-url-authoring/outside-url-authoring.component.ts @@ -4,9 +4,9 @@ import { debounceTime, distinctUntilChanged } from 'rxjs/operators'; import { ProjectAssetService } from '../../../../../app/services/projectAssetService'; import { AbstractComponentAuthoring } from '../../../authoringTool/components/AbstractComponentAuthoring'; import { ConfigService } from '../../../services/configService'; -import { NodeService } from '../../../services/nodeService'; import { TeacherProjectService } from '../../../services/teacherProjectService'; import { OutsideURLService } from '../outsideURLService'; +import { TeacherNodeService } from '../../../services/teacherNodeService'; @Component({ selector: 'outside-url-authoring', @@ -45,7 +45,7 @@ export class OutsideUrlAuthoring extends AbstractComponentAuthoring { constructor( protected ConfigService: ConfigService, - protected NodeService: NodeService, + protected NodeService: TeacherNodeService, protected OutsideURLService: OutsideURLService, protected ProjectAssetService: ProjectAssetService, protected ProjectService: TeacherProjectService diff --git a/src/assets/wise5/components/peerChat/edit-peer-chat-advanced-component/edit-peer-chat-advanced-component.component.spec.ts b/src/assets/wise5/components/peerChat/edit-peer-chat-advanced-component/edit-peer-chat-advanced-component.component.spec.ts index 4260437c71c..6ce4c250fa9 100644 --- a/src/assets/wise5/components/peerChat/edit-peer-chat-advanced-component/edit-peer-chat-advanced-component.component.spec.ts +++ b/src/assets/wise5/components/peerChat/edit-peer-chat-advanced-component/edit-peer-chat-advanced-component.component.spec.ts @@ -6,6 +6,7 @@ import { TeacherProjectService } from '../../../services/teacherProjectService'; import { PeerChatContent } from '../PeerChatContent'; import { EditPeerChatAdvancedComponentComponent } from './edit-peer-chat-advanced-component.component'; import { NO_ERRORS_SCHEMA } from '@angular/core'; +import { TeacherNodeService } from '../../../services/teacherNodeService'; describe('EditPeerChatAdvancedComponentComponent', () => { let component: EditPeerChatAdvancedComponentComponent; @@ -15,7 +16,7 @@ describe('EditPeerChatAdvancedComponentComponent', () => { await TestBed.configureTestingModule({ imports: [HttpClientTestingModule, MatDialogModule, StudentTeacherCommonServicesModule], declarations: [EditPeerChatAdvancedComponentComponent], - providers: [TeacherProjectService], + providers: [TeacherNodeService, TeacherProjectService], schemas: [NO_ERRORS_SCHEMA] }).compileComponents(); }); diff --git a/src/assets/wise5/components/peerChat/edit-peer-chat-advanced-component/edit-peer-chat-advanced-component.component.ts b/src/assets/wise5/components/peerChat/edit-peer-chat-advanced-component/edit-peer-chat-advanced-component.component.ts index b94e2ca6d0b..f31fdc7609b 100644 --- a/src/assets/wise5/components/peerChat/edit-peer-chat-advanced-component/edit-peer-chat-advanced-component.component.ts +++ b/src/assets/wise5/components/peerChat/edit-peer-chat-advanced-component/edit-peer-chat-advanced-component.component.ts @@ -1,8 +1,8 @@ import { Component } from '@angular/core'; import { EditAdvancedComponentComponent } from '../../../../../app/authoring-tool/edit-advanced-component/edit-advanced-component.component'; -import { NodeService } from '../../../services/nodeService'; import { NotebookService } from '../../../services/notebookService'; import { TeacherProjectService } from '../../../services/teacherProjectService'; +import { TeacherNodeService } from '../../../services/teacherNodeService'; @Component({ selector: 'edit-peer-chat-advanced', @@ -11,7 +11,7 @@ import { TeacherProjectService } from '../../../services/teacherProjectService'; }) export class EditPeerChatAdvancedComponentComponent extends EditAdvancedComponentComponent { constructor( - protected nodeService: NodeService, + protected nodeService: TeacherNodeService, protected notebookService: NotebookService, protected projectService: TeacherProjectService ) { diff --git a/src/assets/wise5/components/peerChat/peer-chat-authoring/peer-chat-authoring.component.spec.ts b/src/assets/wise5/components/peerChat/peer-chat-authoring/peer-chat-authoring.component.spec.ts index e0d732b1db0..47e54cdf902 100644 --- a/src/assets/wise5/components/peerChat/peer-chat-authoring/peer-chat-authoring.component.spec.ts +++ b/src/assets/wise5/components/peerChat/peer-chat-authoring/peer-chat-authoring.component.spec.ts @@ -11,7 +11,6 @@ import { EditComponentPrompt } from '../../../../../app/authoring-tool/edit-comp import { ProjectAssetService } from '../../../../../app/services/projectAssetService'; import { copy } from '../../../common/object/object'; import { ConfigService } from '../../../services/configService'; -import { NodeService } from '../../../services/nodeService'; import { ProjectService } from '../../../services/projectService'; import { SessionService } from '../../../services/sessionService'; import { TeacherProjectService } from '../../../services/teacherProjectService'; @@ -19,6 +18,7 @@ import { MockNodeService } from '../../common/MockNodeService'; import { PeerChatAuthoringComponent } from './peer-chat-authoring.component'; import { StudentTeacherCommonServicesModule } from '../../../../../app/student-teacher-common-services.module'; import { NO_ERRORS_SCHEMA } from '@angular/core'; +import { TeacherNodeService } from '../../../services/teacherNodeService'; const componentContent = { id: 'qn3savv52r', @@ -60,7 +60,7 @@ describe('PeerChatAuthoringComponent', () => { declarations: [EditComponentPrompt, PeerChatAuthoringComponent], providers: [ ConfigService, - { provide: NodeService, useClass: MockNodeService }, + { provide: TeacherNodeService, useClass: MockNodeService }, ProjectAssetService, ProjectService, SessionService, diff --git a/src/assets/wise5/components/peerChat/peer-chat-authoring/peer-chat-authoring.component.ts b/src/assets/wise5/components/peerChat/peer-chat-authoring/peer-chat-authoring.component.ts index f2d7ff3aa63..4690fc17946 100644 --- a/src/assets/wise5/components/peerChat/peer-chat-authoring/peer-chat-authoring.component.ts +++ b/src/assets/wise5/components/peerChat/peer-chat-authoring/peer-chat-authoring.component.ts @@ -2,9 +2,9 @@ import { Component } from '@angular/core'; import { ProjectAssetService } from '../../../../../app/services/projectAssetService'; import { AbstractComponentAuthoring } from '../../../authoringTool/components/AbstractComponentAuthoring'; import { ConfigService } from '../../../services/configService'; -import { NodeService } from '../../../services/nodeService'; import { TeacherProjectService } from '../../../services/teacherProjectService'; import peerChatLogicOptions from './peer-chat-logic-options'; +import { TeacherNodeService } from '../../../services/teacherNodeService'; @Component({ selector: 'peer-chat-authoring', @@ -27,7 +27,7 @@ export class PeerChatAuthoringComponent extends AbstractComponentAuthoring { constructor( protected configService: ConfigService, - protected nodeService: NodeService, + protected nodeService: TeacherNodeService, protected projectAssetService: ProjectAssetService, protected projectService: TeacherProjectService ) { diff --git a/src/assets/wise5/components/showGroupWork/show-group-work-authoring/show-group-work-authoring.component.spec.ts b/src/assets/wise5/components/showGroupWork/show-group-work-authoring/show-group-work-authoring.component.spec.ts index 0d8e8dd7798..e15ec719ca4 100644 --- a/src/assets/wise5/components/showGroupWork/show-group-work-authoring/show-group-work-authoring.component.spec.ts +++ b/src/assets/wise5/components/showGroupWork/show-group-work-authoring/show-group-work-authoring.component.spec.ts @@ -14,6 +14,7 @@ import { EditComponentPrompt } from '../../../../../app/authoring-tool/edit-comp import { MatCheckboxModule } from '@angular/material/checkbox'; import { StudentTeacherCommonServicesModule } from '../../../../../app/student-teacher-common-services.module'; import { NO_ERRORS_SCHEMA } from '@angular/core'; +import { TeacherNodeService } from '../../../services/teacherNodeService'; describe('ShowGroupWorkAuthoringComponent', () => { let component: ShowGroupWorkAuthoringComponent; @@ -35,7 +36,7 @@ describe('ShowGroupWorkAuthoringComponent', () => { StudentTeacherCommonServicesModule ], declarations: [EditComponentPrompt, ShowGroupWorkAuthoringComponent], - providers: [ProjectAssetService, TeacherProjectService], + providers: [ProjectAssetService, TeacherNodeService, TeacherProjectService], schemas: [NO_ERRORS_SCHEMA] }).compileComponents(); }); diff --git a/src/assets/wise5/components/showGroupWork/show-group-work-authoring/show-group-work-authoring.component.ts b/src/assets/wise5/components/showGroupWork/show-group-work-authoring/show-group-work-authoring.component.ts index 2d2fe91ebd2..cd1ad67fc08 100644 --- a/src/assets/wise5/components/showGroupWork/show-group-work-authoring/show-group-work-authoring.component.ts +++ b/src/assets/wise5/components/showGroupWork/show-group-work-authoring/show-group-work-authoring.component.ts @@ -1,9 +1,9 @@ import { Component } from '@angular/core'; import { ProjectAssetService } from '../../../../../app/services/projectAssetService'; import { ConfigService } from '../../../services/configService'; -import { NodeService } from '../../../services/nodeService'; import { TeacherProjectService } from '../../../services/teacherProjectService'; import { ShowMyWorkAuthoringComponent } from '../../showMyWork/show-my-work-authoring/show-my-work-authoring.component'; +import { TeacherNodeService } from '../../../services/teacherNodeService'; @Component({ selector: 'show-group-work-authoring', @@ -13,7 +13,7 @@ import { ShowMyWorkAuthoringComponent } from '../../showMyWork/show-my-work-auth export class ShowGroupWorkAuthoringComponent extends ShowMyWorkAuthoringComponent { constructor( protected configService: ConfigService, - protected nodeService: NodeService, + protected nodeService: TeacherNodeService, protected projectAssetService: ProjectAssetService, protected projectService: TeacherProjectService ) { diff --git a/src/assets/wise5/components/showMyWork/show-my-work-authoring/show-my-work-authoring.component.spec.ts b/src/assets/wise5/components/showMyWork/show-my-work-authoring/show-my-work-authoring.component.spec.ts index e5c3c88d7b7..b539105b46b 100644 --- a/src/assets/wise5/components/showMyWork/show-my-work-authoring/show-my-work-authoring.component.spec.ts +++ b/src/assets/wise5/components/showMyWork/show-my-work-authoring/show-my-work-authoring.component.spec.ts @@ -12,6 +12,7 @@ import { ProjectAssetService } from '../../../../../app/services/projectAssetSer import { StudentTeacherCommonServicesModule } from '../../../../../app/student-teacher-common-services.module'; import { TeacherProjectService } from '../../../services/teacherProjectService'; import { ShowMyWorkAuthoringComponent } from './show-my-work-authoring.component'; +import { TeacherNodeService } from '../../../services/teacherNodeService'; describe('ShowMyWorkAuthoringComponent', () => { let component: ShowMyWorkAuthoringComponent; @@ -43,7 +44,7 @@ describe('ShowMyWorkAuthoringComponent', () => { StudentTeacherCommonServicesModule ], declarations: [EditComponentPrompt, ShowMyWorkAuthoringComponent], - providers: [ProjectAssetService, TeacherProjectService] + providers: [ProjectAssetService, TeacherNodeService, TeacherProjectService] }).compileComponents(); }); diff --git a/src/assets/wise5/components/showMyWork/show-my-work-authoring/show-my-work-authoring.component.ts b/src/assets/wise5/components/showMyWork/show-my-work-authoring/show-my-work-authoring.component.ts index 342f44a2150..4153274f7f5 100644 --- a/src/assets/wise5/components/showMyWork/show-my-work-authoring/show-my-work-authoring.component.ts +++ b/src/assets/wise5/components/showMyWork/show-my-work-authoring/show-my-work-authoring.component.ts @@ -2,8 +2,8 @@ import { Component } from '@angular/core'; import { ProjectAssetService } from '../../../../../app/services/projectAssetService'; import { AbstractComponentAuthoring } from '../../../authoringTool/components/AbstractComponentAuthoring'; import { ConfigService } from '../../../services/configService'; -import { NodeService } from '../../../services/nodeService'; import { TeacherProjectService } from '../../../services/teacherProjectService'; +import { TeacherNodeService } from '../../../services/teacherNodeService'; @Component({ selector: 'show-my-work-authoring', @@ -30,7 +30,7 @@ export class ShowMyWorkAuthoringComponent extends AbstractComponentAuthoring { constructor( protected configService: ConfigService, - protected nodeService: NodeService, + protected nodeService: TeacherNodeService, protected projectAssetService: ProjectAssetService, protected projectService: TeacherProjectService ) { diff --git a/src/assets/wise5/components/summary/summary-authoring/summary-authoring.component.spec.ts b/src/assets/wise5/components/summary/summary-authoring/summary-authoring.component.spec.ts index 154cd731198..c839071adf1 100644 --- a/src/assets/wise5/components/summary/summary-authoring/summary-authoring.component.spec.ts +++ b/src/assets/wise5/components/summary/summary-authoring/summary-authoring.component.spec.ts @@ -14,10 +14,10 @@ import { EditComponentPrompt } from '../../../../../app/authoring-tool/edit-comp import { ProjectAssetService } from '../../../../../app/services/projectAssetService'; import { StudentTeacherCommonServicesModule } from '../../../../../app/student-teacher-common-services.module'; import { copy } from '../../../common/object/object'; -import { NodeService } from '../../../services/nodeService'; import { TeacherProjectService } from '../../../services/teacherProjectService'; import { MockNodeService } from '../../common/MockNodeService'; import { SummaryAuthoring } from './summary-authoring.component'; +import { TeacherNodeService } from '../../../services/teacherNodeService'; export class MockConfigService {} @@ -45,7 +45,7 @@ describe('SummaryAuthoringComponent', () => { ], declarations: [EditComponentPrompt, SummaryAuthoring], providers: [ - { provide: NodeService, useClass: MockNodeService }, + { provide: TeacherNodeService, useClass: MockNodeService }, ProjectAssetService, TeacherProjectService ] diff --git a/src/assets/wise5/components/summary/summary-authoring/summary-authoring.component.ts b/src/assets/wise5/components/summary/summary-authoring/summary-authoring.component.ts index 0cbd80ccf9f..b1a0060049f 100644 --- a/src/assets/wise5/components/summary/summary-authoring/summary-authoring.component.ts +++ b/src/assets/wise5/components/summary/summary-authoring/summary-authoring.component.ts @@ -5,10 +5,10 @@ import { ProjectAssetService } from '../../../../../app/services/projectAssetSer import { AbstractComponentAuthoring } from '../../../authoringTool/components/AbstractComponentAuthoring'; import { ComponentServiceLookupService } from '../../../services/componentServiceLookupService'; import { ConfigService } from '../../../services/configService'; -import { NodeService } from '../../../services/nodeService'; import { TeacherProjectService } from '../../../services/teacherProjectService'; import { MultipleChoiceContent } from '../../multipleChoice/MultipleChoiceContent'; import { SummaryService } from '../summaryService'; +import { TeacherNodeService } from '../../../services/teacherNodeService'; @Component({ selector: 'summary-authoring', @@ -24,7 +24,7 @@ export class SummaryAuthoring extends AbstractComponentAuthoring { constructor( private componentServiceLookupService: ComponentServiceLookupService, protected ConfigService: ConfigService, - protected NodeService: NodeService, + protected NodeService: TeacherNodeService, protected ProjectAssetService: ProjectAssetService, protected ProjectService: TeacherProjectService, private SummaryService: SummaryService diff --git a/src/assets/wise5/components/table/edit-table-advanced/edit-table-advanced.component.spec.ts b/src/assets/wise5/components/table/edit-table-advanced/edit-table-advanced.component.spec.ts index bef831ca2c9..127fbce3117 100644 --- a/src/assets/wise5/components/table/edit-table-advanced/edit-table-advanced.component.spec.ts +++ b/src/assets/wise5/components/table/edit-table-advanced/edit-table-advanced.component.spec.ts @@ -27,6 +27,7 @@ import { TeacherProjectService } from '../../../services/teacherProjectService'; import { EditTableConnectedComponentsComponent } from '../edit-table-connected-components/edit-table-connected-components.component'; import { EditTableAdvancedComponent } from './edit-table-advanced.component'; import { NO_ERRORS_SCHEMA } from '@angular/core'; +import { TeacherNodeService } from '../../../services/teacherNodeService'; let component: EditTableAdvancedComponent; let fixture: ComponentFixture; @@ -62,7 +63,7 @@ describe('EditTableAdvancedComponent', () => { EditTableAdvancedComponent, EditTableConnectedComponentsComponent ], - providers: [TeacherProjectService], + providers: [TeacherNodeService, TeacherProjectService], schemas: [NO_ERRORS_SCHEMA] }).compileComponents(); }); diff --git a/src/assets/wise5/components/table/edit-table-advanced/edit-table-advanced.component.ts b/src/assets/wise5/components/table/edit-table-advanced/edit-table-advanced.component.ts index ebbe85bd1ae..72708a38612 100644 --- a/src/assets/wise5/components/table/edit-table-advanced/edit-table-advanced.component.ts +++ b/src/assets/wise5/components/table/edit-table-advanced/edit-table-advanced.component.ts @@ -1,10 +1,10 @@ import { Component } from '@angular/core'; import { EditAdvancedComponentComponent } from '../../../../../app/authoring-tool/edit-advanced-component/edit-advanced-component.component'; import { CSVToArray } from '../../../common/array/array'; -import { NodeService } from '../../../services/nodeService'; import { NotebookService } from '../../../services/notebookService'; import { TeacherProjectService } from '../../../services/teacherProjectService'; import { TableContent } from '../TableContent'; +import { TeacherNodeService } from '../../../services/teacherNodeService'; @Component({ selector: 'edit-table-advanced', @@ -25,7 +25,7 @@ export class EditTableAdvancedComponent extends EditAdvancedComponentComponent { importTableMessage: string; constructor( - protected nodeService: NodeService, + protected nodeService: TeacherNodeService, protected notebookService: NotebookService, protected teacherProjectService: TeacherProjectService ) { diff --git a/src/assets/wise5/components/table/table-authoring/table-authoring.component.ts b/src/assets/wise5/components/table/table-authoring/table-authoring.component.ts index 4b569da1230..22d80ca27e7 100644 --- a/src/assets/wise5/components/table/table-authoring/table-authoring.component.ts +++ b/src/assets/wise5/components/table/table-authoring/table-authoring.component.ts @@ -6,8 +6,8 @@ import { debounceTime, distinctUntilChanged } from 'rxjs/operators'; import { ProjectAssetService } from '../../../../../app/services/projectAssetService'; import { AbstractComponentAuthoring } from '../../../authoringTool/components/AbstractComponentAuthoring'; import { ConfigService } from '../../../services/configService'; -import { NodeService } from '../../../services/nodeService'; import { TeacherProjectService } from '../../../services/teacherProjectService'; +import { TeacherNodeService } from '../../../services/teacherNodeService'; @Component({ selector: 'table-authoring', @@ -25,7 +25,7 @@ export class TableAuthoring extends AbstractComponentAuthoring { constructor( protected ConfigService: ConfigService, - protected NodeService: NodeService, + protected NodeService: TeacherNodeService, protected ProjectAssetService: ProjectAssetService, protected ProjectService: TeacherProjectService ) { diff --git a/src/assets/wise5/services/nodeService.ts b/src/assets/wise5/services/nodeService.ts index f6abc4ab9ab..d409dc86915 100644 --- a/src/assets/wise5/services/nodeService.ts +++ b/src/assets/wise5/services/nodeService.ts @@ -17,12 +17,6 @@ export class NodeService { public nodeSubmitClicked$: Observable = this.nodeSubmitClickedSource.asObservable(); private doneRenderingComponentSource: Subject = new Subject(); public doneRenderingComponent$ = this.doneRenderingComponentSource.asObservable(); - private componentShowSubmitButtonValueChangedSource: Subject = new Subject(); - public componentShowSubmitButtonValueChanged$: Observable = this.componentShowSubmitButtonValueChangedSource.asObservable(); - private starterStateResponseSource: Subject = new Subject(); - public starterStateResponse$: Observable = this.starterStateResponseSource.asObservable(); - private deleteStarterStateSource: Subject = new Subject(); - public deleteStarterState$: Observable = this.deleteStarterStateSource.asObservable(); constructor( protected dialog: MatDialog, @@ -546,18 +540,6 @@ export class NodeService { this.doneRenderingComponentSource.next(nodeIdAndComponentId); } - broadcastComponentShowSubmitButtonValueChanged(args: any) { - this.componentShowSubmitButtonValueChangedSource.next(args); - } - - deleteStarterState(args: any) { - this.deleteStarterStateSource.next(args); - } - - respondStarterState(args: any) { - this.starterStateResponseSource.next(args); - } - scrollToComponentAndHighlight(componentId: string): void { setTimeout(() => { const componentElement = $('#component_' + componentId); diff --git a/src/assets/wise5/services/teacherNodeService.ts b/src/assets/wise5/services/teacherNodeService.ts index ddaabb1474f..dac5c86d3df 100644 --- a/src/assets/wise5/services/teacherNodeService.ts +++ b/src/assets/wise5/services/teacherNodeService.ts @@ -1,5 +1,25 @@ import { Injectable } from '@angular/core'; import { NodeService } from './nodeService'; +import { Subject, Observable } from 'rxjs'; @Injectable() -export class TeacherNodeService extends NodeService {} +export class TeacherNodeService extends NodeService { + private componentShowSubmitButtonValueChangedSource: Subject = new Subject(); + public componentShowSubmitButtonValueChanged$: Observable = this.componentShowSubmitButtonValueChangedSource.asObservable(); + private deleteStarterStateSource: Subject = new Subject(); + public deleteStarterState$: Observable = this.deleteStarterStateSource.asObservable(); + private starterStateResponseSource: Subject = new Subject(); + public starterStateResponse$: Observable = this.starterStateResponseSource.asObservable(); + + broadcastComponentShowSubmitButtonValueChanged(args: any): void { + this.componentShowSubmitButtonValueChangedSource.next(args); + } + + deleteStarterState(args: any): void { + this.deleteStarterStateSource.next(args); + } + + respondStarterState(args: any): void { + this.starterStateResponseSource.next(args); + } +} diff --git a/src/messages.xlf b/src/messages.xlf index c19dd018668..e9b6f54c3a0 100644 --- a/src/messages.xlf +++ b/src/messages.xlf @@ -9589,7 +9589,7 @@ Click "Cancel" to keep the invalid JSON open so you can fix it. src/assets/wise5/classroomMonitor/classroom-monitor.component.ts - 83 + 84 src/assets/wise5/classroomMonitor/classroomMonitorComponents/shared/tool-bar/tool-bar.component.ts @@ -9611,7 +9611,7 @@ Click "Cancel" to keep the invalid JSON open so you can fix it. src/assets/wise5/classroomMonitor/classroom-monitor.component.ts - 146 + 147 src/assets/wise5/vle/vle.component.ts @@ -9626,7 +9626,7 @@ Click "Cancel" to keep the invalid JSON open so you can fix it. src/assets/wise5/classroomMonitor/classroom-monitor.component.ts - 147 + 148 src/assets/wise5/vle/vle.component.ts @@ -12613,7 +12613,7 @@ Click "Cancel" to keep the invalid JSON open so you can fix it.Grade by Step src/assets/wise5/classroomMonitor/classroom-monitor.component.ts - 90 + 91 src/assets/wise5/classroomMonitor/classroomMonitorComponents/shared/tool-bar/tool-bar.component.ts @@ -12624,7 +12624,7 @@ Click "Cancel" to keep the invalid JSON open so you can fix it.Grade by Team src/assets/wise5/classroomMonitor/classroom-monitor.component.ts - 103 + 104 src/assets/wise5/classroomMonitor/classroomMonitorComponents/shared/tool-bar/tool-bar.component.ts @@ -12635,7 +12635,7 @@ Click "Cancel" to keep the invalid JSON open so you can fix it.Manage Students src/assets/wise5/classroomMonitor/classroom-monitor.component.ts - 110 + 111 src/assets/wise5/classroomMonitor/classroomMonitorComponents/shared/tool-bar/tool-bar.component.ts @@ -12646,7 +12646,7 @@ Click "Cancel" to keep the invalid JSON open so you can fix it.Student Notebooks src/assets/wise5/classroomMonitor/classroom-monitor.component.ts - 117 + 118 src/assets/wise5/classroomMonitor/classroomMonitorComponents/shared/tool-bar/tool-bar.component.ts @@ -12657,7 +12657,7 @@ Click "Cancel" to keep the invalid JSON open so you can fix it.Data Export src/assets/wise5/classroomMonitor/classroom-monitor.component.ts - 124 + 125 src/assets/wise5/classroomMonitor/classroomMonitorComponents/shared/tool-bar/tool-bar.component.ts @@ -12668,7 +12668,7 @@ Click "Cancel" to keep the invalid JSON open so you can fix it.Error: Data is not being saved! Check your internet connection. src/assets/wise5/classroomMonitor/classroom-monitor.component.ts - 189 + 190 @@ -17367,7 +17367,7 @@ Category Name: src/assets/wise5/components/draw/draw-authoring/draw-authoring.component.ts - 243 + 244