diff --git a/src/main/webapp/app/course/dashboards/assessment-dashboard/assessment-dashboard-information.component.ts b/src/main/webapp/app/course/dashboards/assessment-dashboard/assessment-dashboard-information.component.ts index b2d0ef1ee8d3..36819ac62b0f 100644 --- a/src/main/webapp/app/course/dashboards/assessment-dashboard/assessment-dashboard-information.component.ts +++ b/src/main/webapp/app/course/dashboards/assessment-dashboard/assessment-dashboard-information.component.ts @@ -1,10 +1,14 @@ -import { Component, Input, OnChanges, OnDestroy, OnInit } from '@angular/core'; +import { Component, Input, OnChanges, OnDestroy, OnInit, inject } from '@angular/core'; import { DueDateStat } from 'app/course/dashboards/due-date-stat.model'; -import { LegendPosition } from '@swimlane/ngx-charts'; +import { LegendPosition, PieChartModule } from '@swimlane/ngx-charts'; import { TranslateService } from '@ngx-translate/core'; import { GraphColors } from 'app/entities/statistics.model'; import { Subscription } from 'rxjs'; import { Course } from 'app/entities/course.model'; +import { TranslateDirective } from 'app/shared/language/translate.directive'; +import { ArtemisSidePanelModule } from 'app/shared/side-panel/side-panel.module'; +import { RouterLink } from '@angular/router'; +import { ArtemisTranslatePipe } from 'app/shared/pipes/artemis-translate.pipe'; export class AssessmentDashboardInformationEntry { constructor( @@ -33,8 +37,12 @@ export class AssessmentDashboardInformationEntry { selector: 'jhi-assessment-dashboard-information', templateUrl: './assessment-dashboard-information.component.html', styleUrls: ['./assessment-dashboard-information.component.scss'], + standalone: true, + imports: [TranslateDirective, PieChartModule, ArtemisSidePanelModule, RouterLink, ArtemisTranslatePipe], }) export class AssessmentDashboardInformationComponent implements OnInit, OnChanges, OnDestroy { + private translateService = inject(TranslateService); + @Input() isExamMode: boolean; @Input() course: Course; @Input() examId?: number; @@ -71,8 +79,6 @@ export class AssessmentDashboardInformationComponent implements OnInit, OnChange themeSubscription: Subscription; - constructor(private translateService: TranslateService) {} - ngOnInit(): void { this.setup(); this.translateService.onLangChange.subscribe(() => { diff --git a/src/main/webapp/app/course/dashboards/assessment-dashboard/assessment-dashboard.component.ts b/src/main/webapp/app/course/dashboards/assessment-dashboard/assessment-dashboard.component.ts index a39b6af80e77..8ada9ad9321b 100644 --- a/src/main/webapp/app/course/dashboards/assessment-dashboard/assessment-dashboard.component.ts +++ b/src/main/webapp/app/course/dashboards/assessment-dashboard/assessment-dashboard.component.ts @@ -1,5 +1,5 @@ -import { Component, OnInit } from '@angular/core'; -import { ActivatedRoute } from '@angular/router'; +import { Component, OnInit, inject } from '@angular/core'; +import { ActivatedRoute, RouterLink } from '@angular/router'; import { CourseManagementService } from '../../manage/course-management.service'; import { AlertService } from 'app/core/util/alert.service'; import { User } from 'app/core/user/user.model'; @@ -17,19 +17,55 @@ import { Exam } from 'app/entities/exam/exam.model'; import { ExamManagementService } from 'app/exam/manage/exam-management.service'; import { ExerciseService } from 'app/exercises/shared/exercise/exercise.service'; import { QuizExercise } from 'app/entities/quiz/quiz-exercise.model'; -import { AssessmentDashboardInformationEntry } from './assessment-dashboard-information.component'; +import { AssessmentDashboardInformationComponent, AssessmentDashboardInformationEntry } from './assessment-dashboard-information.component'; import { TutorIssue, TutorIssueComplaintsChecker, TutorIssueRatingChecker, TutorIssueScoreChecker } from 'app/course/dashboards/assessment-dashboard/tutor-issue'; import { TutorLeaderboardElement } from 'app/shared/dashboards/tutor-leaderboard/tutor-leaderboard.model'; import { faClipboard, faHeartBroken, faSort, faTable } from '@fortawesome/free-solid-svg-icons'; import { DocumentationType } from 'app/shared/components/documentation-button/documentation-button.component'; +import { ArtemisSharedComponentModule } from 'app/shared/components/shared-component.module'; +import { FaIconComponent } from '@fortawesome/angular-fontawesome'; +import { TranslateDirective } from 'app/shared/language/translate.directive'; +import { ExamAssessmentButtonsComponent } from 'app/course/dashboards/assessment-dashboard/exam-assessment-buttons/exam-assessment-buttons.component'; +import { FormsModule } from '@angular/forms'; +import { ArtemisSharedCommonModule } from 'app/shared/shared-common.module'; +import { NgbTooltip } from '@ng-bootstrap/ng-bootstrap'; +import { ArtemisTutorParticipationGraphModule } from 'app/shared/dashboards/tutor-participation-graph/tutor-participation-graph.module'; +import { ArtemisExerciseAssessmentDashboardModule } from 'app/exercises/shared/dashboards/tutor/exercise-assessment-dashboard.module'; +import { ArtemisTutorLeaderboardModule } from 'app/shared/dashboards/tutor-leaderboard/tutor-leaderboard.module'; +import { ArtemisTranslatePipe } from 'app/shared/pipes/artemis-translate.pipe'; @Component({ selector: 'jhi-assessment-dashboard', templateUrl: './assessment-dashboard.component.html', styleUrls: ['./exam-assessment-buttons/exam-assessment-buttons.component.scss'], providers: [CourseManagementService], + standalone: true, + imports: [ + ArtemisSharedComponentModule, + RouterLink, + FaIconComponent, + TranslateDirective, + ExamAssessmentButtonsComponent, + AssessmentDashboardInformationComponent, + FormsModule, + ArtemisSharedCommonModule, + NgbTooltip, + ArtemisTutorParticipationGraphModule, + ArtemisExerciseAssessmentDashboardModule, + ArtemisTutorLeaderboardModule, + ArtemisTranslatePipe, + ], }) export class AssessmentDashboardComponent implements OnInit { + private courseService = inject(CourseManagementService); + private exerciseService = inject(ExerciseService); + private examManagementService = inject(ExamManagementService); + private alertService = inject(AlertService); + private accountService = inject(AccountService); + private route = inject(ActivatedRoute); + private guidedTourService = inject(GuidedTourService); + private sortService = inject(SortService); + readonly TeamFilterProp = TeamFilterProp; readonly documentationType: DocumentationType = 'Assessment'; @@ -79,17 +115,6 @@ export class AssessmentDashboardComponent implements OnInit { faClipboard = faClipboard; faHeartBroken = faHeartBroken; - constructor( - private courseService: CourseManagementService, - private exerciseService: ExerciseService, - private examManagementService: ExamManagementService, - private alertService: AlertService, - private accountService: AccountService, - private route: ActivatedRoute, - private guidedTourService: GuidedTourService, - private sortService: SortService, - ) {} - /** * On init set the courseID, load all exercises and statistics for tutors and set the identity for the AccountService. */ diff --git a/src/main/webapp/app/course/dashboards/assessment-dashboard/assessment-dashboard.module.ts b/src/main/webapp/app/course/dashboards/assessment-dashboard/assessment-dashboard.module.ts index 1095436e3162..d4edadae0921 100644 --- a/src/main/webapp/app/course/dashboards/assessment-dashboard/assessment-dashboard.module.ts +++ b/src/main/webapp/app/course/dashboards/assessment-dashboard/assessment-dashboard.module.ts @@ -26,7 +26,9 @@ const ENTITY_STATES = [...assessmentDashboardRoute]; ArtemisExerciseAssessmentDashboardModule, ArtemisSharedComponentModule, PieChartModule, + AssessmentDashboardComponent, + AssessmentDashboardInformationComponent, + ExamAssessmentButtonsComponent, ], - declarations: [AssessmentDashboardComponent, AssessmentDashboardInformationComponent, ExamAssessmentButtonsComponent], }) export class ArtemisAssessmentDashboardModule {} diff --git a/src/main/webapp/app/course/dashboards/assessment-dashboard/exam-assessment-buttons/exam-assessment-buttons.component.ts b/src/main/webapp/app/course/dashboards/assessment-dashboard/exam-assessment-buttons/exam-assessment-buttons.component.ts index 7bc20e00e55c..de7010811fae 100644 --- a/src/main/webapp/app/course/dashboards/assessment-dashboard/exam-assessment-buttons/exam-assessment-buttons.component.ts +++ b/src/main/webapp/app/course/dashboards/assessment-dashboard/exam-assessment-buttons/exam-assessment-buttons.component.ts @@ -1,5 +1,5 @@ -import { Component, OnInit } from '@angular/core'; -import { ActivatedRoute } from '@angular/router'; +import { Component, OnInit, inject } from '@angular/core'; +import { ActivatedRoute, RouterLink } from '@angular/router'; import { StudentExamService } from 'app/exam/manage/student-exams/student-exam.service'; import { Subscription, forkJoin } from 'rxjs'; import { tap } from 'rxjs/operators'; @@ -15,12 +15,24 @@ import { AccountService } from 'app/core/auth/account.service'; import { onError } from 'app/shared/util/global.utils'; import { ArtemisTranslatePipe } from 'app/shared/pipes/artemis-translate.pipe'; import { faClipboard } from '@fortawesome/free-solid-svg-icons'; +import { FaIconComponent } from '@fortawesome/angular-fontawesome'; +import { TranslateDirective } from 'app/shared/language/translate.directive'; @Component({ selector: 'jhi-exam-assessment-buttons', templateUrl: './exam-assessment-buttons.component.html', + standalone: true, + imports: [RouterLink, FaIconComponent, TranslateDirective], }) export class ExamAssessmentButtonsComponent implements OnInit { + private route = inject(ActivatedRoute); + private examManagementService = inject(ExamManagementService); + private studentExamService = inject(StudentExamService); + private courseService = inject(CourseManagementService); + private alertService = inject(AlertService); + private accountService = inject(AccountService); + private artemisTranslatePipe = inject(ArtemisTranslatePipe); + courseId: number; examId: number; studentExams: StudentExam[]; @@ -38,16 +50,6 @@ export class ExamAssessmentButtonsComponent implements OnInit { // icons faClipboard = faClipboard; - constructor( - private route: ActivatedRoute, - private examManagementService: ExamManagementService, - private studentExamService: StudentExamService, - private courseService: CourseManagementService, - private alertService: AlertService, - private accountService: AccountService, - private artemisTranslatePipe: ArtemisTranslatePipe, - ) {} - /** * Initialize the courseId and examId */ diff --git a/src/test/javascript/spec/component/assessment-dashboard/assessment-dashboard-information.component.spec.ts b/src/test/javascript/spec/component/assessment-dashboard/assessment-dashboard-information.component.spec.ts index 92d0ec9f0f89..ee0f7b8f686f 100644 --- a/src/test/javascript/spec/component/assessment-dashboard/assessment-dashboard-information.component.spec.ts +++ b/src/test/javascript/spec/component/assessment-dashboard/assessment-dashboard-information.component.spec.ts @@ -20,7 +20,7 @@ describe('AssessmentDashboardInformationComponent', () => { beforeEach(() => { TestBed.configureTestingModule({ imports: [ArtemisTestModule, MockModule(PieChartModule)], - declarations: [AssessmentDashboardInformationComponent, MockPipe(ArtemisTranslatePipe), MockComponent(SidePanelComponent)], + declarations: [MockPipe(ArtemisTranslatePipe), MockComponent(SidePanelComponent)], providers: [{ provide: TranslateService, useClass: MockTranslateService }], }).compileComponents(); diff --git a/src/test/javascript/spec/component/assessment-dashboard/assessment-dashboard.component.spec.ts b/src/test/javascript/spec/component/assessment-dashboard/assessment-dashboard.component.spec.ts index bc3cfc327be3..55bb55097cc4 100644 --- a/src/test/javascript/spec/component/assessment-dashboard/assessment-dashboard.component.spec.ts +++ b/src/test/javascript/spec/component/assessment-dashboard/assessment-dashboard.component.spec.ts @@ -142,7 +142,6 @@ describe('AssessmentDashboardInformationComponent', () => { return TestBed.configureTestingModule({ imports: [ArtemisTestModule, MockModule(RouterModule)], declarations: [ - AssessmentDashboardComponent, MockComponent(TutorLeaderboardComponent), MockComponent(TutorParticipationGraphComponent), MockComponent(AssessmentDashboardInformationComponent), diff --git a/src/test/javascript/spec/component/assessment-dashboard/exam-assessment-buttons.component.spec.ts b/src/test/javascript/spec/component/assessment-dashboard/exam-assessment-buttons.component.spec.ts index e3e18abc527a..eb9e8da45f07 100644 --- a/src/test/javascript/spec/component/assessment-dashboard/exam-assessment-buttons.component.spec.ts +++ b/src/test/javascript/spec/component/assessment-dashboard/exam-assessment-buttons.component.spec.ts @@ -116,7 +116,7 @@ describe('ExamAssessmentButtons', () => { TestBed.configureTestingModule({ imports: [ArtemisTestModule], - declarations: [ExamAssessmentButtonsComponent, MockDirective(MockHasAnyAuthorityDirective), MockPipe(ArtemisTranslatePipe), MockRouterLinkDirective], + declarations: [MockDirective(MockHasAnyAuthorityDirective), MockPipe(ArtemisTranslatePipe), MockRouterLinkDirective], providers, }) .compileComponents()