Skip to content

Commit 333cf73

Browse files
committed
Merge branch 'main' into feat/gitifynotification-format-display
Signed-off-by: Adam Setch <[email protected]>
2 parents a310706 + 3ccc49c commit 333cf73

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

60 files changed

+1107
-1117
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,5 +57,5 @@ For more information, see [LICENSE](LICENSE).
5757
[license-badge]: https://img.shields.io/github/license/gitify-app/gitify?logo=github
5858
[github-release-badge]: https://img.shields.io/github/v/release/gitify-app/gitify?logo=github
5959
[homebrew-cask-badge]: https://img.shields.io/homebrew/cask/v/gitify?logo=homebrew&logoColor=white
60-
[renovate]: https://renovatebot.com/
60+
[renovate]: https://github.com/gitify-app/gitify/issues/576
6161
[renovate-badge]: https://img.shields.io/badge/renovate-enabled-brightgreen.svg?logo=renovate&logoColor=white

biome.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"$schema": "https://biomejs.dev/schemas/2.3.10/schema.json",
2+
"$schema": "https://biomejs.dev/schemas/2.3.11/schema.json",
33
"files": {
44
"includes": ["**", "!**/generated/**/*"]
55
},

package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@
7070
"homepage": "https://gitify.io/",
7171
"dependencies": {
7272
"electron-log": "5.4.3",
73-
"electron-updater": "6.6.2",
73+
"electron-updater": "6.7.3",
7474
"menubar": "9.5.2",
7575
"react": "19.2.3",
7676
"react-dom": "19.2.3",
@@ -79,7 +79,7 @@
7979
"devDependencies": {
8080
"@babel/core": "7.28.5",
8181
"@babel/preset-env": "7.28.5",
82-
"@biomejs/biome": "2.3.10",
82+
"@biomejs/biome": "2.3.11",
8383
"@discordapp/twemoji": "16.0.1",
8484
"@electron/notarize": "3.1.1",
8585
"@graphql-codegen/cli": "6.1.0",
@@ -110,7 +110,7 @@
110110
"date-fns": "4.1.0",
111111
"dotenv": "17.2.3",
112112
"electron": "39.2.7",
113-
"electron-builder": "26.0.12",
113+
"electron-builder": "26.4.0",
114114
"final-form": "5.0.0",
115115
"graphql": "16.12.0",
116116
"html-webpack-plugin": "5.6.5",

pnpm-lock.yaml

Lines changed: 315 additions & 342 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/renderer/__mocks__/account-mocks.ts

Lines changed: 12 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,15 @@ import type {
88
} from '../types';
99
import { mockGitifyUser } from './user-mocks';
1010

11+
export const mockGitHubAppAccount: Account = {
12+
platform: 'GitHub Cloud',
13+
method: 'GitHub App',
14+
token: 'token-987654321' as Token,
15+
hostname: Constants.DEFAULT_AUTH_OPTIONS.hostname,
16+
user: mockGitifyUser,
17+
hasRequiredScopes: true,
18+
};
19+
1120
export const mockPersonalAccessTokenAccount: Account = {
1221
platform: 'GitHub Cloud',
1322
method: 'Personal Access Token',
@@ -20,7 +29,7 @@ export const mockPersonalAccessTokenAccount: Account = {
2029
export const mockOAuthAccount: Account = {
2130
platform: 'GitHub Enterprise Server',
2231
method: 'OAuth App',
23-
token: '1234568790' as Token,
32+
token: 'token-1234568790' as Token,
2433
hostname: 'github.gitify.io' as Hostname,
2534
user: mockGitifyUser,
2635
hasRequiredScopes: true,
@@ -39,24 +48,13 @@ export const mockGitHubCloudAccount: Account = {
3948
export const mockGitHubEnterpriseServerAccount: Account = {
4049
platform: 'GitHub Enterprise Server',
4150
method: 'Personal Access Token',
42-
token: '1234568790' as Token,
51+
token: 'token-1234568790' as Token,
4352
hostname: 'github.gitify.io' as Hostname,
4453
user: mockGitifyUser,
4554
hasRequiredScopes: true,
4655
};
4756

48-
export const mockGitHubAppAccount: Account = {
49-
platform: 'GitHub Cloud',
50-
method: 'GitHub App',
51-
token: '987654321' as Token,
52-
hostname: Constants.DEFAULT_AUTH_OPTIONS.hostname,
53-
user: mockGitifyUser,
54-
hasRequiredScopes: true,
55-
};
56-
57-
export function createMockAccountWithError(
58-
error: GitifyError,
59-
): AccountNotifications {
57+
export function mockAccountWithError(error: GitifyError): AccountNotifications {
6058
return {
6159
account: mockGitHubCloudAccount,
6260
notifications: [],

src/renderer/__mocks__/notifications-mocks.ts

Lines changed: 221 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,64 +1,255 @@
1-
import { Constants } from '../constants';
2-
import type {
3-
AccountNotifications,
4-
GitifyNotification,
5-
GitifyReason,
6-
GitifyRepository,
7-
GitifySubject,
8-
Hostname,
9-
Link,
10-
} from '../types';
111
import {
12-
mockEnterpriseNotifications,
13-
mockGitHubNotifications,
14-
mockSingleNotification,
15-
} from '../utils/api/__mocks__/response-mocks';
2+
FeedPullRequestOpenIcon,
3+
IssueOpenedIcon,
4+
} from '@primer/octicons-react';
5+
6+
import {
7+
type AccountNotifications,
8+
type GitifyNotification,
9+
type GitifyNotificationUser,
10+
type GitifyOwner,
11+
type GitifyReason,
12+
type GitifyRepository,
13+
type GitifySubject,
14+
IconColor,
15+
type Link,
16+
} from '../types';
1617
import {
18+
mockGitHubAppAccount,
1719
mockGitHubCloudAccount,
1820
mockGitHubEnterpriseServerAccount,
1921
} from './account-mocks';
20-
import { mockToken } from './state-mocks';
21-
import { mockGitifyUser } from './user-mocks';
2222

23-
export const mockAccountNotifications: AccountNotifications[] = [
23+
const mockGitHubOwner: GitifyOwner = {
24+
login: 'gitify-app',
25+
avatarUrl:
26+
'https://avatars.githubusercontent.com/u/133795385?s=200&v=4' as Link,
27+
type: 'User',
28+
};
29+
30+
const mockGitHubRepository: GitifyRepository = {
31+
name: 'notifications-test',
32+
fullName: 'gitify-app/notifications-test',
33+
owner: mockGitHubOwner,
34+
htmlUrl: 'https://github.com/gitify-app/notifications-test' as Link,
35+
};
36+
37+
const mockSubjectUser: GitifyNotificationUser = {
38+
login: 'gitify-app',
39+
htmlUrl: 'https://github.com/gitify-app' as Link,
40+
avatarUrl:
41+
'https://avatars.githubusercontent.com/u/133795385?s=200&v=4' as Link,
42+
type: 'User',
43+
};
44+
45+
/**
46+
* Mock Gitify Notifications for GitHub Cloud account
47+
*
48+
* 2 Notifications
49+
* Hostname: 'github.com'
50+
* Repository: 'gitify-app/notifications-test'
51+
*/
52+
export const mockGitHubCloudGitifyNotifications: GitifyNotification[] = [
53+
{
54+
account: mockGitHubCloudAccount,
55+
order: 0,
56+
id: '138661096',
57+
unread: true,
58+
reason: {
59+
code: 'subscribed',
60+
title: 'Updated',
61+
description: "You're watching the repository.",
62+
},
63+
updatedAt: '2017-05-20T17:51:57Z',
64+
subject: {
65+
title: 'I am a robot and this is a test!',
66+
url: 'https://api.github.com/repos/gitify-app/notifications-test/issues/1' as Link,
67+
latestCommentUrl:
68+
'https://api.github.com/repos/gitify-app/notifications-test/issues/comments/302888448' as Link,
69+
type: 'Issue',
70+
state: 'OPEN',
71+
user: mockSubjectUser,
72+
reviews: [
73+
{
74+
state: 'APPROVED',
75+
users: ['octocat'],
76+
},
77+
{
78+
state: 'CHANGES_REQUESTED',
79+
users: ['gitify-app'],
80+
},
81+
{
82+
state: 'PENDING',
83+
users: ['gitify-user'],
84+
},
85+
],
86+
},
87+
repository: mockGitHubRepository,
88+
display: {
89+
number: '123',
90+
title: 'I am a robot and this is a test! [#123]',
91+
type: 'Open Issue',
92+
icon: {
93+
type: IssueOpenedIcon,
94+
color: IconColor.GREEN,
95+
},
96+
defaultUserType: 'User',
97+
},
98+
},
99+
{
100+
account: mockGitHubCloudAccount,
101+
order: 1,
102+
id: '148827438',
103+
unread: true,
104+
reason: {
105+
code: 'author',
106+
title: 'Authored',
107+
description: 'You created the thread.',
108+
},
109+
updatedAt: '2017-05-20T17:06:34Z',
110+
subject: {
111+
title: 'Improve the UI',
112+
url: 'https://api.github.com/repos/gitify-app/notifications-test/issues/4' as Link,
113+
latestCommentUrl:
114+
'https://api.github.com/repos/gitify-app/notifications-test/issues/comments/302885965' as Link,
115+
type: 'Issue',
116+
reviews: null,
117+
},
118+
repository: mockGitHubRepository,
119+
display: {
120+
number: '456',
121+
title: 'Improve the UI [#456]',
122+
type: 'Issue',
123+
icon: {
124+
type: IssueOpenedIcon,
125+
color: IconColor.GREEN,
126+
},
127+
defaultUserType: 'User',
128+
},
129+
},
130+
];
131+
132+
const mockEnterpriseOwner: GitifyOwner = {
133+
login: 'myorg',
134+
avatarUrl: 'https://github.gitify.io/avatars/u/4?' as Link,
135+
type: 'Organization',
136+
};
137+
138+
const mockEnterpriseRepository: GitifyRepository = {
139+
name: 'notifications-test',
140+
fullName: 'myorg/notifications-test',
141+
owner: mockEnterpriseOwner,
142+
htmlUrl: 'https://github.gitify.io/myorg/notifications-test' as Link,
143+
};
144+
145+
/**
146+
* Mock Gitify Notifications for GitHub Enterprise account
147+
*
148+
* 2 Notifications
149+
* Hostname: 'github.gitify.io'
150+
* Repository: 'myorg/notifications-test'
151+
*/
152+
export const mockGithubEnterpriseGitifyNotifications: GitifyNotification[] = [
153+
{
154+
account: mockGitHubEnterpriseServerAccount,
155+
order: 0,
156+
id: '3',
157+
unread: true,
158+
reason: {
159+
code: 'subscribed',
160+
title: 'Updated',
161+
description: "You're watching the repository.",
162+
},
163+
updatedAt: '2017-05-20T13:02:48Z',
164+
subject: {
165+
title: 'Release 0.0.1',
166+
url: 'https://github.gitify.io/api/v3/repos/myorg/notifications-test/releases/3' as Link,
167+
latestCommentUrl:
168+
'https://github.gitify.io/api/v3/repos/myorg/notifications-test/releases/3' as Link,
169+
type: 'Release',
170+
reviews: null,
171+
},
172+
repository: mockEnterpriseRepository,
173+
display: {
174+
number: '',
175+
title: 'Release 0.0.1',
176+
type: 'Release',
177+
icon: {
178+
type: IssueOpenedIcon,
179+
color: IconColor.GREEN,
180+
},
181+
defaultUserType: 'User',
182+
},
183+
},
184+
{
185+
account: mockGitHubEnterpriseServerAccount,
186+
order: 1,
187+
id: '4',
188+
unread: true,
189+
reason: {
190+
code: 'subscribed',
191+
title: 'Updated',
192+
description: "You're watching the repository.",
193+
},
194+
updatedAt: '2017-05-20T15:52:20Z',
195+
subject: {
196+
title: 'Bump Version',
197+
url: 'https://github.gitify.io/api/v3/repos/myorg/notifications-test/pulls/4' as Link,
198+
latestCommentUrl:
199+
'https://github.gitify.io/api/v3/repos/myorg/notifications-test/issues/comments/21' as Link,
200+
type: 'PullRequest',
201+
reviews: null,
202+
},
203+
repository: mockEnterpriseRepository,
204+
display: {
205+
number: '123',
206+
title: 'Bump Version [#123]',
207+
type: 'Pull Request',
208+
icon: {
209+
type: FeedPullRequestOpenIcon,
210+
color: IconColor.GREEN,
211+
},
212+
defaultUserType: 'User',
213+
},
214+
},
215+
];
216+
217+
export const mockGitifyNotification: GitifyNotification =
218+
mockGitHubCloudGitifyNotifications[0];
219+
220+
export const mockMultipleAccountNotifications: AccountNotifications[] = [
24221
{
25222
account: mockGitHubCloudAccount,
26-
notifications: mockGitHubNotifications,
223+
notifications: mockGitHubCloudGitifyNotifications,
27224
error: null,
28225
},
29226
{
30227
account: mockGitHubEnterpriseServerAccount,
31-
notifications: mockEnterpriseNotifications,
228+
notifications: mockGithubEnterpriseGitifyNotifications,
32229
error: null,
33230
},
34231
];
35232

36233
export const mockSingleAccountNotifications: AccountNotifications[] = [
37234
{
38235
account: mockGitHubCloudAccount,
39-
notifications: [mockSingleNotification],
236+
notifications: [mockGitifyNotification],
40237
error: null,
41238
},
42239
];
43240

44-
export function createPartialMockNotification(
241+
export function mockPartialGitifyNotification(
45242
subject: Partial<GitifySubject>,
46243
repository?: Partial<GitifyRepository>,
47244
): GitifyNotification {
48245
const mockNotification: Partial<GitifyNotification> = {
49-
account: {
50-
method: 'Personal Access Token',
51-
platform: 'GitHub Cloud',
52-
hostname: Constants.GITHUB_API_BASE_URL as Hostname,
53-
token: mockToken,
54-
user: mockGitifyUser,
55-
hasRequiredScopes: true,
56-
},
246+
account: mockGitHubAppAccount,
57247
reason: {
58248
code: 'subscribed',
59249
title: 'Updated',
60250
description: "You're watching the repository.",
61251
} as GitifyReason,
252+
updatedAt: '2026-01-01T17:00:00Z',
62253
subject: subject as GitifySubject,
63254
repository: {
64255
name: 'notifications-test',
@@ -76,7 +267,7 @@ export function createPartialMockNotification(
76267
return mockNotification as GitifyNotification;
77268
}
78269

79-
export function createMockNotificationForRepoName(
270+
export function mockGitifyNotificationForRepoName(
80271
id: string,
81272
repoFullName: string | null,
82273
): GitifyNotification {

0 commit comments

Comments
 (0)