Disable CLIN fields via a config option
This commit is contained in:
parent
7a7f8914c8
commit
99f34fe45a
@ -121,6 +121,7 @@ def map_config(config):
|
|||||||
**config["default"],
|
**config["default"],
|
||||||
"ENV": config["default"]["ENVIRONMENT"],
|
"ENV": config["default"]["ENVIRONMENT"],
|
||||||
"DEBUG": config["default"].getboolean("DEBUG"),
|
"DEBUG": config["default"].getboolean("DEBUG"),
|
||||||
|
"CLASSIFIED": config["default"].getboolean("CLASSIFIED"),
|
||||||
"PORT": int(config["default"]["PORT"]),
|
"PORT": int(config["default"]["PORT"]),
|
||||||
"SQLALCHEMY_DATABASE_URI": config["default"]["DATABASE_URI"],
|
"SQLALCHEMY_DATABASE_URI": config["default"]["DATABASE_URI"],
|
||||||
"SQLALCHEMY_TRACK_MODIFICATIONS": False,
|
"SQLALCHEMY_TRACK_MODIFICATIONS": False,
|
||||||
|
@ -77,6 +77,11 @@ class FundingForm(CacheableForm):
|
|||||||
clin_04 = IntegerField("CLIN 04: Classified")
|
clin_04 = IntegerField("CLIN 04: Classified")
|
||||||
|
|
||||||
|
|
||||||
|
class UnclassifiedFundingForm(FundingForm):
|
||||||
|
clin_02 = IntegerField("CLIN 02: Classified (available soon)")
|
||||||
|
clin_04 = IntegerField("CLIN 04: Classified (available soon)")
|
||||||
|
|
||||||
|
|
||||||
class OversightForm(CacheableForm):
|
class OversightForm(CacheableForm):
|
||||||
ko_first_name = StringField("First Name")
|
ko_first_name = StringField("First Name")
|
||||||
ko_last_name = StringField("Last Name")
|
ko_last_name = StringField("Last Name")
|
||||||
|
@ -1,4 +1,11 @@
|
|||||||
from flask import request as http_request, render_template, g, redirect, url_for
|
from flask import (
|
||||||
|
request as http_request,
|
||||||
|
render_template,
|
||||||
|
g,
|
||||||
|
redirect,
|
||||||
|
url_for,
|
||||||
|
current_app as app,
|
||||||
|
)
|
||||||
|
|
||||||
from . import task_orders_bp
|
from . import task_orders_bp
|
||||||
from atst.domain.task_orders import TaskOrders
|
from atst.domain.task_orders import TaskOrders
|
||||||
@ -18,6 +25,7 @@ TASK_ORDER_SECTIONS = [
|
|||||||
"title": "Funding",
|
"title": "Funding",
|
||||||
"template": "task_orders/new/funding.html",
|
"template": "task_orders/new/funding.html",
|
||||||
"form": task_order_form.FundingForm,
|
"form": task_order_form.FundingForm,
|
||||||
|
"unclassified_form": task_order_form.UnclassifiedFundingForm,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"section": "oversight",
|
"section": "oversight",
|
||||||
@ -59,12 +67,18 @@ class ShowTaskOrderWorkflow:
|
|||||||
|
|
||||||
@property
|
@property
|
||||||
def form(self):
|
def form(self):
|
||||||
|
form_type = (
|
||||||
|
"unclassified_form"
|
||||||
|
if "unclassified_form" in self._section and not app.config.get("CLASSIFIED")
|
||||||
|
else "form"
|
||||||
|
)
|
||||||
|
|
||||||
if self._form:
|
if self._form:
|
||||||
pass
|
pass
|
||||||
elif self.task_order:
|
elif self.task_order:
|
||||||
self._form = self._section["form"](formdata=self.task_order_formdata)
|
self._form = self._section[form_type](formdata=self.task_order_formdata)
|
||||||
else:
|
else:
|
||||||
self._form = self._section["form"]()
|
self._form = self._section[form_type]()
|
||||||
|
|
||||||
return self._form
|
return self._form
|
||||||
|
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
[default]
|
[default]
|
||||||
CAC_URL = http://localhost:8000/login-redirect
|
CAC_URL = http://localhost:8000/login-redirect
|
||||||
CA_CHAIN = ssl/server-certs/ca-chain.pem
|
CA_CHAIN = ssl/server-certs/ca-chain.pem
|
||||||
|
CLASSIFIED = false
|
||||||
COOKIE_SECRET = some-secret-please-replace
|
COOKIE_SECRET = some-secret-please-replace
|
||||||
CRL_DIRECTORY = crl
|
CRL_DIRECTORY = crl
|
||||||
DEBUG = true
|
DEBUG = true
|
||||||
|
@ -108,6 +108,15 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.usa-input__coming-soon {
|
||||||
|
@include h5;
|
||||||
|
font-weight: normal;
|
||||||
|
|
||||||
|
@include line-max;
|
||||||
|
|
||||||
|
color: $color-gray-medium;
|
||||||
|
}
|
||||||
|
|
||||||
input,
|
input,
|
||||||
textarea,
|
textarea,
|
||||||
select,
|
select,
|
||||||
@ -348,3 +357,17 @@ select {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.input--disabled {
|
||||||
|
color: $color-gray-lighter;
|
||||||
|
|
||||||
|
input[disabled] {
|
||||||
|
border-color: $color-gray-lighter;
|
||||||
|
cursor: not-allowed;
|
||||||
|
|
||||||
|
&:hover {
|
||||||
|
border-color: $color-gray-lighter !important;
|
||||||
|
box-shadow: none;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
@ -9,6 +9,7 @@
|
|||||||
placeholder='',
|
placeholder='',
|
||||||
validation='anything',
|
validation='anything',
|
||||||
paragraph=False,
|
paragraph=False,
|
||||||
|
disabled=False,
|
||||||
initial_value='',
|
initial_value='',
|
||||||
noMaxWidth=False) -%}
|
noMaxWidth=False) -%}
|
||||||
|
|
||||||
@ -23,10 +24,14 @@
|
|||||||
inline-template>
|
inline-template>
|
||||||
|
|
||||||
<div
|
<div
|
||||||
v-bind:class="['usa-input usa-input--validation--' + validation, { 'usa-input--error': showError, 'usa-input--success': showValid, 'usa-input--validation--paragraph': paragraph, 'no-max-width': noMaxWidth }]">
|
{% if disabled %}class="input--disabled"{% endif %}
|
||||||
|
v-bind:class="['usa-input usa-input--validation--' + validation, { 'usa-input--error': showError, 'usa-input--success': showValid, 'usa-input--validation--paragraph': paragraph, 'no-max-width': noMaxWidth, 'disabled-available-soon': disabled_available_soon }]">
|
||||||
|
|
||||||
<label for={{field.name}}>
|
<label for={{field.name}}>
|
||||||
<div class="usa-input__title">{{ label }} {% if tooltip %}{{ Tooltip(tooltip) }}{% endif %}</div>
|
<div class="usa-input__title">
|
||||||
|
{{ label }}
|
||||||
|
{% if tooltip %}{{ Tooltip(tooltip) }}{% endif %}
|
||||||
|
</div>
|
||||||
|
|
||||||
{% if field.description %}
|
{% if field.description %}
|
||||||
<span class='usa-input__help'>{{ description | safe }}</span>
|
<span class='usa-input__help'>{{ description | safe }}</span>
|
||||||
@ -60,6 +65,9 @@
|
|||||||
v-bind:aria-invalid='showError'
|
v-bind:aria-invalid='showError'
|
||||||
id='{{ field.name }}'
|
id='{{ field.name }}'
|
||||||
type='text'
|
type='text'
|
||||||
|
{% if disabled %}
|
||||||
|
disabled="disabled"
|
||||||
|
{% endif %}
|
||||||
ref='input'
|
ref='input'
|
||||||
placeholder='{{ placeholder }}'>
|
placeholder='{{ placeholder }}'>
|
||||||
</masked-input>
|
</masked-input>
|
||||||
|
@ -65,7 +65,7 @@
|
|||||||
</p>
|
</p>
|
||||||
|
|
||||||
{{ TextInput(form.clin_01, validation='dollars') }}
|
{{ TextInput(form.clin_01, validation='dollars') }}
|
||||||
{{ TextInput(form.clin_02, validation='dollars') }}
|
{{ TextInput(form.clin_02, validation='dollars', disabled=(not config.CLASSIFIED)) }}
|
||||||
|
|
||||||
<h4>Cloud Support and Assistance</h4>
|
<h4>Cloud Support and Assistance</h4>
|
||||||
<p>
|
<p>
|
||||||
@ -74,7 +74,7 @@
|
|||||||
other services.
|
other services.
|
||||||
</p>
|
</p>
|
||||||
{{ TextInput(form.clin_03, validation='dollars', tooltip='The cloud support and assistance packages cannot be used as a primary development resource.') }}
|
{{ TextInput(form.clin_03, validation='dollars', tooltip='The cloud support and assistance packages cannot be used as a primary development resource.') }}
|
||||||
{{ TextInput(form.clin_04, validation='dollars', tooltip='The cloud support and assistance packages cannot be used as a primary development resource.') }}
|
{{ TextInput(form.clin_04, validation='dollars', tooltip='The cloud support and assistance packages cannot be used as a primary development resource.', disabled=(not config.CLASSIFIED)) }}
|
||||||
</div>
|
</div>
|
||||||
</funding>
|
</funding>
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user