Skip to content

Commit

Permalink
3989 - RowData: show review indicator logic
Browse files Browse the repository at this point in the history
  • Loading branch information
sorja committed Oct 4, 2024
1 parent 9699e46 commit 62e56c9
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import { Topics } from 'meta/messageCenter'

import { useCycle } from 'client/store/assessment'
import { useTopicKeys } from 'client/store/ui/messageCenter/hooks'
import { useCanViewReview } from 'client/store/user/hooks'
import ReviewIndicator from 'client/components/ReviewIndicator'

import { Props } from '../props'
Expand All @@ -29,6 +30,8 @@ const RowData: React.FC<Props> = (props) => {
const id = `${row.props.type}_${row.id}_${row.props.variableName ?? ''}`
const className = classNames({ 'fra-row-comments__open': openTopics.includes(Topics.getDataReviewTopicKey(row)) })

const canViewReview = useCanViewReview(sectionName)

return (
<tr className={className} id={id}>
{colHeader && <CellHeader assessmentName={assessmentName} col={colHeader} row={row} />}
Expand All @@ -47,7 +50,7 @@ const RowData: React.FC<Props> = (props) => {
/>
))}

{!disabled && withReview && (
{canViewReview && withReview && (
<td className="fra-table__review-cell no-print">
<ReviewIndicator
title={colHeader ? Cols.getLabel({ cycle, col: colHeader, t }) : ''}
Expand Down

0 comments on commit 62e56c9

Please sign in to comment.