Skip to content

Commit c05c3d8

Browse files
authored
refactor(renderer): organize utils (#2683)
* refactor(renderer): organize utils Signed-off-by: Adam Setch <adam.setch@outlook.com> * refactor(renderer): organize utils Signed-off-by: Adam Setch <adam.setch@outlook.com> * refactor(renderer): organize utils Signed-off-by: Adam Setch <adam.setch@outlook.com> --------- Signed-off-by: Adam Setch <adam.setch@outlook.com>
1 parent 7457907 commit c05c3d8

110 files changed

Lines changed: 800 additions & 782 deletions

File tree

Some content is hidden

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

sonar-project.properties

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,3 +34,12 @@ sonar.links.homepage=https://gitify.io
3434
sonar.links.ci=https://github.com/gitify-app/gitify/actions
3535
sonar.links.scm=https://github.com/gitify-app/gitify
3636
sonar.links.issue=https://github.com/gitify-app/gitify/issues
37+
38+
39+
# =====================================================
40+
# Default Rule Ignores
41+
# =====================================================
42+
# Prefer `globalThis` over `window`.
43+
sonar.issue.ignore.multicriteria=globalThisOverWindow
44+
sonar.issue.ignore.multicriteria.globalThisOverWindow.ruleKey=typescript:S7764
45+
sonar.issue.ignore.multicriteria.globalThisOverWindow.resourceKey=**/*

src/renderer/components/GlobalShortcuts.test.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@ import userEvent from '@testing-library/user-event';
22

33
import { navigateMock, renderWithAppContext } from '../__helpers__/test-utils';
44

5-
import * as comms from '../utils/comms';
6-
import * as links from '../utils/links';
5+
import * as comms from '../utils/system/comms';
6+
import * as links from '../utils/system/links';
77
import { GlobalShortcuts } from './GlobalShortcuts';
88

99
describe('components/GlobalShortcuts.tsx', () => {

src/renderer/components/Oops.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import { EmojiSplash } from './layout/EmojiSplash';
77

88
import type { GitifyError } from '../types';
99

10-
import { Errors } from '../utils/errors';
10+
import { Errors } from '../utils/core/errors';
1111

1212
interface OopsProps {
1313
error: GitifyError;

src/renderer/components/Sidebar.test.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import { mockMultipleAccountNotifications } from '../__mocks__/notifications-moc
66
import { mockSettings } from '../__mocks__/state-mocks';
77

88
import { useFiltersStore } from '../stores';
9-
import * as comms from '../utils/comms';
9+
import * as comms from '../utils/system/comms';
1010
import { Sidebar } from './Sidebar';
1111

1212
describe('renderer/components/Sidebar.tsx', () => {

src/renderer/components/avatars/AvatarWithFallback.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ import { Avatar, Stack, Truncate } from '@primer/react';
55

66
import { type Link, Size, type UserType } from '../../types';
77

8-
import { getDefaultUserIcon } from '../../utils/icons';
98
import { isNonHumanUser } from '../../utils/notifications/filters/userType';
9+
import { getDefaultUserIcon } from '../../utils/ui/icons';
1010

1111
export interface AvatarWithFallbackProps {
1212
src?: Link;

src/renderer/components/fields/Checkbox.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import { Stack } from '@primer/react';
44

55
import { CustomCounter } from '../primitives/CustomCounter';
66

7-
import { cn } from '../../utils/cn';
7+
import { cn } from '../../utils/ui/cn';
88
import { Tooltip } from './Tooltip';
99

1010
export interface CheckboxProps {

src/renderer/components/fields/Tooltip.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { type FC, type ReactNode, useEffect, useRef, useState } from 'react';
33
import { QuestionIcon } from '@primer/octicons-react';
44
import { AnchoredOverlay } from '@primer/react';
55

6-
import { cn } from '../../utils/cn';
6+
import { cn } from '../../utils/ui/cn';
77

88
export interface TooltipProps {
99
name: string;

src/renderer/components/filters/SearchFilter.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,11 @@ import { Title } from '../primitives/Title';
1717
import { IconColor, type SearchToken, Size } from '../../types';
1818

1919
import { useFiltersStore } from '../../stores';
20-
import { cn } from '../../utils/cn';
2120
import {
2221
hasExcludeSearchFilters,
2322
hasIncludeSearchFilters,
2423
} from '../../utils/notifications/filters/search';
24+
import { cn } from '../../utils/ui/cn';
2525
import { RequiresDetailedNotificationWarning } from './RequiresDetailedNotificationsWarning';
2626
import { TokenSearchInput } from './TokenSearchInput';
2727

src/renderer/components/filters/SearchFilterSuggestions.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,12 @@ import { useAppContext } from '../../hooks/useAppContext';
66

77
import { Opacity } from '../../types';
88

9-
import { cn } from '../../utils/cn';
109
import {
1110
ALL_SEARCH_QUALIFIERS,
1211
BASE_SEARCH_QUALIFIERS,
1312
SEARCH_DELIMITER,
1413
} from '../../utils/notifications/filters/search';
14+
import { cn } from '../../utils/ui/cn';
1515

1616
interface SearchFilterSuggestionsProps {
1717
open: boolean;

src/renderer/components/icons/LogoIcon.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import { APPLICATION } from '../../../shared/constants';
44

55
import { Size } from '../../types';
66

7-
import { cn } from '../../utils/cn';
7+
import { cn } from '../../utils/ui/cn';
88

99
interface LogoIconProps {
1010
isDark?: boolean;

0 commit comments

Comments
 (0)