select priority column, project persons avatars, copy links on button, executor on task

This commit is contained in:
Николай Полтщук 2023-06-27 17:14:22 +03:00
parent e24a08210a
commit 836d16691a
5 changed files with 75 additions and 34 deletions

View File

@ -335,7 +335,9 @@ export const ModalTiсket = ({
}, [members]); }, [members]);
function copyProjectLink() { function copyProjectLink() {
navigator.clipboard.writeText(`https://itguild.info/tracker/project/${projectId}`) navigator.clipboard.writeText(
`https://itguild.info/tracker/project/${projectId}`
);
} }
return ( return (

View File

@ -211,7 +211,9 @@ export const TicketFullScreen = () => {
}; };
function copyTicketLink() { function copyTicketLink() {
navigator.clipboard.writeText(`https://itguild.info/tracker/task/${taskInfo.id}`) navigator.clipboard.writeText(
`https://itguild.info/tracker/task/${taskInfo.id}`
);
} }
return ( return (

View File

@ -51,8 +51,11 @@ 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 [selectColumnPriority, setSelectColumnPriority] = useState(
const [selectColumnPriorityOpen, setSelectColumnPriorityOpen] = useState(false) "Выберите приоритет колонки"
);
const [selectColumnPriorityOpen, setSelectColumnPriorityOpen] =
useState(false);
function createTab() { function createTab() {
if (!valueColumn) { if (!valueColumn) {
@ -386,19 +389,31 @@ export const TrackerModal = ({
/> />
</div> </div>
<h4>Приоритет колонки</h4> <h4>Приоритет колонки</h4>
<div className='select-priority' onClick={() => setSelectColumnPriorityOpen(!selectColumnPriorityOpen)}> <div
className="select-priority"
onClick={() =>
setSelectColumnPriorityOpen(!selectColumnPriorityOpen)
}
>
<span>{selectColumnPriority}</span> <span>{selectColumnPriority}</span>
<img src={arrowDown} alt='arrow' /> <img src={arrowDown} alt="arrow" />
{selectColumnPriorityOpen && {selectColumnPriorityOpen && (
<div className='select-priority__dropDown'> <div className="select-priority__dropDown">
{projectBoard.columns.map((column, index) => { {projectBoard.columns.map((column, index) => {
return <span key={column.id} onClick={() => { return (
setSelectColumnPriority(index + 1) <span
dispatch(setColumnPriority(index + 1)) key={column.id}
}}>{index + 1}</span> onClick={() => {
setSelectColumnPriority(index + 1);
dispatch(setColumnPriority(index + 1));
}}
>
{index + 1}
</span>
);
})} })}
</div> </div>
} )}
</div> </div>
{/*<div className="input-container">*/} {/*<div className="input-container">*/}
{/* <input*/} {/* <input*/}

View File

@ -53,7 +53,9 @@ export const ProjectTiket = ({ project, index }) => {
} }
function copyProjectLink() { function copyProjectLink() {
navigator.clipboard.writeText(`https://itguild.info/tracker/project/${project.id}`) navigator.clipboard.writeText(
`https://itguild.info/tracker/project/${project.id}`
);
} }
return ( return (

View File

@ -324,12 +324,26 @@ export const ProjectTracker = () => {
<span className="countPersons"> <span className="countPersons">
{projectBoard.projectUsers?.length} {projectBoard.projectUsers?.length}
</span> </span>
<div className='projectPersons'> <div className="projectPersons">
{projectBoard.projectUsers?.length && {projectBoard.projectUsers?.length &&
projectBoard.projectUsers.slice(0, projectBoard.length > 3 ? 3 : projectBoard.length).map((person) => { projectBoard.projectUsers
return <img key={person.user_id} src={person.user?.avatar ? urlForLocal(person.user.avatar) : avatarMok} alt='avatar' /> .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> </div>
<span <span
className="addPerson" className="addPerson"
@ -524,15 +538,21 @@ export const ProjectTracker = () => {
className="tasks__board__item__description" className="tasks__board__item__description"
></p> ></p>
<div className="tasks__board__item__executor"> <div className="tasks__board__item__executor">
<span>{task.executor?.fio ? task.executor?.fio : 'Исполнитель не назначен'}</span> <span>
{task.executor?.avatar && {task.executor?.fio
? task.executor?.fio
: "Исполнитель не назначен"}
</span>
{task.executor?.avatar && (
<img <img
src={ src={
task.executor?.avatar ? urlForLocal(task.executor?.avatar) : avatarMok task.executor?.avatar
? urlForLocal(task.executor?.avatar)
: avatarMok
} }
alt="avatar" alt="avatar"
/> />
} )}
</div> </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">