Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions src/js/utils/github-api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ const DESCRIPTIONS = {
STATE_CHANGE: 'You changed the thread state (for example, closing an issue or merging a pull request).',
SUBSCRIBED: "You're watching the repository.",
TEAM_MENTION: 'You were on a team that was mentioned.',
CI_ACTIVITY: 'A GitHub Actions workflow run was triggered for your repository',
UNKNOWN: 'The reason for this notification is not supported by the app.',
};

Expand Down Expand Up @@ -43,6 +44,8 @@ export function formatReason(
return { type: 'Subscribed', description: DESCRIPTIONS['SUBSCRIBED'] };
case 'team_mention':
return { type: 'Team Mention', description: DESCRIPTIONS['TEAM_MENTION'] };
case 'ci_activity':
return { type: 'Workflow Run', description: DESCRIPTIONS['WORKFLOW_RUN'] };
default:
return { type: 'Unknown', description: DESCRIPTIONS['UNKNOWN'] };
}
Expand All @@ -60,6 +63,8 @@ export function getNotificationTypeIcon(type: SubjectType): string {
return 'tag';
case 'RepositoryVulnerabilityAlert':
return 'alert';
case 'CheckSuite':
return 'sync';
default:
return 'question';
}
Expand Down
8 changes: 5 additions & 3 deletions src/types/github.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,15 @@ export type Reason =
| 'security_alert'
| 'state_change'
| 'subscribed'
| 'team_mention';
| 'team_mention'
| 'ci_activity';

export type SubjectType =
| 'Issue'
| 'PullRequest'
| 'Commit'
| 'Release'
| 'CheckSuite'
| 'RepositoryVulnerabilityAlert';

export interface Notification {
Expand Down Expand Up @@ -102,7 +104,7 @@ export interface Owner {

export interface Subject {
title: string;
url: string;
latest_comment_url: string;
url?: string;
Comment thread
manosim marked this conversation as resolved.
latest_comment_url?: string;
type: SubjectType;
}