Skip to content

Commit

Permalink
Feedback to use inject for services and wording change
Browse files Browse the repository at this point in the history
  • Loading branch information
Pablosanqt committed Oct 24, 2024
1 parent 40175f2 commit 068c060
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 8 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Component, ElementRef, EventEmitter, HostListener, OnDestroy, OnInit, ViewChild, ViewEncapsulation } from '@angular/core';
import { Component, ElementRef, EventEmitter, HostListener, OnDestroy, OnInit, ViewChild, ViewEncapsulation, inject } from '@angular/core';
import { ConversationDTO } from 'app/entities/metis/conversation/conversation.model';
import { Post } from 'app/entities/metis/post.model';
import { ActivatedRoute, Router } from '@angular/router';
Expand Down Expand Up @@ -138,6 +138,9 @@ export class CourseConversationsComponent implements OnInit, OnDestroy {
createChannelFn?: (channel: ChannelDTO) => Observable<never>;
channelActions$ = new EventEmitter<ChannelAction>();

private courseSidebarService: CourseSidebarService = inject(CourseSidebarService);
private layoutService: LayoutService = inject(LayoutService);

constructor(
private router: Router,
private activatedRoute: ActivatedRoute,
Expand All @@ -146,8 +149,6 @@ export class CourseConversationsComponent implements OnInit, OnDestroy {
private courseOverviewService: CourseOverviewService,
private modalService: NgbModal,
private profileService: ProfileService,
private courseSidebarService: CourseSidebarService,
private layoutService: LayoutService,
) {}

getAsChannel = getAsChannelDTO;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import {
ViewChild,
ViewChildren,
ViewEncapsulation,
inject,
} from '@angular/core';
import { faChevronLeft, faCircleNotch, faEnvelope, faFilter, faLongArrowAltDown, faLongArrowAltUp, faPlus, faTimes } from '@fortawesome/free-solid-svg-icons';
import { FormBuilder, FormGroup } from '@angular/forms';
Expand Down Expand Up @@ -71,12 +72,13 @@ export class CourseWideSearchComponent implements OnInit, AfterViewInit, OnDestr

getAsChannel = getAsChannelDTO;

private courseSidebarService: CourseSidebarService = inject(CourseSidebarService);

constructor(
public metisService: MetisService, // instance from course-conversations.component
public metisConversationService: MetisConversationService, // instance from course-conversations.component
private formBuilder: FormBuilder,
public cdr: ChangeDetectorRef,
private courseSidebarService: CourseSidebarService,
) {}

ngOnInit() {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Component, EventEmitter, OnDestroy, OnInit, Output } from '@angular/core';
import { Component, EventEmitter, OnDestroy, OnInit, Output, inject } from '@angular/core';
import { faChevronLeft, faSearch, faUserGroup, faUserPlus } from '@fortawesome/free-solid-svg-icons';
import { ConversationDTO } from 'app/entities/metis/conversation/conversation.model';
import { NgbModal, NgbModalRef } from '@ng-bootstrap/ng-bootstrap';
Expand Down Expand Up @@ -45,13 +45,14 @@ export class ConversationHeaderComponent implements OnInit, OnDestroy {
faSearch = faSearch;
faChevronLeft = faChevronLeft;

private courseSidebarService: CourseSidebarService = inject(CourseSidebarService);

constructor(
private modalService: NgbModal,
// instantiated at course-conversation.component.ts
public metisConversationService: MetisConversationService,
public conversationService: ConversationService,
private metisService: MetisService,
private courseSidebarService: CourseSidebarService,
) {}

getAsGroupChat = getAsGroupChatDTO;
Expand Down
4 changes: 3 additions & 1 deletion src/main/webapp/app/overview/course-overview.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import {
ViewChild,
ViewChildren,
ViewContainerRef,
inject,
} from '@angular/core';
import { ActivatedRoute, Router } from '@angular/router';
import {
Expand Down Expand Up @@ -190,6 +191,8 @@ export class CourseOverviewComponent implements OnInit, OnDestroy, AfterViewInit
readonly isMessagingEnabled = isMessagingEnabled;
readonly isCommunicationEnabled = isCommunicationEnabled;

private courseSidebarService: CourseSidebarService = inject(CourseSidebarService);

constructor(
private courseService: CourseManagementService,
private courseExerciseService: CourseExerciseService,
Expand All @@ -206,7 +209,6 @@ export class CourseOverviewComponent implements OnInit, OnDestroy, AfterViewInit
private profileService: ProfileService,
private modalService: NgbModal,
private examParticipationService: ExamParticipationService,
private courseSidebarService: CourseSidebarService,
private ltiService: LtiService,
) {}

Expand Down
2 changes: 1 addition & 1 deletion src/main/webapp/i18n/de/metis.json
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@
"ANNOUNCEMENT": "Ankündigung",
"allPublicMessages": "Alle öffentlichen Nachrichten",
"searchResults": "Suchergebnisse für {{ search }}",
"mobileDisclaimer": "Bitte wähle erst eine Konversation aus.",
"mobileDisclaimer": "Bitte erst eine Konversation auswählen.",
"mobileDisclaimerCallToAction": "Konversation wählen"
},
"post": {
Expand Down

0 comments on commit 068c060

Please sign in to comment.