-
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.
- Loading branch information
Showing
6 changed files
with
127 additions
and
19 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
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
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
88 changes: 88 additions & 0 deletions
88
webapp/src/app/home/activity-dashboard/activity-dashboard/activity-dashboard.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 |
---|---|---|
@@ -0,0 +1,88 @@ | ||
<div class="flex flex-col gap-8"> | ||
<div> | ||
<p class="text-xl font-semibold">Open pull requests</p> | ||
<div class="flex flex-row justify-between pt-2 w-full"> | ||
<div class="flex flex-col w-1/2 gap-2 m-1 mr-3"> | ||
@if (query.data()?.pullRequests) { | ||
@for (activity of query.data()?.pullRequests; track activity.id) { | ||
<app-issue-card | ||
class="w-full" | ||
[title]="activity.title" | ||
[number]="activity.number" | ||
[additions]="activity.additions" | ||
[deletions]="activity.deletions" | ||
[htmlUrl]="activity.htmlUrl" | ||
[repositoryName]="activity.repository?.name" | ||
[createdAt]="activity.createdAt" | ||
[state]="activity.state" | ||
[isDraft]="activity.isDraft" | ||
[isMerged]="activity.isMerged" | ||
[pullRequestLabels]="activity.labels" | ||
> | ||
</app-issue-card> | ||
} | ||
} | ||
</div> | ||
<div class="border-l mx-4 border-border"></div> | ||
<div class="w-1/2"> | ||
<p>Pull request metrics coming</p> | ||
</div> | ||
</div> | ||
</div> | ||
|
||
<div> | ||
<p class="text-xl font-semibold">Open issues</p> | ||
<div class="flex flex-row justify-between pt-2 w-full"> | ||
<div class="flex flex-col w-1/2 gap-2 m-1 mr-3"> | ||
@if (query.data()?.issues) { | ||
@for (issue of query.data()?.issues; track issue.id) { | ||
<app-issue-card | ||
class="w-full" | ||
[title]="issue.title" | ||
[number]="issue.number" | ||
[htmlUrl]="issue.htmlUrl" | ||
[repositoryName]="issue.repositoryNameWithOwner" | ||
[createdAt]="issue.createdAt" | ||
[state]="issue.state" | ||
[isIssue]="true" | ||
> | ||
</app-issue-card> | ||
} | ||
} | ||
</div> | ||
<div class="border-l mx-4 border-border"></div> | ||
<div class="w-1/2"> | ||
<p>Issue metrics coming</p> | ||
</div> | ||
</div> | ||
|
||
<div> | ||
<p class="text-xl font-semibold">Open reviews</p> | ||
<div class="flex flex-row justify-between pt-2 w-full"> | ||
<div class="flex flex-col w-1/2 gap-2 m-1 mr-3"> | ||
@if (query.data()?.reviews) { | ||
@for (review of query.data()?.reviews; track review.id) { | ||
<app-issue-card | ||
class="w-full" | ||
[title]="review.pullRequest?.title" | ||
[number]="review.pullRequest?.number" | ||
[htmlUrl]="review.pullRequest?.htmlUrl" | ||
[repositoryName]="review.pullRequest?.repository?.name" | ||
[state]="review.pullRequest?.state" | ||
[isDraft]="review.pullRequest?.isDraft" | ||
[isMerged]="review.pullRequest?.isMerged" | ||
[additions]="review.pullRequest?.additions" | ||
[deletions]="review.pullRequest?.deletions" | ||
> | ||
</app-issue-card> | ||
} | ||
} | ||
</div> | ||
<div class="border-l mx-4 border-border"></div> | ||
<div class="w-1/2"> | ||
<p>Review metrics coming</p> | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
</div> |
29 changes: 29 additions & 0 deletions
29
webapp/src/app/home/activity-dashboard/activity-dashboard/activity-dashboard.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 |
---|---|---|
@@ -0,0 +1,29 @@ | ||
import { Component, inject } from '@angular/core'; | ||
import { ActivityService } from '@app/core/modules/openapi'; | ||
import { injectQuery } from '@tanstack/angular-query-experimental'; | ||
import { combineLatest, lastValueFrom, map, timer } from 'rxjs'; | ||
import { ActivatedRoute } from '@angular/router'; | ||
import { IssueCardComponent } from '@app/user/issue-card/issue-card.component'; | ||
|
||
@Component({ | ||
selector: 'app-activity-dashboard', | ||
standalone: true, | ||
imports: [IssueCardComponent], | ||
templateUrl: './activity-dashboard.component.html', | ||
styles: `` | ||
}) | ||
export class ActivityDashboardComponent { | ||
activityService = inject(ActivityService); | ||
|
||
protected userLogin: string | null = null; | ||
|
||
constructor(private route: ActivatedRoute) { | ||
this.userLogin = this.route.snapshot.paramMap.get('id'); | ||
} | ||
|
||
query = injectQuery(() => ({ | ||
queryKey: ['user', { id: this.userLogin }], | ||
enabled: !!this.userLogin, | ||
queryFn: async () => lastValueFrom(combineLatest([this.activityService.getActivityByUser(this.userLogin!), timer(400)]).pipe(map(([activity]) => activity))) | ||
})); | ||
} |