tracker-tasks

This commit is contained in:
Николай Полтщук 2023-06-29 02:27:08 +03:00
parent 4db278fdbd
commit 3131fbe1ef
5 changed files with 55 additions and 36 deletions

View File

@ -1,8 +1,8 @@
import ClassicEditor from "@ckeditor/ckeditor5-build-classic";
import { CKEditor } from "@ckeditor/ckeditor5-react";
import React, { useEffect, useState } from "react";
import { useDispatch, useSelector } from "react-redux";
import { Link } from "react-router-dom";
import ClassicEditor from "@ckeditor/ckeditor5-build-classic";
import { CKEditor } from "@ckeditor/ckeditor5-react";
import { getProfileInfo } from "@redux/outstaffingSlice";
import { setProjectBoardFetch } from "@redux/projectsTrackerSlice";

View File

@ -1,8 +1,8 @@
import ClassicEditor from "@ckeditor/ckeditor5-build-classic";
import { CKEditor } from "@ckeditor/ckeditor5-react";
import React, { useEffect, useState } from "react";
import { useDispatch, useSelector } from "react-redux";
import { Link, useNavigate, useParams } from "react-router-dom";
import ClassicEditor from "@ckeditor/ckeditor5-build-classic";
import { CKEditor } from "@ckeditor/ckeditor5-react";
import {
deletePersonOnProject,
@ -40,9 +40,9 @@ import send from "assets/icons/send.svg";
import project from "assets/icons/trackerProject.svg";
import tasks from "assets/icons/trackerTasks.svg";
import watch from "assets/icons/watch.svg";
import avatarMok from "assets/images/avatarMok.png";
import "./ticketFullScreen.scss";
import avatarMok from "assets/images/avatarMok.png";
export const TicketFullScreen = () => {
const [modalAddWorker, setModalAddWorker] = useState(false);
@ -89,10 +89,11 @@ export const TicketFullScreen = () => {
}, []);
setComments(comments);
});
apiRequest(`/timer/get-by-entity?entity_type=2&entity_id=${taskInfo.id}`).then(
(res) => {
let timerSeconds = 0;
res.length &&
apiRequest(
`/timer/get-by-entity?entity_type=2&entity_id=${taskInfo.id}`
).then((res) => {
let timerSeconds = 0;
res.length &&
res.forEach((time) => {
timerSeconds += time.deltaSeconds;
setCurrentTimerCount({
@ -109,8 +110,7 @@ export const TicketFullScreen = () => {
setTimerInfo(time);
}
});
}
);
});
dispatch(setProjectBoardFetch(taskInfo.project_id));
setLoader(boardLoader);
});
@ -337,11 +337,9 @@ export const TicketFullScreen = () => {
></TrackerModal>
<div className="tasks__head__persons">
{projectBoard.projectUsers?.length > 3 &&
<span className="countPersons">
+1...
</span>
}
{projectBoard.projectUsers?.length > 3 && (
<span className="countPersons">+1...</span>
)}
<div className="projectPersons">
{projectBoard.projectUsers?.length &&
projectBoard.projectUsers
@ -478,7 +476,11 @@ export const TicketFullScreen = () => {
}}
/>
) : (
<p dangerouslySetInnerHTML={{ __html: inputsValue.description }} />
<p
dangerouslySetInnerHTML={{
__html: inputsValue.description,
}}
/>
)}
</div>
<div className="content__communication">
@ -535,7 +537,8 @@ export const TicketFullScreen = () => {
<div className="workers">
<div className="workers_box task__info">
<p className="workers__creator">
Создатель : <br/>{taskInfo.user?.fio}
Создатель : <br />
{taskInfo.user?.fio}
</p>
<div>
{Boolean(taskInfo.taskUsers?.length) &&
@ -590,7 +593,8 @@ export const TicketFullScreen = () => {
{timerStart ? (
<button
className={
taskInfo.executor_id === Number(localStorage.getItem("id"))
taskInfo.executor_id ===
Number(localStorage.getItem("id"))
? "stop"
: "stop disable"
}
@ -601,7 +605,8 @@ export const TicketFullScreen = () => {
) : (
<button
className={
taskInfo.executor_id === Number(localStorage.getItem("id"))
taskInfo.executor_id ===
Number(localStorage.getItem("id"))
? "start"
: "start disable"
}

View File

@ -1,7 +1,7 @@
import React, { useEffect, useState } from "react";
import { useDispatch, useSelector } from "react-redux";
import ClassicEditor from "@ckeditor/ckeditor5-build-classic";
import { CKEditor } from "@ckeditor/ckeditor5-react";
import React, { useEffect, useState } from "react";
import { useDispatch, useSelector } from "react-redux";
import { getProfileInfo } from "@redux/outstaffingSlice";
import {
@ -27,9 +27,9 @@ import BaseButton from "@components/Common/BaseButton/BaseButton";
import ModalLayout from "@components/Common/ModalLayout/ModalLayout";
import arrowDown from "assets/icons/arrows/selectArrow.png";
import avatarMok from "assets/images/avatarMok.png";
import "./trackerModal.scss";
import avatarMok from "assets/images/avatarMok.png";
export const TrackerModal = ({
active,
@ -344,10 +344,17 @@ export const TrackerModal = ({
editor={ClassicEditor}
data={descriptionTicket}
config={{
toolbar: [ 'heading', '|', 'bold', 'italic', 'link', 'bulletedList', 'numberedList', 'blockQuote' ],
removePlugins: [
"BlockQuote",
toolbar: [
"heading",
"|",
"bold",
"italic",
"link",
"bulletedList",
"numberedList",
"blockQuote",
],
removePlugins: ["BlockQuote"],
}}
onChange={(event, editor) => {
const data = editor.getData();

View File

@ -1,3 +1,5 @@
import ClassicEditor from "@ckeditor/ckeditor5-build-classic";
import { CKEditor } from "@ckeditor/ckeditor5-react";
import React, { useState } from "react";
import { urlForLocal } from "@utils/helper";
@ -6,8 +8,6 @@ import { apiRequest } from "@api/request";
import { getCorrectDate } from "@components/Calendar/calendarHelper";
import TrackerTaskSubComment from "@components/TrackerTaskComment/TrackerTaskComment";
import ClassicEditor from "@ckeditor/ckeditor5-build-classic";
import { CKEditor } from "@ckeditor/ckeditor5-react";
import del from "assets/icons/delete.svg";
import edit from "assets/icons/edit.svg";
@ -78,7 +78,7 @@ export const TrackerTaskComment = ({
? "comments__list__item__main"
: "",
"comments__list__item",
commentsEditOpen ? 'comment__edit--open' : '',
commentsEditOpen ? "comment__edit--open" : "",
comment.parent_id ? "comments__list__item__subComment" : "",
].join(" ")}
>
@ -132,7 +132,10 @@ export const TrackerTaskComment = ({
}}
/>
) : (
<p dangerouslySetInnerHTML={{ __html: commentsEditText}} className="comments__list__item__text" />
<p
dangerouslySetInnerHTML={{ __html: commentsEditText }}
className="comments__list__item__text"
/>
)}
{!comment.parent_id && !commentsEditOpen && (
<>

View File

@ -322,11 +322,9 @@ export const ProjectTracker = () => {
<p>добавить колонку</p>
</div>
<div className="tasks__head__persons">
{projectBoard.projectUsers?.length > 3 &&
<span className="countPersons">
+1...
</span>
}
{projectBoard.projectUsers?.length > 3 && (
<span className="countPersons">+1...</span>
)}
<div className="projectPersons">
{projectBoard.projectUsers?.length &&
projectBoard.projectUsers
@ -468,7 +466,13 @@ export const ProjectTracker = () => {
<span
className="add"
onClick={() =>
selectedTabTask(column.id, projectBoard?.columns ? projectBoard?.columns[0].tasks.at(-1).priority + 1 : 1)
selectedTabTask(
column.id,
projectBoard?.columns
? projectBoard?.columns[0].tasks.at(-1)
.priority + 1
: 1
)
}
>
+