diff --git a/src/app/notebook/notebook-notes/notebook-notes.component.html b/src/app/notebook/notebook-notes/notebook-notes.component.html index bd527492ade..ce4abb24e04 100644 --- a/src/app/notebook/notebook-notes/notebook-notes.component.html +++ b/src/app/notebook/notebook-notes/notebook-notes.component.html @@ -1,21 +1,22 @@
-

- You haven't created any {{ label.plural }} yet. -

- - - + @if (!hasPrivateNotes) { +

You haven't created any {{ label.plural }} yet.

+ } + @for (note of group.items; track note) { + @if (note.serverDeleteTime == null) { + + } + }
@@ -31,19 +32,24 @@ (selectedIndexChange)="selectedTabIndex = $event" animationDuration="0ms" > - -
- -
-
+ @for (group of groups; track group) { + +
+ +
+
+ }
- + @if (mode !== 'classroomMonitor') { -

Select item to insert

-

{{ label.link }}

+ @if (insertArgs.insertMode) { +

Select item to insert

+ } @else { +

{{ label.link }}

+ }
- - -
-
-

- {{ group.title }} -

-

- Team hasn't created any {{ label.plural }} yet. -

-
- - - -
+ @if (config.itemTypes.note.enableAddNote) { + + } + } + @if (mode === 'classroomMonitor') { +
+ @for (group of groups; track group) { +
+ @if (groups.length > 1) { +

+ {{ group.title }} +

+ } + @if (group.name === 'private' && !hasPrivateNotes) { +

Team hasn't created any {{ label.plural }} yet.

+ } +
+ @for (note of group.items; track note) { + @if (note.serverDeleteTime == null && this.workgroupId === note.workgroupId) { + + } + } +
+
+ }
-
+ }
diff --git a/src/app/notebook/notebook-notes/notebook-notes.component.spec.ts b/src/app/notebook/notebook-notes/notebook-notes.component.spec.ts index d38c997d587..cd73410bc41 100644 --- a/src/app/notebook/notebook-notes/notebook-notes.component.spec.ts +++ b/src/app/notebook/notebook-notes/notebook-notes.component.spec.ts @@ -1,19 +1,15 @@ -import { provideHttpClientTesting } from '@angular/common/http/testing'; import { TestBed } from '@angular/core/testing'; -import { MatDialogModule } from '@angular/material/dialog'; import { StudentTeacherCommonServicesModule } from '../../student-teacher-common-services.module'; import { NotebookNotesComponent } from './notebook-notes.component'; import { provideHttpClient, withInterceptorsFromDi } from '@angular/common/http'; let component: NotebookNotesComponent; - describe('NotebookNotesComponent', () => { beforeEach(() => { TestBed.configureTestingModule({ - declarations: [NotebookNotesComponent], - imports: [MatDialogModule, StudentTeacherCommonServicesModule], - providers: [provideHttpClient(withInterceptorsFromDi()), provideHttpClientTesting()] -}); + imports: [NotebookNotesComponent, StudentTeacherCommonServicesModule], + providers: [provideHttpClient(withInterceptorsFromDi())] + }); const fixture = TestBed.createComponent(NotebookNotesComponent); component = fixture.componentInstance; }); diff --git a/src/app/notebook/notebook-notes/notebook-notes.component.ts b/src/app/notebook/notebook-notes/notebook-notes.component.ts index 40c86cc97e6..f770e9ee952 100644 --- a/src/app/notebook/notebook-notes/notebook-notes.component.ts +++ b/src/app/notebook/notebook-notes/notebook-notes.component.ts @@ -5,34 +5,53 @@ import { NotebookService } from '../../../assets/wise5/services/notebookService' import { ProjectService } from '../../../assets/wise5/services/projectService'; import { StudentDataService } from '../../../assets/wise5/services/studentDataService'; import { NotebookParentComponent } from '../notebook-parent/notebook-parent.component'; +import { CommonModule } from '@angular/common'; +import { FlexLayoutModule } from '@angular/flex-layout'; +import { NotebookItemComponent } from '../notebook-item/notebook-item.component'; +import { MatTabsModule } from '@angular/material/tabs'; +import { MatToolbarModule } from '@angular/material/toolbar'; +import { MatDividerModule } from '@angular/material/divider'; +import { MatTooltipModule } from '@angular/material/tooltip'; +import { MatButtonModule } from '@angular/material/button'; +import { MatIconModule } from '@angular/material/icon'; @Component({ + imports: [ + CommonModule, + FlexLayoutModule, + MatButtonModule, + MatDividerModule, + MatIconModule, + MatTabsModule, + MatToolbarModule, + MatTooltipModule, + NotebookItemComponent + ], selector: 'notebook-notes', - styleUrls: ['notebook-notes.component.scss'], + standalone: true, + styleUrl: 'notebook-notes.component.scss', templateUrl: 'notebook-notes.component.html', encapsulation: ViewEncapsulation.None }) export class NotebookNotesComponent extends NotebookParentComponent { - @Input() viewOnly: boolean; - - groups = []; - groupNameToGroup = {}; - hasPrivateNotes: boolean = false; - insertArgs: any = { + protected groups = []; + private groupNameToGroup = {}; + protected hasPrivateNotes: boolean = false; + protected insertArgs: any = { insertMode: false }; - label: any; - selectedTabIndex = 0; - title: string; - subscriptions: Subscription = new Subscription(); + protected label: any; + protected selectedTabIndex = 0; + private subscriptions: Subscription = new Subscription(); + @Input() viewOnly: boolean; constructor( - ConfigService: ConfigService, + configService: ConfigService, + private dataService: StudentDataService, NotebookService: NotebookService, - private ProjectService: ProjectService, - private studentDataService: StudentDataService + private projectService: ProjectService ) { - super(ConfigService, NotebookService); + super(configService, NotebookService); } ngOnInit(): void { @@ -77,7 +96,7 @@ export class NotebookNotesComponent extends NotebookParentComponent { ); this.subscriptions.add( - this.ProjectService.projectParsed$.subscribe(() => { + this.projectService.projectParsed$.subscribe(() => { this.setConfig(); this.setLabel(); }) @@ -116,8 +135,8 @@ export class NotebookNotesComponent extends NotebookParentComponent { this.groups.push(personalGroup); } - addSpacesToGroups(): void { - for (const space of this.ProjectService.getSpaces()) { + private addSpacesToGroups(): void { + for (const space of this.projectService.getSpaces()) { if (space.isShowInNotebook) { const spaceGroup = { title: space.name, @@ -131,7 +150,7 @@ export class NotebookNotesComponent extends NotebookParentComponent { } } - updatePrivateNotebookNote(notebookItem: any): void { + private updatePrivateNotebookNote(notebookItem: any): void { this.updateNotebookNote( this.groupNameToGroup['private'], notebookItem.localNotebookItemId, @@ -147,7 +166,7 @@ export class NotebookNotesComponent extends NotebookParentComponent { } } - updatePublicNotebookNote(notebookItem: any): void { + private updatePublicNotebookNote(notebookItem: any): void { this.updateNotebookNote( this.groupNameToGroup['public'], notebookItem.localNotebookItemId, @@ -161,7 +180,7 @@ export class NotebookNotesComponent extends NotebookParentComponent { ); } - updateNotebookNote( + private updateNotebookNote( group: any, localNotebookItemId: string, workgroupId: number, @@ -181,7 +200,7 @@ export class NotebookNotesComponent extends NotebookParentComponent { } } - removeNotebookNote(group: any, localNotebookItemId: string, workgroupId: number): void { + private removeNotebookNote(group: any, localNotebookItemId: string, workgroupId: number): void { let items = group.items; for (let i = 0; i < items.length; i++) { let item = items[i]; @@ -192,25 +211,21 @@ export class NotebookNotesComponent extends NotebookParentComponent { } } - addNote() { - this.NotebookService.addNote(this.studentDataService.getCurrentNodeId()); + protected addNote(): void { + this.NotebookService.addNote(this.dataService.getCurrentNodeId()); } - select({ event, note }: any): void { + protected select({ event, note }: any): void { if (this.insertArgs.insertMode) { this.insertArgs.notebookItem = note; this.NotebookService.broadcastNotebookItemChosen(this.insertArgs); } else { const isEditMode = !this.viewOnly; - this.NotebookService.editNote(this.studentDataService.getCurrentNodeId(), note, isEditMode); + this.NotebookService.editNote(this.dataService.getCurrentNodeId(), note, isEditMode); } } - close(): void { + protected close(): void { this.NotebookService.closeNotes(); } - - filterDeleted(item: any): boolean { - return item.serverDeleteTime == null; - } } diff --git a/src/app/notebook/notebook.module.ts b/src/app/notebook/notebook.module.ts index 8eb763e5d47..f728d0b073e 100644 --- a/src/app/notebook/notebook.module.ts +++ b/src/app/notebook/notebook.module.ts @@ -25,7 +25,6 @@ import { WiseTinymceEditorComponent } from '../../assets/wise5/directives/wise-t @NgModule({ declarations: [ NotebookParentComponent, - NotebookNotesComponent, NotebookReportComponent, NotebookReportAnnotationsComponent ], @@ -47,6 +46,7 @@ import { WiseTinymceEditorComponent } from '../../assets/wise5/directives/wise-t MatTooltipModule, NotebookItemComponent, NotebookLauncherComponent, + NotebookNotesComponent, WiseTinymceEditorComponent ], exports: [ diff --git a/src/assets/wise5/classroomMonitor/classroomMonitorComponents/notebook/notebook-workgroup-grading/notebook-workgroup-grading.component.html b/src/assets/wise5/classroomMonitor/classroomMonitorComponents/notebook/notebook-workgroup-grading/notebook-workgroup-grading.component.html index 4392d914f94..faea18b6b81 100644 --- a/src/assets/wise5/classroomMonitor/classroomMonitorComponents/notebook/notebook-workgroup-grading/notebook-workgroup-grading.component.html +++ b/src/assets/wise5/classroomMonitor/classroomMonitorComponents/notebook/notebook-workgroup-grading/notebook-workgroup-grading.component.html @@ -27,7 +27,7 @@
- Latest Work: {{ workgroup.report.serverSaveTime | date : 'mediumDate' }} + Latest Work: {{ workgroup.report.serverSaveTime | date: 'mediumDate' }} No Work
@@ -42,8 +42,7 @@ [config]="notebookConfig" [viewOnly]="true" [workgroupId]="workgroup.workgroupId" - > - + /> - + diff --git a/src/assets/wise5/vle/vle.component.spec.ts b/src/assets/wise5/vle/vle.component.spec.ts index fd2cdcfde55..61feb49aa3b 100644 --- a/src/assets/wise5/vle/vle.component.spec.ts +++ b/src/assets/wise5/vle/vle.component.spec.ts @@ -39,7 +39,7 @@ let saveVLEEventSpy: jasmine.Spy; describe('VLEComponent', () => { beforeEach(async () => { await TestBed.configureTestingModule({ - declarations: [NotebookNotesComponent, SafeUrl, VLEComponent], + declarations: [SafeUrl, VLEComponent], imports: [ BrowserAnimationsModule, FormsModule, @@ -56,6 +56,7 @@ describe('VLEComponent', () => { NodeComponent, NodeIconComponent, NodeStatusIconComponent, + NotebookNotesComponent, StepToolsComponent, StudentTeacherCommonServicesModule, TopBarComponent diff --git a/src/messages.xlf b/src/messages.xlf index 19befcf9aae..a3bc1b72bbd 100644 --- a/src/messages.xlf +++ b/src/messages.xlf @@ -6408,39 +6408,39 @@ Click "Cancel" to keep the invalid JSON open so you can fix it.109 - - You haven't created any yet. + + You haven't created any yet. src/app/notebook/notebook-notes/notebook-notes.component.html - 3,5 + 4 Select item to insert src/app/notebook/notebook-notes/notebook-notes.component.html - 45 + 49 Add src/app/notebook/notebook-notes/notebook-notes.component.html - 70 + 76 - - Team hasn't created any yet. + + Team hasn't created any yet. src/app/notebook/notebook-notes/notebook-notes.component.html - 82,84 + 94 Personal src/app/notebook/notebook-notes/notebook-notes.component.ts - 103 + 122 @@ -14261,8 +14261,8 @@ Click "Cancel" to keep the invalid JSON open so you can fix it.7 - - Latest Work: + + Latest Work: src/assets/wise5/classroomMonitor/classroomMonitorComponents/notebook/notebook-workgroup-grading/notebook-workgroup-grading.component.html 29,31