Merge pull request #607 from dod-ccpo/portfolio-name-validation

Portfolio name validation
This commit is contained in:
leigh-mil 2019-02-06 16:38:37 -05:00 committed by GitHub
commit 6cadd4df1d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 11 additions and 4 deletions

View File

@ -31,7 +31,14 @@ class AppInfoForm(CacheableForm):
portfolio_name = StringField(
translate("forms.task_order.portfolio_name_label"),
description=translate("forms.task_order.portfolio_name_description"),
validators=[Required()],
validators=[
Required(),
Length(
min=4,
max=100,
message=translate("forms.portfolio.name_length_validation_message"),
),
],
)
scope = TextAreaField(
translate("forms.task_order.scope_label"),

View File

@ -122,6 +122,6 @@ export default {
match: /^.{4,100}$/,
unmask: [],
validationError:
'Portfolio and request names must be at least 4 and not more than 100 characters',
'Portfolio names must be at least 4 and not more than 100 characters',
},
}

View File

@ -13,7 +13,7 @@
<!-- App Info Section -->
<h3 class="task-order-form__heading subheading">{{ "task_orders.new.app_info.basic_info_title"| translate }}</h3>
{{ TextInput(form.portfolio_name, placeholder="The name of your office or organization") }}
{{ TextInput(form.portfolio_name, placeholder="The name of your office or organization", validation="portfolioName") }}
{{ TextInput(form.scope, paragraph=True) }}
<p><i>{{ "task_orders.new.app_info.sample_scope" | translate | safe }}</i></p>
<div class="subheading--black">

View File

@ -254,7 +254,7 @@ forms:
is_required: This field is required.
portfolio:
name_label: Portfolio Name
name_length_validation_message: Portfolio names must be at least 4 and not more than 50 characters
name_length_validation_message: Portfolio names must be at least 4 and not more than 100 characters
fragments:
edit_application_form:
existing_application_title: 'Edit {application_name} application'