Skip to content

Commit

Permalink
style(frontend): Fix lint problems
Browse files Browse the repository at this point in the history
  • Loading branch information
Clashsoft committed Nov 10, 2023
1 parent 630a02c commit f701f88
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -126,16 +126,15 @@ export class SubmitService {
}

private hasRelevantInfo(task: Task, points: number, evaluation: Evaluation | undefined, depth: number): boolean {
return !!(
evaluation?.remark
|| evaluation?.snippets.find(s => s.comment)
return !!evaluation?.remark
|| !!evaluation?.snippets.some(s => s.comment)
// always show non-full points
|| points !== Math.max(task.points, 0)
// always show top-level tasks (but not deductions)
|| depth === 0 && task.points > 0
// always show tasks with subtasks
|| task.children.length
);
|| !!task.children.length
;
}

private renderSnippets(assignment: ReadAssignmentDto, solution: Solution, snippets: Snippet[]) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ export class SolutionNamePipe implements PipeTransform {
return '';
}
const {name, github, studentId, email} = solution.author;
// eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing
return name || github || studentId || email || '';
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -73,9 +73,7 @@ export class CreateSolutionComponent implements OnInit {
}

addFiles(files: FileList) {
for (let i = 0; i < files.length; i++) {
this.files.push(files[i]);
}
this.files.push(...Array.from(files));
}

submit(): void {
Expand Down

0 comments on commit f701f88

Please sign in to comment.