Compare commits

..

3 Commits

Author SHA1 Message Date
Mikola
a353f96d16 editSkills 2023-12-05 16:02:59 +03:00
Mikola
35b1b871c4 editSkills 2023-12-05 16:02:47 +03:00
Mikola
9e10088494 test 2023-12-05 14:15:04 +03:00
33 changed files with 320 additions and 149 deletions

View File

@ -19,7 +19,7 @@ export const apiRequest = (
"Access-Control-Allow-Origin": "*",
"Content-Type": "application/json",
},
} = {},
} = {}
) => {
const fullHeaders = { ...headers, ...getToken() };
let urWithParams = urlHasParams(url);
@ -41,7 +41,7 @@ export const apiRequest = (
// dispatch(auth(false));
}
return resolve(response);
}),
})
)
.then((response) => new Promise((resolve) => resolve(response.data)));
};

View File

@ -63,7 +63,7 @@ export const AuthBox = ({ title }) => {
localStorage.setItem("role_status", res.status);
localStorage.setItem(
"access_token_expired_at",
res.access_token_expired_at,
res.access_token_expired_at
);
dispatch(auth(true));
dispatch(setUserInfo(res));

View File

@ -89,7 +89,7 @@ const CalendarComponent = ({ onSelect }) => {
<img className={"calendar__icon"} src={calendarIcon} alt="" />
{currentMonthAndDay(day)}
</button>
)),
))
)}
</div>
</div>

View File

@ -17,7 +17,7 @@ export function calendarHelper(value) {
calendar.push(
Array(1)
.fill(0)
.map(() => day.add(1, "day").clone()),
.map(() => day.add(1, "day").clone())
);
}
@ -45,7 +45,7 @@ export function getReports(value) {
export function getCreatedDate(day) {
if (day) {
return `${new Date(day).getFullYear()}-${correctDay(
new Date(day).getMonth() + 1,
new Date(day).getMonth() + 1
)}-${correctDay(new Date(day).getDate())}`;
} else {
const date = new Date();

View File

@ -48,7 +48,7 @@ const Candidate = () => {
useEffect(() => {
apiRequest(`/user/me`, {}).then((el) =>
dispatch(currentCandidate(el.userCard)),
dispatch(currentCandidate(el.userCard))
);
}, [dispatch]);

View File

@ -70,7 +70,7 @@ export const ModalTiсket = ({
const [deadLine, setDeadLine] = useState(task.dead_line);
const [datePickerOpen, setDatePickerOpen] = useState(false);
const [startDate, setStartDate] = useState(
task.dead_line ? new Date(task.dead_line) : new Date(),
task.dead_line ? new Date(task.dead_line) : new Date()
);
const [dropListOpen, setDropListOpen] = useState(false);
const [dropListMembersOpen, setDropListMembersOpen] = useState(false);
@ -190,7 +190,7 @@ export const ModalTiсket = ({
function commentDelete(comment) {
setComments((prevValue) =>
prevValue.filter((item) => item.id !== comment.id),
prevValue.filter((item) => item.id !== comment.id)
);
if (comment.subComments.length) {
// promiseAll
@ -221,7 +221,7 @@ export const ModalTiсket = ({
deleteSubComment.forEach((comment, index) => {
if (comment.id === subComment.parent_id) {
deleteSubComment[index].subComments = comment.subComments.filter(
(item) => item.id !== subComment.id,
(item) => item.id !== subComment.id
);
}
});
@ -328,7 +328,7 @@ export const ModalTiсket = ({
useEffect(() => {
initListeners();
apiRequest(
`/comment/get-by-entity?entity_type=2&entity_id=${task.id}`,
`/comment/get-by-entity?entity_type=2&entity_id=${task.id}`
).then((res) => {
const comments = res.reduce((acc, cur) => {
if (!cur.parent_id) {
@ -362,7 +362,7 @@ export const ModalTiсket = ({
setTimerInfo(time);
}
});
},
}
);
apiRequest(`/file/get-by-entity?entity_type=2&entity_id=${task.id}`).then(
@ -370,15 +370,15 @@ export const ModalTiсket = ({
if (Array.isArray(res)) {
setTaskFiles(res);
}
},
}
);
if (
localStorage.getItem("role_status") !== "18" &&
Boolean(
!correctProjectUsers.find(
(item) => item.user_id === profileInfo.id_user,
),
(item) => item.user_id === profileInfo.id_user
)
)
) {
setCorrectProjectUsers((prevState) => [
@ -400,7 +400,7 @@ export const ModalTiсket = ({
projectMarks.reduce((acc, cur) => {
if (!tagIds.includes(cur.id)) acc.push(cur);
return acc;
}, []),
}, [])
);
}, [taskTags]);
@ -440,7 +440,7 @@ export const ModalTiсket = ({
function deleteFile(file) {
setTaskFiles((prevValue) =>
prevValue.filter((item) => item.id !== file.id),
prevValue.filter((item) => item.id !== file.id)
);
}
@ -448,7 +448,7 @@ export const ModalTiсket = ({
setTimerId(
setInterval(() => {
run();
}, 1000),
}, 1000)
);
}
@ -485,13 +485,13 @@ export const ModalTiсket = ({
projectUsers.reduce((acc, cur) => {
if (!ids.includes(cur.user_id)) acc.push(cur);
return acc;
}, []),
}, [])
);
}, [members]);
function copyTicketLink() {
navigator.clipboard.writeText(
`https://itguild.info/tracker/task/${task.id}`,
`https://itguild.info/tracker/task/${task.id}`
);
showNotification({
show: true,
@ -558,7 +558,7 @@ export const ModalTiсket = ({
(div) =>
div.classList &&
(div.classList.contains("button-add-worker") ||
div.classList.contains("dropdownList")),
div.classList.contains("dropdownList"))
)
) {
setDropListOpen(false);
@ -571,7 +571,7 @@ export const ModalTiсket = ({
(div) =>
div.classList &&
(div.classList.contains("deadLine") ||
div.classList.contains("react-datepicker-popper")),
div.classList.contains("react-datepicker-popper"))
)
) {
setDatePickerOpen(false);
@ -583,7 +583,7 @@ export const ModalTiсket = ({
(div) =>
div.classList &&
(div.classList.contains("tags") ||
div.classList.contains("tags__dropDown")),
div.classList.contains("tags__dropDown"))
)
) {
setSelectTagsOpen(false);

View File

@ -128,7 +128,7 @@ export const TicketFullScreen = () => {
setDeadLine(taskInfo.dead_line);
setTaskPriority(taskInfo.execution_priority);
setStartDate(
taskInfo.dead_line ? new Date(taskInfo.dead_line) : new Date(),
taskInfo.dead_line ? new Date(taskInfo.dead_line) : new Date()
);
setInputsValue({
title: taskInfo.title,
@ -137,7 +137,7 @@ export const TicketFullScreen = () => {
});
setTaskTags(taskInfo.mark);
apiRequest(
`/comment/get-by-entity?entity_type=2&entity_id=${taskInfo.id}`,
`/comment/get-by-entity?entity_type=2&entity_id=${taskInfo.id}`
).then((res) => {
const comments = res.reduce((acc, cur) => {
if (!cur.parent_id) {
@ -152,14 +152,14 @@ export const TicketFullScreen = () => {
setComments(comments);
});
apiRequest(
`/file/get-by-entity?entity_type=2&entity_id=${taskInfo.id}`,
`/file/get-by-entity?entity_type=2&entity_id=${taskInfo.id}`
).then((res) => {
if (Array.isArray(res)) {
setTaskFiles(res);
}
});
apiRequest(
`/timer/get-by-entity?entity_type=2&entity_id=${taskInfo.id}`,
`/timer/get-by-entity?entity_type=2&entity_id=${taskInfo.id}`
).then((res) => {
let timerSeconds = 0;
res.length &&
@ -181,13 +181,13 @@ export const TicketFullScreen = () => {
});
});
apiRequest(
`/project/get-project?project_id=${taskInfo.project_id}&expand=columns,mark`,
`/project/get-project?project_id=${taskInfo.project_id}&expand=columns,mark`
).then((res) => {
setProjectInfo(res);
setCorrectProjectUsers(res.projectUsers);
});
setLoader(boardLoader);
},
}
);
}, []);
@ -198,7 +198,7 @@ export const TicketFullScreen = () => {
projectInfo.mark.reduce((acc, cur) => {
if (!tagIds.includes(cur.id)) acc.push(cur);
return acc;
}, []),
}, [])
);
}
}, [taskTags, projectInfo]);
@ -306,7 +306,7 @@ export const TicketFullScreen = () => {
function commentDelete(comment) {
setComments((prevValue) =>
prevValue.filter((item) => item.id !== comment.id),
prevValue.filter((item) => item.id !== comment.id)
);
if (comment.subComments.length) {
comment.subComments.forEach((subComment) => {
@ -336,7 +336,7 @@ export const TicketFullScreen = () => {
deleteSubComment.forEach((comment, index) => {
if (comment.id === subComment.parent_id) {
deleteSubComment[index].subComments = comment.subComments.filter(
(item) => item.id !== subComment.id,
(item) => item.id !== subComment.id
);
}
});
@ -349,7 +349,7 @@ export const TicketFullScreen = () => {
function copyTicketLink() {
navigator.clipboard.writeText(
`https://itguild.info/tracker/task/${taskInfo.id}`,
`https://itguild.info/tracker/task/${taskInfo.id}`
);
}
@ -357,7 +357,7 @@ export const TicketFullScreen = () => {
setTimerId(
setInterval(() => {
run();
}, 1000),
}, 1000)
);
}
@ -368,7 +368,7 @@ export const TicketFullScreen = () => {
projectInfo.projectUsers.reduce((acc, cur) => {
if (!ids.includes(cur.user_id)) acc.push(cur);
return acc;
}, []),
}, [])
);
}
}, [taskInfo.taskUsers, projectInfo]);
@ -444,7 +444,7 @@ export const TicketFullScreen = () => {
setTaskInfo((prevState) => ({
...prevState,
taskUsers: taskInfo.taskUsers.filter(
(item) => item.user_id !== person.user_id,
(item) => item.user_id !== person.user_id
),
}));
});
@ -538,7 +538,7 @@ export const TicketFullScreen = () => {
function deleteFile(file) {
setTaskFiles((prevValue) =>
prevValue.filter((item) => item.id !== file.id),
prevValue.filter((item) => item.id !== file.id)
);
}
@ -586,7 +586,7 @@ export const TicketFullScreen = () => {
(div) =>
div.classList &&
(div.classList.contains("button-add-worker") ||
div.classList.contains("dropdownList")),
div.classList.contains("dropdownList"))
)
) {
setDropListOpen(false);
@ -599,7 +599,7 @@ export const TicketFullScreen = () => {
(div) =>
div.classList &&
(div.classList.contains("deadLine") ||
div.classList.contains("react-datepicker-popper")),
div.classList.contains("react-datepicker-popper"))
)
) {
setDatePickerOpen(false);
@ -611,7 +611,7 @@ export const TicketFullScreen = () => {
(div) =>
div.classList &&
(div.classList.contains("tags") ||
div.classList.contains("tags__dropDown")),
div.classList.contains("tags__dropDown"))
)
) {
setSelectTagsOpen(false);
@ -623,7 +623,7 @@ export const TicketFullScreen = () => {
(div) =>
div.classList &&
(div.classList.contains("addPerson") ||
div.classList.contains("persons__list")),
div.classList.contains("persons__list"))
)
) {
setPersonListOpen(false);

View File

@ -71,10 +71,10 @@ export const TrackerModal = ({
const [selectWorkersOpen, setSelectWorkersOpen] = useState(false);
const [selectedWorker, setSelectedWorker] = useState(null);
const [selectColumnPriority, setSelectColumnPriority] = useState(
"Выберите приоритет колонки",
"Выберите приоритет колонки"
);
const [selectedExecutorTask, setSelectedExecutorTask] = useState(
"Выберите исполнителя задачи",
"Выберите исполнителя задачи"
);
const [selectExecutorTaskOpen, setSelectExecutorTaskOpen] = useState(false);
const [correctProjectUsers, setCorrectProjectUsers] = useState([]);
@ -316,7 +316,7 @@ export const TrackerModal = ({
persons.reduce((acc, cur) => {
if (!ids.includes(cur.user_id)) acc.push(cur);
return acc;
}, []),
}, [])
);
})
: "";
@ -324,7 +324,7 @@ export const TrackerModal = ({
localStorage.getItem("role_status") !== "18" &&
projectUsers &&
Boolean(
!projectUsers.find((item) => item.user_id === profileInfo.id_user),
!projectUsers.find((item) => item.user_id === profileInfo.id_user)
)
) {
setCorrectProjectUsers([
@ -350,7 +350,7 @@ export const TrackerModal = ({
projectMarks.reduce((acc, cur) => {
if (!tagIds.includes(cur.id)) acc.push(cur);
return acc;
}, []),
}, [])
);
}
}, [taskTags, projectMarks]);
@ -368,7 +368,7 @@ export const TrackerModal = ({
(div) =>
div.classList &&
(div.classList.contains("tags__selected__name") ||
div.classList.contains("tags__dropDown")),
div.classList.contains("tags__dropDown"))
)
) {
setSelectTagsOpen(false);
@ -380,7 +380,7 @@ export const TrackerModal = ({
(div) =>
div.classList &&
(div.classList.contains("select__executor") ||
div.classList.contains("select__executor__dropDown")),
div.classList.contains("select__executor__dropDown"))
)
) {
setSelectExecutorTaskOpen(false);
@ -555,8 +555,8 @@ export const TrackerModal = ({
onClick={() =>
setTaskTags((prevState) =>
prevState.filter(
(prevTag) => prevTag.id !== tag.id,
),
(prevTag) => prevTag.id !== tag.id
)
)
}
/>

View File

@ -15,7 +15,7 @@ export const Navigation = () => {
const profileInfo = useSelector(getProfileInfo);
const [user] = useState(
localStorage.getItem("role_status") === "18" ? "partner" : "developer",
localStorage.getItem("role_status") === "18" ? "partner" : "developer"
);
const [navInfo] = useState({
@ -79,9 +79,9 @@ export const Navigation = () => {
apiRequest(`/user/me`).then((profileInfo) =>
dispatch(
setProfileInfo(
profileInfo.userCard ? profileInfo.userCard : profileInfo,
),
),
profileInfo.userCard ? profileInfo.userCard : profileInfo
)
)
);
}, [dispatch]);

View File

@ -64,8 +64,8 @@ export const ProfileCalendar = () => {
}
apiRequest(
`/reports/reports-by-date?${requestDates}&user_card_id=${localStorage.getItem(
"cardId",
)}`,
"cardId"
)}`
).then((reports) => {
let spendTime = 0;
for (const report of reports) {

View File

@ -86,7 +86,7 @@ export const ProfileCalendarComponent = React.memo(
for (const date of reports) {
if (
`${new Date(day).getFullYear()}-${correctDay(
new Date(day).getMonth() + 1,
new Date(day).getMonth() + 1
)}-${correctDay(new Date(day).getDate())}` === date.created_at
) {
return `before`;
@ -101,7 +101,7 @@ export const ProfileCalendarComponent = React.memo(
for (const date of reports) {
if (
`${new Date(day).getFullYear()}-${correctDay(
new Date(day).getMonth() + 1,
new Date(day).getMonth() + 1
)}-${correctDay(new Date(day).getDate())}` === date.created_at
) {
return "#";
@ -122,15 +122,15 @@ export const ProfileCalendarComponent = React.memo(
const requestDates =
startDate < endDay
? `fromDate=${getCorrectYYMMDD(
startDate._d,
startDate._d
)}&toDate=${getCorrectYYMMDD(endDay._d)}`
: `fromDate=${getCorrectYYMMDD(endDay._d)}&toDate=${getCorrectYYMMDD(
startDate._d,
startDate._d
)}`;
apiRequest(
`/reports/reports-by-date?${requestDates}&user_card_id=${localStorage.getItem(
"cardId",
)}`,
"cardId"
)}`
).then((reports) => {
let spendTime = 0;
for (const report of reports) {
@ -298,7 +298,7 @@ export const ProfileCalendarComponent = React.memo(
{currentMonthAndDay(day)}
</Link>
</button>
)),
))
)}
</div>
</div>
@ -316,15 +316,15 @@ export const ProfileCalendarComponent = React.memo(
? `${getCorrectDate(startDate)} - ${getCorrectDate(endDate)}`
: `${getCorrectDate(endDate)} - ${getCorrectDate(startDate)}`
: activePeriod
? "Выберите диапазон на календаре"
: "Выбрать диапазон"}
? "Выберите диапазон на календаре"
: "Выбрать диапазон"}
</span>
<span>
{totalRangeHours
? `${totalRangeHours} ${hourOfNum(totalRangeHours)}`
: endDate
? "0 часов"
: ""}
? "0 часов"
: ""}
</span>
{endDate && (
<BaseButton
@ -342,5 +342,5 @@ export const ProfileCalendarComponent = React.memo(
{shortReport && <ShortReport />}
</div>
);
},
}
);

View File

@ -15,7 +15,7 @@ export const ProfileHeader = () => {
const dispatch = useDispatch();
const profileInfo = useSelector(getProfileInfo);
const [user] = useState(
localStorage.getItem("role_status") === "18" ? "partner" : "developer",
localStorage.getItem("role_status") === "18" ? "partner" : "developer"
);
const [isLoggingOut, setIsLoggingOut] = useState(false);
@ -30,8 +30,8 @@ export const ProfileHeader = () => {
apiRequest(`/user/me`).then((profileInfo) => {
dispatch(
setProfileInfo(
profileInfo.userCard ? profileInfo.userCard : profileInfo,
),
profileInfo.userCard ? profileInfo.userCard : profileInfo
)
);
});
}, [dispatch]);

View File

@ -46,7 +46,7 @@ export const ProjectTiket = ({ project, index }) => {
event &&
!path.find(
(div) =>
div.classList && div.classList.contains(`project-${project.id}`),
div.classList && div.classList.contains(`project-${project.id}`)
)
) {
setModalSelect(false);
@ -91,7 +91,7 @@ export const ProjectTiket = ({ project, index }) => {
{project.columns.reduce(
(accumulator, currentValue) =>
accumulator + currentValue.tasks.length,
0,
0
)}
</span>
<img src={avatarProject} alt="#" className="project__avatar" />

View File

@ -43,7 +43,7 @@ const ReportForm = () => {
const [isFetching, setIsFetching] = useState(false);
const [reportSuccess, setReportSuccess] = useState("");
const [startDate, setStartDate] = useState(
reportDate ? new Date(reportDate._d) : new Date(),
reportDate ? new Date(reportDate._d) : new Date()
);
const [datePickerOpen, setDatePickerOpen] = useState(false);
@ -73,7 +73,7 @@ const ReportForm = () => {
(div) =>
div.classList &&
(div.classList.contains("report-form__block-img") ||
div.classList.contains("react-datepicker-popper")),
div.classList.contains("react-datepicker-popper"))
)
) {
setDatePickerOpen(false);
@ -210,7 +210,7 @@ const ReportForm = () => {
task: e.target.value,
}
: input;
}),
})
)
}
/>
@ -236,7 +236,7 @@ const ReportForm = () => {
hours_spent: Number(e.target.value),
}
: input;
}),
})
)
}
/>

View File

@ -40,8 +40,8 @@ export const ShortReport = () => {
setTotalHours(0);
apiRequest(
`reports/find-by-date?user_card_id=${localStorage.getItem(
"cardId",
)}&date=${day}`,
"cardId"
)}&date=${day}`
).then((res) => {
let spendTime = 0;
for (const item of res) {

View File

@ -28,7 +28,7 @@ export const TrackerSelectColumn = ({ columns, task, currentColumn }) => {
moveProjectTask({
startWrapperIndex: { index: currentColumn.id, task },
columnId: column.id,
}),
})
);
}}
>

View File

@ -14,7 +14,7 @@ export const Results = () => {
useEffect(() => {
dispatch(fetchResultTest(test.uuid));
apiRequest(
`/user-questionnaire/get-points-number?user_questionnaire_uuid=${test.uuid}`,
`/user-questionnaire/get-points-number?user_questionnaire_uuid=${test.uuid}`
).then((res) => setMaxScore(res.sum_point));
}, [apiRequest, dispatch, test]);

View File

@ -40,7 +40,7 @@ export const TaskQuiz = () => {
(response) => {
dispatch(fetchGetAnswers(response[0].id));
setStripValue(((+index + 1) * 100) / response.length);
},
}
);
}, [dispatch]);

View File

@ -9,5 +9,5 @@ import { store } from "./store/store";
ReactDOM.createRoot(document.getElementById("root")).render(
<Provider store={store}>
<App />
</Provider>,
</Provider>
);

View File

@ -43,7 +43,7 @@ const Home = () => {
const tempTags = values.map((value, index) =>
value.map((val) => {
return { id: val.id, value: val.tags, name: keys[index] };
}),
})
);
dispatch(tags(tempTags));
});

View File

@ -40,11 +40,11 @@ export const PartnerAddRequest = () => {
const [editRequest, setEditRequest] = useState(false);
const [selectedSkills, setSelectedSkills] = useState([]);
const [selectedSpecialization, setSelectedSpecialization] = useState(
"Выберите специализацию",
"Выберите специализацию"
);
const [selectedLevel, setSelectedLevel] = useState("Выберите уровень");
const [selectedCount, setSelectedCount] = useState(
"Выберите кол-во сотрудников",
"Выберите кол-во сотрудников"
);
const [inputs, setInputs] = useState({ title: "", description: "" });
@ -57,7 +57,7 @@ export const PartnerAddRequest = () => {
useEffect(() => {
apiRequest(`/profile/positions-list`).then((el) =>
setSpecializationList(el),
setSpecializationList(el)
);
apiRequest(`/profile/level-list`).then((el) => setLevelList(el));
apiRequest(`/skills/get-skills-list`).then((el) => {
@ -247,7 +247,7 @@ export const PartnerAddRequest = () => {
setSelectedSkills(
selectedSkills.filter((skill, indexSkill) => {
return indexSkill !== index;
}),
})
);
}}
/>
@ -263,7 +263,7 @@ export const PartnerAddRequest = () => {
return skill.name
.toLowerCase()
.includes(e.target.value.toLowerCase());
}),
})
);
}}
/>
@ -282,12 +282,12 @@ export const PartnerAddRequest = () => {
setFilteredSkills(
filteredSkills.filter((skill, skillIndex) => {
return skillIndex !== index;
}),
})
);
setSkills(
skills.filter((initSkill) => {
return initSkill.id !== skill.id;
}),
})
);
setOpenSkillsSelect(false);
}}

View File

@ -140,8 +140,8 @@ export const PartnerBid = () => {
partnerRequests[
partnerRequests.findIndex((el) => el.id === requestId) -
1
].id,
),
].id
)
);
}}
>
@ -162,8 +162,8 @@ export const PartnerBid = () => {
partnerRequests[
partnerRequests.findIndex((el) => el.id === requestId) +
1
].id,
),
].id
)
);
}}
>

View File

@ -33,8 +33,8 @@ export const PartnerRequests = () => {
useEffect(() => {
apiRequest(
`/request/get-request-list?user_id=${localStorage.getItem(
"id",
)}&search_depth=3`,
"id"
)}&search_depth=3`
).then((el) => {
setRequests(el);
setLoader(false);

View File

@ -23,7 +23,7 @@ import "./profile.scss";
export const Profile = () => {
const profileInfo = useSelector(getProfileInfo);
const [user] = useState(
localStorage.getItem("role_status") === "18" ? "partner" : "developer",
localStorage.getItem("role_status") === "18" ? "partner" : "developer"
);
const [profileItemsInfo] = useState({
developer: [

View File

@ -169,7 +169,7 @@ export const ProjectTracker = () => {
startTask: startWrapperIndexTest.current.task,
finishTask: task,
finishIndex: finishTask,
}),
})
);
}
@ -207,7 +207,7 @@ export const ProjectTracker = () => {
moveProjectTask({
startWrapperIndex: startWrapperIndexTest.current,
columnId,
}),
})
);
}
}
@ -382,7 +382,7 @@ export const ProjectTracker = () => {
(div) =>
div.classList &&
(div.classList.contains("addPerson") ||
div.classList.contains("persons__list")),
div.classList.contains("persons__list"))
)
) {
setPersonListOpen(false);
@ -394,7 +394,7 @@ export const ProjectTracker = () => {
(div) =>
div.classList &&
(div.classList.contains("tasks__head__executor") ||
div.classList.contains("tasks__head__executorDropdown")),
div.classList.contains("tasks__head__executorDropdown"))
)
) {
setSelectedExecutorOpen(false);
@ -406,7 +406,7 @@ export const ProjectTracker = () => {
(div) =>
div.classList &&
(div.classList.contains("tasks__head__tags") ||
div.classList.contains("tags__list")),
div.classList.contains("tags__list"))
)
) {
setTags({
@ -427,7 +427,7 @@ export const ProjectTracker = () => {
(div) =>
div.classList &&
(div.classList.contains("board__head__more") ||
div.classList.contains("column__select")),
div.classList.contains("column__select"))
)
) {
setOpenColumnSelect((prevState) => {
@ -577,7 +577,7 @@ export const ProjectTracker = () => {
<span>{projectBoard.projectUsers?.length}</span>
{caseOfNum(
projectBoard.projectUsers?.length,
"persons",
"persons"
)}
</div>
<div className="persons__list__info">
@ -880,7 +880,7 @@ export const ProjectTracker = () => {
column.id,
projectBoard?.columns && column.tasks.length
? column.tasks[0].priority - 1
: 1,
: 1
);
}}
>
@ -959,7 +959,7 @@ export const ProjectTracker = () => {
onClick={() => {
if (window.innerWidth < 985) {
window.location.replace(
`/tracker/task/${task.id}`,
`/tracker/task/${task.id}`
);
}
}}
@ -1037,7 +1037,7 @@ export const ProjectTracker = () => {
{task.comment_count}{" "}
{caseOfNum(
task.comment_count,
"comments",
"comments"
)}
</span>
</div>
@ -1051,7 +1051,7 @@ export const ProjectTracker = () => {
</div>
<TrackerSelectColumn
columns={projectBoard.columns.filter(
(item) => item.id !== column.id,
(item) => item.id !== column.id
)}
currentColumn={column}
task={task}

View File

@ -17,6 +17,8 @@ import { ProfileHeader } from "@components/ProfileHeader/ProfileHeader";
import rightArrow from "assets/icons/arrows/arrowRight.svg";
import arrow from "assets/icons/arrows/left-arrow.png";
import arrowDown from "assets/icons/arrows/selectArrow.png";
import deleteIcon from "assets/icons/closeProjectPersons.svg";
import gitImgItem from "assets/icons/gitItemImg.svg";
import avatarMok from "assets/images/avatarMok.png";
@ -30,18 +32,40 @@ export const Summary = () => {
const [openGit, setOpenGit] = useState(false);
const [gitInfo, setGitInfo] = useState([]);
const [editSummeryOpen, setEditSummeryOpen] = useState(false);
const [editSkills, setEditSkills] = useState(false);
const [summery, setSummery] = useState("");
const [selectedSkills, setSelectedSkills] = useState([]);
const [selectSkillsOpen, setSelectSkillsOpen] = useState(false);
const [skillsList, seSkillsList] = useState([]);
useEffect(() => {
apiRequest(
`/profile/portfolio-projects?card_id=${localStorage.getItem("cardId")}`,
`/profile/portfolio-projects?card_id=${localStorage.getItem("cardId")}`
).then((responseGit) => setGitInfo(responseGit));
}, []);
useEffect(() => {
setSummery(profileInfo.vc_text);
setSelectedSkills(profileInfo.skillValues);
}, [profileInfo]);
useEffect(() => {
apiRequest(`/skills/get-skills-list`).then((el) => {
seSkillsList(el);
});
}, []);
function setSkills() {
apiRequest("/resume/edit-skills", {
method: "PUT",
data: {
UserCard: {
skill: selectedSkills.map((item) => item.skill_id),
},
},
}).then(() => {});
}
function editSummery() {
apiRequest("/resume/edit-text", {
method: "PUT",
@ -98,18 +122,84 @@ export const Summary = () => {
<div className="summary__skills skills__section">
<div className="summary__sections__head">
<h3>Основной стек</h3>
<button>Редактировать</button>
<button
className={editSkills ? "edit" : ""}
onClick={() => {
if (editSkills) {
setSkills();
}
setEditSkills(!editSkills);
}}
>
{editSkills ? "Сохранить" : "Редактировать"}
</button>
</div>
<div className="skills__section__items">
<div className="skills__section__items__wrapper">
{profileInfo.skillValues &&
profileInfo.skillValues.map((skill, index) => (
<span key={skill.id} className="skill_item">
{skill.skill.name}
{profileInfo.skillValues.length > index + 1 && ","}
</span>
))}
</div>
{editSkills ? (
<div className="editSkills">
{selectedSkills &&
selectedSkills.map((skill) => {
return (
<span key={skill.skill_id}>
{skill.skill.name}
<img
src={deleteIcon}
alt="deleteIcon"
onClick={() =>
setSelectedSkills((prevValue) =>
prevValue.filter(
(item) => item.skill_id !== skill.skill_id
)
)
}
/>
</span>
);
})}
<div className="selectSkills">
<div
className="selectSkills__name"
onClick={() => setSelectSkillsOpen(!selectSkillsOpen)}
>
Выберите скилл
<img
className={selectSkillsOpen ? "open" : ""}
src={arrowDown}
/>
</div>
{selectSkillsOpen && (
<div className="selectSkills__dropDown">
{skillsList.map((skill) => {
return (
<p
onClick={() =>
setSelectedSkills((prevValue) => [
...prevValue,
{ skill: skill, skill_id: skill.id },
])
}
key={skill.id}
className="selectSkills__item"
>
{skill.name}
</p>
);
})}
</div>
)}
</div>
</div>
) : (
<div className="skills__section__items__wrapper">
{selectedSkills &&
selectedSkills.map((skill, index) => (
<span key={skill.id} className="skill_item">
{skill.skill.name}
{selectedSkills.length > index + 1 && ","}
</span>
))}
</div>
)}
</div>
</div>
)}

View File

@ -250,6 +250,89 @@
}
}
}
.editSkills {
display: flex;
flex-wrap: wrap;
gap: 14px;
align-items: center;
span {
display: flex;
column-gap: 8px;
background-color: #f5f5f5;
border-radius: 15px;
padding: 3px 10px 3px 10px;
font-weight: 700;
font-size: 16px;
line-height: 32px;
white-space: nowrap;
text-transform: uppercase;
img {
cursor: pointer;
}
}
.selectSkills {
position: relative;
display: flex;
flex-direction: column;
font-weight: 700;
font-size: 16px;
&__name {
display: flex;
column-gap: 12px;
align-items: center;
cursor: pointer;
background-color: #f5f5f5;
border-radius: 15px;
padding: 3px 10px 3px 10px;
img {
transition: all 0.3s ease;
}
.open {
transform: rotate(180deg);
}
}
&__dropDown {
position: absolute;
background-color: white;
border-radius: 12px;
max-height: 300px;
overflow-y: auto;
display: flex;
flex-direction: column;
row-gap: 5px;
align-items: center;
padding: 7px;
top: 35px;
&::-webkit-scrollbar {
width: 3px;
border-radius: 10px;
}
&::-webkit-scrollbar-thumb {
background: #cbd9f9;
border-radius: 20px;
}
&::-webkit-scrollbar-track {
background: #c5c0c6;
border-radius: 20px;
}
p {
cursor: pointer;
}
}
}
}
}
&__experience {

View File

@ -57,8 +57,8 @@ export const Tracker = () => {
setLoader(true);
apiRequest(
`/project/project-list?user_id=${localStorage.getItem(
"id",
)}&expand=columns`,
"id"
)}&expand=columns`
).then((el) => {
dispatch(setAllProjects(el.projects));
setLoader(false);
@ -74,9 +74,7 @@ export const Tracker = () => {
// }, []))
});
apiRequest(
`/task/get-user-tasks?user_id=${localStorage.getItem(
"id",
)}&expand=timers`,
`/task/get-user-tasks?user_id=${localStorage.getItem("id")}&expand=timers`
).then((el) => {
const allTasks = el ? el.filter((item) => item.status !== 0) : [];
const completedTasks = el ? el.filter((item) => item.status === 0) : [];
@ -105,7 +103,7 @@ export const Tracker = () => {
) {
return item;
}
}),
})
);
}
@ -123,7 +121,7 @@ export const Tracker = () => {
) {
return item;
}
}),
})
);
}
@ -207,7 +205,7 @@ export const Tracker = () => {
{typeof projects === "object" &&
(!Boolean(projects.length) ||
!Boolean(
projects.filter((project) => project.status !== 10).length,
projects.filter((project) => project.status !== 10).length
)) &&
!loader && (
<div className="no-projects">
@ -473,7 +471,7 @@ export const Tracker = () => {
? "-"
: task.timers.map((item) => {
let time = new Date(
item.deltaSeconds * 1000,
item.deltaSeconds * 1000
)
.toISOString()
.slice(11, 19);
@ -509,13 +507,13 @@ export const Tracker = () => {
${caseOfNum(
projects.filter((project) => project.status === 10)
.length,
"projects",
"projects"
)}`}
</p>
</div>
<div className="archive__tasksWrapper">
{Boolean(
projects.filter((project) => project.status === 10).length,
projects.filter((project) => project.status === 10).length
) ? (
projects.map((project, index) => {
return project.status === 10 ? (

View File

@ -42,8 +42,8 @@ export const ViewReport = () => {
setTomorrowTask([]);
apiRequest(
`reports/find-by-date?user_card_id=${localStorage.getItem(
"cardId",
)}&date=${day}`,
"cardId"
)}&date=${day}`
).then((res) => {
let spendTime = 0;
for (const item of res) {

View File

@ -103,7 +103,7 @@ export const QuizPage = () => {
useEffect(() => {
apiRequest(
`/user-questionnaire/questionnaires-list?user_id=${userId}`,
`/user-questionnaire/questionnaires-list?user_id=${userId}`
).then((res) => dispatch(setQuestionnaires(res)));
}, []);

View File

@ -14,7 +14,7 @@ const initialState = {
};
export const setProjectBoardFetch = createAsyncThunk("userInfo", (id) =>
apiRequest(`/project/get-project?project_id=${id}&expand=columns,mark`),
apiRequest(`/project/get-project?project_id=${id}&expand=columns,mark`)
);
export const projectsTrackerSlice = createSlice({
@ -39,12 +39,12 @@ export const projectsTrackerSlice = createSlice({
},
deletePersonOnProject: (state, action) => {
state.projectBoard.projectUsers = state.projectBoard.projectUsers.filter(
(person) => person.user_id !== action.payload,
(person) => person.user_id !== action.payload
);
},
deleteTagProject: (state, action) => {
state.projectBoard.mark = state.projectBoard.mark.filter(
(tag) => tag.id !== action.payload,
(tag) => tag.id !== action.payload
);
},
addPersonToProject: (state, action) => {
@ -74,7 +74,7 @@ export const projectsTrackerSlice = createSlice({
}
if (column.id === action.payload.startWrapperIndex.index) {
state.projectBoard.columns[index].tasks = column.tasks.filter(
(task) => task.id !== action.payload.startWrapperIndex.task.id,
(task) => task.id !== action.payload.startWrapperIndex.task.id
);
}
});
@ -83,7 +83,7 @@ export const projectsTrackerSlice = createSlice({
state.projectBoard.columns.forEach((column, index) => {
if (column.id === action.payload.startTask.column_id) {
state.projectBoard.columns[index].tasks = column.tasks.filter(
(task) => task.id !== action.payload.startTask.id,
(task) => task.id !== action.payload.startTask.id
);
}
if (column.id === action.payload.finishTask.column_id) {
@ -119,21 +119,21 @@ export const projectsTrackerSlice = createSlice({
filterCreatedByMe: (state, action) => {
state.projectBoard.columns.forEach((column) => {
column.tasks = column.tasks.filter(
(task) => task.user_id === action.payload,
(task) => task.user_id === action.payload
);
});
},
filteredParticipateTasks: (state, action) => {
state.projectBoard.columns.forEach((column) => {
column.tasks = column.tasks.filter((task) =>
task.taskUsers.some((person) => person.user_id === action.payload),
task.taskUsers.some((person) => person.user_id === action.payload)
);
});
},
filteredExecutorTasks: (state, action) => {
state.projectBoard.columns.forEach((column) => {
column.tasks = column.tasks.filter(
(task) => task.executor_id === action.payload,
(task) => task.executor_id === action.payload
);
});
},

View File

@ -76,7 +76,7 @@ const initialState = {
userInfo: null,
};
export const setUserInfo = createAsyncThunk("userInfo", (id) =>
apiRequest(`/profile/get-main-data?user_id=${id}`),
apiRequest(`/profile/get-main-data?user_id=${id}`)
);
export const fetchUserAnswersMany = createAsyncThunk(
@ -85,7 +85,7 @@ export const fetchUserAnswersMany = createAsyncThunk(
apiRequest("/user-response/set-responses", {
method: "POST",
data: { userResponses: checkedValues },
}),
})
);
export const fetchUserAnswerOne = createAsyncThunk(
@ -94,17 +94,17 @@ export const fetchUserAnswerOne = createAsyncThunk(
apiRequest("/user-response/set-response", {
method: "POST",
data: checkedValues[0],
}),
})
);
export const fetchGetAnswers = createAsyncThunk("answers", (question_id) =>
apiRequest(`/answer/get-answers?question_id=${question_id}`),
apiRequest(`/answer/get-answers?question_id=${question_id}`)
);
export const fetchResultTest = createAsyncThunk("result", (uuid) =>
apiRequest(
`/user-questionnaire/questionnaire-completed?user_questionnaire_uuid=${uuid}`,
),
`/user-questionnaire/questionnaire-completed?user_questionnaire_uuid=${uuid}`
)
);
export const quizSlice = createSlice({

View File

@ -89,6 +89,6 @@ export function caseOfNum(number, type) {
export function copyProjectLink(projectId) {
navigator.clipboard.writeText(
`https://itguild.info/tracker/project/${projectId}`,
`https://itguild.info/tracker/project/${projectId}`
);
}