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

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

View File

@ -210,8 +210,10 @@ export const TicketFullScreen = () => {
dispatch(setToggleTab(index));
};
function copyTicketLink () {
navigator.clipboard.writeText(`https://itguild.info/tracker/task/${taskInfo.id}`)
function copyTicketLink() {
navigator.clipboard.writeText(
`https://itguild.info/tracker/task/${taskInfo.id}`
);
}
return (

View File

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

View File

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

View File

@ -324,12 +324,26 @@ export const ProjectTracker = () => {
<span className="countPersons">
{projectBoard.projectUsers?.length}
</span>
<div className='projectPersons'>
<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' />
})
}
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
className="addPerson"
@ -524,15 +538,21 @@ export const ProjectTracker = () => {
className="tasks__board__item__description"
></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"
/>
}
<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__more">