From d207561d6b0c5d8e48dfa24d627c688f993b78ae Mon Sep 17 00:00:00 2001 From: GODrums Date: Fri, 13 Sep 2024 18:20:45 +0200 Subject: [PATCH] Extract icons into files --- .../leaderboard/leaderboard.component.html | 21 +++---------------- .../leaderboard/leaderboard.component.ts | 17 ++++++++++++++- .../PullRequestApprovedIcon.component.ts | 15 +++++++++++++ ...llRequestChangesRequestedIcon.component.ts | 15 +++++++++++++ .../icons/PullRequestCommentIcon.component.ts | 15 +++++++++++++ 5 files changed, 64 insertions(+), 19 deletions(-) create mode 100644 webapp/src/app/ui/icons/PullRequestApprovedIcon.component.ts create mode 100644 webapp/src/app/ui/icons/PullRequestChangesRequestedIcon.component.ts create mode 100644 webapp/src/app/ui/icons/PullRequestCommentIcon.component.ts diff --git a/webapp/src/app/components/leaderboard/leaderboard.component.html b/webapp/src/app/components/leaderboard/leaderboard.component.html index c0136383..492f3c4a 100644 --- a/webapp/src/app/components/leaderboard/leaderboard.component.html +++ b/webapp/src/app/components/leaderboard/leaderboard.component.html @@ -26,30 +26,15 @@

Artemis Leaderboard

{{ entry.score }}
- - - + {{ entry.changes_requested }}
- - - + {{ entry.approvals }}
- - - + {{ entry.comments }}
diff --git a/webapp/src/app/components/leaderboard/leaderboard.component.ts b/webapp/src/app/components/leaderboard/leaderboard.component.ts index af8e7cd6..966ba2fe 100644 --- a/webapp/src/app/components/leaderboard/leaderboard.component.ts +++ b/webapp/src/app/components/leaderboard/leaderboard.component.ts @@ -2,6 +2,9 @@ import { HttpClient } from '@angular/common/http'; import { ChangeDetectionStrategy, Component, computed, inject } from '@angular/core'; import { injectQuery } from '@tanstack/angular-query-experimental'; import { Leaderboard } from 'app/@types/leaderboard'; +import { PullRequestApprovedIconComponent } from 'app/ui/icons/PullRequestApprovedIcon.component'; +import { PullRequestChangesRequestedIconComponent } from 'app/ui/icons/PullRequestChangesRequestedIcon.component'; +import { PullRequestCommentIconComponent } from 'app/ui/icons/PullRequestCommentIcon.component'; import { TableBodyDirective } from 'app/ui/table/table-body.directive'; import { TableCaptionDirective } from 'app/ui/table/table-caption.directive'; import { TableCellDirective } from 'app/ui/table/table-cell.directive'; @@ -27,7 +30,19 @@ const defaultData: Leaderboard.Entry[] = [ @Component({ selector: 'app-leaderboard', standalone: true, - imports: [TableComponent, TableBodyDirective, TableCaptionDirective, TableCellDirective, TableFooterDirective, TableHeaderDirective, TableHeadDirective, TableRowDirective], + imports: [ + TableComponent, + TableBodyDirective, + TableCaptionDirective, + TableCellDirective, + TableFooterDirective, + TableHeaderDirective, + TableHeadDirective, + TableRowDirective, + PullRequestChangesRequestedIconComponent, + PullRequestApprovedIconComponent, + PullRequestCommentIconComponent + ], templateUrl: './leaderboard.component.html', changeDetection: ChangeDetectionStrategy.OnPush }) diff --git a/webapp/src/app/ui/icons/PullRequestApprovedIcon.component.ts b/webapp/src/app/ui/icons/PullRequestApprovedIcon.component.ts new file mode 100644 index 00000000..42fd5286 --- /dev/null +++ b/webapp/src/app/ui/icons/PullRequestApprovedIcon.component.ts @@ -0,0 +1,15 @@ +import { Component } from '@angular/core'; + +@Component({ + selector: 'app-icon-pull-request-approved', + template: ` + + + + `, + standalone: true +}) +export class PullRequestApprovedIconComponent {} diff --git a/webapp/src/app/ui/icons/PullRequestChangesRequestedIcon.component.ts b/webapp/src/app/ui/icons/PullRequestChangesRequestedIcon.component.ts new file mode 100644 index 00000000..5e729e2f --- /dev/null +++ b/webapp/src/app/ui/icons/PullRequestChangesRequestedIcon.component.ts @@ -0,0 +1,15 @@ +import { Component } from '@angular/core'; + +@Component({ + selector: 'app-icon-pull-request-changes-requested', + template: ` + + + + `, + standalone: true +}) +export class PullRequestChangesRequestedIconComponent {} diff --git a/webapp/src/app/ui/icons/PullRequestCommentIcon.component.ts b/webapp/src/app/ui/icons/PullRequestCommentIcon.component.ts new file mode 100644 index 00000000..919cedcb --- /dev/null +++ b/webapp/src/app/ui/icons/PullRequestCommentIcon.component.ts @@ -0,0 +1,15 @@ +import { Component } from '@angular/core'; + +@Component({ + selector: 'app-icon-pull-request-comment', + template: ` + + + + `, + standalone: true +}) +export class PullRequestCommentIconComponent {}