From 33e892c1404efa9d5b48ab7539f9861155735204 Mon Sep 17 00:00:00 2001 From: Hassan Matout Date: Fri, 29 Nov 2024 08:58:48 +0100 Subject: [PATCH] Development: Migrate plagiarism-case-student-detail-view.component.ts dependency injection from constructor to inject --- .../plagiarism-case-student-detail-view.component.ts | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/src/main/webapp/app/course/plagiarism-cases/student-view/detail-view/plagiarism-case-student-detail-view.component.ts b/src/main/webapp/app/course/plagiarism-cases/student-view/detail-view/plagiarism-case-student-detail-view.component.ts index 25187a72efed..f75ef5d342fc 100644 --- a/src/main/webapp/app/course/plagiarism-cases/student-view/detail-view/plagiarism-case-student-detail-view.component.ts +++ b/src/main/webapp/app/course/plagiarism-cases/student-view/detail-view/plagiarism-case-student-detail-view.component.ts @@ -1,4 +1,4 @@ -import { Component, OnDestroy, OnInit, ViewChild } from '@angular/core'; +import { Component, OnDestroy, OnInit, ViewChild, inject } from '@angular/core'; import { PlagiarismCase } from 'app/exercises/shared/plagiarism/types/PlagiarismCase'; import { PlagiarismCasesService } from 'app/course/plagiarism-cases/shared/plagiarism-cases.service'; import { ActivatedRoute, Params, RouterLink } from '@angular/router'; @@ -28,6 +28,10 @@ import { ArtemisSharedCommonModule } from 'app/shared/shared-common.module'; imports: [TranslateDirective, FaIconComponent, RouterLink, MetisModule, ArtemisSharedComponentModule, ArtemisSharedCommonModule], }) export class PlagiarismCaseStudentDetailViewComponent implements OnInit, OnDestroy { + protected metisService = inject(MetisService); + private plagiarismCasesService = inject(PlagiarismCasesService); + private activatedRoute = inject(ActivatedRoute); + @ViewChild('post') postComponent: PostComponent; readonly ButtonType = ButtonType; @@ -51,12 +55,6 @@ export class PlagiarismCaseStudentDetailViewComponent implements OnInit, OnDestr readonly dayjs = dayjs; - constructor( - protected metisService: MetisService, - private plagiarismCasesService: PlagiarismCasesService, - private activatedRoute: ActivatedRoute, - ) {} - ngOnInit(): void { this.paramSubscription = combineLatest({ ancestorParams: this.activatedRoute.parent!.parent!.params,