Skip to content

Commit 7f55353

Browse files
feat: refactor imports and add new components for improved structure and functionality
1 parent c041dea commit 7f55353

File tree

26 files changed

+38
-161
lines changed

26 files changed

+38
-161
lines changed

frontend/src/components/HomeComponents/BottomBar/BottomBar.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@ import React from 'react';
22
import { NavigationMenu } from '@/components/ui/navigation-menu';
33
import { buttonVariants } from '@/components/ui/button';
44
import { BottomBarProps } from './bottom-bar-utils';
5-
import { Icons } from '@/components/icons';
6-
import { MultiSelectFilter } from '@/components/ui/multiSelect';
5+
import { Icons } from '@/components/ui/icons';
6+
import { MultiSelectFilter } from '@/components/ui/multi-select';
77
import {
88
Popover,
99
PopoverTrigger,

frontend/src/components/HomeComponents/BottomBar/__tests__/BottomBar.test.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import BottomBar from '../BottomBar';
44
import { BottomBarProps } from '../bottom-bar-utils';
55

66
// Mock the MultiSelectFilter component
7-
jest.mock('@/components/ui/multiSelect', () => ({
7+
jest.mock('@/components/ui/multi-select', () => ({
88
MultiSelectFilter: jest.fn(({ title, selectedValues }) => (
99
<div data-testid={`multiselect-${title.toLowerCase()}`}>
1010
<span data-testid={`multiselect-title-${title.toLowerCase()}`}>

frontend/src/components/HomeComponents/DevLogs/__tests__/__snapshots__/DevLogs.test.tsx.snap

Lines changed: 3 additions & 133 deletions
Original file line numberDiff line numberDiff line change
@@ -180,6 +180,7 @@ exports[`DevLogs Component using Snapshot renders open dialog with logs correctl
180180
Refresh
181181
</button>
182182
<button
183+
disabled=""
183184
variant="outline"
184185
>
185186
Copy All
@@ -190,140 +191,9 @@ exports[`DevLogs Component using Snapshot renders open dialog with logs correctl
190191
class="flex-1 overflow-y-auto border rounded-md p-4 bg-gray-50 dark:bg-gray-900"
191192
>
192193
<div
193-
class="space-y-2"
194+
class="text-center py-8 text-gray-500"
194195
>
195-
<div
196-
class="p-3 bg-white dark:bg-gray-800 rounded border border-gray-200 dark:border-gray-700 hover:shadow-sm transition-shadow group"
197-
>
198-
<div
199-
class="flex justify-between items-start gap-2"
200-
>
201-
<div
202-
class="flex-1 font-mono text-sm"
203-
>
204-
<div
205-
class="flex items-center gap-2 mb-1"
206-
>
207-
<span
208-
class="text-gray-500 dark:text-gray-400"
209-
>
210-
Mon, 01 Jan 2024 12:00:00 GMT
211-
</span>
212-
<span
213-
class="font-semibold text-blue-600 dark:text-blue-400"
214-
>
215-
[INFO]
216-
</span>
217-
<span
218-
class="text-purple-600 dark:text-purple-400 text-xs"
219-
>
220-
SYNC_START
221-
</span>
222-
</div>
223-
<div
224-
class="text-gray-800 dark:text-gray-200 break-words"
225-
>
226-
Sync operation started
227-
</div>
228-
<div
229-
class="text-xs text-gray-500 dark:text-gray-400 mt-1"
230-
>
231-
Sync ID: sync-123
232-
</div>
233-
</div>
234-
<button
235-
class="opacity-0 group-hover:opacity-100 transition-opacity"
236-
variant="ghost"
237-
>
238-
<div>
239-
CopyIcon
240-
</div>
241-
</button>
242-
</div>
243-
</div>
244-
<div
245-
class="p-3 bg-white dark:bg-gray-800 rounded border border-gray-200 dark:border-gray-700 hover:shadow-sm transition-shadow group"
246-
>
247-
<div
248-
class="flex justify-between items-start gap-2"
249-
>
250-
<div
251-
class="flex-1 font-mono text-sm"
252-
>
253-
<div
254-
class="flex items-center gap-2 mb-1"
255-
>
256-
<span
257-
class="text-gray-500 dark:text-gray-400"
258-
>
259-
Mon, 01 Jan 2024 12:01:00 GMT
260-
</span>
261-
<span
262-
class="font-semibold text-yellow-600 dark:text-yellow-400"
263-
>
264-
[WARN]
265-
</span>
266-
</div>
267-
<div
268-
class="text-gray-800 dark:text-gray-200 break-words"
269-
>
270-
Warning message
271-
</div>
272-
</div>
273-
<button
274-
class="opacity-0 group-hover:opacity-100 transition-opacity"
275-
variant="ghost"
276-
>
277-
<div>
278-
CopyIcon
279-
</div>
280-
</button>
281-
</div>
282-
</div>
283-
<div
284-
class="p-3 bg-white dark:bg-gray-800 rounded border border-gray-200 dark:border-gray-700 hover:shadow-sm transition-shadow group"
285-
>
286-
<div
287-
class="flex justify-between items-start gap-2"
288-
>
289-
<div
290-
class="flex-1 font-mono text-sm"
291-
>
292-
<div
293-
class="flex items-center gap-2 mb-1"
294-
>
295-
<span
296-
class="text-gray-500 dark:text-gray-400"
297-
>
298-
Mon, 01 Jan 2024 12:02:00 GMT
299-
</span>
300-
<span
301-
class="font-semibold text-red-600 dark:text-red-400"
302-
>
303-
[ERROR]
304-
</span>
305-
<span
306-
class="text-purple-600 dark:text-purple-400 text-xs"
307-
>
308-
SYNC_ERROR
309-
</span>
310-
</div>
311-
<div
312-
class="text-gray-800 dark:text-gray-200 break-words"
313-
>
314-
Error occurred
315-
</div>
316-
</div>
317-
<button
318-
class="opacity-0 group-hover:opacity-100 transition-opacity"
319-
variant="ghost"
320-
>
321-
<div>
322-
CopyIcon
323-
</div>
324-
</button>
325-
</div>
326-
</div>
196+
No logs available
327197
</div>
328198
</div>
329199
</div>

frontend/src/components/HomeComponents/FAQ/FAQ.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { Accordion } from '@/components/ui/accordion';
22
import { FAQItem } from './FAQItem';
33
import { FAQList } from './faq-utils';
4-
import { BlueHeading } from '@/lib/utils';
4+
import { BlueHeading } from '@/lib/Utils';
55
import { HighlightLink } from '@/components/ui/link-highlight';
66

77
export const FAQ = () => {

frontend/src/components/HomeComponents/Navbar/NavbarDesktop.tsx

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ import {
1717
DropdownMenuTrigger,
1818
} from '@/components/ui/dropdown-menu';
1919
import { Avatar, AvatarFallback, AvatarImage } from '../../ui/avatar';
20-
import { ModeToggle } from '../../utils/theme-mode-toggle';
20+
import { ModeToggle } from '../../utils/ThemeModeToggle';
2121
import { buttonVariants } from '@/components/ui/button';
2222
import {
2323
routeList,
@@ -35,10 +35,13 @@ import {
3535
} from '@/components/ui/dialog';
3636
import { Button } from '@/components/ui/button';
3737
import { url } from '@/components/utils/URLs';
38-
import { exportTasksAsJSON, exportTasksAsTXT } from '@/exports-tasks';
38+
import {
39+
exportTasksAsJSON,
40+
exportTasksAsTXT,
41+
} from '@/components/utils/ExportTasks';
3942
import { useState } from 'react';
4043
import { DevLogs } from '../DevLogs/DevLogs';
41-
import { useTaskAutoSync } from '@/components/utils/Task-AutoSync';
44+
import { useTaskAutoSync } from '@/components/utils/TaskAutoSync';
4245
import { Label } from '@/components/ui/label';
4346

4447
export const NavbarDesktop = (

frontend/src/components/HomeComponents/Navbar/NavbarMobile.tsx

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ import {
1717
FileText,
1818
Terminal,
1919
} from 'lucide-react';
20-
import { ModeToggle } from '../../utils/theme-mode-toggle';
20+
import { ModeToggle } from '../../utils/ThemeModeToggle';
2121
import { buttonVariants } from '@/components/ui/button';
2222
import {
2323
routeList,
@@ -35,9 +35,12 @@ import {
3535
DialogTrigger,
3636
} from '@/components/ui/dialog';
3737
import { Button } from '@/components/ui/button';
38-
import { exportTasksAsJSON, exportTasksAsTXT } from '@/exports-tasks';
38+
import {
39+
exportTasksAsJSON,
40+
exportTasksAsTXT,
41+
} from '@/components/utils/ExportTasks';
3942
import { DevLogs } from '../DevLogs/DevLogs';
40-
import { useTaskAutoSync } from '@/components/utils/Task-AutoSync';
43+
import { useTaskAutoSync } from '@/components/utils/TaskAutoSync';
4144
import { Label } from '@/components/ui/label';
4245
import { Switch } from '@/components/ui/switch';
4346
import { Slider } from '@/components/ui/slider';

frontend/src/components/HomeComponents/Tasks/Tasks.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import { useEffect, useState, useCallback, useRef } from 'react';
22
import { Task } from '../../utils/types';
33
import { ReportsView } from './ReportsView';
44
import Fuse from 'fuse.js';
5-
import { useHotkeys } from '@/hooks/useHotkeys';
5+
import { useHotkeys } from '@/components/utils/use-hotkeys';
66
import {
77
Table,
88
TableBody,
@@ -60,7 +60,7 @@ import {
6060
} from './tasks-utils';
6161
import Pagination from './Pagination';
6262
import { url } from '@/components/utils/URLs';
63-
import { MultiSelectFilter } from '@/components/ui/multiSelect';
63+
import { MultiSelectFilter } from '@/components/ui/multi-select';
6464
import BottomBar from '../BottomBar/BottomBar';
6565
import {
6666
addTaskToBackend,
@@ -72,7 +72,7 @@ import {
7272
import { debounce } from '@/components/utils/utils';
7373
import { DatePicker } from '@/components/ui/date-picker';
7474
import { format } from 'date-fns';
75-
import { Taskskeleton } from './Task-Skeleton';
75+
import { Taskskeleton } from './TaskSkeleton';
7676
import { Key } from '@/components/ui/key-button';
7777

7878
const db = new TasksDatabase();

frontend/src/components/HomeComponents/Tasks/__tests__/Tasks.test.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ jest.mock('../tasks-utils', () => {
3939
};
4040
});
4141

42-
jest.mock('@/components/ui/multiSelect', () => ({
42+
jest.mock('@/components/ui/multi-select', () => ({
4343
MultiSelectFilter: jest.fn(({ title }) => (
4444
<div>Mocked MultiSelect: {title}</div>
4545
)),

frontend/src/components/HomeComponents/Tasks/__tests__/task-skeleton.test.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { render } from '@testing-library/react';
2-
import { Taskskeleton } from '../Task-Skeleton';
2+
import { Taskskeleton } from '../TaskSkeleton';
33

44
// Mock des composants UI
55
jest.mock('@/components/ui/table', () => ({

0 commit comments

Comments
 (0)