#146 setup mytask on translated statuses of tasks

parent 00ed8c90
...@@ -14,7 +14,7 @@ import { ...@@ -14,7 +14,7 @@ import {
import {Project} from './Project'; import {Project} from './Project';
import { DateTimeTask } from './DateTimeTask'; import { DateTimeTask } from './DateTimeTask';
export type taskFinishType = "opened"| "in-progress" | "done" |"failed"|"cancelled"; export type taskFinishType = "opened"| "progress" | "done" |"failed"|"cancelled";
export type priorityType = "A" | "B" |"C"; export type priorityType = "A" | "B" |"C";
interface ITask{ interface ITask{
...@@ -55,7 +55,7 @@ import { DateTimeTask } from './DateTimeTask'; ...@@ -55,7 +55,7 @@ import { DateTimeTask } from './DateTimeTask';
@Column({ @Column({
type: "enum", type: "enum",
enum: ["opened", "done" , "failed","in-progress","cancelled"], enum: ["opened", "done" , "failed","progress","cancelled"],
default: "opened" default: "opened"
}) })
accomplish!: taskFinishType accomplish!: taskFinishType
......
...@@ -22,7 +22,7 @@ const CalendarStandartCell = ({ children, xs, hours, dayNumber, createTaskInCell ...@@ -22,7 +22,7 @@ const CalendarStandartCell = ({ children, xs, hours, dayNumber, createTaskInCell
} }
},[copyTask, copyModeTask, year, month, dayNumber, hours]) },[copyTask, copyModeTask, year, month, dayNumber, hours])
console.log(copyTask) // console.log(copyTask)
const cellClass = useMemo(() => { const cellClass = useMemo(() => {
const backgroundColor = isDeadLine ? '#fa9b9be3' : 'null' const backgroundColor = isDeadLine ? '#fa9b9be3' : 'null'
return ({ return ({
......
...@@ -25,6 +25,7 @@ import KeyboardArrowUpIcon from '@mui/icons-material/KeyboardArrowUp'; ...@@ -25,6 +25,7 @@ import KeyboardArrowUpIcon from '@mui/icons-material/KeyboardArrowUp';
import { useNavigate } from "react-router-dom"; import { useNavigate } from "react-router-dom";
import { useDispatch } from "react-redux"; import { useDispatch } from "react-redux";
import { activateCreateCopyTasksMode } from "../../../store/actions/tasksActions"; import { activateCreateCopyTasksMode } from "../../../store/actions/tasksActions";
import { TaskStatuses } from "../../../helpers/TableTasksHelpers";
const weekDays = ["Вс","Пн","Вт","Ср","Чт","Пт","Сб" ]; const weekDays = ["Вс","Пн","Вт","Ср","Чт","Пт","Сб" ];
...@@ -232,9 +233,11 @@ const TableRowTask= ({ ...@@ -232,9 +233,11 @@ const TableRowTask= ({
<TableCell> <TableCell>
<BasicSelect <BasicSelect
items={[ items={[
{ value: "opened", title: "opened" }, { value: "opened", title: "создано" },
{ value: "done", title: "done" }, { value: "done", title: "выполнено" },
{ value: "failed", title: "failed" }, { value: "failed", title: "просрочено" },
{ value: "progress", title: "в работе" },
{ value: "cancelled", title: "отменено" },
]} ]}
task={task} task={task}
onChange={onChange} onChange={onChange}
...@@ -248,7 +251,7 @@ const TableRowTask= ({ ...@@ -248,7 +251,7 @@ const TableRowTask= ({
{...{ {...{
task, task,
name: "accomplish", name: "accomplish",
value: task.accomplish, value: TaskStatuses[task.accomplish],
user:user user:user
}} }}
/> />
......
...@@ -44,7 +44,7 @@ export default function EnhancedTable() { ...@@ -44,7 +44,7 @@ export default function EnhancedTable() {
}, [ }, [
tasks?.length, tasks?.length,
addTaskForm, setAddTaskForm, dispatch]); addTaskForm, setAddTaskForm, dispatch]);
console.log('tasks ', tasks, 'projects ', projects,"recievedTasks ", recievedTasks ) // console.log('tasks ', tasks, 'projects ', projects,"recievedTasks ", recievedTasks )
......
export const TaskStatuses = {
'done': 'выполнено',
'cancelled': 'отменено',
'progress': 'в работе',
'failed': 'просрочено',
'opened': 'создано'
};
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment