From 6e63172ab4d40e65b9834b499ae1fbf7cf79f5d0 Mon Sep 17 00:00:00 2001 From: "Jay R. Newlin (PromptWorks)" Date: Thu, 21 Nov 2019 17:28:47 -0500 Subject: [PATCH 01/39] Ghost Inspector updates week ending 11/22/2019 --- uitests/Add_CCPO_User.html | 9 +++--- uitests/Application_Settings.html | 9 +++--- uitests/Edit_App_Member.html | 39 +++++++++++++++++++++++--- uitests/Edit_Portfolio_Member.html | 40 ++++++++++++++++++++++++--- uitests/Login_Brandon.html | 7 +++-- uitests/New_App_Step_3.html | 9 +++--- uitests/New_Portfolio_Member.html | 24 +++++++++++++--- uitests/Remove_Portfolio_Member.html | 25 ++++++++++++++--- uitests/Resend_App_User_Invite.html | 9 +++--- uitests/Revoke_App_Member_Invite.html | 9 +++--- 10 files changed, 141 insertions(+), 39 deletions(-) diff --git a/uitests/Add_CCPO_User.html b/uitests/Add_CCPO_User.html index 2fe94797..bab35aa4 100644 --- a/uitests/Add_CCPO_User.html +++ b/uitests/Add_CCPO_User.html @@ -74,15 +74,16 @@ - + waitForElementPresent -css=.col > .usa-alert.usa-alert-info:nth-of-type(3) > .usa-alert-body > h3.usa-alert-heading +css=.col > .usa-alert.usa-alert-info:nth-of-type(2) > .usa-alert-body > h3.usa-alert-heading -assertText -css=.col > .usa-alert.usa-alert-info:nth-of-type(3) > .usa-alert-body > h3.usa-alert-heading +verifyText +css=.col > .usa-alert.usa-alert-info:nth-of-type(2) > .usa-alert-body > h3.usa-alert-heading *Logged out* diff --git a/uitests/Application_Settings.html b/uitests/Application_Settings.html index 07584bdb..963ed1e3 100644 --- a/uitests/Application_Settings.html +++ b/uitests/Application_Settings.html @@ -78,15 +78,16 @@ Imported from: AT-AT CI - Login Brandon--> +Imported from: AT-AT CI - Login Brandon +11/19/19 17:10 Temporarily making optional until Leigh's PR#1197 merges--> waitForElementPresent -css=.col > .usa-alert.usa-alert-info:nth-of-type(3) > .usa-alert-body > h3.usa-alert-heading +css=.col > .usa-alert.usa-alert-info:nth-of-type(2) > .usa-alert-body > h3.usa-alert-heading -assertText -css=.col > .usa-alert.usa-alert-info:nth-of-type(3) > .usa-alert-body > h3.usa-alert-heading +verifyText +css=.col > .usa-alert.usa-alert-info:nth-of-type(2) > .usa-alert-body > h3.usa-alert-heading *Logged out* diff --git a/uitests/Edit_App_Member.html b/uitests/Edit_App_Member.html index 7fc081ab..ee2af0b5 100644 --- a/uitests/Edit_App_Member.html +++ b/uitests/Edit_App_Member.html @@ -82,15 +82,16 @@ Imported from: AT-AT CI - Login Brandon--> +Imported from: AT-AT CI - Login Brandon +11/19/19 17:10 Temporarily making optional until Leigh's PR#1197 merges--> waitForElementPresent -css=.col > .usa-alert.usa-alert-info:nth-of-type(3) > .usa-alert-body > h3.usa-alert-heading +css=.col > .usa-alert.usa-alert-info:nth-of-type(2) > .usa-alert-body > h3.usa-alert-heading -assertText -css=.col > .usa-alert.usa-alert-info:nth-of-type(3) > .usa-alert-body > h3.usa-alert-heading +verifyText +css=.col > .usa-alert.usa-alert-info:nth-of-type(2) > .usa-alert-body > h3.usa-alert-heading *Logged out* @@ -1431,6 +1432,36 @@ Imported from: AT-AT CI - New App Step 3--> css=.usa-alert.usa-alert-success > .usa-alert-body > .usa-alert-text *You have successfully updated the permissions for Brandon Buchannan* + +waitForPageToLoad + + + + +waitForElementPresent +css=table.atat-table > tbody > tr:nth-of-type(1) > td:nth-of-type(2) > div:nth-of-type(1) + + + +assertText +css=table.atat-table > tbody > tr:nth-of-type(1) > td:nth-of-type(2) > div:nth-of-type(1) +*View Team* + + +waitForPageToLoad + + + + +waitForElementPresent +css=table.atat-table > tbody > tr:nth-of-type(1) > td:nth-of-type(2) > div:nth-of-type(2) + + + +assertText +css=table.atat-table > tbody > tr:nth-of-type(1) > td:nth-of-type(2) > div:nth-of-type(2) +*View Environments* + diff --git a/uitests/Edit_Portfolio_Member.html b/uitests/Edit_Portfolio_Member.html index 0f5c8361..d50e14fe 100644 --- a/uitests/Edit_Portfolio_Member.html +++ b/uitests/Edit_Portfolio_Member.html @@ -78,15 +78,16 @@ Imported from: AT-AT CI - Login Brandon--> +Imported from: AT-AT CI - Login Brandon +11/19/19 17:10 Temporarily making optional until Leigh's PR#1197 merges--> waitForElementPresent -css=.col > .usa-alert.usa-alert-info:nth-of-type(3) > .usa-alert-body > h3.usa-alert-heading +css=.col > .usa-alert.usa-alert-info:nth-of-type(2) > .usa-alert-body > h3.usa-alert-heading -assertText -css=.col > .usa-alert.usa-alert-info:nth-of-type(3) > .usa-alert-body > h3.usa-alert-heading +verifyText +css=.col > .usa-alert.usa-alert-info:nth-of-type(2) > .usa-alert-body > h3.usa-alert-heading *Logged out* @@ -874,6 +875,22 @@ Imported from: AT-AT CI - Portfolio Settings--> + + +waitForElementPresent +css=.usa-alert-body > p:nth-of-type(2) + + + +assertText +css=.usa-alert-body > p:nth-of-type(2) +*You have successfully invited Brandon Buchannan to the portfolio.* + + +waitForPageToLoad + + + waitForElementPresent css=select[name="members_permissions-1-perms_app_mgmt"] @@ -959,6 +976,21 @@ Imported from: AT-AT CI - Portfolio Settings--> css=.usa-alert.usa-alert-success > .usa-alert-body > h3.usa-alert-heading *Success!* + +waitForPageToLoad + + + + +waitForElementPresent +css=.usa-alert-body > p:nth-of-type(2) + + + +assertText +css=.usa-alert-body > p:nth-of-type(2) +*You have successfully updated access permissions for members of Tatooine Energy Maintenance Systems.* + diff --git a/uitests/Login_Brandon.html b/uitests/Login_Brandon.html index 3d99c92d..75543571 100644 --- a/uitests/Login_Brandon.html +++ b/uitests/Login_Brandon.html @@ -71,14 +71,15 @@ + waitForElementPresent -css=.col > .usa-alert.usa-alert-info:nth-of-type(3) > .usa-alert-body > h3.usa-alert-heading +css=.col > .usa-alert.usa-alert-info:nth-of-type(2) > .usa-alert-body > h3.usa-alert-heading -assertText -css=.col > .usa-alert.usa-alert-info:nth-of-type(3) > .usa-alert-body > h3.usa-alert-heading +verifyText +css=.col > .usa-alert.usa-alert-info:nth-of-type(2) > .usa-alert-body > h3.usa-alert-heading *Logged out* diff --git a/uitests/New_App_Step_3.html b/uitests/New_App_Step_3.html index e33895fa..cd8a47f5 100644 --- a/uitests/New_App_Step_3.html +++ b/uitests/New_App_Step_3.html @@ -74,15 +74,16 @@ - + waitForElementPresent -css=.col > .usa-alert.usa-alert-info:nth-of-type(3) > .usa-alert-body > h3.usa-alert-heading +css=.col > .usa-alert.usa-alert-info:nth-of-type(2) > .usa-alert-body > h3.usa-alert-heading -assertText -css=.col > .usa-alert.usa-alert-info:nth-of-type(3) > .usa-alert-body > h3.usa-alert-heading +verifyText +css=.col > .usa-alert.usa-alert-info:nth-of-type(2) > .usa-alert-body > h3.usa-alert-heading *Logged out* diff --git a/uitests/New_Portfolio_Member.html b/uitests/New_Portfolio_Member.html index 02e119fb..e2dbbe82 100644 --- a/uitests/New_Portfolio_Member.html +++ b/uitests/New_Portfolio_Member.html @@ -74,15 +74,16 @@ - + waitForElementPresent -css=.col > .usa-alert.usa-alert-info:nth-of-type(3) > .usa-alert-body > h3.usa-alert-heading +css=.col > .usa-alert.usa-alert-info:nth-of-type(2) > .usa-alert-body > h3.usa-alert-heading -assertText -css=.col > .usa-alert.usa-alert-info:nth-of-type(3) > .usa-alert-body > h3.usa-alert-heading +verifyText +css=.col > .usa-alert.usa-alert-info:nth-of-type(2) > .usa-alert-body > h3.usa-alert-heading *Logged out* @@ -819,6 +820,21 @@ Imported from: AT-AT CI - New Portfolio--> css=table.atat-table > tbody > tr:nth-of-type(2) > td.name + +waitForPageToLoad + + + + +waitForElementPresent +css=.usa-alert-body > p:nth-of-type(2) + + + +assertText +css=.usa-alert-body > p:nth-of-type(2) +*You have successfully invited Brandon Buchannan to the portfolio.* + diff --git a/uitests/Remove_Portfolio_Member.html b/uitests/Remove_Portfolio_Member.html index 192d3340..99801981 100644 --- a/uitests/Remove_Portfolio_Member.html +++ b/uitests/Remove_Portfolio_Member.html @@ -78,15 +78,16 @@ Imported from: AT-AT CI - Login Brandon--> +Imported from: AT-AT CI - Login Brandon +11/19/19 17:10 Temporarily making optional until Leigh's PR#1197 merges--> waitForElementPresent -css=.col > .usa-alert.usa-alert-info:nth-of-type(3) > .usa-alert-body > h3.usa-alert-heading +css=.col > .usa-alert.usa-alert-info:nth-of-type(2) > .usa-alert-body > h3.usa-alert-heading -assertText -css=.col > .usa-alert.usa-alert-info:nth-of-type(3) > .usa-alert-body > h3.usa-alert-heading +verifyText +css=.col > .usa-alert.usa-alert-info:nth-of-type(2) > .usa-alert-body > h3.usa-alert-heading *Logged out* @@ -874,6 +875,22 @@ Imported from: AT-AT CI - Portfolio Settings--> + + +waitForElementPresent +css=.usa-alert-body > p:nth-of-type(2) + + + +assertText +css=.usa-alert-body > p:nth-of-type(2) +*You have successfully invited Brandon Buchannan to the portfolio.* + + +waitForPageToLoad + + + waitForElementPresent css=a.usa-button.button-danger-outline diff --git a/uitests/Resend_App_User_Invite.html b/uitests/Resend_App_User_Invite.html index 13faba35..6f93e334 100644 --- a/uitests/Resend_App_User_Invite.html +++ b/uitests/Resend_App_User_Invite.html @@ -82,15 +82,16 @@ Imported from: AT-AT CI - Login Brandon--> +Imported from: AT-AT CI - Login Brandon +11/19/19 17:10 Temporarily making optional until Leigh's PR#1197 merges--> waitForElementPresent -css=.col > .usa-alert.usa-alert-info:nth-of-type(3) > .usa-alert-body > h3.usa-alert-heading +css=.col > .usa-alert.usa-alert-info:nth-of-type(2) > .usa-alert-body > h3.usa-alert-heading -assertText -css=.col > .usa-alert.usa-alert-info:nth-of-type(3) > .usa-alert-body > h3.usa-alert-heading +verifyText +css=.col > .usa-alert.usa-alert-info:nth-of-type(2) > .usa-alert-body > h3.usa-alert-heading *Logged out* diff --git a/uitests/Revoke_App_Member_Invite.html b/uitests/Revoke_App_Member_Invite.html index 5e6c9db4..48ca1e42 100644 --- a/uitests/Revoke_App_Member_Invite.html +++ b/uitests/Revoke_App_Member_Invite.html @@ -82,15 +82,16 @@ Imported from: AT-AT CI - Login Brandon--> +Imported from: AT-AT CI - Login Brandon +11/19/19 17:10 Temporarily making optional until Leigh's PR#1197 merges--> waitForElementPresent -css=.col > .usa-alert.usa-alert-info:nth-of-type(3) > .usa-alert-body > h3.usa-alert-heading +css=.col > .usa-alert.usa-alert-info:nth-of-type(2) > .usa-alert-body > h3.usa-alert-heading -assertText -css=.col > .usa-alert.usa-alert-info:nth-of-type(3) > .usa-alert-body > h3.usa-alert-heading +verifyText +css=.col > .usa-alert.usa-alert-info:nth-of-type(2) > .usa-alert-body > h3.usa-alert-heading *Logged out* From 4cba564c9717ff169c0062870c43ae9f735f4d89 Mon Sep 17 00:00:00 2001 From: leigh-mil Date: Tue, 19 Nov 2019 16:33:58 -0500 Subject: [PATCH 02/39] Catch CSP exceptions and display a flash message with the error --- atst/routes/applications/settings.py | 21 +++++++++++++++------ atst/utils/flash.py | 5 +++++ 2 files changed, 20 insertions(+), 6 deletions(-) diff --git a/atst/routes/applications/settings.py b/atst/routes/applications/settings.py index 3454c30e..35dc3583 100644 --- a/atst/routes/applications/settings.py +++ b/atst/routes/applications/settings.py @@ -6,6 +6,7 @@ from atst.domain.environments import Environments from atst.domain.applications import Applications from atst.domain.application_roles import ApplicationRoles from atst.domain.audit_log import AuditLog +from atst.domain.csp.cloud import GeneralCSPException from atst.domain.common import Paginator from atst.domain.environment_roles import EnvironmentRoles from atst.domain.invitations import ApplicationInvitations @@ -221,14 +222,22 @@ def handle_update_member(application_id, application_role_id, form_data): ) if form.validate(): - ApplicationRoles.update_permission_sets(app_role, form.data["permission_sets"]) + try: + ApplicationRoles.update_permission_sets( + app_role, form.data["permission_sets"] + ) - for env_role in form.environment_roles: - environment = Environments.get(env_role.environment_id.data) - new_role = None if env_role.disabled.data else env_role.data["role"] - Environments.update_env_role(environment, app_role, new_role) + for env_role in form.environment_roles: + environment = Environments.get(env_role.environment_id.data) + new_role = None if env_role.disabled.data else env_role.data["role"] + Environments.update_env_role(environment, app_role, new_role) - flash("application_member_updated", user_name=app_role.user_name) + flash("application_member_updated", user_name=app_role.user_name) + + except GeneralCSPException: + flash( + "application_member_update_error", user_name=app_role.user_name, + ) else: pass # TODO: flash error message diff --git a/atst/utils/flash.py b/atst/utils/flash.py index 5fbad688..73bdbc4c 100644 --- a/atst/utils/flash.py +++ b/atst/utils/flash.py @@ -54,6 +54,11 @@ MESSAGES = { "message_template": "You have successfully deleted {{ user_name }} from {{ application_name }}", "category": "success", }, + "application_member_update_error": { + "title_template": "{{ user_name }} could not be updated", + "message_template": "An unexpected problem occurred with your request, please try again. If the problem persists, contact an administrator.", + "category": "error", + }, "application_member_updated": { "title_template": "Team member updated", "message_template": "You have successfully updated the permissions for {{ user_name }}", From 62cdcbe6dc5eff58d27ec6f99bf5c45a188b8ec3 Mon Sep 17 00:00:00 2001 From: leigh-mil Date: Fri, 22 Nov 2019 09:22:47 -0500 Subject: [PATCH 03/39] Remove some leftover 'watch' attributes from Vue components --- js/components/options_input.js | 4 ---- js/mixins/text_input_mixin.js | 4 ---- .../applications/fragments/member_form_fields.html | 3 +-- templates/components/clin_dollar_amount.html | 11 +++++------ templates/components/clin_fields.html | 9 ++++----- templates/components/options_input.html | 2 -- templates/components/text_input.html | 2 -- 7 files changed, 10 insertions(+), 25 deletions(-) diff --git a/js/components/options_input.js b/js/components/options_input.js index 639c8454..fafd0e02 100644 --- a/js/components/options_input.js +++ b/js/components/options_input.js @@ -10,10 +10,6 @@ export default { default: () => [], }, initialValue: String, - watch: { - type: Boolean, - default: false, - }, optional: Boolean, nullOption: { type: String, diff --git a/js/mixins/text_input_mixin.js b/js/mixins/text_input_mixin.js index 54f8a7cf..87471a50 100644 --- a/js/mixins/text_input_mixin.js +++ b/js/mixins/text_input_mixin.js @@ -27,10 +27,6 @@ export default { paragraph: String, noMaxWidth: String, optional: Boolean, - watch: { - type: Boolean, - default: false, - }, }, data: function() { diff --git a/templates/applications/fragments/member_form_fields.html b/templates/applications/fragments/member_form_fields.html index 97ab3832..20ecc210 100644 --- a/templates/applications/fragments/member_form_fields.html +++ b/templates/applications/fragments/member_form_fields.html @@ -66,8 +66,7 @@ + v-bind:optional="true">
{{ sub_form.role(**{"v-model": "value", "id": "{}-{}".format(sub_form.role.name, member_role_id)}) }}
diff --git a/templates/components/clin_dollar_amount.html b/templates/components/clin_dollar_amount.html index dd8468dc..c39d3ef6 100644 --- a/templates/components/clin_dollar_amount.html +++ b/templates/components/clin_dollar_amount.html @@ -1,6 +1,6 @@ {% from 'components/icon.html' import Icon %} -{% macro CLINDollarAmount(type, field=None, funding_validation=False) -%} +{% macro CLINDollarAmount(type, field=None, funding_validation=False) -%}
+ validation="clinDollars">
{% if field %} -
- {%- endmacro %} \ No newline at end of file + {%- endmacro %} diff --git a/templates/components/clin_fields.html b/templates/components/clin_fields.html index 94ca2a5b..6d79dc08 100644 --- a/templates/components/clin_fields.html +++ b/templates/components/clin_fields.html @@ -41,10 +41,9 @@
{% if fields %} - {{ TextInput(fields.number, watch=True, optional=False) }} + {{ TextInput(fields.number, optional=False) }} {% else %} - +