From 8c0c02f1ded49ee88779183b7a01c56c0482b457 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lukas=20Mau=C3=9F?= <lukas.mauss@mni.thm.de> Date: Wed, 1 May 2019 00:37:18 +0200 Subject: [PATCH] Several fixes --- .../shared/comment-list/comment-list.component.html | 8 ++++---- .../shared/comment-list/comment-list.component.ts | 2 +- src/app/components/shared/comment/comment.component.html | 2 +- src/assets/i18n/creator/de.json | 4 ++-- src/assets/i18n/creator/en.json | 4 ++-- src/assets/i18n/participant/de.json | 4 ++-- src/assets/i18n/participant/en.json | 4 ++-- 7 files changed, 14 insertions(+), 14 deletions(-) diff --git a/src/app/components/shared/comment-list/comment-list.component.html b/src/app/components/shared/comment-list/comment-list.component.html index 883b7e74c..64683e4f7 100644 --- a/src/app/components/shared/comment-list/comment-list.component.html +++ b/src/app/components/shared/comment-list/comment-list.component.html @@ -2,7 +2,7 @@ <mat-label fxLayoutAlign="center center"> <mat-icon class="search-icon">search</mat-icon> </mat-label> - <input #searchBox placeholder="{{ 'comment-list-page.search-box-placeholder-text' | translate }}" + <input #searchBox placeholder="{{ 'comment-list-page.search' | translate }}" (input)="searchComments(searchBox.value)"> <button mat-button *ngIf="searchBox.value || isIconHide" (click)="hideCommentsList=false; searchBox.value=''; isIconHide=false"> <mat-icon>close</mat-icon> @@ -17,7 +17,7 @@ </button> <mat-icon mat-icon-button *ngIf="!searchBox.value" class="add-filterIcon" color="accent" [matMenuTriggerFor]="filterMenu"> - filter_list + sort </mat-icon> <mat-menu #filterMenu="matMenu" xPosition="before"> @@ -50,8 +50,8 @@ </div> <mat-card id="outer-card" *ngIf="hideCommentsList"> - <app-comment *ngFor="let current of filteredComments" [comment]="current"> </app-comment> + <app-comment *ngFor="let current of filteredComments" [comment]="current"></app-comment> </mat-card> <mat-card *ngIf="!hideCommentsList"> - <app-comment *ngFor="let current of comments | orderBy: 'timestamp'" [comment]="current"> </app-comment> + <app-comment *ngFor="let current of comments | orderBy: 'timestamp'" [comment]="current"></app-comment> </mat-card> diff --git a/src/app/components/shared/comment-list/comment-list.component.ts b/src/app/components/shared/comment-list/comment-list.component.ts index d0ceeb765..e188ed059 100644 --- a/src/app/components/shared/comment-list/comment-list.component.ts +++ b/src/app/components/shared/comment-list/comment-list.component.ts @@ -57,7 +57,7 @@ export class CommentListComponent implements OnInit { } searchComments(term: string): void { - if (term) { + if (term && term.length > 2) { this.hideCommentsList = true; this.filteredComments = this.comments.filter(c => c.body.toLowerCase().includes(term.toLowerCase())); } else { diff --git a/src/app/components/shared/comment/comment.component.html b/src/app/components/shared/comment/comment.component.html index eff545cbd..8b4c59b3f 100644 --- a/src/app/components/shared/comment/comment.component.html +++ b/src/app/components/shared/comment/comment.component.html @@ -22,7 +22,7 @@ </div> <div fxLayout="row"> <div class="body" (click)="openPresentDialog(comment)">{{comment.body}}</div> - <span class="fill-remaining-space"></span> + <span class="fill-remaining-space" (click)="openPresentDialog(comment)"></span> <div fxLayout="column" (tap)="startAnimation('rubberBand')" [@rubberBand]="animationState" (@rubberBand.done)="resetAnimationState()"> <button mat-icon-button [disabled]="!isStudent" (click)="voteUp(comment)" > <mat-icon class="voting-icon" [ngClass]="{'upvoted' : hasVoted === 1}">keyboard_arrow_up</mat-icon> diff --git a/src/assets/i18n/creator/de.json b/src/assets/i18n/creator/de.json index 41537e07d..dd4ab8c08 100644 --- a/src/assets/i18n/creator/de.json +++ b/src/assets/i18n/creator/de.json @@ -89,7 +89,7 @@ "export": "Exportieren" }, "comment-list-page": { - "search-box-placeholder-text": "Kommentare durchsuchen", + "search": "Suchen", "cancel": "Abbrechen" } -} \ No newline at end of file +} diff --git a/src/assets/i18n/creator/en.json b/src/assets/i18n/creator/en.json index 9a64abd7d..ac9edfcd9 100644 --- a/src/assets/i18n/creator/en.json +++ b/src/assets/i18n/creator/en.json @@ -89,7 +89,7 @@ "export": "Export" }, "comment-list-page": { - "search-box-placeholder-text": "Search in comments", + "search": "Search", "cancel": "Cancel" } -} \ No newline at end of file +} diff --git a/src/assets/i18n/participant/de.json b/src/assets/i18n/participant/de.json index b45ceb1d8..db81bfab0 100644 --- a/src/assets/i18n/participant/de.json +++ b/src/assets/i18n/participant/de.json @@ -24,7 +24,7 @@ "error-both-fields": "Bitte füllen Sie alle Felder aus." }, "comment-list-page": { - "search-box-placeholder-text": "Kommentare durchsuchen", + "search": "Suchen", "cancel": "Abbrechen" }, "answer": { @@ -48,4 +48,4 @@ "improvable": "Luft nach oben", "no-answers": "Keine Antworten" } -} \ No newline at end of file +} diff --git a/src/assets/i18n/participant/en.json b/src/assets/i18n/participant/en.json index b129791e4..33772d28f 100644 --- a/src/assets/i18n/participant/en.json +++ b/src/assets/i18n/participant/en.json @@ -24,7 +24,7 @@ "error-both-fields": "Please fill in all fields." }, "comment-list-page": { - "search-box-placeholder-text": "Search in comments", + "search": "Search", "cancel": "Cancel" }, "answer": { @@ -48,4 +48,4 @@ "improvable": "Improvable", "no-answers": "No answers" } -} \ No newline at end of file +} -- GitLab