Merge pull request #1203 from dod-ccpo/new-portfolio-validation

Bugfixes
This commit is contained in:
leigh-mil 2019-11-25 09:46:27 -05:00 committed by GitHub
commit 6de93d7181
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
10 changed files with 19 additions and 34 deletions

View File

@ -113,19 +113,17 @@ class ApplicationRole(
@property @property
def display_status(self): def display_status(self):
if ( if (
self.is_pending
and self.latest_invitation
and self.latest_invitation.is_pending
):
return "invite_pending"
elif (
self.is_pending self.is_pending
and self.latest_invitation and self.latest_invitation
and self.latest_invitation.is_expired and self.latest_invitation.is_expired
): ):
return "invite_expired" return "invite_expired"
elif (
self.is_pending
and self.latest_invitation
and self.latest_invitation.is_pending
):
return "invite_pending"
elif self.is_active and any( elif self.is_active and any(
env_role.is_pending for env_role in self.environment_roles env_role.is_pending for env_role in self.environment_roles
): ):

View File

@ -14,6 +14,7 @@ export default {
default: () => [], default: () => [],
}, },
initialOtherValue: String, initialOtherValue: String,
optional: Boolean,
}, },
data: function() { data: function() {
@ -45,7 +46,7 @@ export default {
computed: { computed: {
valid: function() { valid: function() {
return this.showValid return this.optional || this.showValid
}, },
}, },
} }

View File

@ -10,10 +10,6 @@ export default {
default: () => [], default: () => [],
}, },
initialValue: String, initialValue: String,
watch: {
type: Boolean,
default: false,
},
optional: Boolean, optional: Boolean,
nullOption: { nullOption: {
type: String, type: String,

View File

@ -27,10 +27,6 @@ export default {
paragraph: String, paragraph: String,
noMaxWidth: String, noMaxWidth: String,
optional: Boolean, optional: Boolean,
watch: {
type: Boolean,
default: false,
},
}, },
data: function() { data: function() {

View File

@ -66,8 +66,7 @@
<optionsinput inline-template <optionsinput inline-template
v-bind:initial-value="'{{ sub_form.role.data | string }}'" v-bind:initial-value="'{{ sub_form.role.data | string }}'"
v-bind:name="'{{ sub_form.name | string }}{% if member_role_id %}-{{ member_role_id }}{% endif %}'" v-bind:name="'{{ sub_form.name | string }}{% if member_role_id %}-{{ member_role_id }}{% endif %}'"
v-bind:optional="true" v-bind:optional="true">
v-bind:watch="true">
<fieldset data-ally-disabled="true" v-on:change="onInput" class="usa-input__choices"> <fieldset data-ally-disabled="true" v-on:change="onInput" class="usa-input__choices">
{{ sub_form.role(**{"v-model": "value", "id": "{}-{}".format(sub_form.role.name, member_role_id)}) }} {{ sub_form.role(**{"v-model": "value", "id": "{}-{}".format(sub_form.role.name, member_role_id)}) }}
</fieldset> </fieldset>

View File

@ -1,6 +1,6 @@
{% from 'components/icon.html' import Icon %} {% from 'components/icon.html' import Icon %}
{% macro CLINDollarAmount(type, field=None, funding_validation=False) -%} {% macro CLINDollarAmount(type, field=None, funding_validation=False) -%}
<div class="form-row"> <div class="form-row">
<div class="form-col"> <div class="form-col">
<clindollaramount <clindollaramount
@ -21,16 +21,15 @@
:key="'clins-' + clinIndex + '-' + '{{ type }}' + '_amount'" :key="'clins-' + clinIndex + '-' + '{{ type }}' + '_amount'"
{% endif %} {% endif %}
validation="clinDollars" validation="clinDollars">
:watch='true'>
<div v-bind:class="['usa-input usa-input--validation--dollars', { 'usa-input--error': showFundingError, 'usa-input--success': showFundingValid}]"> <div v-bind:class="['usa-input usa-input--validation--dollars', { 'usa-input--error': showFundingError, 'usa-input--success': showFundingValid}]">
{% if field %} {% if field %}
<label for='{{ field.name }}'> <label for='{{ field.name }}'>
{% else %} {% else %}
<label :for='name'> <label :for='name'>
{% endif %} {% endif %}
{% if type=="obligated" %} {% if type=="obligated" %}
<div class="usa-input__title">{{ 'task_orders.form.obligated_funds_label' | translate }}</div> <div class="usa-input__title">{{ 'task_orders.form.obligated_funds_label' | translate }}</div>
{% else %} {% else %}
<div class="usa-input__title">{{ 'task_orders.form.total_funds_label' | translate }}</div> <div class="usa-input__title">{{ 'task_orders.form.total_funds_label' | translate }}</div>
@ -67,4 +66,4 @@
</clindollaramount> </clindollaramount>
</div> </div>
</div> </div>
{%- endmacro %} {%- endmacro %}

View File

@ -41,10 +41,9 @@
<div class="form-row"> <div class="form-row">
<div class="form-col"> <div class="form-col">
{% if fields %} {% if fields %}
{{ TextInput(fields.number, watch=True, optional=False) }} {{ TextInput(fields.number, optional=False) }}
{% else %} {% else %}
<textinput :name="'clins-' + clinIndex + '-number'" :watch='true' <textinput :name="'clins-' + clinIndex + '-number'" inline-template>
inline-template>
<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 }]"> <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 }]">
<label :for="name"> <label :for="name">
<span v-show='showError'>{{ Icon('alert',classes="icon-validation") }}</span> <span v-show='showError'>{{ Icon('alert',classes="icon-validation") }}</span>
@ -82,9 +81,9 @@
<div class="form-row"> <div class="form-row">
<div class="form-col"> <div class="form-col">
{% if fields %} {% if fields %}
{{ OptionsInput(fields.jedi_clin_type, watch=True, show_validation=False, optional=False) }} {{ OptionsInput(fields.jedi_clin_type, show_validation=False, optional=False) }}
{% else %} {% else %}
<optionsinput :name="'clins-' + clinIndex + '-jedi_clin_type'" :watch='true' :optional='false' inline-template> <optionsinput :name="'clins-' + clinIndex + '-jedi_clin_type'" :optional='false' inline-template>
<div v-bind:class="['usa-input', { 'usa-input--error': showError, 'usa-input--success': showValid }]"> <div v-bind:class="['usa-input', { 'usa-input--error': showError, 'usa-input--success': showValid }]">
<fieldset data-ally-disabled="true" class="usa-input__choices" v-on:change="onInput"> <fieldset data-ally-disabled="true" class="usa-input__choices" v-on:change="onInput">
<legend> <legend>

View File

@ -11,6 +11,7 @@
{% if other_input_field and other_input_field.data and other_input_field.data != "None" %} {% if other_input_field and other_input_field.data and other_input_field.data != "None" %}
initial-other-value="{{ other_input_field.data }}" initial-other-value="{{ other_input_field.data }}"
{% endif %} {% endif %}
v-bind:optional={{ optional|lower }}
key='{{ field.name }}'> key='{{ field.name }}'>
<div <div
v-bind:class="['usa-input', { 'usa-input--error': showError, 'usa-input--success': showValid }]"> v-bind:class="['usa-input', { 'usa-input--error': showError, 'usa-input--success': showValid }]">

View File

@ -8,7 +8,6 @@
label=True, label=True,
show_validation=True, show_validation=True,
disabled=False, disabled=False,
watch=False,
optional=True) -%} optional=True) -%}
<optionsinput <optionsinput
name='{{ field.name }}' name='{{ field.name }}'
@ -16,7 +15,6 @@
{% if field.errors %}v-bind:initial-errors='{{ field.errors | list }}'{% endif %} {% if field.errors %}v-bind:initial-errors='{{ field.errors | list }}'{% endif %}
{% if field.data and field.data != "None" %}v-bind:initial-value="'{{ field.data }}'"{% endif %} {% if field.data and field.data != "None" %}v-bind:initial-value="'{{ field.data }}'"{% endif %}
key='{{ field.name }}' key='{{ field.name }}'
v-bind:watch='{{ watch | string | lower }}'
v-bind:optional={{ optional|lower }} v-bind:optional={{ optional|lower }}
v-bind:null-option="'{{ field.default }}'" v-bind:null-option="'{{ field.default }}'"
> >

View File

@ -17,7 +17,6 @@
optional=True, optional=True,
showOptional=True, showOptional=True,
showLabel=True, showLabel=True,
watch=False,
show_validation=True) -%} show_validation=True) -%}
<textinput <textinput
@ -30,7 +29,6 @@
{% if field.errors %}v-bind:initial-errors='{{ field.errors | list }}'{% endif %} {% if field.errors %}v-bind:initial-errors='{{ field.errors | list }}'{% endif %}
v-bind:optional={{ optional|lower }} v-bind:optional={{ optional|lower }}
key='{{ field.name }}' key='{{ field.name }}'
:watch='{{ watch | string | lower }}'
inline-template> inline-template>
<div <div