chore: upgrade dependencies
This commit is contained in:
@@ -1,29 +0,0 @@
|
||||
{
|
||||
"env": {
|
||||
"browser": true,
|
||||
"es2021": true
|
||||
},
|
||||
"extends": [
|
||||
"eslint:recommended",
|
||||
"plugin:@typescript-eslint/recommended"
|
||||
],
|
||||
"parser": "@typescript-eslint/parser",
|
||||
"parserOptions": {
|
||||
"ecmaFeatures": {
|
||||
"jsx": true
|
||||
},
|
||||
"ecmaVersion": "latest",
|
||||
"sourceType": "module"
|
||||
},
|
||||
"plugins": ["@typescript-eslint", "react-refresh", "react-hooks"],
|
||||
"rules": {
|
||||
"react-refresh/only-export-components": ["warn", { "allowConstantExport": true }],
|
||||
"react-hooks/rules-of-hooks": "error",
|
||||
"react-hooks/exhaustive-deps": "warn"
|
||||
},
|
||||
"settings": {
|
||||
"react": {
|
||||
"version": "detect"
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,53 @@
|
||||
import js from '@eslint/js';
|
||||
import globals from 'globals';
|
||||
import reactHooks from 'eslint-plugin-react-hooks';
|
||||
import reactRefresh from 'eslint-plugin-react-refresh';
|
||||
import tseslint from 'typescript-eslint';
|
||||
|
||||
export default tseslint.config(
|
||||
{
|
||||
ignores: ['node_modules', 'build', 'dist', 'public'],
|
||||
},
|
||||
js.configs.recommended,
|
||||
...tseslint.configs.recommended,
|
||||
{
|
||||
files: ['**/*.{ts,tsx}'],
|
||||
languageOptions: {
|
||||
parser: tseslint.parser,
|
||||
ecmaVersion: 'latest',
|
||||
sourceType: 'module',
|
||||
globals: {
|
||||
...globals.browser,
|
||||
},
|
||||
},
|
||||
plugins: {
|
||||
'react-hooks': reactHooks,
|
||||
'react-refresh': reactRefresh,
|
||||
},
|
||||
rules: {
|
||||
'react-refresh/only-export-components': ['warn', { allowConstantExport: true }],
|
||||
'react-hooks/rules-of-hooks': 'error',
|
||||
'react-hooks/exhaustive-deps': 'warn',
|
||||
},
|
||||
},
|
||||
{
|
||||
files: ['**/*.test.{ts,tsx}', '**/__tests__/**/*.{ts,tsx}'],
|
||||
rules: {
|
||||
'@typescript-eslint/no-explicit-any': 'off',
|
||||
},
|
||||
},
|
||||
{
|
||||
files: ['src/context/**/*.{ts,tsx}'],
|
||||
rules: {
|
||||
'react-refresh/only-export-components': 'off',
|
||||
},
|
||||
},
|
||||
{
|
||||
files: ['src/pwa/service-worker.js'],
|
||||
languageOptions: {
|
||||
globals: {
|
||||
...globals.serviceworker,
|
||||
},
|
||||
},
|
||||
},
|
||||
);
|
||||
Generated
+805
-977
File diff suppressed because it is too large
Load Diff
+28
-27
@@ -12,38 +12,39 @@
|
||||
"test:e2e": "playwright test"
|
||||
},
|
||||
"dependencies": {
|
||||
"@emotion/react": "^11.13.0",
|
||||
"@emotion/styled": "^11.13.0",
|
||||
"@mui/icons-material": "^5.16.4",
|
||||
"@mui/material": "^5.16.4",
|
||||
"@types/uuid": "^10.0.0",
|
||||
"@zxing/browser": "^0.1.4",
|
||||
"@emotion/react": "^11.14.0",
|
||||
"@emotion/styled": "^11.14.1",
|
||||
"@mui/icons-material": "^7.3.5",
|
||||
"@mui/material": "^7.3.5",
|
||||
"@types/uuid": "^11.0.0",
|
||||
"@zxing/browser": "^0.1.5",
|
||||
"date-fns": "^4.1.0",
|
||||
"dexie": "^4.0.7",
|
||||
"react": "^18.3.1",
|
||||
"react-dom": "^18.3.1",
|
||||
"react-router-dom": "^6.26.0",
|
||||
"uuid": "^9.0.1"
|
||||
"dexie": "^4.2.1",
|
||||
"react": "^19.2.0",
|
||||
"react-dom": "^19.2.0",
|
||||
"react-router-dom": "^7.9.6",
|
||||
"uuid": "^13.0.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@playwright/test": "^1.50.1",
|
||||
"@testing-library/jest-dom": "^6.6.3",
|
||||
"@testing-library/react": "^16.1.0",
|
||||
"@testing-library/user-event": "^14.5.2",
|
||||
"@types/node": "^22.0.0",
|
||||
"@types/react": "^18.3.3",
|
||||
"@types/react-dom": "^18.3.0",
|
||||
"@typescript-eslint/eslint-plugin": "^7.18.0",
|
||||
"@typescript-eslint/parser": "^7.18.0",
|
||||
"@vitejs/plugin-react": "^4.3.1",
|
||||
"@playwright/test": "^1.56.1",
|
||||
"@testing-library/jest-dom": "^6.9.1",
|
||||
"@testing-library/react": "^16.3.0",
|
||||
"@testing-library/user-event": "^14.6.1",
|
||||
"@types/node": "^24.10.1",
|
||||
"@types/react": "^19.2.7",
|
||||
"@types/react-dom": "^19.2.3",
|
||||
"@typescript-eslint/eslint-plugin": "^8.47.0",
|
||||
"@typescript-eslint/parser": "^8.47.0",
|
||||
"@vitejs/plugin-react": "^5.1.1",
|
||||
"@vitest/coverage-v8": "^4.0.13",
|
||||
"@vitest/ui": "^4.0.13",
|
||||
"eslint": "^8.57.1",
|
||||
"eslint-plugin-react-hooks": "^5.1.0",
|
||||
"eslint-plugin-react-refresh": "^0.4.7",
|
||||
"jsdom": "^24.1.0",
|
||||
"msw": "^2.6.5",
|
||||
"typescript": "^5.5.4",
|
||||
"eslint": "^9.39.1",
|
||||
"eslint-plugin-react-hooks": "^7.0.1",
|
||||
"eslint-plugin-react-refresh": "^0.4.24",
|
||||
"jsdom": "^27.2.0",
|
||||
"msw": "^2.12.3",
|
||||
"typescript": "^5.9.3",
|
||||
"typescript-eslint": "^8.47.0",
|
||||
"vite": "^7.2.4",
|
||||
"vitest": "^4.0.13"
|
||||
}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "StockFill",
|
||||
"short_name": "StockFill",
|
||||
"start_url": "https://stockfill.lan.ddnsgeek.com",
|
||||
"start_url": "/",
|
||||
"display": "standalone",
|
||||
"background_color": "#ffffff",
|
||||
"theme_color": "#0d6efd",
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
/* eslint-env serviceworker */
|
||||
|
||||
const CACHE_NAME = 'stockfill-cache-v1';
|
||||
const OFFLINE_URLS = ['/', '/index.html'];
|
||||
|
||||
|
||||
+1
-1
@@ -42,7 +42,7 @@ const AppRoutes = () => {
|
||||
export const App = () => (
|
||||
<ThemeProvider theme={theme}>
|
||||
<CssBaseline />
|
||||
<BrowserRouter future={{ v7_startTransition: true, v7_relativeSplatPath: true }}>
|
||||
<BrowserRouter>
|
||||
<DBProvider>
|
||||
<AppRoutes />
|
||||
</DBProvider>
|
||||
|
||||
+4
-4
@@ -1,4 +1,4 @@
|
||||
import { randomUUID } from 'crypto';
|
||||
import { v4 as uuidv4 } from 'uuid';
|
||||
import { describe, expect, it } from 'vitest';
|
||||
import { seedAreas, seedCategories, seedDatabase, seedProducts } from './seed';
|
||||
import { Area } from '../models/Area';
|
||||
@@ -29,14 +29,14 @@ class MockTable<T extends { id: string; name: string }> {
|
||||
}
|
||||
|
||||
const buildArea = (overrides: Partial<Area> = {}): Area => ({
|
||||
id: overrides.id ?? randomUUID(),
|
||||
id: overrides.id ?? uuidv4(),
|
||||
name: overrides.name ?? 'Area',
|
||||
created_at: overrides.created_at ?? Date.now(),
|
||||
updated_at: overrides.updated_at ?? Date.now(),
|
||||
});
|
||||
|
||||
const buildProduct = (overrides: Partial<Product> = {}): Product => ({
|
||||
id: overrides.id ?? randomUUID(),
|
||||
id: overrides.id ?? uuidv4(),
|
||||
name: overrides.name ?? 'Product',
|
||||
category: overrides.category ?? 'Category',
|
||||
unit_type: overrides.unit_type ?? DEFAULT_UNIT_TYPE,
|
||||
@@ -48,7 +48,7 @@ const buildProduct = (overrides: Partial<Product> = {}): Product => ({
|
||||
});
|
||||
|
||||
const buildCategory = (overrides: Partial<Category> = {}): Category => ({
|
||||
id: overrides.id ?? randomUUID(),
|
||||
id: overrides.id ?? uuidv4(),
|
||||
name: overrides.name ?? 'Category',
|
||||
created_at: overrides.created_at ?? Date.now(),
|
||||
updated_at: overrides.updated_at ?? Date.now(),
|
||||
|
||||
@@ -5,9 +5,9 @@ import { useBarcodeScanner } from '../useBarcodeScanner';
|
||||
const decodeFromVideoDevice = vi.fn();
|
||||
|
||||
vi.mock('@zxing/browser', () => ({
|
||||
BrowserMultiFormatReader: vi.fn().mockImplementation(() => ({
|
||||
decodeFromVideoDevice,
|
||||
})),
|
||||
BrowserMultiFormatReader: vi.fn(function MockBrowserMultiFormatReader() {
|
||||
return { decodeFromVideoDevice };
|
||||
}),
|
||||
}));
|
||||
|
||||
declare global {
|
||||
|
||||
@@ -7,7 +7,7 @@ interface LongPressOptions {
|
||||
}
|
||||
|
||||
export const useLongPress = ({ delay = 500, onLongPress, onClick }: LongPressOptions) => {
|
||||
const timerRef = useRef<number>();
|
||||
const timerRef = useRef<number | undefined>(undefined);
|
||||
const handledRef = useRef(false);
|
||||
|
||||
const start = useCallback(() => {
|
||||
|
||||
+17
-14
@@ -1,4 +1,4 @@
|
||||
import { useMemo, useRef } from 'react';
|
||||
import { useCallback, useMemo, useRef } from 'react';
|
||||
|
||||
interface SwipeConfig {
|
||||
onSwipeLeft?: () => void;
|
||||
@@ -9,26 +9,29 @@ interface SwipeConfig {
|
||||
export const useSwipe = ({ onSwipeLeft, onSwipeRight, threshold = 50 }: SwipeConfig) => {
|
||||
const startX = useRef<number | null>(null);
|
||||
|
||||
const onTouchStart = (e: React.TouchEvent) => {
|
||||
const onTouchStart = useCallback((e: React.TouchEvent) => {
|
||||
startX.current = e.changedTouches[0].screenX;
|
||||
};
|
||||
}, []);
|
||||
|
||||
const onTouchEnd = (e: React.TouchEvent) => {
|
||||
if (startX.current === null) return;
|
||||
const deltaX = e.changedTouches[0].screenX - startX.current;
|
||||
if (deltaX < -threshold) {
|
||||
onSwipeLeft?.();
|
||||
} else if (deltaX > threshold) {
|
||||
onSwipeRight?.();
|
||||
}
|
||||
startX.current = null;
|
||||
};
|
||||
const onTouchEnd = useCallback(
|
||||
(e: React.TouchEvent) => {
|
||||
if (startX.current === null) return;
|
||||
const deltaX = e.changedTouches[0].screenX - startX.current;
|
||||
if (deltaX < -threshold) {
|
||||
onSwipeLeft?.();
|
||||
} else if (deltaX > threshold) {
|
||||
onSwipeRight?.();
|
||||
}
|
||||
startX.current = null;
|
||||
},
|
||||
[onSwipeLeft, onSwipeRight, threshold],
|
||||
);
|
||||
|
||||
return useMemo(
|
||||
() => ({
|
||||
onTouchStart,
|
||||
onTouchEnd,
|
||||
}),
|
||||
[],
|
||||
[onTouchEnd, onTouchStart],
|
||||
);
|
||||
};
|
||||
|
||||
@@ -44,7 +44,7 @@ export const fetchProductFromOFF = async (barcode: string): Promise<ExternalProd
|
||||
image: data.product.image_url ?? null,
|
||||
source: 'openfoodfacts',
|
||||
} satisfies ExternalProductInfo;
|
||||
} catch (error) {
|
||||
} catch {
|
||||
return null;
|
||||
} finally {
|
||||
clearTimeout(timeout);
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
/* eslint-env serviceworker */
|
||||
|
||||
const CACHE_NAME = 'stockfill-cache-v1';
|
||||
const OFFLINE_URLS = ['/', '/index.html'];
|
||||
|
||||
|
||||
@@ -86,7 +86,7 @@ describe('ActivePickListScreen product search', () => {
|
||||
const user = userEvent.setup();
|
||||
|
||||
render(
|
||||
<MemoryRouter initialEntries={['/pick-lists/1']} future={{ v7_startTransition: true, v7_relativeSplatPath: true }}>
|
||||
<MemoryRouter initialEntries={['/pick-lists/1']}>
|
||||
<Routes>
|
||||
<Route path="/pick-lists/:id" element={<ActivePickListScreen />} />
|
||||
</Routes>
|
||||
@@ -118,7 +118,7 @@ describe('ActivePickListScreen product search', () => {
|
||||
const user = userEvent.setup();
|
||||
|
||||
render(
|
||||
<MemoryRouter initialEntries={['/pick-lists/1']} future={{ v7_startTransition: true, v7_relativeSplatPath: true }}>
|
||||
<MemoryRouter initialEntries={['/pick-lists/1']}>
|
||||
<Routes>
|
||||
<Route path="/pick-lists/:id" element={<ActivePickListScreen />} />
|
||||
</Routes>
|
||||
@@ -171,7 +171,7 @@ describe('ActivePickListScreen product search', () => {
|
||||
]);
|
||||
|
||||
render(
|
||||
<MemoryRouter initialEntries={['/pick-lists/1']} future={{ v7_startTransition: true, v7_relativeSplatPath: true }}>
|
||||
<MemoryRouter initialEntries={['/pick-lists/1']}>
|
||||
<Routes>
|
||||
<Route path="/pick-lists/:id" element={<ActivePickListScreen />} />
|
||||
</Routes>
|
||||
@@ -191,7 +191,7 @@ describe('ActivePickListScreen product search', () => {
|
||||
const user = userEvent.setup();
|
||||
|
||||
render(
|
||||
<MemoryRouter initialEntries={['/pick-lists/1']} future={{ v7_startTransition: true, v7_relativeSplatPath: true }}>
|
||||
<MemoryRouter initialEntries={['/pick-lists/1']}>
|
||||
<Routes>
|
||||
<Route path="/pick-lists/:id" element={<ActivePickListScreen />} />
|
||||
</Routes>
|
||||
@@ -253,7 +253,7 @@ describe('ActivePickListScreen product search', () => {
|
||||
]);
|
||||
|
||||
render(
|
||||
<MemoryRouter initialEntries={['/pick-lists/1']} future={{ v7_startTransition: true, v7_relativeSplatPath: true }}>
|
||||
<MemoryRouter initialEntries={['/pick-lists/1']}>
|
||||
<Routes>
|
||||
<Route path="/pick-lists/:id" element={<ActivePickListScreen />} />
|
||||
</Routes>
|
||||
@@ -270,7 +270,7 @@ describe('ActivePickListScreen product search', () => {
|
||||
const user = userEvent.setup();
|
||||
|
||||
render(
|
||||
<MemoryRouter initialEntries={['/pick-lists/1']} future={{ v7_startTransition: true, v7_relativeSplatPath: true }}>
|
||||
<MemoryRouter initialEntries={['/pick-lists/1']}>
|
||||
<Routes>
|
||||
<Route path="/pick-lists/:id" element={<ActivePickListScreen />} />
|
||||
</Routes>
|
||||
@@ -295,7 +295,7 @@ describe('ActivePickListScreen product search', () => {
|
||||
const user = userEvent.setup();
|
||||
|
||||
render(
|
||||
<MemoryRouter initialEntries={['/pick-lists/1']} future={{ v7_startTransition: true, v7_relativeSplatPath: true }}>
|
||||
<MemoryRouter initialEntries={['/pick-lists/1']}>
|
||||
<Routes>
|
||||
<Route path="/pick-lists/:id" element={<ActivePickListScreen />} />
|
||||
</Routes>
|
||||
@@ -322,7 +322,7 @@ describe('ActivePickListScreen product search', () => {
|
||||
const user = userEvent.setup();
|
||||
|
||||
render(
|
||||
<MemoryRouter initialEntries={['/pick-lists/1']} future={{ v7_startTransition: true, v7_relativeSplatPath: true }}>
|
||||
<MemoryRouter initialEntries={['/pick-lists/1']}>
|
||||
<Routes>
|
||||
<Route path="/pick-lists/:id" element={<ActivePickListScreen />} />
|
||||
</Routes>
|
||||
@@ -354,7 +354,7 @@ describe('ActivePickListScreen product search', () => {
|
||||
const user = userEvent.setup();
|
||||
|
||||
render(
|
||||
<MemoryRouter initialEntries={['/pick-lists/1']} future={{ v7_startTransition: true, v7_relativeSplatPath: true }}>
|
||||
<MemoryRouter initialEntries={['/pick-lists/1']}>
|
||||
<Routes>
|
||||
<Route path="/pick-lists/:id" element={<ActivePickListScreen />} />
|
||||
</Routes>
|
||||
@@ -387,7 +387,7 @@ describe('ActivePickListScreen product search', () => {
|
||||
const user = userEvent.setup();
|
||||
|
||||
render(
|
||||
<MemoryRouter initialEntries={['/pick-lists/1']} future={{ v7_startTransition: true, v7_relativeSplatPath: true }}>
|
||||
<MemoryRouter initialEntries={['/pick-lists/1']}>
|
||||
<Routes>
|
||||
<Route path="/pick-lists/:id" element={<ActivePickListScreen />} />
|
||||
</Routes>
|
||||
@@ -424,7 +424,7 @@ describe('ActivePickListScreen product search', () => {
|
||||
const user = userEvent.setup();
|
||||
|
||||
render(
|
||||
<MemoryRouter initialEntries={['/pick-lists/1']} future={{ v7_startTransition: true, v7_relativeSplatPath: true }}>
|
||||
<MemoryRouter initialEntries={['/pick-lists/1']}>
|
||||
<Routes>
|
||||
<Route path="/pick-lists/:id" element={<ActivePickListScreen />} />
|
||||
</Routes>
|
||||
@@ -486,7 +486,7 @@ describe('ActivePickListScreen product search', () => {
|
||||
]);
|
||||
|
||||
render(
|
||||
<MemoryRouter initialEntries={['/pick-lists/1']} future={{ v7_startTransition: true, v7_relativeSplatPath: true }}>
|
||||
<MemoryRouter initialEntries={['/pick-lists/1']}>
|
||||
<Routes>
|
||||
<Route path="/pick-lists/:id" element={<ActivePickListScreen />} />
|
||||
</Routes>
|
||||
@@ -525,7 +525,7 @@ describe('ActivePickListScreen product search', () => {
|
||||
]);
|
||||
|
||||
render(
|
||||
<MemoryRouter initialEntries={['/pick-lists/1']} future={{ v7_startTransition: true, v7_relativeSplatPath: true }}>
|
||||
<MemoryRouter initialEntries={['/pick-lists/1']}>
|
||||
<Routes>
|
||||
<Route path="/pick-lists/:id" element={<ActivePickListScreen />} />
|
||||
</Routes>
|
||||
@@ -563,7 +563,7 @@ describe('ActivePickListScreen product search', () => {
|
||||
const user = userEvent.setup();
|
||||
|
||||
render(
|
||||
<MemoryRouter initialEntries={['/pick-lists/1']} future={{ v7_startTransition: true, v7_relativeSplatPath: true }}>
|
||||
<MemoryRouter initialEntries={['/pick-lists/1']}>
|
||||
<Routes>
|
||||
<Route path="/pick-lists/:id" element={<ActivePickListScreen />} />
|
||||
</Routes>
|
||||
@@ -613,7 +613,7 @@ describe('ActivePickListScreen product search', () => {
|
||||
const user = userEvent.setup();
|
||||
|
||||
render(
|
||||
<MemoryRouter initialEntries={['/pick-lists/1']} future={{ v7_startTransition: true, v7_relativeSplatPath: true }}>
|
||||
<MemoryRouter initialEntries={['/pick-lists/1']}>
|
||||
<Routes>
|
||||
<Route path="/pick-lists/:id" element={<ActivePickListScreen />} />
|
||||
</Routes>
|
||||
@@ -657,7 +657,7 @@ describe('ActivePickListScreen product search', () => {
|
||||
const user = userEvent.setup();
|
||||
|
||||
render(
|
||||
<MemoryRouter initialEntries={['/pick-lists/1']} future={{ v7_startTransition: true, v7_relativeSplatPath: true }}>
|
||||
<MemoryRouter initialEntries={['/pick-lists/1']}>
|
||||
<Routes>
|
||||
<Route path="/pick-lists/:id" element={<ActivePickListScreen />} />
|
||||
</Routes>
|
||||
@@ -702,7 +702,7 @@ describe('ActivePickListScreen product search', () => {
|
||||
const user = userEvent.setup();
|
||||
|
||||
render(
|
||||
<MemoryRouter initialEntries={['/pick-lists/1']} future={{ v7_startTransition: true, v7_relativeSplatPath: true }}>
|
||||
<MemoryRouter initialEntries={['/pick-lists/1']}>
|
||||
<Routes>
|
||||
<Route path="/pick-lists/:id" element={<ActivePickListScreen />} />
|
||||
</Routes>
|
||||
@@ -749,7 +749,7 @@ describe('ActivePickListScreen product search', () => {
|
||||
const user = userEvent.setup();
|
||||
|
||||
render(
|
||||
<MemoryRouter initialEntries={['/pick-lists/1']} future={{ v7_startTransition: true, v7_relativeSplatPath: true }}>
|
||||
<MemoryRouter initialEntries={['/pick-lists/1']}>
|
||||
<Routes>
|
||||
<Route path="/pick-lists/:id" element={<ActivePickListScreen />} />
|
||||
</Routes>
|
||||
@@ -797,7 +797,7 @@ describe('ActivePickListScreen product search', () => {
|
||||
const user = userEvent.setup();
|
||||
|
||||
render(
|
||||
<MemoryRouter initialEntries={['/pick-lists/1']} future={{ v7_startTransition: true, v7_relativeSplatPath: true }}>
|
||||
<MemoryRouter initialEntries={['/pick-lists/1']}>
|
||||
<Routes>
|
||||
<Route path="/pick-lists/:id" element={<ActivePickListScreen />} />
|
||||
</Routes>
|
||||
@@ -837,7 +837,7 @@ describe('ActivePickListScreen product search', () => {
|
||||
]);
|
||||
|
||||
render(
|
||||
<MemoryRouter initialEntries={['/pick-lists/1']} future={{ v7_startTransition: true, v7_relativeSplatPath: true }}>
|
||||
<MemoryRouter initialEntries={['/pick-lists/1']}>
|
||||
<Routes>
|
||||
<Route path="/pick-lists/:id" element={<ActivePickListScreen />} />
|
||||
</Routes>
|
||||
@@ -873,7 +873,7 @@ describe('ActivePickListScreen product search', () => {
|
||||
]);
|
||||
|
||||
render(
|
||||
<MemoryRouter initialEntries={['/pick-lists/1']} future={{ v7_startTransition: true, v7_relativeSplatPath: true }}>
|
||||
<MemoryRouter initialEntries={['/pick-lists/1']}>
|
||||
<Routes>
|
||||
<Route path="/pick-lists/:id" element={<ActivePickListScreen />} />
|
||||
</Routes>
|
||||
@@ -899,7 +899,7 @@ describe('ActivePickListScreen product search', () => {
|
||||
]);
|
||||
|
||||
render(
|
||||
<MemoryRouter initialEntries={['/pick-lists/1']} future={{ v7_startTransition: true, v7_relativeSplatPath: true }}>
|
||||
<MemoryRouter initialEntries={['/pick-lists/1']}>
|
||||
<Routes>
|
||||
<Route path="/pick-lists/:id" element={<ActivePickListScreen />} />
|
||||
</Routes>
|
||||
|
||||
@@ -90,9 +90,6 @@ export const ActivePickListScreen = () => {
|
||||
);
|
||||
|
||||
const sortedItems = useMemo(() => {
|
||||
const normalizeProductName = (product?: Product | null) =>
|
||||
product?.name ? product.name.trim().toLowerCase() : '';
|
||||
|
||||
return [...itemsVisibleByStatus].sort((a, b) => {
|
||||
const productA = productMap.get(a.product_id);
|
||||
const productB = productMap.get(b.product_id);
|
||||
@@ -221,7 +218,7 @@ export const ActivePickListScreen = () => {
|
||||
}, [appliedItemFilter]);
|
||||
|
||||
const visibleItems = useMemo(() => {
|
||||
let filteredItems = showPicked
|
||||
const filteredItems = showPicked
|
||||
? sortedItems
|
||||
: sortedItems.filter((item) => item.status !== 'picked');
|
||||
|
||||
|
||||
@@ -36,7 +36,7 @@ describe('ManageAreasScreen deletion safeguards', () => {
|
||||
|
||||
const user = userEvent.setup();
|
||||
render(
|
||||
<MemoryRouter future={{ v7_startTransition: true, v7_relativeSplatPath: true }}>
|
||||
<MemoryRouter>
|
||||
<ManageAreasScreen />
|
||||
</MemoryRouter>,
|
||||
);
|
||||
|
||||
@@ -44,7 +44,7 @@ describe('ManageCategoriesScreen deletion safeguards', () => {
|
||||
it('shows an error when trying to delete an in-use category', async () => {
|
||||
const user = userEvent.setup();
|
||||
render(
|
||||
<MemoryRouter future={{ v7_startTransition: true, v7_relativeSplatPath: true }}>
|
||||
<MemoryRouter>
|
||||
<ManageCategoriesScreen />
|
||||
</MemoryRouter>,
|
||||
);
|
||||
|
||||
@@ -120,7 +120,7 @@ describe('ManageProductsScreen barcode lookup', () => {
|
||||
|
||||
const user = userEvent.setup();
|
||||
render(
|
||||
<MemoryRouter future={{ v7_startTransition: true, v7_relativeSplatPath: true }}>
|
||||
<MemoryRouter>
|
||||
<ManageProductsScreen />
|
||||
</MemoryRouter>,
|
||||
);
|
||||
@@ -150,7 +150,7 @@ describe('ManageProductsScreen barcode lookup', () => {
|
||||
|
||||
const user = userEvent.setup();
|
||||
render(
|
||||
<MemoryRouter future={{ v7_startTransition: true, v7_relativeSplatPath: true }}>
|
||||
<MemoryRouter>
|
||||
<ManageProductsScreen />
|
||||
</MemoryRouter>,
|
||||
);
|
||||
@@ -182,7 +182,7 @@ describe('ManageProductsScreen barcode lookup', () => {
|
||||
|
||||
const user = userEvent.setup();
|
||||
render(
|
||||
<MemoryRouter future={{ v7_startTransition: true, v7_relativeSplatPath: true }}>
|
||||
<MemoryRouter>
|
||||
<ManageProductsScreen />
|
||||
</MemoryRouter>,
|
||||
);
|
||||
@@ -204,7 +204,7 @@ describe('ManageProductsScreen barcode lookup', () => {
|
||||
try {
|
||||
const user = userEvent.setup();
|
||||
render(
|
||||
<MemoryRouter future={{ v7_startTransition: true, v7_relativeSplatPath: true }}>
|
||||
<MemoryRouter>
|
||||
<ManageProductsScreen />
|
||||
</MemoryRouter>,
|
||||
);
|
||||
@@ -249,7 +249,7 @@ describe('ManageProductsScreen barcode lookup', () => {
|
||||
|
||||
const user = userEvent.setup();
|
||||
render(
|
||||
<MemoryRouter future={{ v7_startTransition: true, v7_relativeSplatPath: true }}>
|
||||
<MemoryRouter>
|
||||
<ManageProductsScreen />
|
||||
</MemoryRouter>,
|
||||
);
|
||||
@@ -295,7 +295,7 @@ describe('ManageProductsScreen barcode lookup', () => {
|
||||
|
||||
const user = userEvent.setup();
|
||||
render(
|
||||
<MemoryRouter future={{ v7_startTransition: true, v7_relativeSplatPath: true }}>
|
||||
<MemoryRouter>
|
||||
<ManageProductsScreen />
|
||||
</MemoryRouter>,
|
||||
);
|
||||
@@ -333,7 +333,7 @@ describe('ManageProductsScreen auto-adding products to pick lists', () => {
|
||||
|
||||
const user = userEvent.setup();
|
||||
render(
|
||||
<MemoryRouter future={{ v7_startTransition: true, v7_relativeSplatPath: true }}>
|
||||
<MemoryRouter>
|
||||
<ManageProductsScreen />
|
||||
</MemoryRouter>,
|
||||
);
|
||||
@@ -374,7 +374,7 @@ describe('ManageProductsScreen deletion safeguards', () => {
|
||||
|
||||
const user = userEvent.setup();
|
||||
render(
|
||||
<MemoryRouter future={{ v7_startTransition: true, v7_relativeSplatPath: true }}>
|
||||
<MemoryRouter>
|
||||
<ManageProductsScreen />
|
||||
</MemoryRouter>,
|
||||
);
|
||||
@@ -407,7 +407,7 @@ describe('ManageProductsScreen filtering feedback', () => {
|
||||
|
||||
const user = userEvent.setup();
|
||||
render(
|
||||
<MemoryRouter future={{ v7_startTransition: true, v7_relativeSplatPath: true }}>
|
||||
<MemoryRouter>
|
||||
<ManageProductsScreen />
|
||||
</MemoryRouter>,
|
||||
);
|
||||
|
||||
@@ -54,7 +54,7 @@ describe('PickListsScreen sorting', () => {
|
||||
|
||||
it('sorts pick lists alphabetically by area name', () => {
|
||||
render(
|
||||
<MemoryRouter future={{ v7_startTransition: true, v7_relativeSplatPath: true }}>
|
||||
<MemoryRouter>
|
||||
<PickListsScreen />
|
||||
</MemoryRouter>,
|
||||
);
|
||||
@@ -80,7 +80,7 @@ describe('PickListsScreen sorting', () => {
|
||||
];
|
||||
|
||||
render(
|
||||
<MemoryRouter future={{ v7_startTransition: true, v7_relativeSplatPath: true }}>
|
||||
<MemoryRouter>
|
||||
<PickListsScreen />
|
||||
</MemoryRouter>,
|
||||
);
|
||||
|
||||
@@ -92,7 +92,7 @@ beforeEach(() => {
|
||||
describe('StartPickListScreen', () => {
|
||||
it('shows category selection controls', () => {
|
||||
render(
|
||||
<MemoryRouter future={{ v7_startTransition: true, v7_relativeSplatPath: true }}>
|
||||
<MemoryRouter>
|
||||
<StartPickListScreen />
|
||||
</MemoryRouter>,
|
||||
);
|
||||
@@ -108,7 +108,7 @@ describe('StartPickListScreen', () => {
|
||||
const user = userEvent.setup();
|
||||
|
||||
render(
|
||||
<MemoryRouter future={{ v7_startTransition: true, v7_relativeSplatPath: true }}>
|
||||
<MemoryRouter>
|
||||
<StartPickListScreen />
|
||||
</MemoryRouter>,
|
||||
);
|
||||
@@ -149,7 +149,7 @@ describe('StartPickListScreen', () => {
|
||||
]);
|
||||
|
||||
render(
|
||||
<MemoryRouter future={{ v7_startTransition: true, v7_relativeSplatPath: true }}>
|
||||
<MemoryRouter>
|
||||
<StartPickListScreen />
|
||||
</MemoryRouter>,
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user