Skip to content

Commit cdd09a3

Browse files
Merge pull request #2246 from WISE-Community/remove-modules-part-2
refactor(VLE): Remove modules part 2
2 parents 076c35d + d01285e commit cdd09a3

34 files changed

+335
-573
lines changed

src/app/app-routing.module.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,11 +32,11 @@ const routes: Routes = [
3232
},
3333
{
3434
path: 'forgot',
35-
loadChildren: () => import('./forgot/forgot-routing.module').then((m) => m.ForgotRoutingModule)
35+
loadChildren: () => import('./forgot/forgot.routes').then((m) => m.routes)
3636
},
3737
{
3838
path: 'help',
39-
loadChildren: () => import('./help/help-routing.module').then((m) => m.HelpRoutingModule)
39+
loadChildren: () => import('./help/help.routes').then((m) => m.routes)
4040
},
4141
{
4242
path: 'join',

src/app/classroom-monitor/milestones/milestones.component.ts

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
import { Component } from '@angular/core';
1+
import { Component, Injector } from '@angular/core';
2+
import { createCustomElement } from '@angular/elements';
23
import { MatDialog } from '@angular/material/dialog';
34
import { Subscription } from 'rxjs';
45
import { MilestoneDetailsDialogComponent } from '../../../assets/wise5/classroomMonitor/classroomMonitorComponents/milestones/milestone-details-dialog/milestone-details-dialog.component';
@@ -12,6 +13,8 @@ import { MatCard, MatCardContent } from '@angular/material/card';
1213
import { MatProgressSpinner } from '@angular/material/progress-spinner';
1314
import { NgClass } from '@angular/common';
1415
import { MatIcon } from '@angular/material/icon';
16+
import { MilestoneReportDataComponent } from '../../teacher/milestone/milestone-report-data/milestone-report-data.component';
17+
import { MilestoneReportGraphComponent } from '../../teacher/milestone/milestone-report-graph/milestone-report-graph.component';
1518

1619
@Component({
1720
imports: [MatCard, MatCardContent, MatProgressSpinner, NgClass, MatIcon],
@@ -27,9 +30,23 @@ export class MilestonesComponent {
2730
private achievementService: AchievementService,
2831
private annotationService: AnnotationService,
2932
private milestoneService: MilestoneService,
33+
private injector: Injector,
3034
private dialog: MatDialog,
3135
private dataService: TeacherDataService
32-
) {}
36+
) {
37+
if (!customElements.get('milestone-report-data')) {
38+
customElements.define(
39+
'milestone-report-data',
40+
createCustomElement(MilestoneReportDataComponent, { injector: this.injector })
41+
);
42+
}
43+
if (!customElements.get('milestone-report-graph')) {
44+
customElements.define(
45+
'milestone-report-graph',
46+
createCustomElement(MilestoneReportGraphComponent, { injector: this.injector })
47+
);
48+
}
49+
}
3350

3451
ngOnInit() {
3552
this.loadProjectMilestones();

src/app/forgot/forgot-routing.module.ts renamed to src/app/forgot/forgot.routes.ts

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
import { NgModule } from '@angular/core';
2-
import { Routes, RouterModule } from '@angular/router';
1+
import { Routes } from '@angular/router';
32
import { ForgotComponent } from './forgot.component';
43
import { ForgotHomeComponent } from './forgot-home/forgot-home.component';
54
import { ForgotStudentComponent } from './student/forgot-student/forgot-student.component';
@@ -15,7 +14,7 @@ import { ForgotTeacherPasswordVerifyComponent } from './teacher/forgot-teacher-p
1514
import { ForgotTeacherPasswordChangeComponent } from './teacher/forgot-teacher-password-change/forgot-teacher-password-change.component';
1615
import { ForgotUserPasswordCompleteComponent } from './forgot-user-password-complete/forgot-user-password-complete.component';
1716

18-
const routes: Routes = [
17+
export const routes: Routes = [
1918
{
2019
path: '',
2120
component: ForgotComponent,
@@ -37,9 +36,3 @@ const routes: Routes = [
3736
]
3837
}
3938
];
40-
41-
@NgModule({
42-
imports: [RouterModule.forChild(routes)],
43-
exports: [RouterModule]
44-
})
45-
export class ForgotRoutingModule {}
Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,11 @@
1-
import { NgModule } from '@angular/core';
2-
import { RouterModule, Routes } from '@angular/router';
1+
import { Routes } from '@angular/router';
32
import { HelpComponent } from './help.component';
43
import { HelpHomeComponent } from './help-home/help-home.component';
54
import { GettingStartedComponent } from './faq/getting-started/getting-started.component';
65
import { TeacherFaqComponent } from './faq/teacher-faq/teacher-faq.component';
76
import { StudentFaqComponent } from './faq/student-faq/student-faq.component';
87

9-
const helpRoutes: Routes = [
8+
export const routes: Routes = [
109
{
1110
path: '',
1211
component: HelpComponent,
@@ -18,9 +17,3 @@ const helpRoutes: Routes = [
1817
]
1918
}
2019
];
21-
22-
@NgModule({
23-
imports: [RouterModule.forChild(helpRoutes)],
24-
exports: [RouterModule]
25-
})
26-
export class HelpRoutingModule {}

src/app/teacher/authoring-routing.module.ts renamed to src/app/teacher/authoring.routes.ts

Lines changed: 8 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
1-
import { NgModule } from '@angular/core';
2-
import { RouterModule, Routes } from '@angular/router';
1+
import { Routes } from '@angular/router';
32
import { AuthoringConfigResolver } from './authoring.config.resolver';
43
import { AuthoringProjectResolver } from './authoring.project.resolver';
54
import { RecoveryAuthoringProjectResolver } from './recovery-authoring-project.resolver';
65

7-
const routes: Routes = [
6+
export const authoringRoutes: Routes = [
87
{
98
path: '',
109
loadComponent: () =>
@@ -53,15 +52,15 @@ const routes: Routes = [
5352
{
5453
path: 'add-lesson',
5554
loadChildren: () =>
56-
import('../../assets/wise5/authoringTool/addLesson/add-lesson-routing.module').then(
57-
(m) => m.AddLessonRoutingModule
55+
import('../../assets/wise5/authoringTool/addLesson/add-lesson.routes').then(
56+
(m) => m.routes
5857
)
5958
},
6059
{
6160
path: 'add-node',
6261
loadChildren: () =>
63-
import('../../assets/wise5/authoringTool/addNode/add-node-routing.module').then(
64-
(m) => m.AddNodeRoutingModule
62+
import('../../assets/wise5/authoringTool/addNode/add-node.routes').then(
63+
(m) => m.routes
6564
)
6665
},
6766
{
@@ -123,8 +122,8 @@ const routes: Routes = [
123122
{
124123
path: 'node/:nodeId',
125124
loadChildren: () =>
126-
import('../../assets/wise5/authoringTool/node/node-authoring-routing.module').then(
127-
(m) => m.NodeAuthoringRoutingModule
125+
import('../../assets/wise5/authoringTool/node/node-authoring.routes').then(
126+
(m) => m.routes
128127
)
129128
},
130129
{
@@ -139,9 +138,3 @@ const routes: Routes = [
139138
]
140139
}
141140
];
142-
143-
@NgModule({
144-
imports: [RouterModule.forChild(routes)],
145-
exports: [RouterModule]
146-
})
147-
export class AuthoringRoutingModule {}

src/app/teacher/classroom-monitor.module.ts

Lines changed: 0 additions & 43 deletions
This file was deleted.

src/app/teacher/milestone/milestone.module.ts

Lines changed: 0 additions & 40 deletions
This file was deleted.

src/app/teacher/peer-group-grading.module.ts

Lines changed: 0 additions & 32 deletions
This file was deleted.

src/app/teacher/teacher-authoring.module.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ import { PeerGroupService } from '../../assets/wise5/services/peerGroupService';
2626
import { NodeService } from '../../assets/wise5/services/nodeService';
2727
import { TeacherNodeService } from '../../assets/wise5/services/teacherNodeService';
2828
import { MilestoneReportService } from '../../assets/wise5/services/milestoneReportService';
29-
import { AuthoringRoutingModule } from './authoring-routing.module';
29+
import { authoringRoutes } from './authoring.routes';
3030
import { ComponentInfoService } from '../../assets/wise5/services/componentInfoService';
3131
import { CreateBranchService } from '../../assets/wise5/services/createBranchService';
3232
import { EditBranchService } from '../../assets/wise5/services/editBranchService';
@@ -42,10 +42,11 @@ import { RegisterProjectService } from '../../assets/wise5/services/registerProj
4242
import { StudentTeacherCommonServicesModule } from '../student-teacher-common-services.module';
4343
import { EditComponentAdvancedComponent } from '../authoring-tool/edit-component-advanced/edit-component-advanced.component';
4444
import { PeerGroupingAuthoringService } from '../../assets/wise5/services/peerGroupingAuthoringService';
45+
import { RouterModule } from '@angular/router';
4546

4647
@NgModule({
4748
imports: [
48-
AuthoringRoutingModule,
49+
RouterModule.forChild(authoringRoutes),
4950
EditComponentAdvancedComponent, // TODO: refactor. currently needed for peer grouping authoring dialog to work
5051
StudentTeacherCommonServicesModule
5152
],

src/app/teacher/teacher-tools.module.ts

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ import { ImportComponentService } from '../../assets/wise5/services/importCompon
1515
import { InsertComponentService } from '../../assets/wise5/services/insertComponentService';
1616
import { InsertNodesService } from '../../assets/wise5/services/insertNodesService';
1717
import { MoveNodesService } from '../../assets/wise5/services/moveNodesService';
18-
import { ClassroomMonitorModule } from '../teacher/classroom-monitor.module';
1918
import { UpdateWorkgroupService } from '../services/updateWorkgroupService';
2019
import { GetWorkgroupService } from '../services/getWorkgroupService';
2120
import { WorkgroupService } from '../services/workgroup.service';
@@ -27,20 +26,28 @@ import { PeerGroupService } from '../../assets/wise5/services/peerGroupService';
2726
import { NodeService } from '../../assets/wise5/services/nodeService';
2827
import { TeacherNodeService } from '../../assets/wise5/services/teacherNodeService';
2928
import { MilestoneReportService } from '../../assets/wise5/services/milestoneReportService';
30-
import { RouterModule } from '@angular/router';
31-
import { TeacherToolsRoutingModule } from './teacher-tools-routing.module';
29+
import { teacherToolsRoutes } from './teacher-tools.routes';
3230
import { TeacherPauseScreenService } from '../../assets/wise5/services/teacherPauseScreenService';
3331
import { RunStatusService } from '../../assets/wise5/services/runStatusService';
32+
import { GradingNodeService } from '../../assets/wise5/services/gradingNodeService';
33+
import { ComponentStudentModule } from '../../assets/wise5/components/component/component-student.module';
34+
import { StudentTeacherCommonServicesModule } from '../student-teacher-common-services.module';
35+
import { RouterModule } from '@angular/router';
3436

3537
@NgModule({
36-
imports: [ClassroomMonitorModule, RouterModule, TeacherToolsRoutingModule],
38+
imports: [
39+
ComponentStudentModule,
40+
StudentTeacherCommonServicesModule,
41+
RouterModule.forChild(teacherToolsRoutes)
42+
],
3743
providers: [
3844
ClassroomStatusService,
3945
CopyNodesService,
4046
CopyProjectService,
4147
DataExportService,
4248
{ provide: DataService, useExisting: TeacherDataService },
4349
GetWorkgroupService,
50+
GradingNodeService,
4451
DeleteNodeService,
4552
ImportComponentService,
4653
InsertComponentService,

0 commit comments

Comments
 (0)