tracker-tasks

This commit is contained in:
Николай Полтщук 2023-06-29 03:41:59 +03:00
parent 6f534bb82b
commit 4180cb5858
3 changed files with 59 additions and 64 deletions

View File

@ -25,9 +25,9 @@ import file from "assets/icons/fileModal.svg";
import link from "assets/icons/link.svg";
import send from "assets/icons/send.svg";
import watch from "assets/icons/watch.svg";
import avatarMok from "assets/images/avatarMok.png";
import "./modalTicket.scss";
import avatarMok from "assets/images/avatarMok.png";
export const ModalTiсket = ({
active,
@ -471,12 +471,11 @@ export const ModalTiсket = ({
<div className="executor">
<p>Исполнитель: {executor.fio}</p>
<img
src={
executor?.avatar
? urlForLocal(executor.avatar)
: avatarMok
}
alt="avatar" />
src={
executor?.avatar ? urlForLocal(executor.avatar) : avatarMok
}
alt="avatar"
/>
<img
src={close}
className="delete"
@ -513,7 +512,7 @@ export const ModalTiсket = ({
? urlForLocal(person.user.avatar)
: avatarMok
}
alt='avatar'
alt="avatar"
/>
</div>
);
@ -537,7 +536,7 @@ export const ModalTiсket = ({
? urlForLocal(member.avatar)
: avatarMok
}
alt='avatar'
alt="avatar"
/>
<img
src={close}
@ -581,7 +580,7 @@ export const ModalTiсket = ({
? urlForLocal(person.user.avatar)
: avatarMok
}
alt='avatar'
alt="avatar"
/>
</div>
);

View File

@ -7,8 +7,9 @@ import { Link, useNavigate, useParams } from "react-router-dom";
import {
deletePersonOnProject,
getBoarderLoader,
modalToggle, setProjectBoardFetch,
setToggleTab
modalToggle,
setProjectBoardFetch,
setToggleTab,
} from "@redux/projectsTrackerSlice";
import { getCorrectRequestDate, urlForLocal } from "@utils/helper";
@ -47,7 +48,7 @@ export const TicketFullScreen = () => {
const dispatch = useDispatch();
const navigate = useNavigate();
const boardLoader = useSelector(getBoarderLoader);
const [projectInfo, setProjectInfo] = useState({})
const [projectInfo, setProjectInfo] = useState({});
const [taskInfo, setTaskInfo] = useState({});
const [editOpen, setEditOpen] = useState(false);
const [inputsValue, setInputsValue] = useState({});
@ -112,10 +113,12 @@ export const TicketFullScreen = () => {
}
});
});
apiRequest(`/project/get-project?project_id=${taskInfo.project_id}&expand=columns`).then((res) => {
setProjectInfo(res)
setCorrectProjectUsers(res.projectUsers)
})
apiRequest(
`/project/get-project?project_id=${taskInfo.project_id}&expand=columns`
).then((res) => {
setProjectInfo(res);
setCorrectProjectUsers(res.projectUsers);
});
setLoader(boardLoader);
});
}, []);
@ -307,8 +310,8 @@ export const TicketFullScreen = () => {
setTaskInfo((prevState) => ({
...prevState,
executor_id: null,
executor: null
}))
executor: null,
}));
});
}
@ -324,8 +327,8 @@ export const TicketFullScreen = () => {
setTaskInfo((prevState) => ({
...prevState,
executor_id: res.executor_id,
executor: res.executor
}))
executor: res.executor,
}));
});
}
@ -339,8 +342,10 @@ export const TicketFullScreen = () => {
}).then(() => {
setTaskInfo((prevState) => ({
...prevState,
taskUsers: taskInfo.taskUsers.filter((item) => item.user_id !== person.user_id)
}))
taskUsers: taskInfo.taskUsers.filter(
(item) => item.user_id !== person.user_id
),
}));
});
}
@ -355,7 +360,7 @@ export const TicketFullScreen = () => {
setDropListMembersOpen(false);
setTaskInfo((prevValue) => ({
...prevValue,
taskUsers: [...prevValue.taskUsers, res]
taskUsers: [...prevValue.taskUsers, res],
}));
});
}
@ -422,24 +427,19 @@ export const TicketFullScreen = () => {
)}
<div className="projectPersons">
{projectInfo.projectUsers?.length &&
projectInfo.projectUsers
.slice(
0,
3
)
.map((person) => {
return (
<img
key={person.user_id}
src={
person.user?.avatar
? urlForLocal(person.user.avatar)
: avatarMok
}
alt="avatar"
/>
);
})}
projectInfo.projectUsers.slice(0, 3).map((person) => {
return (
<img
key={person.user_id}
src={
person.user?.avatar
? urlForLocal(person.user.avatar)
: avatarMok
}
alt="avatar"
/>
);
})}
</div>
<span
className="addPerson"
@ -634,7 +634,8 @@ export const TicketFullScreen = () => {
? urlForLocal(taskInfo.executor.avatar)
: avatarMok
}
alt="avatar" />
alt="avatar"
/>
<img
src={close}
className="delete"
@ -671,7 +672,7 @@ export const TicketFullScreen = () => {
? urlForLocal(person.user.avatar)
: avatarMok
}
alt='avatar'
alt="avatar"
/>
</div>
);
@ -694,7 +695,7 @@ export const TicketFullScreen = () => {
? urlForLocal(member.avatar)
: avatarMok
}
alt='avatar'
alt="avatar"
/>
<img
src={close}
@ -737,7 +738,7 @@ export const TicketFullScreen = () => {
? urlForLocal(person.user.avatar)
: avatarMok
}
alt='avatar'
alt="avatar"
/>
</div>
);

View File

@ -327,24 +327,19 @@ export const ProjectTracker = () => {
)}
<div className="projectPersons">
{projectBoard.projectUsers?.length &&
projectBoard.projectUsers
.slice(
0,
3
)
.map((person) => {
return (
<img
key={person.user_id}
src={
person.user?.avatar
? urlForLocal(person.user.avatar)
: avatarMok
}
alt="avatar"
/>
);
})}
projectBoard.projectUsers.slice(0, 3).map((person) => {
return (
<img
key={person.user_id}
src={
person.user?.avatar
? urlForLocal(person.user.avatar)
: avatarMok
}
alt="avatar"
/>
);
})}
</div>
<span
className="addPerson"