chore(web): remove standalone Currencies page (managed via Country FK)
Валюты — закрытый сидируемый список (KZT, USD, EUR, RUB), пользователь их не создаёт. Currency остаётся в БД как FK для Country и Organization; GET /api/catalog/currencies продолжает работать для дропдаунов в форме страны и настройках организации. Отдельная страница в меню избыточна. - удалена pages/CurrenciesPage.tsx - из роутера убран /catalog/currencies - из сайдбара пропал пункт «Валюты», иконка Coins больше не импортируется Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
e9f8da1b82
commit
43bf1dc3de
|
|
@ -3,7 +3,6 @@ import { QueryClient, QueryClientProvider } from '@tanstack/react-query'
|
||||||
import { LoginPage } from '@/pages/LoginPage'
|
import { LoginPage } from '@/pages/LoginPage'
|
||||||
import { DashboardPage } from '@/pages/DashboardPage'
|
import { DashboardPage } from '@/pages/DashboardPage'
|
||||||
import { CountriesPage } from '@/pages/CountriesPage'
|
import { CountriesPage } from '@/pages/CountriesPage'
|
||||||
import { CurrenciesPage } from '@/pages/CurrenciesPage'
|
|
||||||
import { UnitsOfMeasurePage } from '@/pages/UnitsOfMeasurePage'
|
import { UnitsOfMeasurePage } from '@/pages/UnitsOfMeasurePage'
|
||||||
import { PriceTypesPage } from '@/pages/PriceTypesPage'
|
import { PriceTypesPage } from '@/pages/PriceTypesPage'
|
||||||
import { StoresPage } from '@/pages/StoresPage'
|
import { StoresPage } from '@/pages/StoresPage'
|
||||||
|
|
@ -51,7 +50,6 @@ export default function App() {
|
||||||
<Route path="/catalog/stores" element={<StoresPage />} />
|
<Route path="/catalog/stores" element={<StoresPage />} />
|
||||||
<Route path="/catalog/retail-points" element={<RetailPointsPage />} />
|
<Route path="/catalog/retail-points" element={<RetailPointsPage />} />
|
||||||
<Route path="/catalog/countries" element={<CountriesPage />} />
|
<Route path="/catalog/countries" element={<CountriesPage />} />
|
||||||
<Route path="/catalog/currencies" element={<CurrenciesPage />} />
|
|
||||||
<Route path="/inventory/stock" element={<StockPage />} />
|
<Route path="/inventory/stock" element={<StockPage />} />
|
||||||
<Route path="/inventory/movements" element={<StockMovementsPage />} />
|
<Route path="/inventory/movements" element={<StockMovementsPage />} />
|
||||||
<Route path="/purchases/supplies" element={<SuppliesPage />} />
|
<Route path="/purchases/supplies" element={<SuppliesPage />} />
|
||||||
|
|
|
||||||
|
|
@ -6,7 +6,7 @@ import { logout } from '@/lib/auth'
|
||||||
import { cn } from '@/lib/utils'
|
import { cn } from '@/lib/utils'
|
||||||
import {
|
import {
|
||||||
LayoutDashboard, Package, FolderTree, Ruler, Tag,
|
LayoutDashboard, Package, FolderTree, Ruler, Tag,
|
||||||
Users, Warehouse, Store as StoreIcon, Globe, Coins, LogOut, Download,
|
Users, Warehouse, Store as StoreIcon, Globe, LogOut, Download,
|
||||||
Boxes, History, TruckIcon, ShoppingCart, Settings, Menu, X,
|
Boxes, History, TruckIcon, ShoppingCart, Settings, Menu, X,
|
||||||
} from 'lucide-react'
|
} from 'lucide-react'
|
||||||
import { Logo } from './Logo'
|
import { Logo } from './Logo'
|
||||||
|
|
@ -53,7 +53,6 @@ function buildNav(): NavSection[] {
|
||||||
]},
|
]},
|
||||||
{ group: 'Справочники', items: [
|
{ group: 'Справочники', items: [
|
||||||
{ to: '/catalog/countries', icon: Globe, label: 'Страны' },
|
{ to: '/catalog/countries', icon: Globe, label: 'Страны' },
|
||||||
{ to: '/catalog/currencies', icon: Coins, label: 'Валюты' },
|
|
||||||
]},
|
]},
|
||||||
{ group: 'Импорт', items: [
|
{ group: 'Импорт', items: [
|
||||||
{ to: '/admin/import/moysklad', icon: Download, label: 'МойСклад' },
|
{ to: '/admin/import/moysklad', icon: Download, label: 'МойСклад' },
|
||||||
|
|
|
||||||
|
|
@ -1,35 +0,0 @@
|
||||||
import { ListPageShell } from '@/components/ListPageShell'
|
|
||||||
import { DataTable } from '@/components/DataTable'
|
|
||||||
import { Pagination } from '@/components/Pagination'
|
|
||||||
import { SearchBar } from '@/components/SearchBar'
|
|
||||||
import { useCatalogList } from '@/lib/useCatalog'
|
|
||||||
import type { Currency } from '@/lib/types'
|
|
||||||
|
|
||||||
export function CurrenciesPage() {
|
|
||||||
const { data, isLoading, page, setPage, search, setSearch, sortKey, sortOrder, setSort } = useCatalogList<Currency>('/api/catalog/currencies')
|
|
||||||
|
|
||||||
return (
|
|
||||||
<ListPageShell
|
|
||||||
title="Валюты"
|
|
||||||
description="Доступные валюты для операций. Основная — тенге (KZT)."
|
|
||||||
actions={<SearchBar value={search} onChange={setSearch} />}
|
|
||||||
footer={data && data.total > 0 && (
|
|
||||||
<Pagination page={page} pageSize={data.pageSize} total={data.total} onPageChange={setPage} />
|
|
||||||
)}
|
|
||||||
>
|
|
||||||
<DataTable
|
|
||||||
rows={data?.items ?? []}
|
|
||||||
isLoading={isLoading}
|
|
||||||
rowKey={(r) => r.id}
|
|
||||||
sortKey={sortKey}
|
|
||||||
sortOrder={sortOrder}
|
|
||||||
onSortChange={setSort}
|
|
||||||
columns={[
|
|
||||||
{ header: 'Код', width: '90px', sortKey: 'code', cell: (r) => <span className="font-mono">{r.code}</span> },
|
|
||||||
{ header: 'Название', sortKey: 'name', cell: (r) => r.name },
|
|
||||||
{ header: 'Символ', width: '100px', sortKey: 'symbol', cell: (r) => <span className="text-lg">{r.symbol}</span> },
|
|
||||||
]}
|
|
||||||
/>
|
|
||||||
</ListPageShell>
|
|
||||||
)
|
|
||||||
}
|
|
||||||
Loading…
Reference in a new issue