diff --git a/atst/routes/requests/requests_form.py b/atst/routes/requests/requests_form.py index 8e14b0e2..b0252b86 100644 --- a/atst/routes/requests/requests_form.py +++ b/atst/routes/requests/requests_form.py @@ -62,6 +62,7 @@ def requests_form_update(screen=1, request_id=None): next_screen=screen + 1, request_id=request_id, jedi_request=jedi_flow.request, + review_comment=request.review_comment, can_submit=jedi_flow.can_submit, ) diff --git a/templates/requests/_new.html b/templates/requests/_new.html index da27e795..fcdf1c95 100644 --- a/templates/requests/_new.html +++ b/templates/requests/_new.html @@ -1,11 +1,19 @@ {% extends "base.html" %} +{% from "components/alert.html" import Alert %} + {% block content %}
{% include 'requests/menu.html' %} + {% if review_comment %} + {{ Alert('Changes Requested', + message="

CCPO has requested changes to your submission with the following notes:
" + review_comment + "
Please contact info@jedi.cloud or 123-123-4567 for further discussion.

", + level='warning') }} + {% endif %} + {% block form_action %} {% if request_id %}
diff --git a/tests/routes/test_request_new.py b/tests/routes/test_request_new.py index b27f4758..9bc8a668 100644 --- a/tests/routes/test_request_new.py +++ b/tests/routes/test_request_new.py @@ -1,5 +1,12 @@ import re -from tests.factories import RequestFactory, UserFactory, RequestRevisionFactory +from tests.factories import ( + RequestFactory, + UserFactory, + RequestRevisionFactory, + RequestStatusEventFactory, + RequestReviewFactory, +) +from atst.models.request_status_event import RequestStatus from atst.domain.roles import Roles from atst.domain.requests import Requests from urllib.parse import urlencode @@ -213,3 +220,21 @@ def test_can_review_data(user_session, client): # assert a sampling of the request data is on the review page assert request.body["primary_poc"]["fname_poc"] in body assert request.body["information_about_you"]["email_request"] in body + + +def test_displays_ccpo_review_comment(user_session, client): + creator = UserFactory.create() + ccpo = UserFactory.from_atat_role("ccpo") + user_session(creator) + request = RequestFactory.create(creator=creator) + review_comment = "add all of the correct info, instead of the incorrect info" + request.status_events = [ + RequestStatusEventFactory.create( + revision=request.latest_revision, + new_status=RequestStatus.CHANGES_REQUESTED, + review=RequestReviewFactory.create(reviewer=ccpo, comment=review_comment), + ) + ] + response = client.get("/requests/new/1/{}".format(request.id)) + body = response.data.decode() + assert review_comment in body