Skip to content

Commit

Permalink
Timer::CreatedBy link
Browse files Browse the repository at this point in the history
  • Loading branch information
Fi1osof committed Feb 27, 2021
1 parent 0fa07d9 commit dbc2717
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/pages/Office/Projects/Project/View/Tasks/Task/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ const OfficeProjectPageViewTask: React.FC<OfficeProjectPageViewTaskProps> = ({
info,
activeTimer,
filterByProject,
CreatedBy,
}) => {
const { stopTimerClickHandler, stopTimerLoading } = useActiveTimer()

Expand Down Expand Up @@ -183,6 +184,7 @@ const OfficeProjectPageViewTask: React.FC<OfficeProjectPageViewTaskProps> = ({
projects={projects}
task={childTask}
project={project}
CreatedBy={childTask.CreatedBy}
/>
)
})
Expand All @@ -192,7 +194,7 @@ const OfficeProjectPageViewTask: React.FC<OfficeProjectPageViewTaskProps> = ({
return (
<OfficeProjectPageViewTaskStyled>
<OfficeTaskListItemStyled>
<UikitUserLink user={task.CreatedBy} showName={false} />
<UikitUserLink user={CreatedBy} showName={false} />
{timer}
<div className="task">
<div className="task-info">
Expand Down Expand Up @@ -246,6 +248,7 @@ const OfficeProjectPageViewTask: React.FC<OfficeProjectPageViewTaskProps> = ({
</OfficeProjectPageViewTaskStyled>
)
}, [
CreatedBy,
timer,
task,
projects,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import {
Scalars,
Task_Fragment,
} from 'src/modules/gql/generated'
import { UikitUserLinkProps } from 'src/uikit/Link/User'
import { OfficeProjectPageViewTaskProjectProps } from './Project/interfaces'

export type OfficeProjectPageViewTaskProps = {
Expand All @@ -26,4 +27,11 @@ export type OfficeProjectPageViewTaskProps = {
info?: JSX.Element

activeTimer: MeUserTimerFragment | null | undefined

// TODO сейчас это хак, потому что в этот компонент приходит по сути или Задача или Задача таймера,
// в которой не все сущности имеются. Надо будет переделать компонент
/**
* Владелец объекта
*/
CreatedBy: UikitUserLinkProps['user']
}
3 changes: 3 additions & 0 deletions src/pages/Office/Projects/Project/View/Tasks/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,7 @@ const ProjectTasks: React.FC<ProjectTasksProps> = ({ project }) => {
task={task}
activeTimer={activeTimer}
project={project}
CreatedBy={task.CreatedBy}
/>
)
})}
Expand All @@ -157,6 +158,7 @@ const ProjectTasks: React.FC<ProjectTasksProps> = ({ project }) => {
task={task}
activeTimer={activeTimer}
project={project}
CreatedBy={task.CreatedBy}
/>
)
})}
Expand All @@ -176,6 +178,7 @@ const ProjectTasks: React.FC<ProjectTasksProps> = ({ project }) => {
task={task}
activeTimer={activeTimer}
project={project}
CreatedBy={task.CreatedBy}
/>
)
})}
Expand Down
3 changes: 3 additions & 0 deletions src/pages/Office/Timers/View/Timer/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ import React, { useMemo } from 'react'
import { OfficeTimersTimerProps } from './interfaces'

import moment from 'moment'

// TODO Надо создать самостоятельный компонент, так как возникают коллизии со свойствами объекта
import OfficeProjectPageViewTask from 'src/pages/Office/Projects/Project/View/Tasks/Task'

const OfficeTimersTimer: React.FC<OfficeTimersTimerProps> = ({
Expand Down Expand Up @@ -31,6 +33,7 @@ const OfficeTimersTimer: React.FC<OfficeTimersTimerProps> = ({
activeTimer={!timer.stopedAt ? timer : null}
info={info}
filterByProject={filterByProject}
CreatedBy={timer.CreatedBy}
/>
</>
)
Expand Down

0 comments on commit dbc2717

Please sign in to comment.