Skip to content

Commit

Permalink
Added required to inputs
Browse files Browse the repository at this point in the history
  • Loading branch information
PaRangger committed Feb 1, 2025
1 parent 5c1a1bb commit c1161bf
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,13 @@ export class CourseConversationsCodeOfConductComponent implements OnInit {
private alertService = inject(AlertService);
private conversationService = inject(ConversationService);

course = input<Course>();
course = input.required<Course>();

responsibleContacts: User[] = [];

ngOnInit() {
if (this.course()?.id) {
this.conversationService.getResponsibleUsersForCodeOfConduct(this.course()!.id!).subscribe({
if (this.course().id) {
this.conversationService.getResponsibleUsersForCodeOfConduct(this.course().id!).subscribe({
next: (res: HttpResponse<User[]>) => {
if (res.body) {
this.responsibleContacts = res.body;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
<div class="course-wide-search-mobile-disclaimer" [ngClass]="{ 'is-not-in-active-search': !courseWideSearchConfig()?.searchTerm }">
<div class="course-wide-search-mobile-disclaimer" [ngClass]="{ 'is-not-in-active-search': !courseWideSearchConfig().searchTerm }">
<span class="mb-2" jhiTranslate="artemisApp.metis.overview.mobileDisclaimer"></span>
<button class="btn btn-outline-secondary" jhiTranslate="artemisApp.metis.overview.mobileDisclaimerCallToAction" (click)="openSidebar()"></button>
</div>
<div [ngClass]="{ 'is-not-in-active-search': !courseWideSearchConfig()?.searchTerm }">
<div [ngClass]="{ 'is-not-in-active-search': !courseWideSearchConfig().searchTerm }">
<div class="mt-2 mx-2">
<div>
<h4 class="d-inline-block rounded p-1 info">
@if (!courseWideSearchConfig()?.searchTerm) {
@if (!courseWideSearchConfig().searchTerm) {
<span jhiTranslate="artemisApp.metis.overview.allPublicMessages"></span>
} @else {
<button class="btn btn-sm btn-outline-secondary d-inline-block d-sm-none me-2" (click)="openSidebar()">
<fa-icon [icon]="faChevronLeft" />
</button>
<span jhiTranslate="artemisApp.metis.overview.searchResults" [translateValues]="{ search: courseWideSearchConfig()?.searchTerm }"></span>
<span jhiTranslate="artemisApp.metis.overview.searchResults" [translateValues]="{ search: courseWideSearchConfig().searchTerm }"></span>
}
</h4>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ import { ArtemisTranslatePipe } from 'app/shared/pipes/artemis-translate.pipe';
imports: [NgClass, TranslateDirective, FaIconComponent, FormsModule, ReactiveFormsModule, NgbTooltip, InfiniteScrollDirective, PostingThreadComponent, ArtemisTranslatePipe],
})
export class CourseWideSearchComponent implements OnInit, AfterViewInit, OnDestroy {
readonly courseWideSearchConfig = input<CourseWideSearchConfig>();
readonly courseWideSearchConfig = input.required<CourseWideSearchConfig>();

readonly messages = viewChildren<ElementRef>('postingThread');
readonly messages$ = toObservable(this.messages);
Expand Down

0 comments on commit c1161bf

Please sign in to comment.