Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add single project requirement for Review table CSV #2068

Merged
merged 2 commits into from
Sep 4, 2023
Merged
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
10 changes: 10 additions & 0 deletions src/pages/Review/TasksReview/Messages.js
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,16 @@ export default defineMessages({
defaultMessage: "Export Review Table CSV"
},

requiredForExport: {
id: "Review.TaskAnalysisTable.requiredForExport",
defaultMessage: "Your can only export one"
},

requiredProject: {
id: "Review.TaskAnalysisTable.requiredProject",
defaultMessage: "project at a time."
},

actionsColumnHeader: {
id: "Review.TaskAnalysisTable.columnHeaders.actions",
defaultMessage: "Actions",
Expand Down
28 changes: 20 additions & 8 deletions src/pages/Review/TasksReview/TasksReviewTable.js
Original file line number Diff line number Diff line change
Expand Up @@ -323,20 +323,32 @@ export class TaskReviewTable extends Component {
</button>
</li>
{(reviewTasksType === ReviewTasksType.allReviewedTasks || reviewTasksType === ReviewTasksType.toBeReviewed) &&
<li onClick={dropdown.toggleDropdownVisible}>
{
process.env.REACT_APP_REVIEW_TABLE_EXPORT_CSV ?
<a target="_blank"
rel="noopener noreferrer"
href={buildLinkToReviewTableExportCSV(this.props.reviewCriteria, this.props.addedColumns)}
className="mr-flex mr-items-center">
<li>
{this.props.reviewCriteria.filters.project ?
<a target="_blank"
rel="noopener noreferrer"
href={buildLinkToReviewTableExportCSV(this.props.reviewCriteria, this.props.addedColumns)}
onClick={dropdown.toggleDropdownVisible}
className="mr-flex mr-items-center">
<SvgSymbol sym='download-icon' viewBox='0 0 20 20' className="mr-w-4 mr-h-4 mr-fill-current mr-mr-2" />
<FormattedMessage {...messages.exportReviewTableCSVLabel} />
</a> :
<div>
<div className="mr-flex mr-items-center mr-opacity-50">
<SvgSymbol sym='download-icon' viewBox='0 0 20 20' className="mr-w-4 mr-h-4 mr-fill-current mr-mr-2" />
<FormattedMessage {...messages.exportReviewTableCSVLabel} />
</a> : null
</div>
<div className="mr-text-grey-light">
<FormattedMessage {...messages.requiredForExport} />
<div />
<FormattedMessage {...messages.requiredProject} />
</div>
</div>
}
<a target="_blank"
rel="noopener noreferrer"
href={buildLinkToMapperExportCSV(this.props.reviewCriteria)}
onClick={dropdown.toggleDropdownVisible}
className="mr-flex mr-items-center">
<SvgSymbol sym='download-icon' viewBox='0 0 20 20' className="mr-w-4 mr-h-4 mr-fill-current mr-mr-2" />
<FormattedMessage {...messages.exportMapperCSVLabel} />
Expand Down
Loading