Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 4 additions & 8 deletions components/todo-list-table.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -83,14 +83,10 @@ const TodoListTableRow = ({ todo, showActions, showDeferredColumn }: TodoListTab
)}

<TableCell>
{showActions ? (
<div className="flex items-center gap-0.5">
<EditTodoButton todo={todo} />
<WatchListButton taskId={todo.id} isInWatchlist={todo.in_watchlist} />
</div>
) : (
<div className="px-2">--</div>
)}
<div className="flex items-center gap-0.5">
{showActions && <EditTodoButton todo={todo} />}
<WatchListButton taskId={todo.id} isInWatchlist={todo.in_watchlist} />
</div>
</TableCell>
</TableRow>
)
Expand Down
18 changes: 7 additions & 11 deletions modules/teams/team-tasks.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import { TodoLabelsList } from '@/components/todo-labels-list'
import { TodoListTableHeader, TodoListTableRowShimmer } from '@/components/todo-list-table'
import { TodoStatusTable } from '@/components/todo-status-table'
import { Table, TableBody, TableCell, TableRow } from '@/components/ui/table'
import { WatchListButton } from '@/components/watchlist-button'
import { useAuth } from '@/hooks/useAuth'
import { DateFormats, DateUtil } from '@/lib/date-util'
import { useQuery } from '@tanstack/react-query'
Expand All @@ -29,12 +30,10 @@ type TodoListTableRowProps = {

const TodoListTableRow = ({ todo, team }: TodoListTableRowProps) => {
const { user } = useAuth()
const isRessignTodoCtaVisible =
const isReassignTodoCtaVisible =
todo.assignee?.user_type === USER_TYPE_ENUM.TEAM && team?.poc_id === user.id
Comment on lines -32 to 34
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed the typo here. Although this is out of the scope of my task. Still fixed it to maintain clean code

const isEditTodoVisible = todo.assignee?.assignee_id === user.id

const isActionsVisible = isRessignTodoCtaVisible || isEditTodoVisible

return (
<TableRow>
<TableCell className="whitespace-nowrap">{todo.title}</TableCell>
Expand All @@ -58,14 +57,11 @@ const TodoListTableRow = ({ todo, team }: TodoListTableRowProps) => {
</TableCell>

<TableCell>
{isActionsVisible ? (
<div className="flex items-center gap-0.5">
{isRessignTodoCtaVisible && <ReassignUser taskId={todo.id} teamId={team.id} />}
{isEditTodoVisible && <EditTodoButton todo={todo} />}
</div>
) : (
<div className="px-2">--</div>
)}
<div className="flex items-center gap-0.5">
{isReassignTodoCtaVisible && <ReassignUser taskId={todo.id} teamId={team.id} />}
{isEditTodoVisible && <EditTodoButton todo={todo} />}
<WatchListButton taskId={todo.id} isInWatchlist={todo.in_watchlist} />
</div>
</TableCell>
</TableRow>
)
Expand Down