Compare commits

...

3 Commits

Author SHA1 Message Date
Victor Batischev
59d0f5eae6 remove last 2024-02-28 19:59:56 +03:00
Victor Batischev
57cc2bc1fa test 2024-02-28 19:44:43 +03:00
Victor Batischev
ce775e03ab remove last word 2024-02-28 19:44:12 +03:00
13 changed files with 51 additions and 46 deletions

View File

@ -6,7 +6,7 @@ import {
modalToggle
} from "@redux/projectsTrackerSlice";
import { caseOfNum, urlForLocal } from "@utils/helper";
import { caseOfNum, removeLast, urlForLocal } from "@utils/helper";
import { apiRequest } from "@api/request";
@ -67,7 +67,7 @@ const ListEmployees = ({
}
alt="avatar"
/>
<span>{person.user.fio}</span>
<span>{removeLast(person.user.fio)}</span>
<img
className="delete"
src={close}

View File

@ -11,10 +11,10 @@ import { getProfileInfo } from "@redux/outstaffingSlice";
import { setProjectBoardFetch } from "@redux/projectsTrackerSlice";
import {
backendImg,
caseOfNum,
getCorrectRequestDate,
getToken,
removeLast,
urlForLocal
} from "@utils/helper";
@ -759,12 +759,12 @@ export const ModalTiсket = ({
<div className="workers_box task__info">
<span className="exit" onClick={() => setActive(false)}></span>
<h5>Создатель: </h5>
<p className="workers__creator">{task.user?.fio}</p>
<p className="workers__creator">{removeLast(task.user?.fio)}</p>
{executor ? (
<>
<h5>Исполнитель: </h5>
<div className="executor">
<p>{executor.fio}</p>
<p>{removeLast(executor.fio)}</p>
<img
src={
executor?.avatar
@ -803,7 +803,7 @@ export const ModalTiсket = ({
key={person.user_id}
onClick={() => taskExecutor(person)}
>
<span>{person.user.fio}</span>
<span>{removeLast(person.user.fio)}</span>
<img
src={
person.user?.avatar
@ -826,7 +826,7 @@ export const ModalTiсket = ({
{members.map((member) => {
return (
<div className="worker" key={member.user_id}>
<p>{member.fio}</p>
<p>{removeLast(member.fio)}</p>
<img
src={
member?.avatar
@ -869,7 +869,7 @@ export const ModalTiсket = ({
key={person.user_id}
onClick={() => addMember(person)}
>
<span>{person.user.fio}</span>
<span>{removeLast(person.user.fio)}</span>
<img
src={
person.user?.avatar
@ -895,7 +895,7 @@ export const ModalTiсket = ({
className="dead-line__container"
onClick={() => setDatePickerOpen(!datePickerOpen)}
>
<img src={calendarIcon} alt="calendar" />
<p></p>
<span>
{deadLine ? getCorrectDate(deadLine) : "Срок исполнения"}
</span>

View File

@ -950,7 +950,7 @@ export const TicketFullScreen = () => {
className="dead-line__container"
onClick={() => setDatePickerOpen(!datePickerOpen)}
>
<img src={calendarIcon} alt="calendar" />
<p></p>
<span>
{deadLine
? getCorrectDate(deadLine)

View File

@ -23,7 +23,7 @@ import {
} from "@redux/projectsTrackerSlice";
import { getCorrectDate } from "@utils/calendarHelper";
import { getCorrectRequestDate, urlForLocal } from "@utils/helper";
import { getCorrectRequestDate, removeLast, urlForLocal } from "@utils/helper";
import { apiRequest } from "@api/request";
@ -448,7 +448,7 @@ export const TrackerModal = ({
>
<p>
{selectedWorker
? selectedWorker.employee.fio
? removeLast(selectedWorker.employee.fio)
: "Выберите пользователя"}
</p>
<img className="arrow" src={arrowDown} alt="arrow" />
@ -467,7 +467,7 @@ export const TrackerModal = ({
setSelectedWorker(worker);
}}
>
<span>{worker.employee.fio}</span>
<span>{removeLast(worker.employee.fio)}</span>
<img
src={urlForLocal(worker.employee.avatar)}
alt="avatar"
@ -521,7 +521,6 @@ export const TrackerModal = ({
</div>
<div className="create-task-body">
<div className="create-task-body__left">
<h4>Введите название и описание задачи</h4>
<div className="input-container">
<input
maxLength="100"
@ -699,7 +698,7 @@ export const TrackerModal = ({
}
alt="avatar"
/>
<span>{person.user.fio}</span>
<span>{removeLast(person.user.fio)}</span>
</div>
);
})
@ -710,7 +709,7 @@ export const TrackerModal = ({
)}
</div>
<div className="create-task-body__right__dead-line">
<img src={calendarImg} alt="calendar" />
<p></p>
<p onClick={() => setDatePickerOpen(!datePickerOpen)}>
{deadLineDate
? getCorrectDate(deadLineDate)
@ -734,7 +733,7 @@ export const TrackerModal = ({
<Loader style={"green"} />
) : (
<BaseButton styles={"button-add"} onClick={createTicket}>
Создать
Создать задачу
</BaseButton>
)}
</div>

View File

@ -262,7 +262,7 @@
position: absolute;
width: 100%;
padding: 9.5px 12px;
top: 48px;
top: 45px;
left: 0;
background: white;
border-radius: 5px;
@ -337,7 +337,7 @@
}
.create-task-body {
padding: 15px 20px;
padding: 15px 30px;
display: flex;
column-gap: 20px;
@ -373,8 +373,8 @@
}
.ck-editor__editable.ck-rounded-corners {
min-height: 150px;
max-height: 150px;
min-height: 180px;
max-height: 180px;
}
}
@ -383,6 +383,7 @@
flex-direction: column;
align-items: start;
justify-content: end;
row-gap: 10px;
&__owner {
display: flex;
@ -714,6 +715,11 @@
}
}
}
.button-add {
margin: 0 30px;
align-self: flex-end;
}
}
.name-project {

View File

@ -97,7 +97,7 @@ export const Navigation = () => {
<div className="profile-header__personal-info">
<h3 className="profile-header__personal-info-name">
{profileInfo?.fio ? profileInfo?.fio : profileInfo?.username}
{profileInfo?.fio || profileInfo?.username}
</h3>
<NavLink end to={"/profile"}>
<img

View File

@ -95,7 +95,7 @@ export const ProfileCalendar = () => {
alt="avatar"
/>
<p className="summary__name">
{profileInfo?.fio ? profileInfo?.fio : profileInfo?.username},{" "}
{profileInfo?.fio || profileInfo?.username},{" "}
{profileInfo.specification} разработчик
</p>
</div>

View File

@ -286,15 +286,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

View File

@ -146,7 +146,7 @@ export const ProfileHeader = () => {
<nav className="auth-body__navigation">
<div className="profile-header__personal-info">
<h3 className="profile-header__personal-info-name">
{profileInfo?.fio ? profileInfo?.fio : profileInfo?.username}
{profileInfo?.fio || profileInfo?.username}
</h3>
<NavLink end to={"/profile"}>
<img

View File

@ -103,12 +103,12 @@ export const Profile = () => {
{user === "developer" ? (
<span>
<p>Добрый день,&nbsp;</p>
{profileInfo?.fio ? profileInfo?.fio : profileInfo?.username}
{profileInfo?.fio || profileInfo?.username}
</span>
) : (
<span>
<p>Добрый день,&nbsp;</p>
{profileInfo?.fio ? profileInfo?.fio : profileInfo?.username}
{profileInfo?.fio || profileInfo?.username}
</span>
)}
</h2>
@ -124,13 +124,11 @@ export const Profile = () => {
<p className="summary__name">
{user === "developer" ? (
<span>
{profileInfo?.fio ? profileInfo?.fio : profileInfo?.username},{" "}
{profileInfo?.fio || profileInfo?.username},{" "}
{profileInfo?.specification} разработчик
</span>
) : (
<span>
{profileInfo?.fio ? profileInfo?.fio : profileInfo?.username}
</span>
<span>{profileInfo?.fio || profileInfo?.username}</span>
)}
</p>
</div>

View File

@ -23,8 +23,7 @@ import {
setToggleTab
} from "@redux/projectsTrackerSlice";
import { urlForLocal } from "@utils/helper";
import { caseOfNum } from "@utils/helper";
import { removeLast, urlForLocal } from "@utils/helper";
import { apiRequest } from "@api/request";
@ -44,7 +43,6 @@ import TrackerSelectColumn from "@components/TrackerSelectColumn/TrackerSelectCo
import arrow from "assets/icons/arrows/arrowCalendar.png";
import arrowDown from "assets/icons/arrows/selectArrow.png";
import calendarIcon from "assets/icons/calendar.svg";
import category from "assets/icons/category.svg";
import close from "assets/icons/close.png";
import commentsBoard from "assets/icons/commentsBoard.svg";
@ -64,7 +62,6 @@ export const ProjectTracker = () => {
const dispatch = useDispatch();
const projectId = useParams();
const currentDate = new Date().getFullYear();
const [openColumnSelect, setOpenColumnSelect] = useState({});
const [selectedTab, setSelectedTab] = useState(0);
const [priorityTask, setPriorityTask] = useState(0);
@ -612,7 +609,7 @@ export const ProjectTracker = () => {
key={user.user_id}
onClick={() => executorFilter(user)}
>
<p>{user.user?.fio}</p>
<p>{removeLast(user.user?.fio)}</p>
<img
src={
user.user?.avatar
@ -910,10 +907,7 @@ export const ProjectTracker = () => {
}
}}
>
<p
className="task__board__item__title"
style={{ color: titleColor }}
>
<p className="task__board__item__title">
{task.title}
</p>
</div>
@ -955,7 +949,7 @@ export const ProjectTracker = () => {
{task.dead_line && (
<div className="tasks__board__item__dead-line">
<p></p>
<span>
<span style={{ color: titleColor }}>
{getCorrectDate(task.dead_line)}
</span>
</div>
@ -973,7 +967,7 @@ export const ProjectTracker = () => {
alt="avatar"
/>
<span>
{task.executor?.fio ||
{removeLast(task.executor?.fio) ||
"Исполнитель не назначен"}
</span>
</div>

View File

@ -107,7 +107,7 @@ export const Summary = () => {
alt="avatar"
/>
<p className="summary__name">
{profileInfo?.fio ? profileInfo?.fio : profileInfo?.username},{" "}
{profileInfo?.fio || profileInfo?.username},{" "}
{profileInfo.specification} разработчик
</p>
</div>

View File

@ -91,3 +91,11 @@ export function copyProjectLink(projectId) {
`https://itguild.info/tracker/project/${projectId}`
);
}
export function removeLast(string = " ") {
let arr = string.trim().split(" ");
if (arr.length > 2) {
return arr.slice(0, -1).join(" ");
}
return string;
}