remove last word

This commit is contained in:
Victor Batischev 2024-02-28 19:44:12 +03:00
parent 3a0426ae6d
commit ce775e03ab
7 changed files with 24 additions and 20 deletions

View File

@ -67,7 +67,7 @@ const ListEmployees = ({
}
alt="avatar"
/>
<span>{person.user.fio}</span>
<span>{person.user.fio.split(" ").slice(0, -1).join(" ")}</span>
<img
className="delete"
src={close}

View File

@ -826,7 +826,7 @@ export const ModalTiсket = ({
{members.map((member) => {
return (
<div className="worker" key={member.user_id}>
<p>{member.fio}</p>
<p>{member.fio.split(" ").slice(0, -1).join(" ")}</p>
<img
src={
member?.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

@ -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"
@ -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

@ -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

@ -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>

View File

@ -91,3 +91,8 @@ export function copyProjectLink(projectId) {
`https://itguild.info/tracker/project/${projectId}`
);
}
export function removeLast(string) {
let lastIndex = string.lastIndexOf(" ");
return string.substring(0, lastIndex);
}