Skip to content

Commit 16cf02a

Browse files
setchyadufr
authored andcommitted
refactor: order reasons alphabetically (gitify-app#824)
1 parent d1639f4 commit 16cf02a

File tree

1 file changed

+18
-18
lines changed

1 file changed

+18
-18
lines changed

src/utils/github-api.ts

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -25,22 +25,22 @@ import { CheckSuiteStatus, Reason, Subject } from '../typesGithub';
2525

2626
// prettier-ignore
2727
const DESCRIPTIONS = {
28-
APPROVAL_REQUESTED: 'You were requested to review and approve a deployment.',
29-
ASSIGN: 'You were assigned to the issue.',
30-
AUTHOR: 'You created the thread.',
31-
COMMENT: 'You commented on the thread.',
32-
INVITATION: 'You accepted an invitation to contribute to the repository.',
33-
MANUAL: 'You subscribed to the thread (via an issue or pull request).',
34-
MEMBER_FEATURE_REQUESTED: 'Organization members have requested to enable a feature such as Draft Pull Requests or CoPilot.',
35-
MENTION: 'You were specifically @mentioned in the content.',
36-
REVIEW_REQUESTED: "You, or a team you're a member of, were requested to review a pull request.",
37-
SECURITY_ADVISORY_CREDIT: 'You were credited for contributing to a security advisory.',
38-
SECURITY_ALERT: 'GitHub discovered a security vulnerability in your repository.',
39-
STATE_CHANGE: 'You changed the thread state (for example, closing an issue or merging a pull request).',
40-
SUBSCRIBED: "You're watching the repository.",
41-
TEAM_MENTION: 'You were on a team that was mentioned.',
42-
CI_ACTIVITY: 'A GitHub Actions workflow run was triggered for your repository',
43-
UNKNOWN: 'The reason for this notification is not supported by the app.',
28+
APPROVAL_REQUESTED: 'You were requested to review and approve a deployment.',
29+
ASSIGN: 'You were assigned to the issue.',
30+
AUTHOR: 'You created the thread.',
31+
CI_ACTIVITY: 'A GitHub Actions workflow run was triggered for your repository',
32+
COMMENT: 'You commented on the thread.',
33+
INVITATION: 'You accepted an invitation to contribute to the repository.',
34+
MANUAL: 'You subscribed to the thread (via an issue or pull request).',
35+
MEMBER_FEATURE_REQUESTED: 'Organization members have requested to enable a feature such as Draft Pull Requests or CoPilot.',
36+
MENTION: 'You were specifically @mentioned in the content.',
37+
REVIEW_REQUESTED: "You, or a team you're a member of, were requested to review a pull request.",
38+
SECURITY_ADVISORY_CREDIT: 'You were credited for contributing to a security advisory.',
39+
SECURITY_ALERT: 'GitHub discovered a security vulnerability in your repository.',
40+
STATE_CHANGE: 'You changed the thread state (for example, closing an issue or merging a pull request).',
41+
SUBSCRIBED: "You're watching the repository.",
42+
TEAM_MENTION: 'You were on a team that was mentioned.',
43+
UNKNOWN: 'The reason for this notification is not supported by the app.',
4444
};
4545

4646
export function formatReason(reason: Reason): {
@@ -55,6 +55,8 @@ export function formatReason(reason: Reason): {
5555
return { type: 'Assign', description: DESCRIPTIONS['ASSIGN'] };
5656
case 'author':
5757
return { type: 'Author', description: DESCRIPTIONS['AUTHOR'] };
58+
case 'ci_activity':
59+
return { type: 'Workflow Run', description: DESCRIPTIONS['CI_ACTIVITY'] };
5860
case 'comment':
5961
return { type: 'Comment', description: DESCRIPTIONS['COMMENT'] };
6062
case 'invitation':
@@ -77,8 +79,6 @@ export function formatReason(reason: Reason): {
7779
return { type: 'Subscribed', description: DESCRIPTIONS['SUBSCRIBED'] };
7880
case 'team_mention':
7981
return { type: 'Team Mention', description: DESCRIPTIONS['TEAM_MENTION'] };
80-
case 'ci_activity':
81-
return { type: 'Workflow Run', description: DESCRIPTIONS['CI_ACTIVITY'] };
8282
default:
8383
return { type: 'Unknown', description: DESCRIPTIONS['UNKNOWN'] };
8484
}

0 commit comments

Comments
 (0)