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.domain.roles import PORTFOLIO_ROLES as PORTFOLIO_ROLE_DEFINITIONS
from atst.utils.localization import translate
SERVICE_BRANCHES = [ SERVICE_BRANCHES = [
("", "Select an option"), ("", "Select an option"),
@ -176,24 +177,21 @@ FUNDING_TYPES = [
TASK_ORDER_SOURCES = [("MANUAL", "Manual"), ("EDA", "EDA")] TASK_ORDER_SOURCES = [("MANUAL", "Manual"), ("EDA", "EDA")]
APP_MIGRATION = [ APP_MIGRATION = [
("on_premise", "Yes, migrating from an <strong>on-premise data center</strong>"), ("on_premise", translate("forms.task_order.app_migration.on_premise")),
("cloud", "Yes, migrating from <strong>another cloud provider</strong>"), ("cloud", translate("forms.task_order.app_migration.cloud")),
( ("both", translate("forms.task_order.app_migration.both")),
"both", ("none", translate("forms.task_order.app_migration.none")),
"Yes, migrating from an <strong>on-premise data center</strong> and <strong>another cloud provider</strong>", ("not_sure", translate("forms.task_order.app_migration.not_sure")),
),
("none", "Not planning to migrate any applications"),
("not_sure", "Not Sure"),
] ]
APPLICATION_COMPLEXITY = [ PROJECT_COMPLEXITY = [
("storage", "Storage "), ("storage", translate("forms.task_order.complexity.storage")),
("data_analytics", "Data Analytics "), ("data_analytics", translate("forms.task_order.complexity.data_analytics")),
("conus", "CONUS Access "), ("conus", translate("forms.task_order.complexity.conus")),
("oconus", "OCONUS Access "), ("oconus", translate("forms.task_order.complexity.oconus")),
("tactical_edge", "Tactical Edge Access "), ("tactical_edge", translate("forms.task_order.complexity.tactical_edge")),
("not_sure", "Not Sure "), ("not_sure", translate("forms.task_order.complexity.not_sure")),
("other", "Other"), ("other", translate("forms.task_order.complexity.other")),
] ]
DEV_TEAM = [ DEV_TEAM = [
@ -204,14 +202,11 @@ DEV_TEAM = [
] ]
TEAM_EXPERIENCE = [ TEAM_EXPERIENCE = [
("none", "No previous experience"), ("none", translate("forms.task_order.team_experience.none")),
("planned", "Researched or planned a cloud build or migration"), ("planned", translate("forms.task_order.team_experience.planned")),
("built_1", "Built or Migrated 1-2 applications"), ("built_1", translate("forms.task_order.team_experience.built_1")),
("built_3", "Built or Migrated 3-5 applications"), ("built_3", translate("forms.task_order.team_experience.built_3")),
( ("built_many", translate("forms.task_order.team_experience.built_many")),
"built_many",
"Built or migrated many applications, or consulted on several such applications",
),
] ]
PERIOD_OF_PERFORMANCE_LENGTH = [ PERIOD_OF_PERFORMANCE_LENGTH = [

View File

@ -39,8 +39,8 @@ class AppInfoForm(CacheableForm):
translate("forms.task_order.defense_component_label"), choices=SERVICE_BRANCHES translate("forms.task_order.defense_component_label"), choices=SERVICE_BRANCHES
) )
app_migration = RadioField( app_migration = RadioField(
translate("forms.task_order.app_migration_label"), translate("forms.task_order.app_migration.label"),
description=translate("forms.task_order.app_migration_description"), description=translate("forms.task_order.app_migration.description"),
choices=APP_MIGRATION, choices=APP_MIGRATION,
default="", default="",
) )
@ -50,9 +50,9 @@ class AppInfoForm(CacheableForm):
choices=[("yes", "Yes"), ("no", "No"), ("not_sure", "Not Sure")], choices=[("yes", "Yes"), ("no", "No"), ("not_sure", "Not Sure")],
) )
complexity = SelectMultipleField( complexity = SelectMultipleField(
translate("forms.task_order.complexity_label"), translate("forms.task_order.complexity.label"),
description=translate("forms.task_order.complexity_description"), description=translate("forms.task_order.complexity.description"),
choices=APPLICATION_COMPLEXITY, choices=PROJECT_COMPLEXITY,
default="", default="",
widget=ListWidget(prefix_label=False), widget=ListWidget(prefix_label=False),
option_widget=CheckboxInput(), option_widget=CheckboxInput(),
@ -68,8 +68,8 @@ class AppInfoForm(CacheableForm):
) )
dev_team_other = StringField(translate("forms.task_order.dev_team_other_label")) dev_team_other = StringField(translate("forms.task_order.dev_team_other_label"))
team_experience = RadioField( team_experience = RadioField(
translate("forms.task_order.team_experience_label"), translate("forms.task_order.team_experience.label"),
description=translate("forms.task_order.team_experience_description"), description=translate("forms.task_order.team_experience.description"),
choices=TEAM_EXPERIENCE, choices=TEAM_EXPERIENCE,
default="", default="",
) )

View File

@ -6,6 +6,7 @@ from sqlalchemy.types import ARRAY
from sqlalchemy.orm import relationship from sqlalchemy.orm import relationship
from atst.models import Base, types, mixins from atst.models import Base, types, mixins
from atst.utils.localization import translate
class Status(Enum): class Status(Enum):
@ -102,6 +103,39 @@ class TaskOrder(Base, mixins.TimestampsMixin):
def is_pending(self): def is_pending(self):
return self.status == Status.PENDING 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): def to_dictionary(self):
return { return {
"portfolio_name": self.portfolio_name, "portfolio_name": self.portfolio_name,

View File

@ -39,42 +39,52 @@
<hr> <hr>
<section> <h3 class="subheading">Reporting {{ TOEditLink(screen=1) }}</h3>
<h2>Generated Documents</h2>
<ul class="usa-unstyled-list"> <div class="row">
<li> <div class="col col--grow">
<a href="#" download> <h4>App Migration</h4>
{{ Icon('download') }} <p>{{ task_order.app_migration_description or RequiredLabel() }}</p>
Cover Sheet </div>
</a>
</li>
<li> <div class="col col--grow">
<a href="#" download> <h4>Native Apps</h4>
{{ Icon('download') }} <p>{{ task_order.native_apps_description or RequiredLabel() }}</p>
Market Research </div>
</a> </div>
</li
>
{% if task_order %} <h4>Project Complextiy</h4>
<li> {% if task_order.complexity %}
<a href="{{ url_for('task_orders.download_summary', task_order_id=task_order.id) }}" download> <ul class="checked-list">
{{ Icon('download') }} {% for item in task_order.complexity %}
Task Order Draft <li>{{ "forms.task_order.complexity.{}".format(item) | translate }}</li>
</a> {% endfor %}
</li>
{% endif %}
<li>
<a href="#" download>
{{ Icon('download') }}
DD 254
</a>
</li>
</ul> </ul>
</section> <!-- need to add in other here! -->
{% else %}
<p>{{ RequiredLabel() }}</p>
{% endif %}
<div class="row">
<div class="col col--grow">
<h4>Development Team</h4>
{% if task_order.dev_team %}
<ul>
{% for item in task_order.dev_team %}
<li>{{ item.title() }}</li>
{% endfor %}
</ul>
<!-- need to add in other here -->
{% else %}
<p>{{ RequiredLabel() }}</p>
{% endif %}
</div>
<div class="col col--grow">
<h4>Team Experience</h4>
<p>{{ task_order.team_experience_description or RequiredLabel() }}</p>
</div>
</div>
<hr> <hr>

View File

@ -169,19 +169,39 @@ forms:
scope_label: Cloud Project Scope 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. 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 defense_component_label: Department of Defense Component
app_migration_label: App Migration app_migration:
app_migration_description: Do you plan to migrate existing application(s) to the cloud? label: App Migration
description: Do you plan to migrate existing application(s) to the cloud?
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"
native_apps_label: Native Apps native_apps_label: Native Apps
native_apps_description: Do you plan to develop application(s) natively in the cloud? native_apps_description: Do you plan to develop application(s) natively in the cloud?
complexity_label: Project Complexity complexity:
complexity_description: Which of these describes how complex your team's use of the cloud will be? Select all that apply. 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 complexity_other_label: Project Complexity Other
dev_team_label: Development Team 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_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 dev_team_other_label: Development Team Other
team_experience_label: Team Experience team_experience:
team_experience_description: How much experience does your team have with development in the cloud? label: Team Experience
performance_length_label: Period of Performance length 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 start_date_label: Start Date
end_date_label: End Date end_date_label: End Date
pdf_label: Upload a copy of your CSP Cost Estimate Research pdf_label: Upload a copy of your CSP Cost Estimate Research