Skip to content

Commit 3ddbb78

Browse files
authored
feat(filters): search by org, repo, author (#2214)
* feat: search notifications Signed-off-by: Adam Setch <[email protected]> * feat: search notifications Signed-off-by: Adam Setch <[email protected]> * feat: search notifications Signed-off-by: Adam Setch <[email protected]> * feat: search notifications Signed-off-by: Adam Setch <[email protected]> * feat: search notifications Signed-off-by: Adam Setch <[email protected]> * feat: search notifications Signed-off-by: Adam Setch <[email protected]> * feat: search notifications Signed-off-by: Adam Setch <[email protected]> * feat: search notifications Signed-off-by: Adam Setch <[email protected]> * feat: search notifications Signed-off-by: Adam Setch <[email protected]> * feat: search notifications Signed-off-by: Adam Setch <[email protected]> * feat: search notifications Signed-off-by: Adam Setch <[email protected]> * feat: search notifications Signed-off-by: Adam Setch <[email protected]> * feat: search notifications Signed-off-by: Adam Setch <[email protected]> * feat: search notifications Signed-off-by: Adam Setch <[email protected]> * feat: search notifications Signed-off-by: Adam Setch <[email protected]> * feat: search notifications Signed-off-by: Adam Setch <[email protected]> * feat: search notifications Signed-off-by: Adam Setch <[email protected]> * feat: search notifications Signed-off-by: Adam Setch <[email protected]> * feat: search notifications Signed-off-by: Adam Setch <[email protected]> * feat: search notifications Signed-off-by: Adam Setch <[email protected]> * feat: search notifications Signed-off-by: Adam Setch <[email protected]> * feat: search notifications Signed-off-by: Adam Setch <[email protected]> * feat: search notifications Signed-off-by: Adam Setch <[email protected]> * feat: search notifications Signed-off-by: Adam Setch <[email protected]> * feat: search notifications Signed-off-by: Adam Setch <[email protected]> * feat: search notifications Signed-off-by: Adam Setch <[email protected]> --------- Signed-off-by: Adam Setch <[email protected]>
1 parent 5a1b9be commit 3ddbb78

32 files changed

+1994
-2309
lines changed

biome.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@
5858
"useDefaultSwitchClause": "error",
5959
"noParameterAssign": "error",
6060
"useAsConstAssertion": "error",
61+
"useBlockStatements": "error",
6162
"useDefaultParameterLast": "error",
6263
"useEnumInitializers": "error",
6364
"useSelfClosingElements": "error",

src/main/updater.test.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,9 @@ const listeners: ListenerMap = {};
2222
jest.mock('electron-updater', () => ({
2323
autoUpdater: {
2424
on: jest.fn((event: string, cb: Listener) => {
25-
if (!listeners[event]) listeners[event] = [];
25+
if (!listeners[event]) {
26+
listeners[event] = [];
27+
}
2628
listeners[event].push(cb);
2729
return this;
2830
}),
@@ -66,7 +68,9 @@ describe('main/updater.ts', () => {
6668

6769
beforeEach(() => {
6870
jest.clearAllMocks();
69-
for (const k of Object.keys(listeners)) delete listeners[k];
71+
for (const k of Object.keys(listeners)) {
72+
delete listeners[k];
73+
}
7074

7175
menubar = {
7276
app: {

src/main/updater.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,9 @@ export default class AppUpdater {
140140
};
141141

142142
dialog.showMessageBox(dialogOpts).then((returnValue) => {
143-
if (returnValue.response === 0) autoUpdater.quitAndInstall();
143+
if (returnValue.response === 0) {
144+
autoUpdater.quitAndInstall();
145+
}
144146
});
145147
}
146148
}

src/renderer/__mocks__/partial-mocks.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
import { Constants } from '../constants';
22
import type { Hostname, Link } from '../types';
3-
import type { Notification, Subject, User } from '../typesGitHub';
3+
import type { Notification, Repository, Subject, User } from '../typesGitHub';
44
import { mockGitifyUser, mockToken } from './state-mocks';
55

66
export function partialMockNotification(
77
subject: Partial<Subject>,
8+
repository?: Partial<Repository>,
89
): Notification {
910
const mockNotification: Partial<Notification> = {
1011
account: {
@@ -16,6 +17,7 @@ export function partialMockNotification(
1617
hasRequiredScopes: true,
1718
},
1819
subject: subject as Subject,
20+
repository: repository as Repository,
1921
};
2022

2123
return mockNotification as Notification;

src/renderer/__mocks__/state-mocks.ts

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -109,10 +109,8 @@ const mockSystemSettings: SystemSettingsState = {
109109

110110
const mockFilters: FilterSettingsState = {
111111
filterUserTypes: [],
112-
filterIncludeHandles: [],
113-
filterExcludeHandles: [],
114-
filterIncludeOrganizations: [],
115-
filterExcludeOrganizations: [],
112+
filterIncludeSearchTokens: [],
113+
filterExcludeSearchTokens: [],
116114
filterSubjectTypes: [],
117115
filterStates: [],
118116
filterReasons: [],

src/renderer/components/filters/OrganizationFilter.test.tsx

Lines changed: 0 additions & 130 deletions
This file was deleted.

0 commit comments

Comments
 (0)