From 115c84680c9baf92c75f93eb264937eb660df6ec Mon Sep 17 00:00:00 2001 From: Patrick Smith Date: Wed, 8 Aug 2018 19:21:46 -0400 Subject: [PATCH 1/3] Fix link to financial verification page --- atst/domain/requests.py | 4 ++++ atst/routes/requests/index.py | 5 ++++- templates/requests.html | 2 +- 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/atst/domain/requests.py b/atst/domain/requests.py index 85fb688a..66fdf8cf 100644 --- a/atst/domain/requests.py +++ b/atst/domain/requests.py @@ -146,3 +146,7 @@ class Requests(object): return request.status == "incomplete" and all( section in existing_request_sections for section in all_request_sections ) + + @classmethod + def is_pending_financial_verification(cls, request): + return request.status == RequestStatus.PENDING_FINANCIAL_VERIFICATION diff --git a/atst/routes/requests/index.py b/atst/routes/requests/index.py index ec9b566c..5e9d26ca 100644 --- a/atst/routes/requests/index.py +++ b/atst/routes/requests/index.py @@ -1,5 +1,5 @@ import pendulum -from flask import render_template, g +from flask import render_template, g, url_for from . import requests_bp from atst.domain.requests import Requests @@ -9,6 +9,8 @@ def map_request(request): time_created = pendulum.instance(request.time_created) is_new = time_created.add(days=1) > pendulum.now() app_count = request.body.get("details_of_use", {}).get("num_software_systems", 0) + update_url = url_for('requests.requests_form_update', screen=1, request_id=request.id) + verify_url = url_for('requests.financial_verification', request_id=request.id) return { "order_id": request.id, @@ -17,6 +19,7 @@ def map_request(request): "app_count": app_count, "date": time_created.format("M/DD/YYYY"), "full_name": request.creator.full_name, + "edit_link": verify_url if Requests.is_pending_financial_verification(request) else update_url } diff --git a/templates/requests.html b/templates/requests.html index 17993dfa..25520ac2 100644 --- a/templates/requests.html +++ b/templates/requests.html @@ -88,7 +88,7 @@ {% for r in requests %} - {{ r['order_id'] }} + {{ r['order_id'] }} {% if r['is_new'] %}New {% endif %} From e1da908f93958a2575faac78cf69658a97af8de1 Mon Sep 17 00:00:00 2001 From: Patrick Smith Date: Wed, 8 Aug 2018 19:25:16 -0400 Subject: [PATCH 2/3] Use helper method for allowing submission --- atst/domain/requests.py | 2 +- atst/routes/requests/jedi_request_flow.py | 2 +- tests/domain/test_requests.py | 7 +++++++ 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/atst/domain/requests.py b/atst/domain/requests.py index 66fdf8cf..3986a849 100644 --- a/atst/domain/requests.py +++ b/atst/domain/requests.py @@ -143,7 +143,7 @@ class Requests(object): "primary_poc", ] existing_request_sections = request.body.keys() - return request.status == "incomplete" and all( + return request.status == RequestStatus.STARTED and all( section in existing_request_sections for section in all_request_sections ) diff --git a/atst/routes/requests/jedi_request_flow.py b/atst/routes/requests/jedi_request_flow.py index af08251b..1a3a7163 100644 --- a/atst/routes/requests/jedi_request_flow.py +++ b/atst/routes/requests/jedi_request_flow.py @@ -76,7 +76,7 @@ class JEDIRequestFlow(object): @property def can_submit(self): - return self.request and self.request.status != "incomplete" + return self.request and Requests.should_allow_submission(self.request) @property def next_screen(self): diff --git a/tests/domain/test_requests.py b/tests/domain/test_requests.py index ebdc64a0..2044d52b 100644 --- a/tests/domain/test_requests.py +++ b/tests/domain/test_requests.py @@ -50,6 +50,13 @@ def test_dont_auto_approve_if_no_dollar_value_specified(new_request): assert request.status == RequestStatus.PENDING_CCPO_APPROVAL +def test_should_allow_submission(new_request): + assert Requests.should_allow_submission(new_request) + + del new_request.body['details_of_use'] + assert not Requests.should_allow_submission(new_request) + + def test_exists(session): user_allowed = UserFactory.create() user_denied = UserFactory.create() From cc4b87f61163f21bf8173c21eeda1bb8bd5c01de Mon Sep 17 00:00:00 2001 From: Patrick Smith Date: Wed, 8 Aug 2018 19:42:29 -0400 Subject: [PATCH 3/3] Add complete/active indicator to request form nav --- templates/requests/menu.html | 22 +++++++++++++++------- 1 file changed, 15 insertions(+), 7 deletions(-) diff --git a/templates/requests/menu.html b/templates/requests/menu.html index 24b28d4f..d62de246 100644 --- a/templates/requests/menu.html +++ b/templates/requests/menu.html @@ -1,13 +1,21 @@
    {% for s in screens %} -
  • - - {{ s['title'] }} - -
  • + {% if loop.index < current %} + {% set step_indicator = 'complete' %} + {% elif loop.index == current %} + {% set step_indicator = 'active' %} + {% else %} + {% set step_indicator = 'incomplete' %} + {% endif %} + +
  • + + {{ s['title'] }} + +
  • {% endfor %}