Skip to content

Commit

Permalink
#82: small changes after review
Browse files Browse the repository at this point in the history
  • Loading branch information
iam-flo committed Sep 26, 2024
1 parent 633f6d3 commit a2cd226
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
6 changes: 3 additions & 3 deletions webapp/src/app/core/IssueCard/issue-card.component.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<div class="border border-border bg-card rounded-lg p-4 w-72 cursor-pointer" (click)="openIssue()">
<div class="border border-border bg-card rounded-lg p-4 w-72">
<div class="flex justify-between items-center mb-2 text-xs text-gray-500">
<span class="font-bold flex justify-center items-center space-x-1">
@if (state() === 'OPEN') {
Expand All @@ -15,7 +15,7 @@
</span>
</div>

<div class="flex justify-between font-bold text-sm mb-3">
<div class="flex justify-between font-bold text-sm mb-3 hover:text-github-accent-foreground cursor-pointer" (click)="openIssue()">
{{ title() }}
@if (getMostRecentReview(); as review) {
@if (review.state === 'APPROVED') {
Expand All @@ -31,7 +31,7 @@
</div>
<div class="flex gap-1 flex-wrap">
@for (label of pullRequestLabels(); track label.name) {
<span class="px-2 py-1 rounded-full text-xs mr-2 text-white" [style.background-color]="label.color">{{ label.name }}</span>
<span class="px-2 py-1 rounded-full text-xs mr-2 text-neutral-100/95" [style.background-color]="label.color">{{ label.name }}</span>
}
</div>
</div>
6 changes: 3 additions & 3 deletions webapp/src/app/core/IssueCard/issue-card.component.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Component, input } from '@angular/core';
import { PullRequestLabel, PullRequestReview } from '@app/core/modules/openapi';
import { PullRequest, PullRequestLabel, PullRequestReview } from '@app/core/modules/openapi';
import { NgIcon } from '@ng-icons/core';
import { octCheck, octComment, octFileDiff, octGitPullRequest, octGitPullRequestClosed, octX } from '@ng-icons/octicons';
import { Dayjs } from 'dayjs';
Expand All @@ -20,7 +20,7 @@ export class IssueCardComponent {
repositoryName = input.required<string>();
reviews = input.required<Array<PullRequestReview>>();
createdAt = input.required<Dayjs>();
state = input.required<string>();
state = input.required<PullRequest.StateEnum>();
pullRequestLabels = input.required<Array<PullRequestLabel>>();
protected readonly octCheck = octCheck;
protected readonly octX = octX;
Expand All @@ -30,7 +30,7 @@ export class IssueCardComponent {
protected readonly octGitPullRequestClosed = octGitPullRequestClosed;

getMostRecentReview() {
return Array.from(this.reviews() || []).reduce((latest: PullRequestReview, review: PullRequestReview) => {
return this.reviews().reduce((latest, review) => {
return new Date(review.updatedAt || 0) > new Date(latest.updatedAt || 0) ? review : latest;
});
}
Expand Down
2 changes: 1 addition & 1 deletion webapp/src/app/core/IssueCard/issue-card.stories.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { IssueCardComponent } from './issue-card.component';
import dayjs from 'dayjs';

const meta: Meta<IssueCardComponent> = {
title: 'Component/IssueCard',
title: 'Components/Core/IssueCard',
component: IssueCardComponent,
tags: ['autodocs'] // Auto-generate docs if enabled
};
Expand Down

0 comments on commit a2cd226

Please sign in to comment.