Merge pull request #108 from apuc/select-priority-column

select priority column, project persons avatars, copy links on button…
This commit is contained in:
NikoM1k 2023-06-27 17:16:47 +03:00 committed by GitHub
commit 6ec8be4ecd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
7 changed files with 315 additions and 200 deletions

View File

@ -334,6 +334,10 @@ export const ModalTiсket = ({
); );
}, [members]); }, [members]);
function copyProjectLink () {
navigator.clipboard.writeText(`https://itguild.info/tracker/project/${projectId}`)
}
return ( return (
<div <div
className={active ? "modal-tiket active" : "modal-tiket"} className={active ? "modal-tiket active" : "modal-tiket"}
@ -614,7 +618,7 @@ export const ModalTiсket = ({
</div> </div>
<div> <div>
<img src={link}></img> <img src={link}></img>
<p>ссылка на проект</p> <p onClick={copyProjectLink}>ссылка на проект</p>
</div> </div>
<div onClick={deleteTask}> <div onClick={deleteTask}>
<img src={archive}></img> <img src={archive}></img>

View File

@ -210,6 +210,10 @@ export const TicketFullScreen = () => {
dispatch(setToggleTab(index)); dispatch(setToggleTab(index));
}; };
function copyTicketLink () {
navigator.clipboard.writeText(`https://itguild.info/tracker/task/${taskInfo.id}`)
}
return ( return (
<section className="ticket-full-screen"> <section className="ticket-full-screen">
<ProfileHeader /> <ProfileHeader />
@ -510,7 +514,7 @@ export const TicketFullScreen = () => {
</div> </div>
<div> <div>
<img src={link} alt="link"></img> <img src={link} alt="link"></img>
<p>ссылка на проект</p> <p onClick={copyTicketLink}>ссылка на задачу</p>
</div> </div>
<div> <div>
<img src={archive2} alt="arch"></img> <img src={archive2} alt="arch"></img>

View File

@ -21,6 +21,7 @@ import { urlForLocal } from "@utils/helper";
import { apiRequest } from "@api/request"; import { apiRequest } from "@api/request";
import BaseButton from "@components/Common/BaseButton/BaseButton"; import BaseButton from "@components/Common/BaseButton/BaseButton";
import ModalLayout from "@components/Common/ModalLayout/ModalLayout";
import arrowDown from "assets/icons/arrows/selectArrow.png"; import arrowDown from "assets/icons/arrows/selectArrow.png";
@ -50,6 +51,8 @@ export const TrackerModal = ({
const [workers, setWorkers] = useState([]); const [workers, setWorkers] = useState([]);
const [selectWorkersOpen, setSelectWorkersOpen] = useState(false); const [selectWorkersOpen, setSelectWorkersOpen] = useState(false);
const [selectedWorker, setSelectedWorker] = useState(null); const [selectedWorker, setSelectedWorker] = useState(null);
const [selectColumnPriority, setSelectColumnPriority] = useState('Выберите приоритет колонки')
const [selectColumnPriorityOpen, setSelectColumnPriorityOpen] = useState(false)
function createTab() { function createTab() {
if (!valueColumn) { if (!valueColumn) {
@ -211,14 +214,13 @@ export const TrackerModal = ({
}, [active]); }, [active]);
return ( return (
<div <ModalLayout
className={active ? "modal-add active" : "modal-add"} active={active}
onClick={() => { setActive={setActive}
setActive(false); // onClick={() => {
setSelectWorkersOpen(false); // setSelectWorkersOpen(false);
}} // }}
> >
<div className="modal-add__content" onClick={(e) => e.stopPropagation()}>
{modalType === "addWorker" && ( {modalType === "addWorker" && (
<div> <div>
<div className="title-project"> <div className="title-project">
@ -350,10 +352,7 @@ export const TrackerModal = ({
<textarea className="title-project__textarea"></textarea> <textarea className="title-project__textarea"></textarea>
</div> </div>
</div> </div>
<BaseButton <BaseButton styles={"button-add"} onClick={(e) => e.preventDefault()}>
styles={"button-add"}
onClick={(e) => e.preventDefault()}
>
Добавить Добавить
</BaseButton> </BaseButton>
</div> </div>
@ -387,16 +386,30 @@ export const TrackerModal = ({
/> />
</div> </div>
<h4>Приоритет колонки</h4> <h4>Приоритет колонки</h4>
<div className="input-container"> <div className='select-priority' onClick={() => setSelectColumnPriorityOpen(!selectColumnPriorityOpen)}>
<input <span>{selectColumnPriority}</span>
className="name-project" <img src={arrowDown} alt='arrow' />
placeholder="Приоритет колонки" {selectColumnPriorityOpen &&
type="number" <div className='select-priority__dropDown'>
step="1" {projectBoard.columns.map((column, index) => {
value={columnPriority} return <span key={column.id} onClick={() => {
onChange={(e) => dispatch(setColumnPriority(e.target.value))} setSelectColumnPriority(index + 1)
/> dispatch(setColumnPriority(index + 1))
}}>{index + 1}</span>
})}
</div> </div>
}
</div>
{/*<div className="input-container">*/}
{/* <input*/}
{/* className="name-project"*/}
{/* placeholder="Приоритет колонки"*/}
{/* type="number"*/}
{/* step="1"*/}
{/* value={columnPriority}*/}
{/* onChange={(e) => dispatch(setColumnPriority(e.target.value))}*/}
{/* />*/}
{/*</div>*/}
</div> </div>
<BaseButton styles={"button-add"} onClick={changeColumnParams}> <BaseButton styles={"button-add"} onClick={changeColumnParams}>
Сохранить Сохранить
@ -405,8 +418,7 @@ export const TrackerModal = ({
)} )}
<span className="exit" onClick={() => setActive(false)}></span> <span className="exit" onClick={() => setActive(false)}></span>
</div> </ModalLayout>
</div>
); );
}; };

View File

@ -32,6 +32,44 @@
flex-direction: column; flex-direction: column;
margin: 0 0 15px 0; margin: 0 0 15px 0;
.select-priority {
background-color: white;
width: 100%;
margin: 12px 0;
padding: 10px 8px;
border-radius: 8px;
font-size: 14px;
display: flex;
justify-content: space-between;
align-items: center;
cursor: pointer;
position: relative;
img {
width: 15px;
height: 15px;
}
&__dropDown {
position: absolute;
width: 100%;
background: white;
left: 0;
padding: 8px;
top: 50px;
display: flex;
border-radius: 8px;
row-gap: 5px;
flex-direction: column;
span {
&:hover {
font-weight: 700;
}
}
}
}
.input-container { .input-container {
width: 287px; width: 287px;
height: 35px; height: 35px;

View File

@ -52,6 +52,10 @@ export const ProjectTiket = ({ project, index }) => {
}); });
} }
function copyProjectLink () {
navigator.clipboard.writeText(`https://itguild.info/tracker/project/${project.id}`)
}
return ( return (
<div className="project" key={index}> <div className="project" key={index}>
<Link to={`/tracker/project/${project.id}`}>{project.name}</Link> <Link to={`/tracker/project/${project.id}`}>{project.name}</Link>
@ -90,7 +94,7 @@ export const ProjectTiket = ({ project, index }) => {
</div> </div>
<div> <div>
<img src={link}></img> <img src={link}></img>
<p>ссылка на проект</p> <p onClick={copyProjectLink}>ссылка на проект</p>
</div> </div>
<div> <div>
<img src={archiveSet}></img> <img src={archiveSet}></img>

View File

@ -43,6 +43,7 @@ import filesBoard from "assets/icons/filesBoard.svg";
import project from "assets/icons/trackerProject.svg"; import project from "assets/icons/trackerProject.svg";
import tasks from "assets/icons/trackerTasks.svg"; import tasks from "assets/icons/trackerTasks.svg";
import accept from "assets/images/accept.png"; import accept from "assets/images/accept.png";
import avatarMok from "assets/images/avatarMok.png";
export const ProjectTracker = () => { export const ProjectTracker = () => {
const dispatch = useDispatch(); const dispatch = useDispatch();
@ -323,6 +324,13 @@ export const ProjectTracker = () => {
<span className="countPersons"> <span className="countPersons">
{projectBoard.projectUsers?.length} {projectBoard.projectUsers?.length}
</span> </span>
<div className='projectPersons'>
{projectBoard.projectUsers?.length &&
projectBoard.projectUsers.slice(0, projectBoard.length > 3 ? 3 : projectBoard.length).map((person) => {
return <img key={person.user_id} src={person.user?.avatar ? urlForLocal(person.user.avatar) : avatarMok} alt='avatar' />
})
}
</div>
<span <span
className="addPerson" className="addPerson"
onClick={() => { onClick={() => {
@ -515,6 +523,17 @@ export const ProjectTracker = () => {
}} }}
className="tasks__board__item__description" className="tasks__board__item__description"
></p> ></p>
<div className="tasks__board__item__executor">
<span>{task.executor?.fio ? task.executor?.fio : 'Исполнитель не назначен'}</span>
{task.executor?.avatar &&
<img
src={
task.executor?.avatar ? urlForLocal(task.executor?.avatar) : avatarMok
}
alt="avatar"
/>
}
</div>
<div className="tasks__board__item__info"> <div className="tasks__board__item__info">
<div className="tasks__board__item__info__more"> <div className="tasks__board__item__info__more">
<img src={commentsBoard} alt="commentsImg" /> <img src={commentsBoard} alt="commentsImg" />

View File

@ -255,14 +255,27 @@
cursor: pointer; cursor: pointer;
align-items: center; align-items: center;
.projectPersons {
display: flex;
position: relative;
left: -10px;
img { img {
position: relative; position: relative;
display: flex;
width: 32px; width: 32px;
height: 32px; height: 32px;
} }
img:nth-child(1) {
left: -5px;
}
img:nth-child(2) { img:nth-child(2) {
right: 12px; left: -10px;
}
img:nth-child(3) {
left: -15px;
}
} }
span { span {
@ -282,15 +295,14 @@
color: #252c32; color: #252c32;
border: 1px solid #dde2e4; border: 1px solid #dde2e4;
background: white; background: white;
left: -18px; left: -5px;
z-index: 2;
} }
.addPerson { .addPerson {
background: #00c5a8; background: #00c5a8;
color: white; color: white;
font-size: 14px; font-size: 14px;
left: -30px; left: -28px;
z-index: 2; z-index: 2;
} }
@ -586,7 +598,7 @@
} }
&__description { &__description {
margin: 8px 0 15px; margin: 8px 0 4px;
color: #5c6165; color: #5c6165;
font-weight: 400; font-weight: 400;
font-size: 14px; font-size: 14px;
@ -629,6 +641,28 @@
} }
} }
} }
&__executor {
display: flex;
justify-content: space-between;
align-items: center;
margin: 10px 0 15px;
padding-right: 10px;
font-size: 14px;
font-weight: 500;
span {
max-width: 210px;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
img {
width: 25px;
height: 25px;
}
}
} }
.openItems { .openItems {