Add phone ext

This commit is contained in:
leigh-mil 2018-10-29 14:01:16 -04:00
parent 9992ed44b6
commit 6bc157b2b3
16 changed files with 82 additions and 5 deletions

View File

@ -0,0 +1,32 @@
"""Add Phone Extension
Revision ID: 4c0b8263d800
Revises: 9c24c609878a
Create Date: 2018-10-29 11:14:01.332665
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = '4c0b8263d800'
down_revision = '9c24c609878a'
branch_labels = None
depends_on = None
def upgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.add_column('request_reviews', sa.Column('phone_ext_mao', sa.String(), nullable=True))
op.add_column('request_revisions', sa.Column('phone_ext', sa.String(), nullable=True))
op.add_column('users', sa.Column('phone_ext', sa.String(), nullable=True))
# ### end Alembic commands ###
def downgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.drop_column('users', 'phone_ext')
op.drop_column('request_revisions', 'phone_ext')
op.drop_column('request_reviews', 'phone_ext_mao')
# ### end Alembic commands ###

View File

@ -69,6 +69,7 @@ class Users(object):
"last_name", "last_name",
"email", "email",
"phone_number", "phone_number",
"phone_ext",
"service_branch", "service_branch",
"citizenship", "citizenship",
"designation", "designation",

View File

@ -19,5 +19,6 @@ class CCPOReviewForm(ValidatedForm):
phone_mao = TelField( phone_mao = TelField(
"Mission Owner phone number (optional)", validators=[Optional(), PhoneNumber()] "Mission Owner phone number (optional)", validators=[Optional(), PhoneNumber()]
) )
phone_ext_mao = StringField("Extension (optional)")
fname_ccpo = StringField("First Name (optional)", validators=[Optional(), Name()]) fname_ccpo = StringField("First Name (optional)", validators=[Optional(), Name()])
lname_ccpo = StringField("Last Name (optional)", validators=[Optional(), Name()]) lname_ccpo = StringField("Last Name (optional)", validators=[Optional(), Name()])

View File

@ -25,6 +25,7 @@ USER_FIELDS = {
description="Enter your 10-digit U.S. phone number", description="Enter your 10-digit U.S. phone number",
validators=[PhoneNumber()], validators=[PhoneNumber()],
), ),
"phone_ext": StringField("Extension"),
"service_branch": SelectField( "service_branch": SelectField(
"Service Branch or Agency", "Service Branch or Agency",
description="Which service or organization do you belong to within the DoD?", description="Which service or organization do you belong to within the DoD?",
@ -86,6 +87,7 @@ class EditUserForm(ValidatedForm):
last_name = inherit_user_field("last_name") last_name = inherit_user_field("last_name")
email = inherit_user_field("email") email = inherit_user_field("email")
phone_number = inherit_user_field("phone_number") phone_number = inherit_user_field("phone_number")
phone_ext = inherit_user_field("phone_ext")
service_branch = inherit_user_field("service_branch") service_branch = inherit_user_field("service_branch")
citizenship = inherit_user_field("citizenship") citizenship = inherit_user_field("citizenship")
designation = inherit_user_field("designation") designation = inherit_user_field("designation")

View File

@ -167,6 +167,7 @@ class InformationAboutYouForm(ValidatedForm):
lname_request = inherit_field(USER_FIELDS["last_name"]) lname_request = inherit_field(USER_FIELDS["last_name"])
email_request = inherit_field(USER_FIELDS["email"]) email_request = inherit_field(USER_FIELDS["email"])
phone_number = inherit_field(USER_FIELDS["phone_number"]) phone_number = inherit_field(USER_FIELDS["phone_number"])
phone_ext = inherit_field(USER_FIELDS["phone_ext"], required=False)
service_branch = inherit_field(USER_FIELDS["service_branch"]) service_branch = inherit_field(USER_FIELDS["service_branch"])
citizenship = inherit_field(USER_FIELDS["citizenship"]) citizenship = inherit_field(USER_FIELDS["citizenship"])
designation = inherit_field(USER_FIELDS["designation"]) designation = inherit_field(USER_FIELDS["designation"])

View File

@ -81,6 +81,7 @@ class Request(Base, mixins.TimestampsMixin, mixins.AuditableMixin):
"citizenship", "citizenship",
"designation", "designation",
"phone_number", "phone_number",
"phone_ext",
"email_request", "email_request",
"fname_request", "fname_request",
"lname_request", "lname_request",

View File

@ -18,6 +18,7 @@ class RequestReview(Base, mixins.TimestampsMixin, mixins.AuditableMixin):
lname_mao = Column(String) lname_mao = Column(String)
email_mao = Column(String) email_mao = Column(String)
phone_mao = Column(String) phone_mao = Column(String)
phone_ext_mao = Column(String)
fname_ccpo = Column(String) fname_ccpo = Column(String)
lname_ccpo = Column(String) lname_ccpo = Column(String)

View File

@ -57,6 +57,7 @@ class RequestRevision(Base, mixins.TimestampsMixin, mixins.AuditableMixin):
citizenship = Column(String) citizenship = Column(String)
designation = Column(String) designation = Column(String)
phone_number = Column(String) phone_number = Column(String)
phone_ext = Column(String)
email_request = Column(String) email_request = Column(String)
fname_request = Column(String) fname_request = Column(String)
lname_request = Column(String) lname_request = Column(String)

View File

@ -21,6 +21,7 @@ class User(Base, mixins.TimestampsMixin, mixins.AuditableMixin):
first_name = Column(String) first_name = Column(String)
last_name = Column(String) last_name = Column(String)
phone_number = Column(String) phone_number = Column(String)
phone_ext = Column(String)
service_branch = Column(String) service_branch = Column(String)
citizenship = Column(String) citizenship = Column(String)
designation = Column(String) designation = Column(String)

View File

@ -64,6 +64,7 @@ class JEDIRequestFlow(object):
"lname_request": user.last_name, "lname_request": user.last_name,
"email_request": user.email, "email_request": user.email,
"phone_number": user.phone_number, "phone_number": user.phone_number,
"phone_ext": user.phone_ext,
"service_branch": user.service_branch, "service_branch": user.service_branch,
"designation": user.designation, "designation": user.designation,
"citizenship": user.citizenship, "citizenship": user.citizenship,

View File

@ -42,6 +42,10 @@
flex-basis: 66.66%; flex-basis: 66.66%;
} }
&.form-col--sixth {
flex-basis: 16.66%;
}
.usa-input { .usa-input {
margin-left: ($gap * 4); margin-left: ($gap * 4);
margin-right: ($gap * 4); margin-right: ($gap * 4);

View File

@ -21,9 +21,12 @@
{{ TextInput(form.email, validation='email') }} {{ TextInput(form.email, validation='email') }}
</div> </div>
<div class='form-col form-col--half'> <div class='form-col form-col--third'>
{{ TextInput(form.phone_number, validation='usPhone') }} {{ TextInput(form.phone_number, validation='usPhone') }}
</div> </div>
<div class='form-col form-col--sixth'>
{{ TextInput(form.phone_ext)}}
</div>
</div> </div>
{{ OptionsInput(form.service_branch) }} {{ OptionsInput(form.service_branch) }}

View File

@ -102,7 +102,20 @@
{{ DefinitionReviewField("Email Address", "information_about_you", "email_request") }} {{ DefinitionReviewField("Email Address", "information_about_you", "email_request") }}
{{ DefinitionReviewField("Phone Number", "information_about_you", "phone_number", filter="usPhone") }} <div>
<dt>Phone Number</dt>
<dd>
{% if data.information_about_you.phone_number is not none %}
{{ data.information_about_you.phone_number }}
{% else %}
{{ RequiredLabel() }}
{% endif %}
{% if data.information_about_you.phone_ext %}
ext. {{ data.information_about_you.phone_ext }}
{% endif %}
</dd>
</div>
{{ DefinitionReviewField("Service Branch or Agency", "information_about_you", "service_branch", filter="getOptionLabel", filter_args=[service_branches]) }} {{ DefinitionReviewField("Service Branch or Agency", "information_about_you", "service_branch", filter="getOptionLabel", filter_args=[service_branches]) }}

View File

@ -112,7 +112,12 @@
<h3 class='approval-log__log-item__header'>Mission Owner approval on behalf of:</h3> <h3 class='approval-log__log-item__header'>Mission Owner approval on behalf of:</h3>
<span>{{ review.full_name_mao }}</span> <span>{{ review.full_name_mao }}</span>
<span>{{ review.email_mao }}</span> <span>{{ review.email_mao }}</span>
<span>{{ review.phone_mao }}</span> <span>
{{ review.phone_mao }}
{% if review.phone_ext_mao %}
ext. {{ review.phone_ext_mao }}
{% endif %}
</span>
</div> </div>
{% endif %} {% endif %}
@ -202,9 +207,13 @@
{{ TextInput(review_form.email_mao, placeholder="name@mail.mil", validation='email') }} {{ TextInput(review_form.email_mao, placeholder="name@mail.mil", validation='email') }}
</div> </div>
<div class='form-col form-col--half'> <div class='form-col form-col--third'>
{{ TextInput(review_form.phone_mao, placeholder="(123) 456-7890", validation='usPhone') }} {{ TextInput(review_form.phone_mao, placeholder="(123) 456-7890", validation='usPhone') }}
</div> </div>
<div class='form-col form-col--sixth'>
{{ TextInput(review_form.phone_ext_mao)}}
</div>
</div> </div>
<hr /> <hr />

View File

@ -27,7 +27,12 @@
<div class='form-row'> <div class='form-row'>
<div class='form-col form-col--half'>{{ TextInput(f.email_request, placeholder='e.g. jane@mail.mil', validation='email') }}</div> <div class='form-col form-col--half'>{{ TextInput(f.email_request, placeholder='e.g. jane@mail.mil', validation='email') }}</div>
<div class='form-col form-col--half'>{{ TextInput(f.phone_number, placeholder='e.g. (123) 456-7890', validation='usPhone') }}</div> <div class='form-col form-col--third'>
{{ TextInput(f.phone_number, placeholder='e.g. (123) 456-7890', validation='usPhone') }}
</div>
<div class='form-col form-col--sixth'>
{{ TextInput(f.phone_ext)}}
</div>
</div> </div>
<p>We want to collect the following information from you for security auditing and determining priviledged user access.</p> <p>We want to collect the following information from you for security auditing and determining priviledged user access.</p>

View File

@ -163,6 +163,7 @@ class RequestFactory(Base):
citizenship="United States", citizenship="United States",
designation="military", designation="military",
phone_number="1234567890", phone_number="1234567890",
phone_ext="123",
email_request=user.email, email_request=user.email,
fname_request=user.first_name, fname_request=user.first_name,
lname_request=user.last_name, lname_request=user.last_name,