Skip to content

Commit db3638d

Browse files
committed
feat: filter by notification type
Signed-off-by: Adam Setch <[email protected]>
1 parent 5055991 commit db3638d

File tree

4 files changed

+5
-11
lines changed

4 files changed

+5
-11
lines changed

src/renderer/components/filters/SubjectTypeFilter.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,11 @@ export const SubjectTypeFilter: FC = () => {
1919
const { updateFilter, settings, notifications } = useContext(AppContext);
2020

2121
return (
22-
<fieldset id="filter-type" className="mb-3">
22+
<fieldset id="filter-subject-type" className="mb-3">
2323
<Stack direction="horizontal" gap="condensed" align="baseline">
2424
<Title icon={BellIcon}>Type</Title>
2525
<Tooltip
26-
name="tooltip-filter-type"
26+
name="tooltip-filter-subject-type"
2727
tooltip={
2828
<Stack direction="vertical" gap="condensed">
2929
<Text>Filter notifications by type.</Text>

src/renderer/types.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,7 @@ export type ErrorType =
163163

164164
export interface TypeDetails {
165165
title: string;
166-
description: string;
166+
description?: string;
167167
}
168168

169169
export enum IconColor {

src/renderer/utils/notifications/filters/state.ts

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,7 @@ export const FILTERS_STATE_TYPES: Record<FilterStateType, TypeDetails> = {
2525
title: 'Other',
2626
description: 'Catch all for any other notification states',
2727
},
28-
} as Partial<Record<FilterStateType, TypeDetails>> as Record<
29-
FilterStateType,
30-
TypeDetails
31-
>;
28+
};
3229

3330
export function getStateDetails(stateType: FilterStateType): TypeDetails {
3431
return FILTERS_STATE_TYPES[stateType];

src/renderer/utils/notifications/filters/subjectType.ts

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,10 +36,7 @@ export const FILTERS_SUBJECT_TYPES: Record<SubjectType, TypeDetails> = {
3636
WorkflowRun: {
3737
title: 'Workflow Run',
3838
},
39-
} as Partial<Record<SubjectType, TypeDetails>> as Record<
40-
SubjectType,
41-
TypeDetails
42-
>;
39+
};
4340

4441
export function getSubjectTypeDetails(subjectType: SubjectType): TypeDetails {
4542
return FILTERS_SUBJECT_TYPES[subjectType];

0 commit comments

Comments
 (0)