Update reporting section

This commit is contained in:
leigh-mil
2019-01-14 14:09:47 -05:00
parent 3010745cf2
commit 5ef246fe2f
5 changed files with 129 additions and 70 deletions

View File

@@ -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 <strong>on-premise data center</strong>"),
("cloud", "Yes, migrating from <strong>another cloud provider</strong>"),
(
"both",
"Yes, migrating from an <strong>on-premise data center</strong> and <strong>another cloud provider</strong>",
),
("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 = [

View File

@@ -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="",
)

View File

@@ -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,