diff --git a/webapp/package-lock.json b/webapp/package-lock.json index eafc5a17..42280e4f 100644 --- a/webapp/package-lock.json +++ b/webapp/package-lock.json @@ -16,7 +16,9 @@ "@angular/platform-browser": "18.2.1", "@angular/platform-browser-dynamic": "18.2.1", "@angular/router": "18.2.1", - "@primer/primitives": "^9.1.1", + "@ng-icons/core": "29.5.0", + "@ng-icons/octicons": "29.5.0", + "@primer/primitives": "9.1.1", "@tanstack/angular-query-devtools-experimental": "5.52.0", "@tanstack/angular-query-experimental": "5.52.0", "autoprefixer": "10.4.20", @@ -4085,6 +4087,27 @@ "win32" ] }, + "node_modules/@ng-icons/core": { + "version": "29.5.0", + "resolved": "https://registry.npmjs.org/@ng-icons/core/-/core-29.5.0.tgz", + "integrity": "sha512-MpM8I/7uzUC7SKRt29d4ByCpKjk8sXTlOiLuBCTHG1uyI14jUZdpyhBwpCpGKpkqqmfxDkvN848hjhFiOKlBuA==", + "dependencies": { + "tslib": "^2.2.0" + }, + "peerDependencies": { + "@angular/common": ">=18.0.0", + "@angular/core": ">=18.0.0", + "rxjs": "^6.5.3 || ^7.4.0" + } + }, + "node_modules/@ng-icons/octicons": { + "version": "29.5.0", + "resolved": "https://registry.npmjs.org/@ng-icons/octicons/-/octicons-29.5.0.tgz", + "integrity": "sha512-z9EVYqmSCxVkeLF9wp0lruWCZP1eN0UYNYLtjNs38f3nzx3x0+eME8+Ek1iZaEVf9MnMubT0l1lJjupw+rWmKg==", + "dependencies": { + "tslib": "^2.2.0" + } + }, "node_modules/@ngtools/webpack": { "version": "18.2.1", "resolved": "https://registry.npmjs.org/@ngtools/webpack/-/webpack-18.2.1.tgz", diff --git a/webapp/package.json b/webapp/package.json index 207219bc..cb31cc2e 100644 --- a/webapp/package.json +++ b/webapp/package.json @@ -28,7 +28,9 @@ "@angular/platform-browser": "18.2.1", "@angular/platform-browser-dynamic": "18.2.1", "@angular/router": "18.2.1", - "@primer/primitives": "^9.1.1", + "@ng-icons/core": "29.5.0", + "@ng-icons/octicons": "29.5.0", + "@primer/primitives": "9.1.1", "@tanstack/angular-query-devtools-experimental": "5.52.0", "@tanstack/angular-query-experimental": "5.52.0", "autoprefixer": "10.4.20", diff --git a/webapp/src/app/app.component.html b/webapp/src/app/app.component.html index 7835f94e..d71dcc41 100644 --- a/webapp/src/app/app.component.html +++ b/webapp/src/app/app.component.html @@ -4,7 +4,7 @@
- + Hephaestus diff --git a/webapp/src/app/app.component.ts b/webapp/src/app/app.component.ts index 647cf15a..41c404cf 100644 --- a/webapp/src/app/app.component.ts +++ b/webapp/src/app/app.component.ts @@ -1,7 +1,7 @@ import { Component, isDevMode } from '@angular/core'; import { AngularQueryDevtools } from '@tanstack/angular-query-devtools-experimental'; import { RouterLink, RouterLinkActive, RouterOutlet } from '@angular/router'; -import { LucideAngularModule } from 'lucide-angular'; +import { LucideAngularModule, Hammer } from 'lucide-angular'; import { ThemeSwitcherComponent } from './components/theme-switcher/theme-switcher.component'; @Component({ @@ -12,6 +12,8 @@ import { ThemeSwitcherComponent } from './components/theme-switcher/theme-switch styles: [] }) export class AppComponent { + protected Hammer = Hammer; + title = 'Hephaestus'; isDevMode() { diff --git a/webapp/src/app/app.config.ts b/webapp/src/app/app.config.ts index a0e8b341..eb96f70b 100644 --- a/webapp/src/app/app.config.ts +++ b/webapp/src/app/app.config.ts @@ -1,9 +1,8 @@ -import { APP_INITIALIZER, ApplicationConfig, importProvidersFrom, provideExperimentalZonelessChangeDetection } from '@angular/core'; +import { APP_INITIALIZER, ApplicationConfig, provideExperimentalZonelessChangeDetection } from '@angular/core'; import { provideRouter } from '@angular/router'; import { provideAnimationsAsync } from '@angular/platform-browser/animations/async'; import { provideHttpClient, withInterceptorsFromDi } from '@angular/common/http'; import { provideAngularQuery, QueryClient } from '@tanstack/angular-query-experimental'; -import { LucideAngularModule, Home, Sun, Moon, Hammer } from 'lucide-angular'; import { environment } from 'environments/environment'; import { BASE_PATH } from 'app/core/modules/openapi'; import { routes } from 'app/app.routes'; @@ -22,7 +21,6 @@ export const appConfig: ApplicationConfig = { provideAngularQuery(new QueryClient()), provideHttpClient(withInterceptorsFromDi()), provideAnimationsAsync(), - importProvidersFrom(LucideAngularModule.pick({ Home, Sun, Moon, Hammer })), { provide: BASE_PATH, useValue: environment.serverUrl }, { provide: APP_INITIALIZER, useFactory: initializeAnalytics, multi: true, deps: [AnalyticsService] } ] diff --git a/webapp/src/app/components/leaderboard/leaderboard.component.html b/webapp/src/app/components/leaderboard/leaderboard.component.html index 8e854a45..04815e8a 100644 --- a/webapp/src/app/components/leaderboard/leaderboard.component.html +++ b/webapp/src/app/components/leaderboard/leaderboard.component.html @@ -28,22 +28,22 @@

Artemis Leaderboard

{{ entry.score }} - + @if (entry.changesRequested && entry.changesRequested > 0) { -
- +
+ {{ entry.changesRequested }}
} @if (entry.approvals && entry.approvals > 0) { -
- +
+ {{ entry.approvals }}
} @if (entry.comments && entry.comments > 0) { -
- +
+ {{ entry.comments }}
} diff --git a/webapp/src/app/components/leaderboard/leaderboard.component.ts b/webapp/src/app/components/leaderboard/leaderboard.component.ts index 08ddbe8a..24757f6f 100644 --- a/webapp/src/app/components/leaderboard/leaderboard.component.ts +++ b/webapp/src/app/components/leaderboard/leaderboard.component.ts @@ -1,9 +1,8 @@ import { ChangeDetectionStrategy, Component, computed, inject } from '@angular/core'; import { injectQuery } from '@tanstack/angular-query-experimental'; +import { NgIconComponent } from '@ng-icons/core'; +import { octFileDiff, octCheck, octComment } from '@ng-icons/octicons'; import { LeaderboardEntry, LeaderboardService } from 'app/core/modules/openapi'; -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'; @@ -119,14 +118,16 @@ const defaultData: LeaderboardEntry[] = [ TableHeaderDirective, TableHeadDirective, TableRowDirective, - PullRequestChangesRequestedIconComponent, - PullRequestApprovedIconComponent, - PullRequestCommentIconComponent + NgIconComponent ], templateUrl: './leaderboard.component.html', changeDetection: ChangeDetectionStrategy.OnPush }) export class LeaderboardComponent { + protected octFileDiff = octFileDiff; + protected octCheck = octCheck; + protected octComment = octComment; + leaderboardService = inject(LeaderboardService); query = injectQuery(() => ({ diff --git a/webapp/src/app/components/theme-switcher/theme-switcher.component.html b/webapp/src/app/components/theme-switcher/theme-switcher.component.html index f2ca7226..95c8ccb0 100644 --- a/webapp/src/app/components/theme-switcher/theme-switcher.component.html +++ b/webapp/src/app/components/theme-switcher/theme-switcher.component.html @@ -1,5 +1,5 @@
- +
diff --git a/webapp/src/app/components/theme-switcher/theme-switcher.component.ts b/webapp/src/app/components/theme-switcher/theme-switcher.component.ts index 86e285b3..fc7722fc 100644 --- a/webapp/src/app/components/theme-switcher/theme-switcher.component.ts +++ b/webapp/src/app/components/theme-switcher/theme-switcher.component.ts @@ -1,5 +1,5 @@ import { Component, inject } from '@angular/core'; -import { LucideAngularModule } from 'lucide-angular'; +import { LucideAngularModule, Sun, Moon } from 'lucide-angular'; import { ButtonComponent } from 'app/ui/button/button.component'; import { AppTheme, ThemeSwitcherService } from './theme-switcher.service'; import { animate, state, style, transition, trigger } from '@angular/animations'; @@ -20,6 +20,9 @@ import { animate, state, style, transition, trigger } from '@angular/animations' export class ThemeSwitcherComponent { themeSwitcherService = inject(ThemeSwitcherService); + protected Sun = Sun; + protected Moon = Moon; + toggleTheme() { if (this.themeSwitcherService.currentTheme() === AppTheme.DARK) { this.themeSwitcherService.setLightTheme(); diff --git a/webapp/src/app/components/theme-switcher/theme-switcher.stories.ts b/webapp/src/app/components/theme-switcher/theme-switcher.stories.ts index 527dde1c..3f00cdb2 100644 --- a/webapp/src/app/components/theme-switcher/theme-switcher.stories.ts +++ b/webapp/src/app/components/theme-switcher/theme-switcher.stories.ts @@ -1,5 +1,4 @@ import { moduleMetadata, type Meta, type StoryObj } from '@storybook/angular'; -import { LucideAngularModule, Sun, Moon } from 'lucide-angular'; import { ThemeSwitcherComponent } from './theme-switcher.component'; import { BrowserAnimationsModule } from '@angular/platform-browser/animations'; @@ -10,7 +9,7 @@ const meta: Meta = { tags: ['autodocs'], decorators: [ moduleMetadata({ - imports: [LucideAngularModule.pick({ Sun, Moon }), BrowserAnimationsModule] + imports: [BrowserAnimationsModule] }) ] }; diff --git a/webapp/src/app/ui/icons/PullRequestApprovedIcon.component.ts b/webapp/src/app/ui/icons/PullRequestApprovedIcon.component.ts deleted file mode 100644 index 42fd5286..00000000 --- a/webapp/src/app/ui/icons/PullRequestApprovedIcon.component.ts +++ /dev/null @@ -1,15 +0,0 @@ -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 deleted file mode 100644 index 5e729e2f..00000000 --- a/webapp/src/app/ui/icons/PullRequestChangesRequestedIcon.component.ts +++ /dev/null @@ -1,15 +0,0 @@ -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 deleted file mode 100644 index 919cedcb..00000000 --- a/webapp/src/app/ui/icons/PullRequestCommentIcon.component.ts +++ /dev/null @@ -1,15 +0,0 @@ -import { Component } from '@angular/core'; - -@Component({ - selector: 'app-icon-pull-request-comment', - template: ` - - - - `, - standalone: true -}) -export class PullRequestCommentIconComponent {}