quality / commitlint (push) Skipped
quality / changes (push) Successful in 9s
quality / docker-check (push) Skipped
quality / openapi (push) Successful in 39s
quality / web (push) Successful in 1m29s
quality / go (push) Successful in 1m3s
quality / bird2 (push) Successful in 15s
CD / quality (push) Successful in 3m43s
CD / publish (push) Failing after 8m29s
Единый kitDataGridTableLayout и ResourcePage/FrameDataGrid на всех списках. Календарь задач переведён на EventCalendar, lookup — на cascader, у операций появился вид доски. Удалены settings-7 и самописные DataGridSection/toolbar. Co-authored-by: Cursor <cursoragent@cursor.com>
84 lines
2.3 KiB
TypeScript
84 lines
2.3 KiB
TypeScript
import { useState } from 'react'
|
|
import { LayoutGrid, Table2 } from 'lucide-react'
|
|
|
|
import { OperationsJobsGrid } from '@/components/operations/operations-jobs-grid'
|
|
import { OperationsJobsKanban } from '@/components/operations/operations-jobs-kanban'
|
|
import { QueryState } from '@/components/query-state'
|
|
import { ToggleGroup, ToggleGroupItem } from '@evobgp/ui/components/toggle-group'
|
|
import type { JobRow } from '@/types/api'
|
|
import type { QueryClient } from '@tanstack/react-query'
|
|
|
|
/**
|
|
* Jobs ResourcePage + optional Kanban board (не замена грида).
|
|
* @see https://reui.io/preview/base/data-grid-filtering-2
|
|
* @see https://reui.io/docs/components/base/kanban
|
|
*/
|
|
export function OperationsJobsCard({
|
|
jobs,
|
|
nameById,
|
|
qc,
|
|
isLoading,
|
|
isError,
|
|
error,
|
|
onRetry,
|
|
}: {
|
|
jobs: JobRow[]
|
|
nameById: Map<string, string>
|
|
qc: QueryClient
|
|
isLoading: boolean
|
|
isError: boolean
|
|
error: unknown
|
|
onRetry: () => void
|
|
}) {
|
|
const [view, setView] = useState<'table' | 'board'>('table')
|
|
|
|
return (
|
|
<div className="flex flex-col gap-3">
|
|
<div className="flex justify-end">
|
|
<ToggleGroup
|
|
multiple={false}
|
|
value={[view]}
|
|
onValueChange={(values) => {
|
|
const next = values[0]
|
|
if (next === 'table' || next === 'board') setView(next)
|
|
}}
|
|
variant="outline"
|
|
size="sm"
|
|
aria-label="Вид задач"
|
|
className="w-fit"
|
|
>
|
|
<ToggleGroupItem value="table" aria-label="Таблица">
|
|
<Table2 className="size-4" />
|
|
Таблица
|
|
</ToggleGroupItem>
|
|
<ToggleGroupItem value="board" aria-label="Доска">
|
|
<LayoutGrid className="size-4" />
|
|
Доска
|
|
</ToggleGroupItem>
|
|
</ToggleGroup>
|
|
</div>
|
|
<QueryState
|
|
data={jobs}
|
|
isLoading={isLoading}
|
|
isError={isError}
|
|
error={error}
|
|
empty={false}
|
|
onRetry={onRetry}
|
|
>
|
|
{(items) =>
|
|
view === 'board' ? (
|
|
<OperationsJobsKanban items={items} nameById={nameById} />
|
|
) : (
|
|
<OperationsJobsGrid
|
|
items={items}
|
|
nameById={nameById}
|
|
qc={qc}
|
|
isLoading={isLoading && items.length > 0}
|
|
/>
|
|
)
|
|
}
|
|
</QueryState>
|
|
</div>
|
|
)
|
|
}
|