diff --git a/atst/forms/data.py b/atst/forms/data.py index 8aeda1e4..e89d9bdd 100644 --- a/atst/forms/data.py +++ b/atst/forms/data.py @@ -1,4 +1,5 @@ from atst.domain.roles import PORTFOLIO_ROLES as PORTFOLIO_ROLE_DEFINITIONS +from atst.utils.localization import translate SERVICE_BRANCHES = [ ("", "Select an option"), @@ -176,24 +177,21 @@ FUNDING_TYPES = [ TASK_ORDER_SOURCES = [("MANUAL", "Manual"), ("EDA", "EDA")] APP_MIGRATION = [ - ("on_premise", "Yes, migrating from an on-premise data center"), - ("cloud", "Yes, migrating from another cloud provider"), - ( - "both", - "Yes, migrating from an on-premise data center and another cloud provider", - ), - ("none", "Not planning to migrate any applications"), - ("not_sure", "Not Sure"), + ("on_premise", translate("forms.task_order.app_migration.on_premise")), + ("cloud", translate("forms.task_order.app_migration.cloud")), + ("both", translate("forms.task_order.app_migration.both")), + ("none", translate("forms.task_order.app_migration.none")), + ("not_sure", translate("forms.task_order.app_migration.not_sure")), ] -APPLICATION_COMPLEXITY = [ - ("storage", "Storage "), - ("data_analytics", "Data Analytics "), - ("conus", "CONUS Access "), - ("oconus", "OCONUS Access "), - ("tactical_edge", "Tactical Edge Access "), - ("not_sure", "Not Sure "), - ("other", "Other"), +PROJECT_COMPLEXITY = [ + ("storage", translate("forms.task_order.complexity.storage")), + ("data_analytics", translate("forms.task_order.complexity.data_analytics")), + ("conus", translate("forms.task_order.complexity.conus")), + ("oconus", translate("forms.task_order.complexity.oconus")), + ("tactical_edge", translate("forms.task_order.complexity.tactical_edge")), + ("not_sure", translate("forms.task_order.complexity.not_sure")), + ("other", translate("forms.task_order.complexity.other")), ] DEV_TEAM = [ @@ -204,14 +202,11 @@ DEV_TEAM = [ ] TEAM_EXPERIENCE = [ - ("none", "No previous experience"), - ("planned", "Researched or planned a cloud build or migration"), - ("built_1", "Built or Migrated 1-2 applications"), - ("built_3", "Built or Migrated 3-5 applications"), - ( - "built_many", - "Built or migrated many applications, or consulted on several such applications", - ), + ("none", translate("forms.task_order.team_experience.none")), + ("planned", translate("forms.task_order.team_experience.planned")), + ("built_1", translate("forms.task_order.team_experience.built_1")), + ("built_3", translate("forms.task_order.team_experience.built_3")), + ("built_many", translate("forms.task_order.team_experience.built_many")), ] PERIOD_OF_PERFORMANCE_LENGTH = [ diff --git a/atst/forms/task_order.py b/atst/forms/task_order.py index ce33476d..6d654a09 100644 --- a/atst/forms/task_order.py +++ b/atst/forms/task_order.py @@ -39,8 +39,8 @@ class AppInfoForm(CacheableForm): translate("forms.task_order.defense_component_label"), choices=SERVICE_BRANCHES ) app_migration = RadioField( - translate("forms.task_order.app_migration_label"), - description=translate("forms.task_order.app_migration_description"), + translate("forms.task_order.app_migration.label"), + description=translate("forms.task_order.app_migration.description"), choices=APP_MIGRATION, default="", ) @@ -50,9 +50,9 @@ class AppInfoForm(CacheableForm): choices=[("yes", "Yes"), ("no", "No"), ("not_sure", "Not Sure")], ) complexity = SelectMultipleField( - translate("forms.task_order.complexity_label"), - description=translate("forms.task_order.complexity_description"), - choices=APPLICATION_COMPLEXITY, + translate("forms.task_order.complexity.label"), + description=translate("forms.task_order.complexity.description"), + choices=PROJECT_COMPLEXITY, default="", widget=ListWidget(prefix_label=False), option_widget=CheckboxInput(), @@ -68,8 +68,8 @@ class AppInfoForm(CacheableForm): ) dev_team_other = StringField(translate("forms.task_order.dev_team_other_label")) team_experience = RadioField( - translate("forms.task_order.team_experience_label"), - description=translate("forms.task_order.team_experience_description"), + translate("forms.task_order.team_experience.label"), + description=translate("forms.task_order.team_experience.description"), choices=TEAM_EXPERIENCE, default="", ) diff --git a/atst/models/task_order.py b/atst/models/task_order.py index 340be9af..fe3d2752 100644 --- a/atst/models/task_order.py +++ b/atst/models/task_order.py @@ -6,6 +6,7 @@ from sqlalchemy.types import ARRAY from sqlalchemy.orm import relationship from atst.models import Base, types, mixins +from atst.utils.localization import translate class Status(Enum): @@ -102,6 +103,39 @@ class TaskOrder(Base, mixins.TimestampsMixin): def is_pending(self): return self.status == Status.PENDING + @property + def app_migration_description(self): + if self.app_migration: + text = translate( + "forms.task_order.app_migration.{}".format(self.app_migration) + ) + # remove html tags here? + return text + else: + return None + + @property + def native_apps_description(self): + # move all text into translations file! + if self.native_apps == "yes": + return "Yes, planning to develop natively in the cloud" + elif self.native_apps == "no": + return "No, not planning to develop natively in the cloud" + elif self.native_apps == "not_sure": + return "Not sure, unsure if planning to develop natively in the cloud" + else: + return None + + @property + def team_experience_description(self): + if self.team_experience: + return translate( + "forms.task_order.team_experience.{}".format(self.team_experience) + ) + else: + return None + + def to_dictionary(self): return { "portfolio_name": self.portfolio_name, diff --git a/templates/task_orders/new/review.html b/templates/task_orders/new/review.html index 1bfa764e..cb038863 100644 --- a/templates/task_orders/new/review.html +++ b/templates/task_orders/new/review.html @@ -39,42 +39,52 @@
-
-

Generated Documents

+

Reporting {{ TOEditLink(screen=1) }}

-
+ +{% else %} +

{{ RequiredLabel() }}

+{% endif %} + +
+
+

Development Team

+ {% if task_order.dev_team %} + + + {% else %} +

{{ RequiredLabel() }}

+ {% endif %} +
+ +
+

Team Experience

+

{{ task_order.team_experience_description or RequiredLabel() }}

+
+

diff --git a/translations.yaml b/translations.yaml index 987addb9..bf7f0da8 100644 --- a/translations.yaml +++ b/translations.yaml @@ -169,19 +169,39 @@ forms: scope_label: Cloud Project Scope scope_description: Your team's plan for using the cloud, such as migrating an existing application or creating a prototype. defense_component_label: Department of Defense Component - app_migration_label: App Migration - app_migration_description: Do you plan to migrate existing application(s) to the cloud? + app_migration: + label: App Migration + description: Do you plan to migrate existing application(s) to the cloud? + on_premise: Yes, migrating from an on-premise data center + cloud: Yes, migrating from another cloud provider + both: Yes, migrating from an on-premise data center and another cloud provider + none: Not planning to migrate any applications + not_sure: "Not Sure" native_apps_label: Native Apps native_apps_description: Do you plan to develop application(s) natively in the cloud? - complexity_label: Project Complexity - complexity_description: Which of these describes how complex your team's use of the cloud will be? Select all that apply. + complexity: + label: Project Complexity + description: Which of these describes how complex your team's use of the cloud will be? Select all that apply. + storage: Storage + data_analytics: Data Analytics + conus: CONUS Acess + oconus: OCONUS Access + tactical_edge: Tactical Edge Access + not_sure: Not Sure + other: Other complexity_other_label: Project Complexity Other dev_team_label: Development Team dev_team_description: Which people or teams will be completing the development work for your cloud applications? Select all that apply. dev_team_other_label: Development Team Other - team_experience_label: Team Experience - team_experience_description: How much experience does your team have with development in the cloud? - performance_length_label: Period of Performance length + team_experience: + label: Team Experience + description: How much experience does your team have with development in the cloud? + none: No previous experience + planned: Researched or planned a cloud build or migration + built_1: Built or Migrated 1-2 applications + built_3: Built or Migrated 3-5 applications + built_many: Built or migrated many applications, or consulted on several such projects + start_date_label: Start Date end_date_label: End Date pdf_label: Upload a copy of your CSP Cost Estimate Research