From 0e6c54f4139e48aa776ef0aa1139b4ee153a80a0 Mon Sep 17 00:00:00 2001 From: Kelli Rotstan Date: Sat, 25 Apr 2020 13:03:29 -0700 Subject: [PATCH 1/3] Add review links on project and challenge detail pages * Add links to "review" on challenge and detail pages * Change 'Go Back' on review table to "Reconfigure Review" --- .../ChallengeDetail/ChallengeDetail.js | 15 ++++++++++++++- src/components/ChallengeDetail/Messages.js | 5 +++++ src/components/ProjectDetail/Messages.js | 5 +++++ src/components/ProjectDetail/ProjectDetail.js | 17 +++++++++++++++-- src/lang/en-US.json | 4 +++- src/pages/Review/Messages.js | 2 +- src/pages/Review/Review.js | 19 +++++++++++++++++++ 7 files changed, 62 insertions(+), 5 deletions(-) diff --git a/src/components/ChallengeDetail/ChallengeDetail.js b/src/components/ChallengeDetail/ChallengeDetail.js index f5486ec9d..96ee5726d 100644 --- a/src/components/ChallengeDetail/ChallengeDetail.js +++ b/src/components/ChallengeDetail/ChallengeDetail.js @@ -1,6 +1,7 @@ import React, { Component } from 'react' import { Link } from 'react-router-dom' import { FormattedMessage, FormattedRelative, injectIntl } from 'react-intl' +import classNames from 'classnames' import _isObject from 'lodash/isObject' import _get from 'lodash/get' import _findIndex from 'lodash/findIndex' @@ -225,7 +226,19 @@ export class ChallengeDetail extends Component { {unsaveControl} )} - {manageControl &&
  • {manageControl}
  • } +
  • + {_get(this.props.user, 'settings.isReviewer') && + + + + } + {manageControl} +
  • diff --git a/src/components/ChallengeDetail/Messages.js b/src/components/ChallengeDetail/Messages.js index cd84d732f..e7b49830b 100644 --- a/src/components/ChallengeDetail/Messages.js +++ b/src/components/ChallengeDetail/Messages.js @@ -54,4 +54,9 @@ export default defineMessages({ defaultMessage: "View Leaderboard", }, + viewReviews: { + id: "ChallengeDetails.fields.viewReviews.label", + defaultMessage: "Review", + }, + }) diff --git a/src/components/ProjectDetail/Messages.js b/src/components/ProjectDetail/Messages.js index 75bad114b..137effaa6 100644 --- a/src/components/ProjectDetail/Messages.js +++ b/src/components/ProjectDetail/Messages.js @@ -55,4 +55,9 @@ export default defineMessages({ id: "ProjectDetails.fields.viewLeaderboard.label", defaultMessage: "View Leaderboard", }, + + viewReviews: { + id: "ProjectDetails.fields.viewReviews.label", + defaultMessage: "Review", + }, }) diff --git a/src/components/ProjectDetail/ProjectDetail.js b/src/components/ProjectDetail/ProjectDetail.js index bd801bca4..558e0af84 100644 --- a/src/components/ProjectDetail/ProjectDetail.js +++ b/src/components/ProjectDetail/ProjectDetail.js @@ -1,5 +1,6 @@ import React, { Component } from 'react' import { Link } from 'react-router-dom' +import classNames from 'classnames' import { FormattedMessage, FormattedRelative, injectIntl } from 'react-intl' import _isObject from 'lodash/isObject' import _get from 'lodash/get' @@ -124,8 +125,20 @@ export class ProjectDetail extends Component { -