diff --git a/src/app/api/models/project.ts b/src/app/api/models/project.ts index b0125e8d6..bde396b74 100644 --- a/src/app/api/models/project.ts +++ b/src/app/api/models/project.ts @@ -1,7 +1,7 @@ import { HttpClient } from '@angular/common/http'; import { Entity, EntityCache, RequestOptions } from 'ngx-entity-service'; import { Observable, tap } from 'rxjs'; -import { alertService, visualisations } from 'src/app/ajs-upgraded-providers'; +import { visualisations } from 'src/app/ajs-upgraded-providers'; import { AppInjector } from 'src/app/app-injector'; import { DoubtfireConstants } from 'src/app/config/constants/doubtfire-constants'; import { MappingFunctions } from '../services/mapping-fn'; @@ -22,6 +22,7 @@ import { User, } from './doubtfire-model'; import { TaskOutcomeAlignment } from './task-outcome-alignment'; +import { AlertService } from 'src/app/common/services/alert.service'; export class Project extends Entity { public id: number; @@ -82,7 +83,7 @@ export class Project extends Entity { this.tutorials.filter( (enrol) => enrol.abbreviation.toLowerCase().indexOf(matchText) >= 0 || - enrol.tutorName.toLowerCase().indexOf(matchText) >= 0 + enrol.tutorName.toLowerCase().indexOf(matchText) >= 0, ).length > 0 ); } @@ -226,7 +227,7 @@ export class Project extends Entity { // Assigns a grade to a student public assignGrade(score: number, rationale: string): void { - const alerts: any = AppInjector.get(alertService); + const alerts = AppInjector.get(AlertService); const projectService: ProjectService = AppInjector.get(ProjectService); const oldGrade: number = this.grade; this.grade = score; @@ -241,12 +242,13 @@ export class Project extends Entity { }, }) .subscribe({ + // eslint-disable-next-line @typescript-eslint/no-unused-vars next: (project) => { - alerts.add('success', 'Grade updated.', 2000); + alerts.success('Grade updated.'); }, error: (message) => { this.grade = oldGrade; - alerts.add('danger', `Grade was not updated: ${message}`, 8000); + alerts.error(`Grade was not updated: ${message}`); }, }); } @@ -286,7 +288,7 @@ export class Project extends Entity { .pipe( tap(() => { this.portfolioFiles = this.portfolioFiles.filter((value) => value != file); - }) + }), ); } @@ -344,19 +346,15 @@ export class Project extends Entity { } public updateUnitEnrolment(): void { - const expected = (this.enrolled = !this.enrolled); - const alerts: any = AppInjector.get(alertService); + const alerts = AppInjector.get(AlertService); const projectService: ProjectService = AppInjector.get(ProjectService); projectService.update(this).subscribe({ + // eslint-disable-next-line @typescript-eslint/no-unused-vars next: (project) => { - if (expected == project.enrolled) { - alerts.add('success', 'Enrolment changed.', 2000); - } else { - alerts.add('danger', 'Enrolment change failed.', 5000); - } + alerts.success('Enrolment changed.', 2000); }, error: (message) => { - alerts.add('danger', message, 5000); + alerts.error(message); }, }); } @@ -391,7 +389,7 @@ export class Project extends Entity { // dates = unit.start_date.to_date.step(unit.end_date.to_date + 1.week, step=7).to_a const endDateValue = this.unit.endDate.getTime() + MappingFunctions.weeksMs(3); const dates = MappingFunctions.step(this.unit.startDate.getTime(), endDateValue, MappingFunctions.weeksMs(1)).map( - (val) => new Date(val) + (val) => new Date(val), ); // Get the target task from the unit's task definitions @@ -409,7 +407,7 @@ export class Project extends Entity { const tasks = this.tasks; const readyOrCompleteTasks = tasks.filter((task) => - ['ready_for_feedback', 'discuss', 'demonstrate', 'complete'].includes(task.status) + ['ready_for_feedback', 'discuss', 'demonstrate', 'complete'].includes(task.status), ); let lastTargetDate: Date; @@ -417,7 +415,7 @@ export class Project extends Entity { // Get the tasks currently marked as done (or ready to mark) const doneTasks = tasks.filter( - (t) => !['working_on_it', 'not_started', 'fix_and_resubmit', 'redo', 'need_help'].includes(t.status) + (t) => !['working_on_it', 'not_started', 'fix_and_resubmit', 'redo', 'need_help'].includes(t.status), ); // last done task date) diff --git a/src/app/common/edit-profile-form/edit-profile-form.component.html b/src/app/common/edit-profile-form/edit-profile-form.component.html index 57d661613..8b993072a 100644 --- a/src/app/common/edit-profile-form/edit-profile-form.component.html +++ b/src/app/common/edit-profile-form/edit-profile-form.component.html @@ -1,4 +1,4 @@ -
+
diff --git a/src/app/common/modals/edit-profile-dialog/edit-profile-dialog.service.ts b/src/app/common/modals/edit-profile-dialog/edit-profile-dialog.service.ts index 2843904d0..7541f6dd4 100644 --- a/src/app/common/modals/edit-profile-dialog/edit-profile-dialog.service.ts +++ b/src/app/common/modals/edit-profile-dialog/edit-profile-dialog.service.ts @@ -11,6 +11,7 @@ export class EditProfileDialogService { openDialog(user: User): void { this.dialog.open(EditProfileFormComponent, { + width: '800px', data: { user, mode: 'edit' }, }); } diff --git a/src/app/units/states/edit/directives/unit-students-editor/unit-students-editor.component.html b/src/app/units/states/edit/directives/unit-students-editor/unit-students-editor.component.html index 9c90ccafa..4797fff33 100644 --- a/src/app/units/states/edit/directives/unit-students-editor/unit-students-editor.component.html +++ b/src/app/units/states/edit/directives/unit-students-editor/unit-students-editor.component.html @@ -6,7 +6,7 @@

Enrolled Students

- + Search @@ -48,7 +48,7 @@

Enrolled Students

Campus - + @@ -56,7 +56,7 @@

Enrolled Students

Tutorial - + @@ -65,7 +65,11 @@

Enrolled Students

Enrolled - + diff --git a/src/app/units/states/edit/directives/unit-tutorials-list/unit-tutorials-list.component.html b/src/app/units/states/edit/directives/unit-tutorials-list/unit-tutorials-list.component.html index c6b41d369..d908dfa8c 100644 --- a/src/app/units/states/edit/directives/unit-tutorials-list/unit-tutorials-list.component.html +++ b/src/app/units/states/edit/directives/unit-tutorials-list/unit-tutorials-list.component.html @@ -9,12 +9,12 @@

{{ stream.name }} - {{ stream.abbreviation }}

- + Name - - + Abbreviation @@ -45,13 +45,13 @@

Tutorials without a stream

{{ tutorial.abbreviation }}
- + - + @@ -65,7 +65,7 @@

Tutorials without a stream

{{ tutorial.campus ? tutorial.campus.name : '' }} - + Campus Not Specified @@ -77,7 +77,7 @@

Tutorials without a stream

- + Campus Not Specified @@ -97,13 +97,13 @@

Tutorials without a stream

{{ tutorial.meetingLocation }} - + - + @@ -117,7 +117,7 @@

Tutorials without a stream

{{ tutorial.meetingDay }} - + Day @@ -128,7 +128,7 @@

Tutorials without a stream

- + Day @@ -147,7 +147,7 @@

Tutorials without a stream

{{ tutorial.meetingTime }} - + Tutorials without a stream - + @@ -173,7 +173,7 @@

Tutorials without a stream

{{ tutorial.tutor?.name }} - + Tutor @@ -184,7 +184,7 @@

Tutorials without a stream

- + Tutor @@ -203,13 +203,13 @@

Tutorials without a stream

{{ tutorial.capacity }} - + - + diff --git a/src/app/units/states/edit/directives/unit-tutorials-list/unit-tutorials-list.component.ts b/src/app/units/states/edit/directives/unit-tutorials-list/unit-tutorials-list.component.ts index 4ca15bc57..a507dc44d 100644 --- a/src/app/units/states/edit/directives/unit-tutorials-list/unit-tutorials-list.component.ts +++ b/src/app/units/states/edit/directives/unit-tutorials-list/unit-tutorials-list.component.ts @@ -46,7 +46,7 @@ export class UnitTutorialsListComponent extends EntityFormComponent im private tutorialStreamService: TutorialStreamService, private campusService: CampusService, @Inject(confirmationModal) private confirmationModal: any, - @Inject(alertService) private alerts: any + @Inject(alertService) private alerts: any, ) { super( { @@ -58,7 +58,7 @@ export class UnitTutorialsListComponent extends EntityFormComponent im capacity: new UntypedFormControl('', [Validators.required]), tutor: new UntypedFormControl(null, [Validators.required]), }, - 'Tutorial' + 'Tutorial', ); } @@ -80,7 +80,7 @@ export class UnitTutorialsListComponent extends EntityFormComponent im private filterTutorials(): void { this.tutorials = this.unit.tutorials.filter( - (tutorial) => tutorial.tutorialStream === this.stream || (!tutorial.tutorialStream && !this.stream) + (tutorial) => tutorial.tutorialStream === this.stream || (!tutorial.tutorialStream && !this.stream), ); this.dataSource.data = this.tutorials; } @@ -189,7 +189,7 @@ export class UnitTutorialsListComponent extends EntityFormComponent im error: (message) => { this.alerts.add('danger', `Failed to delete stream. ${message}`, 8000); }, - }) + }), ); }