Skip to content

Commit e792d7c

Browse files
refactor(VLE): Convert all components to standalone (#2241)
Needed to change GenerateImageDialogComponent so it is opened by messages instead of by a function call in ComponentStudentComponent because this was causing circular dependency.
1 parent 94d8534 commit e792d7c

File tree

92 files changed

+1086
-1283
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

92 files changed

+1086
-1283
lines changed

src/app/services/notebookService.spec.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,9 @@ const teacherNotebookURL = 'http://localhost:8080/teacher/notebook/run/1';
2525
describe('NotebookService', () => {
2626
beforeEach(() => {
2727
TestBed.configureTestingModule({
28-
imports: [MatDialogModule, StudentTeacherCommonServicesModule],
29-
providers: [provideHttpClient(withInterceptorsFromDi()), provideHttpClientTesting()]
30-
});
28+
imports: [MatDialogModule, StudentTeacherCommonServicesModule],
29+
providers: [provideHttpClient(withInterceptorsFromDi()), provideHttpClientTesting()]
30+
});
3131
http = TestBed.inject(HttpTestingController);
3232
configService = TestBed.inject(ConfigService);
3333
service = TestBed.inject(NotebookService);

src/app/student-teacher-common.module.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@ import { NotebookModule } from './notebook/notebook.module';
3131
import { MatSliderModule } from '@angular/material/slider';
3232
import { DialogResponsesComponent } from '../assets/wise5/components/dialogGuidance/dialog-responses/dialog-responses.component';
3333
import { HighchartsChartModule } from 'highcharts-angular';
34-
import { EditNotebookItemDialogModule } from '../assets/wise5/themes/default/notebook/edit-notebook-item-dialog/edit-notebook-item-dialog.module';
3534
import { StudentTeacherCommonServicesModule } from './student-teacher-common-services.module';
3635
import { MathModule } from './math/math.module';
3736
import { MatMenuModule } from '@angular/material/menu';
@@ -42,7 +41,6 @@ import { ScrollingModule } from '@angular/cdk/scrolling';
4241
CommonModule,
4342
DialogResponsesComponent,
4443
DragDropModule,
45-
EditNotebookItemDialogModule,
4644
EditorModule,
4745
FormsModule,
4846
HighchartsChartModule,

src/app/student/top-bar/top-bar.component.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ <h3 class="title flex-grow px-2" [title]="projectName">{{ projectName }}</h3>
6262
i18n-aria-label
6363
>
6464
</mat-progress-spinner>
65-
<student-account-menu #accountMenu></student-account-menu>
65+
<student-account-menu #accountMenu />
6666
<button
6767
mat-icon-button
6868
[matMenuTriggerFor]="accountMenu?.menu"

src/app/student/top-bar/top-bar.component.ts

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,8 @@ import { getAvatarColorForWorkgroupId } from '../../../assets/wise5/common/workg
1414
import { Language } from '../../domain/language';
1515
import { StudentProjectTranslationService } from '../../../assets/wise5/services/studentProjectTranslationService';
1616
import { ProjectLocale } from '../../domain/projectLocale';
17-
import { StudentAccountMenuModule } from '../../../assets/wise5/vle/student-account-menu/student-account-menu.module';
1817
import { MatButtonModule } from '@angular/material/button';
1918
import { CommonModule } from '@angular/common';
20-
import { DismissAmbientNotificationDialogModule } from '../../../assets/wise5/vle/dismiss-ambient-notification-dialog/dismiss-ambient-notification-dialog.module';
2119
import { MatMenuModule } from '@angular/material/menu';
2220
import { MatProgressSpinnerModule } from '@angular/material/progress-spinner';
2321
import { MatBadgeModule } from '@angular/material/badge';
@@ -28,7 +26,6 @@ import { ProjectLanguageChooserComponent } from '../../common/project-language-c
2826
@Component({
2927
imports: [
3028
CommonModule,
31-
DismissAmbientNotificationDialogModule,
3229
MatBadgeModule,
3330
MatButtonModule,
3431
MatDialogModule,
@@ -37,10 +34,10 @@ import { ProjectLanguageChooserComponent } from '../../common/project-language-c
3734
MatProgressSpinnerModule,
3835
MatToolbarModule,
3936
ProjectLanguageChooserComponent,
40-
StudentAccountMenuModule
37+
StudentAccountMenuComponent
4138
],
4239
selector: 'top-bar',
43-
styleUrls: ['./top-bar.component.scss'],
40+
styleUrl: './top-bar.component.scss',
4441
templateUrl: 'top-bar.component.html'
4542
})
4643
export class TopBarComponent {
@@ -70,7 +67,7 @@ export class TopBarComponent {
7067
private projectTranslationService: StudentProjectTranslationService
7168
) {}
7269

73-
ngOnInit() {
70+
ngOnInit(): void {
7471
this.avatarColor = getAvatarColorForWorkgroupId(this.configService.getWorkgroupId());
7572
this.logoURL = `${this.projectService.getThemePath()}/images/WISE-logo-ffffff.svg`;
7673
this.isPreview = this.configService.isPreview();
@@ -85,7 +82,7 @@ export class TopBarComponent {
8582
this.setHomeURL();
8683
}
8784

88-
ngOnDestroy() {
85+
ngOnDestroy(): void {
8986
this.subscriptions.unsubscribe();
9087
}
9188

src/app/student/vle/student-vle.module.ts

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,6 @@ import { CommonModule } from '@angular/common';
33
import { NgModule } from '@angular/core';
44
import { MatDialogModule } from '@angular/material/dialog';
55
import { ComponentStudentModule } from '../../../assets/wise5/components/component/component-student.module';
6-
import { GenerateImageDialogComponent } from '../../../assets/wise5/directives/generate-image-dialog/generate-image-dialog.component';
7-
import { SimpleDialogModule } from '../../../assets/wise5/directives/simple-dialog.module';
86
import { InitializeVLEService } from '../../../assets/wise5/services/initializeVLEService';
97
import { ProjectService } from '../../../assets/wise5/services/projectService';
108
import { StudentDataService } from '../../../assets/wise5/services/studentDataService';
@@ -21,21 +19,22 @@ import { VLEParentComponent } from '../../../assets/wise5/vle/vle-parent/vle-par
2119
import { StudentPeerGroupService } from '../../../assets/wise5/services/studentPeerGroupService';
2220
import { PeerGroupService } from '../../../assets/wise5/services/peerGroupService';
2321
import { StudentAssetsDialogComponent } from '../../../assets/wise5/vle/studentAsset/student-assets-dialog/student-assets-dialog.component';
22+
import { GenerateImageService } from '../../../assets/wise5/services/generateImageService';
2423

2524
@NgModule({
26-
declarations: [GenerateImageDialogComponent, VLEParentComponent],
2725
imports: [
2826
CommonModule,
2927
ComponentStudentModule,
3028
MatDialogModule,
31-
SimpleDialogModule,
3229
StudentAssetsDialogComponent,
3330
StudentComponentModule,
3431
StudentTeacherCommonModule,
3532
StudentVLERoutingModule,
36-
VLEComponent
33+
VLEComponent,
34+
VLEParentComponent
3735
],
3836
providers: [
37+
GenerateImageService,
3938
InitializeVLEService,
4039
PauseScreenService,
4140
{ provide: DataService, useExisting: StudentDataService },

src/assets/wise5/authoringTool/project-asset-authoring/project-asset-authoring.component.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,19 +7,19 @@ import { isImage, isVideo } from '../../common/file/file';
77
import { MAT_DIALOG_DATA, MatDialogRef } from '@angular/material/dialog';
88
import { AssetChooserDialogData } from './asset-chooser-dialog-data';
99
import { CommonModule } from '@angular/common';
10-
import { DragAndDropModule } from '../../common/drag-and-drop/drag-and-drop.module';
1110
import { FileSizePipe } from '../file-size/filesize.pipe';
1211
import { FormsModule } from '@angular/forms';
1312
import { MatButtonModule } from '@angular/material/button';
1413
import { MatFormFieldModule } from '@angular/material/form-field';
1514
import { MatIconModule } from '@angular/material/icon';
1615
import { MatSelectModule } from '@angular/material/select';
1716
import { MatTooltipModule } from '@angular/material/tooltip';
17+
import { DragAndDropDirective } from '../../common/drag-and-drop/drag-and-drop.directive';
1818

1919
@Component({
2020
imports: [
2121
CommonModule,
22-
DragAndDropModule,
22+
DragAndDropDirective,
2323
FileSizePipe,
2424
FormsModule,
2525
MatButtonModule,

src/assets/wise5/classroomMonitor/classroomMonitorComponents/shared/notifications-menu/notifications-menu.component.spec.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ import { ComponentFixture, TestBed } from '@angular/core/testing';
33
import { MatDialog } from '@angular/material/dialog';
44
import { of } from 'rxjs';
55
import { Notification } from '../../../../../../app/domain/notification';
6-
import { DialogWithConfirmComponent } from '../../../../directives/dialog-with-confirm/dialog-with-confirm.component';
76
import { NotificationService } from '../../../../services/notificationService';
87
import { ClassroomMonitorTestingModule } from '../../../classroom-monitor-testing.module';
98
import { NotificationsMenuComponent } from './notifications-menu.component';
@@ -19,7 +18,6 @@ const notification2 = new Notification({ nodeId: NODE_ID_2 });
1918
describe('NotificationsMenuComponent', () => {
2019
beforeEach(async () => {
2120
await TestBed.configureTestingModule({
22-
declarations: [DialogWithConfirmComponent],
2321
imports: [ClassroomMonitorTestingModule, NotificationsMenuComponent],
2422
providers: [
2523
{ provide: MatDialog, useValue: { open: () => {} } },

src/assets/wise5/common/drag-and-drop/drag-and-drop.directive.ts

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,6 @@
11
import { Directive, EventEmitter, HostBinding, HostListener, Output } from '@angular/core';
22

3-
@Directive({
4-
selector: '[dragAndDrop]',
5-
standalone: false
6-
})
3+
@Directive({ selector: '[dragAndDrop]' })
74
export class DragAndDropDirective {
85
constructor() {}
96

src/assets/wise5/common/drag-and-drop/drag-and-drop.module.ts

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

src/assets/wise5/components/animation/animation-student/animation-student.component.html

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,6 @@
5454
<span class="flex flex-row items-center gap-2">
5555
<span i18n>Slower</span>
5656
<mat-slider
57-
[ngModel]="speedSliderValue"
5857
[disabled]="isDisabled"
5958
(ngModelChange)="speedSliderChanged($event)"
6059
min="1"

0 commit comments

Comments
 (0)