From 8ac5a7e3b04250734c647a8ea680f3f5efdf1cc5 Mon Sep 17 00:00:00 2001 From: Andrew Croce Date: Tue, 2 Oct 2018 08:31:01 -0400 Subject: [PATCH 1/7] Add financial form prop to check if the missing TO is the only error --- atst/forms/financial.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/atst/forms/financial.py b/atst/forms/financial.py index 9522ec12..0a081695 100644 --- a/atst/forms/financial.py +++ b/atst/forms/financial.py @@ -151,6 +151,11 @@ class FinancialForm(BaseFinancialForm): def is_missing_task_order_number(self): return "task_order_number" in self.errors + @property + def is_only_missing_task_order_number(self): + return "task_order_number" in self.errors and len(self.errors) == 1 + + class ExtendedFinancialForm(BaseFinancialForm): def validate(self, *args, **kwargs): From d4b094162270489d958e5ca8fe831c8067c93e16 Mon Sep 17 00:00:00 2001 From: Andrew Croce Date: Tue, 2 Oct 2018 08:31:37 -0400 Subject: [PATCH 2/7] Only display info alert if there arent errors or extended form info to show --- templates/requests/financial_verification.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/templates/requests/financial_verification.html b/templates/requests/financial_verification.html index 66a5afa2..a48725d7 100644 --- a/templates/requests/financial_verification.html +++ b/templates/requests/financial_verification.html @@ -9,7 +9,7 @@ {% include 'requests/review_menu.html' %} -{% if request.is_pending_financial_verification %} +{% if request.is_pending_financial_verification and not f.errors and not extended %} {{ Alert('Pending Financial Verification', fragment="fragments/pending_financial_verification.html") }} {% endif %} From d4ae9763ed66b7f2107c5b16ac649d29df09ada6 Mon Sep 17 00:00:00 2001 From: Andrew Croce Date: Tue, 2 Oct 2018 08:32:06 -0400 Subject: [PATCH 3/7] Update the alert content when viewing the extended financial form --- templates/requests/financial_verification.html | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/templates/requests/financial_verification.html b/templates/requests/financial_verification.html index a48725d7..04de3f23 100644 --- a/templates/requests/financial_verification.html +++ b/templates/requests/financial_verification.html @@ -21,8 +21,8 @@
{% if extended %} - {{ Alert('Task Order not found in EDA', - message="We could not find your Task Order in the EDA, our system of record. Please confirm that you have entered the information correctly and resubmit or click on the button below to enter the TO manually.", + {{ Alert('Manually enter Task Order information', + message="Additional field are displayed below, where you can manually enter financial information as documented in your Task Order.", level='warning' ) }} {% endif %} From 358e66f7f3789302841b78489f2701f84a064ddb Mon Sep 17 00:00:00 2001 From: Andrew Croce Date: Tue, 2 Oct 2018 08:32:32 -0400 Subject: [PATCH 4/7] only show the error alert if TO isn't the only error --- templates/requests/financial_verification.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/templates/requests/financial_verification.html b/templates/requests/financial_verification.html index 04de3f23..d20a2a55 100644 --- a/templates/requests/financial_verification.html +++ b/templates/requests/financial_verification.html @@ -47,7 +47,7 @@ {% block form %} {% autoescape false %} - {% if f.errors %} + {% if f.errors and not f.is_only_missing_task_order_number %} {{ Alert('There were some errors', message="

Please see below.

", level='error' From 987582124809a40990b73fa66295c008d2a86e4c Mon Sep 17 00:00:00 2001 From: Andrew Croce Date: Tue, 2 Oct 2018 08:33:07 -0400 Subject: [PATCH 5/7] remove extraneous line --- atst/forms/financial.py | 1 - 1 file changed, 1 deletion(-) diff --git a/atst/forms/financial.py b/atst/forms/financial.py index 0a081695..23f3732b 100644 --- a/atst/forms/financial.py +++ b/atst/forms/financial.py @@ -156,7 +156,6 @@ class FinancialForm(BaseFinancialForm): return "task_order_number" in self.errors and len(self.errors) == 1 - class ExtendedFinancialForm(BaseFinancialForm): def validate(self, *args, **kwargs): if self.funding_type.data == "OTHER": From 0ce2960a0e399a89b349216bde2b8c91cd310ecb Mon Sep 17 00:00:00 2001 From: Andrew Croce Date: Tue, 2 Oct 2018 08:37:07 -0400 Subject: [PATCH 6/7] add help link to manual TO alert --- templates/requests/financial_verification.html | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/templates/requests/financial_verification.html b/templates/requests/financial_verification.html index d20a2a55..50bf1e3a 100644 --- a/templates/requests/financial_verification.html +++ b/templates/requests/financial_verification.html @@ -23,7 +23,14 @@ {% if extended %} {{ Alert('Manually enter Task Order information', message="Additional field are displayed below, where you can manually enter financial information as documented in your Task Order.", - level='warning' + level='warning', + actions=[ + { + 'href': url_for('atst.helpdocs'), + 'label': 'Learn more about the JEDI Cloud Task Order and the Financial Verification process.', + 'icon': 'help' + } + ] ) }} {% endif %} From 64187a4db3323da74c5d103ca306c1d2ebb32142 Mon Sep 17 00:00:00 2001 From: Andrew Croce Date: Tue, 2 Oct 2018 11:48:26 -0400 Subject: [PATCH 7/7] typo --- templates/requests/financial_verification.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/templates/requests/financial_verification.html b/templates/requests/financial_verification.html index 50bf1e3a..c568c004 100644 --- a/templates/requests/financial_verification.html +++ b/templates/requests/financial_verification.html @@ -22,7 +22,7 @@ {% if extended %} {{ Alert('Manually enter Task Order information', - message="Additional field are displayed below, where you can manually enter financial information as documented in your Task Order.", + message="Additional fields are displayed below, where you can manually enter financial information as documented in your Task Order.", level='warning', actions=[ {