Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor(NodeService): Move authoring-specific observables to TeacherNodeService #1458

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -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 {
Expand All @@ -13,7 +13,7 @@ export abstract class EditAdvancedComponentComponent {
@Input() nodeId: string;

constructor(
protected nodeService: NodeService,
protected nodeService: TeacherNodeService,
protected notebookService: NotebookService,
protected teacherProjectService: TeacherProjectService
) {}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand All @@ -19,7 +19,7 @@ export abstract class AbstractComponentAuthoring {

constructor(
protected configService: ConfigService,
protected nodeService: NodeService,
protected nodeService: TeacherNodeService,
protected projectAssetService: ProjectAssetService,
protected projectService: TeacherProjectService
) {}
Expand Down
Original file line number Diff line number Diff line change
@@ -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({
Expand All @@ -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 {}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -56,6 +57,7 @@ describe('NodeAuthoringComponent', () => {
ClassroomStatusService,
ProjectAssetService,
TeacherDataService,
TeacherNodeService,
TeacherProjectService,
TeacherWebSocketService,
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand All @@ -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',
Expand All @@ -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,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 {}

Expand All @@ -39,7 +39,7 @@ describe('AnimationAuthoring', () => {
],
declarations: [AnimationAuthoring, EditComponentPrompt],
providers: [
{ provide: NodeService, useClass: MockNodeService },
{ provide: TeacherNodeService, useClass: MockNodeService },
ProjectAssetService,
TeacherProjectService
]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand All @@ -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
) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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<AudioOscillatorAuthoring>;
Expand All @@ -30,7 +31,7 @@ describe('AudioOscillatorAuthoring', () => {
StudentTeacherCommonServicesModule
],
declarations: [EditComponentPrompt, AudioOscillatorAuthoring],
providers: [ProjectAssetService, TeacherProjectService]
providers: [ProjectAssetService, TeacherNodeService, TeacherProjectService]
});
fixture = TestBed.createComponent(AudioOscillatorAuthoring);
component = fixture.componentInstance;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand All @@ -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
) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand All @@ -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
) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand All @@ -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],
Expand All @@ -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]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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<EditConceptMapAdvancedComponent>;
Expand Down Expand Up @@ -57,7 +58,7 @@ describe('EditConceptMapAdvancedComponent', () => {
EditConnectedComponentsAddButtonComponent,
EditConnectedComponentsComponent
],
providers: [TeacherProjectService],
providers: [TeacherNodeService, TeacherProjectService],
schemas: [NO_ERRORS_SCHEMA]
}).compileComponents();
});
Expand Down
Original file line number Diff line number Diff line change
@@ -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',
Expand All @@ -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
) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand All @@ -28,7 +29,8 @@ describe('DialogGuidanceAuthoringComponent', () => {
DialogGuidanceAuthoringModule,
HttpClientTestingModule,
StudentTeacherCommonServicesModule
]
],
providers: [TeacherNodeService]
});
fixture = TestBed.createComponent(DialogGuidanceAuthoringComponent);
component = fixture.componentInstance;
Expand Down
Original file line number Diff line number Diff line change
@@ -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',
Expand All @@ -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
) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand All @@ -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
) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down Expand Up @@ -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
) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand All @@ -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],
Expand All @@ -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]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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<EmbeddedAuthoring>;
Expand All @@ -18,7 +19,8 @@ describe('EmbeddedAuthoringComponent', () => {
EmbeddedAuthoringModule,
HttpClientTestingModule,
StudentTeacherCommonServicesModule
]
],
providers: [TeacherNodeService]
});
fixture = TestBed.createComponent(EmbeddedAuthoring);
component = fixture.componentInstance;
Expand Down
Loading
Loading