Skip to content

Commit 9dbe785

Browse files
feat: Add GitHub link opening functionality for repository items
1 parent cd93c9b commit 9dbe785

3 files changed

Lines changed: 10 additions & 1 deletion

File tree

src/app/shared/components/alerts-list/alerts-list.component.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@
4040
class="repo-item"
4141
*ngFor="let repo of alerts.repos"
4242
[class.has-alerts]="repo.alerts > 0"
43+
(click)="openRepoOnGitHub(repo.name)"
4344
>
4445
<div class="repo-info">
4546
<i class="ti ti-package repo-icon"></i>

src/app/shared/components/alerts-list/alerts-list.component.scss

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,7 @@ $border-color: #2a2a4a;
112112
border-radius: 6px;
113113
margin-bottom: 8px;
114114
transition: background 0.2s;
115+
cursor: pointer;
115116

116117
&:hover {
117118
background: $bg-tertiary;

src/app/shared/components/alerts-list/alerts-list.component.ts

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { Component, EventEmitter, Input, Output } from '@angular/core';
2-
import { AlertsResponse } from '../../../core/services';
2+
import { AlertsResponse, TauriService } from '../../../core/services';
33

44
@Component({
55
selector: 'app-alerts-list',
@@ -14,6 +14,8 @@ export class AlertsListComponent {
1414

1515
@Output() showRepos = new EventEmitter<void>();
1616

17+
constructor(private tauriService: TauriService) {}
18+
1719
getAlertIcon(): string {
1820
if (!this.alerts) return 'ti ti-circle-filled';
1921
return this.alerts.total_alerts === 0 ? 'ti ti-check' : 'ti ti-alert-triangle';
@@ -22,4 +24,9 @@ export class AlertsListComponent {
2224
onShowRepos(): void {
2325
this.showRepos.emit();
2426
}
27+
28+
openRepoOnGitHub(repoFullName: string): void {
29+
const url = `https://github.com/${repoFullName}/security/dependabot`;
30+
this.tauriService.openExternalLink(url);
31+
}
2532
}

0 commit comments

Comments
 (0)