From 1222ea71858797672a2dd22b5b3a5c6331db6a6c Mon Sep 17 00:00:00 2001 From: Armin Stanitzok <21990230+GODrums@users.noreply.github.com> Date: Wed, 20 Nov 2024 09:42:11 +0100 Subject: [PATCH] Show Parts of the Legend per default (#181) Co-authored-by: Felix T.J. Dietrich Co-authored-by: Felix T.J. Dietrich --- .../leaderboard/legend/legend.component.html | 62 +++++++++---------- .../leaderboard/legend/legends.component.ts | 32 ++++++---- 2 files changed, 47 insertions(+), 47 deletions(-) diff --git a/webapp/src/app/home/leaderboard/legend/legend.component.html b/webapp/src/app/home/leaderboard/legend/legend.component.html index b3178176..5f8c8eea 100644 --- a/webapp/src/app/home/leaderboard/legend/legend.component.html +++ b/webapp/src/app/home/leaderboard/legend/legend.component.html @@ -1,20 +1,7 @@
-
-
-

Leaderboard Legend

-

Explanation of the most important elements

-
-
- @if (open()) { - - } @else { - - } -
-
-
+
-

Icons

+

Icons

Reviewed pull requests @@ -35,25 +22,32 @@

Icons

Code comments
-
-
-

Scoring System

-

- The score approximates your contribution activity by evaluating your review interactions and the complexity of the pull requests you've reviewed. - Change requests are valued highest, followed by approvals and comments. The score increases with the number of review interactions. Pull - request complexity — based on factors like changed files, commits, additions, and deletions — also enhances your score; - more complex pull requests contribute more. The final score balances your interactions with the complexity of the work reviewed, - highlighting both your engagement and the difficulty of the tasks you've undertaken. This score reflects your impact but does not directly measure time invested or work - quality. - - [source] - -

+
+
+ + +

+ The score approximates your contribution activity by evaluating your review interactions and the complexity of the pull requests you've reviewed. + Change requests are valued highest, followed by approvals and comments. The score increases with the number of review interactions. + Pull request complexity — based on factors like changed files, commits, additions, and deletions — also enhances your score; + more complex pull requests contribute more. The final score balances your interactions with the complexity of the work reviewed, + highlighting both your engagement and the difficulty of the tasks you've undertaken. This score reflects your impact but does not directly measure time invested or + work quality. + + [source] + +

+
+
+
diff --git a/webapp/src/app/home/leaderboard/legend/legends.component.ts b/webapp/src/app/home/leaderboard/legend/legends.component.ts index bc6da240..d25d87dc 100644 --- a/webapp/src/app/home/leaderboard/legend/legends.component.ts +++ b/webapp/src/app/home/leaderboard/legend/legends.component.ts @@ -1,18 +1,31 @@ -import { Component, computed, input, signal } from '@angular/core'; +import { Component, input } from '@angular/core'; import { NgIconComponent } from '@ng-icons/core'; import { octFileDiff, octCheck, octComment, octCommentDiscussion, octGitPullRequest } from '@ng-icons/octicons'; import { HlmIconComponent } from '@spartan-ng/ui-icon-helm'; import { HlmCardModule } from '@spartan-ng/ui-card-helm'; -import { provideIcons } from '@spartan-ng/ui-icon-helm'; -import { lucideChevronsDown, lucideChevronsUp } from '@ng-icons/lucide'; -import { cn } from '@app/utils'; import { HlmButtonDirective } from '@spartan-ng/ui-button-helm'; +import { + HlmAccordionContentComponent, + HlmAccordionDirective, + HlmAccordionIconDirective, + HlmAccordionItemDirective, + HlmAccordionTriggerDirective +} from '@spartan-ng/ui-accordion-helm'; @Component({ selector: 'app-leaderboard-legend', standalone: true, - imports: [HlmCardModule, NgIconComponent, HlmIconComponent, HlmButtonDirective], - providers: [provideIcons({ lucideChevronsDown, lucideChevronsUp })], + imports: [ + HlmAccordionDirective, + HlmAccordionItemDirective, + HlmAccordionTriggerDirective, + HlmAccordionContentComponent, + HlmAccordionIconDirective, + HlmCardModule, + NgIconComponent, + HlmIconComponent, + HlmButtonDirective + ], templateUrl: './legend.component.html' }) export class LeaderboardLegendComponent { @@ -23,11 +36,4 @@ export class LeaderboardLegendComponent { protected octGitPullRequest = octGitPullRequest; isLoading = input(); - open = signal(false); - - contentClass = computed(() => cn('flex flex-wrap gap-y-4 gap-x-8 pt-2', { hidden: !this.open() })); - - toggleOpen() { - this.open.set(!this.open()); - } }