Merge pull request 'исправила цвета, сделала поярче breadcrumbs и исправила поиск в этапах' (#167) from fix-color-table into test
Reviewed-on: #167
This commit is contained in:
commit
760b3a7d62
@ -322,15 +322,15 @@ export const config = {
|
|||||||
accessorKey: "data.q2.base_correction_comment",
|
accessorKey: "data.q2.base_correction_comment",
|
||||||
},
|
},
|
||||||
"data.q2.revision_inc": {
|
"data.q2.revision_inc": {
|
||||||
color_type: redColumn,
|
color_type: yellowColumn,
|
||||||
accessorKey: "data.q2.revision_inc",
|
accessorKey: "data.q2.revision_inc",
|
||||||
},
|
},
|
||||||
"data.q2.revision_seq": {
|
"data.q2.revision_seq": {
|
||||||
color_type: redColumn,
|
color_type: yellowColumn,
|
||||||
accessorKey: "data.q2.revision_seq",
|
accessorKey: "data.q2.revision_seq",
|
||||||
},
|
},
|
||||||
"data.q2.revision_comment": {
|
"data.q2.revision_comment": {
|
||||||
color_type: redColumn,
|
color_type: yellowColumn,
|
||||||
accessorKey: "data.q2.revision_comment",
|
accessorKey: "data.q2.revision_comment",
|
||||||
},
|
},
|
||||||
"data.q2.new_plan": {
|
"data.q2.new_plan": {
|
||||||
@ -454,15 +454,15 @@ export const config = {
|
|||||||
accessorKey: "data.q3.base_correction_comment",
|
accessorKey: "data.q3.base_correction_comment",
|
||||||
},
|
},
|
||||||
"data.q3.revision_inc": {
|
"data.q3.revision_inc": {
|
||||||
color_type: redColumn,
|
color_type: yellowColumn,
|
||||||
accessorKey: "data.q3.revision_inc",
|
accessorKey: "data.q3.revision_inc",
|
||||||
},
|
},
|
||||||
"data.q3.revision_seq": {
|
"data.q3.revision_seq": {
|
||||||
color_type: redColumn,
|
color_type: yellowColumn,
|
||||||
accessorKey: "data.q3.revision_seq",
|
accessorKey: "data.q3.revision_seq",
|
||||||
},
|
},
|
||||||
"data.q3.revision_comment": {
|
"data.q3.revision_comment": {
|
||||||
color_type: redColumn,
|
color_type: yellowColumn,
|
||||||
accessorKey: "data.q3.revision_comment",
|
accessorKey: "data.q3.revision_comment",
|
||||||
},
|
},
|
||||||
"data.q3.new_plan": {
|
"data.q3.new_plan": {
|
||||||
@ -578,15 +578,15 @@ export const config = {
|
|||||||
accessorKey: "data.q4.base_correction_comment",
|
accessorKey: "data.q4.base_correction_comment",
|
||||||
},
|
},
|
||||||
"data.q4.revision_inc": {
|
"data.q4.revision_inc": {
|
||||||
color_type: redColumn,
|
color_type: yellowColumn,
|
||||||
accessorKey: "data.q4.revision_inc",
|
accessorKey: "data.q4.revision_inc",
|
||||||
},
|
},
|
||||||
"data.q4.revision_seq": {
|
"data.q4.revision_seq": {
|
||||||
color_type: redColumn,
|
color_type: yellowColumn,
|
||||||
accessorKey: "data.q4.revision_seq",
|
accessorKey: "data.q4.revision_seq",
|
||||||
},
|
},
|
||||||
"data.q4.revision_comment": {
|
"data.q4.revision_comment": {
|
||||||
color_type: redColumn,
|
color_type: yellowColumn,
|
||||||
accessorKey: "data.q4.revision_comment",
|
accessorKey: "data.q4.revision_comment",
|
||||||
},
|
},
|
||||||
"data.q4.new_plan": {
|
"data.q4.new_plan": {
|
||||||
@ -650,7 +650,7 @@ export const config = {
|
|||||||
accessorKey: "data.q4.actual_m3",
|
accessorKey: "data.q4.actual_m3",
|
||||||
},
|
},
|
||||||
"data.q4.actual_spod": {
|
"data.q4.actual_spod": {
|
||||||
color_type: whiteColumn,
|
color_type: greenColumn,
|
||||||
accessorKey: "data.q4.actual_spod",
|
accessorKey: "data.q4.actual_spod",
|
||||||
},
|
},
|
||||||
"data.q4.actual_quarter": {
|
"data.q4.actual_quarter": {
|
||||||
|
|||||||
@ -322,15 +322,15 @@ export const config = {
|
|||||||
accessorKey: "data.q2.base_correction_comment",
|
accessorKey: "data.q2.base_correction_comment",
|
||||||
},
|
},
|
||||||
"data.q2.revision_inc": {
|
"data.q2.revision_inc": {
|
||||||
color_type: redColumn,
|
color_type: yellowColumn,
|
||||||
accessorKey: "data.q2.revision_inc",
|
accessorKey: "data.q2.revision_inc",
|
||||||
},
|
},
|
||||||
"data.q2.revision_seq": {
|
"data.q2.revision_seq": {
|
||||||
color_type: redColumn,
|
color_type: yellowColumn,
|
||||||
accessorKey: "data.q2.revision_seq",
|
accessorKey: "data.q2.revision_seq",
|
||||||
},
|
},
|
||||||
"data.q2.revision_comment": {
|
"data.q2.revision_comment": {
|
||||||
color_type: redColumn,
|
color_type: yellowColumn,
|
||||||
accessorKey: "data.q2.revision_comment",
|
accessorKey: "data.q2.revision_comment",
|
||||||
},
|
},
|
||||||
"data.q2.new_plan": {
|
"data.q2.new_plan": {
|
||||||
@ -454,15 +454,15 @@ export const config = {
|
|||||||
accessorKey: "data.q3.base_correction_comment",
|
accessorKey: "data.q3.base_correction_comment",
|
||||||
},
|
},
|
||||||
"data.q3.revision_inc": {
|
"data.q3.revision_inc": {
|
||||||
color_type: redColumn,
|
color_type: yellowColumn,
|
||||||
accessorKey: "data.q3.revision_inc",
|
accessorKey: "data.q3.revision_inc",
|
||||||
},
|
},
|
||||||
"data.q3.revision_seq": {
|
"data.q3.revision_seq": {
|
||||||
color_type: redColumn,
|
color_type: yellowColumn,
|
||||||
accessorKey: "data.q3.revision_seq",
|
accessorKey: "data.q3.revision_seq",
|
||||||
},
|
},
|
||||||
"data.q3.revision_comment": {
|
"data.q3.revision_comment": {
|
||||||
color_type: redColumn,
|
color_type: yellowColumn,
|
||||||
accessorKey: "data.q3.revision_comment",
|
accessorKey: "data.q3.revision_comment",
|
||||||
},
|
},
|
||||||
"data.q3.new_plan": {
|
"data.q3.new_plan": {
|
||||||
@ -578,15 +578,15 @@ export const config = {
|
|||||||
accessorKey: "data.q4.base_correction_comment",
|
accessorKey: "data.q4.base_correction_comment",
|
||||||
},
|
},
|
||||||
"data.q4.revision_inc": {
|
"data.q4.revision_inc": {
|
||||||
color_type: redColumn,
|
color_type: yellowColumn,
|
||||||
accessorKey: "data.q4.revision_inc",
|
accessorKey: "data.q4.revision_inc",
|
||||||
},
|
},
|
||||||
"data.q4.revision_seq": {
|
"data.q4.revision_seq": {
|
||||||
color_type: redColumn,
|
color_type: yellowColumn,
|
||||||
accessorKey: "data.q4.revision_seq",
|
accessorKey: "data.q4.revision_seq",
|
||||||
},
|
},
|
||||||
"data.q4.revision_comment": {
|
"data.q4.revision_comment": {
|
||||||
color_type: redColumn,
|
color_type: yellowColumn,
|
||||||
accessorKey: "data.q4.revision_comment",
|
accessorKey: "data.q4.revision_comment",
|
||||||
},
|
},
|
||||||
"data.q4.new_plan": {
|
"data.q4.new_plan": {
|
||||||
|
|||||||
@ -19,7 +19,14 @@ const TaskBreadcrumbs = ({ task, taskId, sheetName, isProject = false, year }) =
|
|||||||
const taskLabel = isProject ? projectLabel : getTaskLabel(task) || `Задача №${taskId}`;
|
const taskLabel = isProject ? projectLabel : getTaskLabel(task) || `Задача №${taskId}`;
|
||||||
const currentSheetLabel = isProject && /^\d{4}$/.test(String(year)) ? `${sheetName} · ${year}` : sheetName;
|
const currentSheetLabel = isProject && /^\d{4}$/.test(String(year)) ? `${sheetName} · ${year}` : sheetName;
|
||||||
return (
|
return (
|
||||||
<Breadcrumbs aria-label={isProject ? 'Навигация по проекту' : 'Навигация по задаче'} sx={{ fontSize: '0.875rem', '& .MuiBreadcrumbs-ol': { rowGap: '0.25rem' } }}>
|
<Breadcrumbs
|
||||||
|
aria-label={isProject ? 'Навигация по проекту' : 'Навигация по задаче'}
|
||||||
|
sx={{
|
||||||
|
fontSize: '0.875rem',
|
||||||
|
'& .MuiBreadcrumbs-ol': { rowGap: '0.25rem' },
|
||||||
|
'& .MuiLink-root, & .MuiTypography-root': { fontWeight: 600 },
|
||||||
|
}}
|
||||||
|
>
|
||||||
<Link component={RouterLink} to={getListReturnUrl(isProject ? 'projects' : 'tasks', taskId)} color='inherit' underline='hover'>{isProject ? 'Проекты' : 'Задачи'}</Link>
|
<Link component={RouterLink} to={getListReturnUrl(isProject ? 'projects' : 'tasks', taskId)} color='inherit' underline='hover'>{isProject ? 'Проекты' : 'Задачи'}</Link>
|
||||||
{sheetName ? (
|
{sheetName ? (
|
||||||
<Link component={RouterLink} to={`/${isProject ? 'project' : 'task'}/${taskId}`} color='inherit' underline='hover'>{taskLabel}</Link>
|
<Link component={RouterLink} to={`/${isProject ? 'project' : 'task'}/${taskId}`} color='inherit' underline='hover'>{taskLabel}</Link>
|
||||||
|
|||||||
@ -8,7 +8,7 @@ export default function PhaseTemplatesFilters({ filters, sheets, changeFilter, l
|
|||||||
<Box sx={{ display: 'flex', gap: 2, flexWrap: 'wrap' }}>
|
<Box sx={{ display: 'flex', gap: 2, flexWrap: 'wrap' }}>
|
||||||
<TextField
|
<TextField
|
||||||
size='small'
|
size='small'
|
||||||
label='Поиск по названию или колонкам'
|
label='Поиск по названию этапа'
|
||||||
value={filters.search}
|
value={filters.search}
|
||||||
onChange={(e) => changeFilter('search', e.target.value)}
|
onChange={(e) => changeFilter('search', e.target.value)}
|
||||||
sx={{ minWidth: 270, flex: 1 }}
|
sx={{ minWidth: 270, flex: 1 }}
|
||||||
|
|||||||
@ -50,17 +50,19 @@ export function usePhaseTemplates(isAdmin) {
|
|||||||
}, [isAdmin, load]);
|
}, [isAdmin, load]);
|
||||||
|
|
||||||
const filteredRows = useMemo(
|
const filteredRows = useMemo(
|
||||||
() =>
|
() => {
|
||||||
rows
|
const search = filters.search.trim().toLocaleLowerCase('ru-RU');
|
||||||
|
|
||||||
|
return rows
|
||||||
.filter((row) => {
|
.filter((row) => {
|
||||||
if (filters.form_type && row.form_type !== filters.form_type) return false;
|
if (filters.form_type && row.form_type !== filters.form_type) return false;
|
||||||
if (filters.sheet && row.sheet !== filters.sheet) return false;
|
if (filters.sheet && row.sheet !== filters.sheet) return false;
|
||||||
if (filters.role && row.role !== filters.role) return false;
|
if (filters.role && row.role !== filters.role) return false;
|
||||||
if (filters.direction && (row.direction || 'none') !== filters.direction) return false;
|
if (filters.direction && (row.direction || 'none') !== filters.direction) return false;
|
||||||
const text = [row.phase_code, ...(row.column_keys || [])].join(' ').toLocaleLowerCase('ru');
|
return String(row.phase_code || '').toLocaleLowerCase('ru-RU').includes(search);
|
||||||
return text.includes(filters.search.trim().toLocaleLowerCase('ru'));
|
|
||||||
})
|
})
|
||||||
.sort((a, b) => templateKey(a).localeCompare(templateKey(b), 'ru')),
|
.sort((a, b) => templateKey(a).localeCompare(templateKey(b), 'ru'));
|
||||||
|
},
|
||||||
[rows, filters],
|
[rows, filters],
|
||||||
);
|
);
|
||||||
const sheets = [
|
const sheets = [
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user