-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
design Pr bad practice component and activity dashboard(#199)
- Loading branch information
Showing
7 changed files
with
111 additions
and
49 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
13 changes: 10 additions & 3 deletions
13
webapp/src/app/user/bad-practice-card/bad-practice-card.component.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,13 @@ | ||
<a class="shadow-sm"> | ||
<div class="flex flex-row justify-start items-center gap-2"> | ||
<div> | ||
@if (resolved()) { | ||
<ng-icon [svg]="octCheck" size="24" class="text-github-success-foreground" /> | ||
} @else { | ||
<ng-icon [svg]="octX" size="24" class="text-github-danger-foreground" /> | ||
} | ||
</div> | ||
<div class="flex flex-col"> | ||
<h1 class="text-lg font-semibold">{{ title() }}</h1> | ||
<div class="text-sm">{{ description() }}</div> | ||
<p class="text-sm">{{ description() }}</p> | ||
</div> | ||
</a> | ||
</div> |
10 changes: 7 additions & 3 deletions
10
webapp/src/app/user/bad-practice-card/bad-practice-card.component.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,20 @@ | ||
import { Component, input } from '@angular/core'; | ||
import { HlmCardModule } from '@spartan-ng/ui-card-helm'; | ||
import { NgIcon } from '@ng-icons/core'; | ||
import { octCheck, octX } from '@ng-icons/octicons'; | ||
|
||
@Component({ | ||
selector: 'app-bad-practice-card', | ||
standalone: true, | ||
imports: [HlmCardModule], | ||
imports: [HlmCardModule, NgIcon], | ||
templateUrl: './bad-practice-card.component.html', | ||
styles: `` | ||
}) | ||
export class BadPracticeCardComponent { | ||
protected readonly octCheck = octCheck; | ||
protected readonly octX = octX; | ||
|
||
title = input<string>(); | ||
description = input<string>(); | ||
repositoryName = input<string>(); | ||
number = input<number>(); | ||
resolved = input<boolean>(); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
85 changes: 50 additions & 35 deletions
85
...src/app/user/pull-request-bad-practice-card/pull-request-bad-practice-card.component.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,48 +1,63 @@ | ||
<brn-collapsible> | ||
<button brnCollapsibleTrigger> | ||
<a hlmCard variant="profile"> | ||
<div hlmCardHeader> | ||
<div class="flex justify-between items-center text-sm text-github-muted-foreground"> | ||
<span class="font-medium flex justify-center items-center space-x-1"> | ||
@if (isLoading()) { | ||
<hlm-skeleton class="size-5 bg-green-500/30"></hlm-skeleton> | ||
<hlm-skeleton class="h-4 w-16 lg:w-36"></hlm-skeleton> | ||
} @else { | ||
<ng-icon [svg]="issueIconAndColor().icon" size="18" [class]="'mr-1 ' + issueIconAndColor().color"></ng-icon> | ||
{{ repositoryName() }} #{{ number() }} on {{ displayCreated().format('MMM D') }} | ||
} | ||
</span> | ||
<span class="flex items-center space-x-2"> | ||
@if (isLoading()) { | ||
<hlm-skeleton class="h-4 w-8 bg-green-500/30"></hlm-skeleton> | ||
<hlm-skeleton class="h-4 w-8 bg-destructive/20"></hlm-skeleton> | ||
} @else { | ||
<span class="text-github-success-foreground font-bold">+{{ additions() }}</span> | ||
<span class="text-github-danger-foreground font-bold">-{{ deletions() }}</span> | ||
} | ||
</span> | ||
</div> | ||
<span class="flex justify-between font-medium"> | ||
<a hlmCard variant="profile"> | ||
<div hlmCardHeader> | ||
<div class="flex justify-between items-center text-sm text-github-muted-foreground"> | ||
<span class="font-medium flex justify-center items-center space-x-1"> | ||
@if (isLoading()) { | ||
<hlm-skeleton class="size-5 bg-green-500/30"></hlm-skeleton> | ||
<hlm-skeleton class="h-4 w-16 lg:w-36"></hlm-skeleton> | ||
} @else { | ||
<ng-icon [svg]="issueIconAndColor().icon" size="18" [class]="'mr-1 ' + issueIconAndColor().color"></ng-icon> | ||
{{ repositoryName() }} #{{ number() }} on {{ displayCreated().format('MMM D') }} | ||
} | ||
</span> | ||
<span class="font-medium flex justify-center items-center gap-1"> | ||
@if (isLoading()) { | ||
<hlm-skeleton class="h-4 w-16 lg:w-36"></hlm-skeleton> | ||
<hlm-skeleton class="size-5"></hlm-skeleton> | ||
} @else { | ||
<span> {{ badPractices()?.length }} bad practices detected </span> | ||
<button brnCollapsibleTrigger hlmBtn variant="ghost"> | ||
<ng-icon [svg]="octFold" size="18" class="text-github-muted-foreground"></ng-icon> | ||
</button> | ||
} | ||
</span> | ||
</div> | ||
<div class="flex justify-between font-medium"> | ||
<span> | ||
@if (isLoading()) { | ||
<hlm-skeleton class="h-6 w-3/4"></hlm-skeleton> | ||
} @else { | ||
<div [innerHTML]="displayTitle()" class="truncate"></div> | ||
} | ||
</span> | ||
<span> | ||
<div class="text-left">You have {{ badPractices()?.length }} bad practices in this pull request.</div> | ||
<span class="flex items-center space-x-2"> | ||
@if (isLoading()) { | ||
<hlm-skeleton class="h-4 w-8 bg-green-500/30"></hlm-skeleton> | ||
<hlm-skeleton class="h-4 w-8 bg-destructive/20"></hlm-skeleton> | ||
} @else { | ||
<span class="text-github-success-foreground font-bold">+{{ additions() }}</span> | ||
<span class="text-github-danger-foreground font-bold">-{{ deletions() }}</span> | ||
} | ||
</span> | ||
</div> | ||
@if (!isLoading()) { | ||
<div hlmCardContent class="gap-2 p-0 space-x-0 pl-6 text-left"> | ||
<brn-collapsible-content> | ||
@for (badpractice of badPractices(); track badpractice.title) { | ||
<brn-separator hlmSeparator /> | ||
<app-bad-practice-card [title]="badpractice.title" [description]="badpractice.description"></app-bad-practice-card> | ||
} | ||
</brn-collapsible-content> | ||
<div class="flex flex-wrap gap-2 p-0 space-x-0"> | ||
@for (label of pullRequestLabels(); track label.name) { | ||
<app-github-label [label]="label"></app-github-label> | ||
} | ||
</div> | ||
} | ||
</a> | ||
</button> | ||
</div> | ||
@if (!isLoading()) { | ||
<div hlmCardContent class="gap-2 p-0 space-x-0 pl-6 text-left"> | ||
<brn-collapsible-content> | ||
@for (badpractice of badPractices(); track badpractice.title) { | ||
<brn-separator hlmSeparator /> | ||
<app-bad-practice-card [title]="badpractice.title" [description]="badpractice.description" [resolved]="false"></app-bad-practice-card> | ||
} | ||
</brn-collapsible-content> | ||
</div> | ||
} | ||
</a> | ||
</brn-collapsible> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters