diff --git a/alembic/versions/0ee5a34a1b84_add_extension_to_invites.py b/alembic/versions/0ee5a34a1b84_add_extension_to_invites.py new file mode 100644 index 00000000..c26faf7c --- /dev/null +++ b/alembic/versions/0ee5a34a1b84_add_extension_to_invites.py @@ -0,0 +1,30 @@ +"""add extension to invites + +Revision ID: 0ee5a34a1b84 +Revises: 4a3122ffe898 +Create Date: 2019-09-09 16:16:32.018776 + +""" +from alembic import op +import sqlalchemy as sa + + +# revision identifiers, used by Alembic. +revision = '0ee5a34a1b84' # pragma: allowlist secret +down_revision = '4a3122ffe898' # pragma: allowlist secret +branch_labels = None +depends_on = None + + +def upgrade(): + # ### commands auto generated by Alembic - please adjust! ### + op.add_column('application_invitations', sa.Column('phone_ext', sa.String(), nullable=True)) + op.add_column('portfolio_invitations', sa.Column('phone_ext', sa.String(), nullable=True)) + # ### end Alembic commands ### + + +def downgrade(): + # ### commands auto generated by Alembic - please adjust! ### + op.drop_column('portfolio_invitations', 'phone_ext') + op.drop_column('application_invitations', 'phone_ext') + # ### end Alembic commands ### diff --git a/atst/forms/member.py b/atst/forms/member.py index aca653e5..a97d5852 100644 --- a/atst/forms/member.py +++ b/atst/forms/member.py @@ -21,6 +21,7 @@ class NewForm(FlaskForm): translate("forms.new_member.phone_number_label"), validators=[Optional(), PhoneNumber()], ) + phone_ext = StringField("Extension") dod_id = StringField( translate("forms.new_member.dod_id_label"), validators=[Required(), Length(min=10), IsNumber()], diff --git a/atst/models/mixins/invites.py b/atst/models/mixins/invites.py index f6c17f43..69e016f8 100644 --- a/atst/models/mixins/invites.py +++ b/atst/models/mixins/invites.py @@ -49,6 +49,7 @@ class InvitesMixin(object): first_name = Column(String) last_name = Column(String) phone_number = Column(String) + phone_ext = Column(String) def __repr__(self): role_id = self.role.id if self.role else None diff --git a/styles/sections/_application_edit.scss b/styles/sections/_application_edit.scss index 985b6956..e487eee1 100644 --- a/styles/sections/_application_edit.scss +++ b/styles/sections/_application_edit.scss @@ -25,6 +25,8 @@ } #modal--add-app-mem { + text-align: left; + input[type="checkbox"] + label::before { margin-left: 0; } @@ -32,6 +34,30 @@ .input__inline-fields { text-align: left; } + + .form-row { + margin-top: 0; + + .usa-input { + margin: 0; + width: 45rem; + + input, + label, + .usa-input__message { + max-width: unset; + } + + label .icon-validation { + left: unset; + right: -$gap * 4; + } + + &--validation--phoneExt { + width: 18rem; + } + } + } } .app-team-settings-link { diff --git a/templates/fragments/applications/new_member_modal_content.html b/templates/fragments/applications/new_member_modal_content.html index e5774ee7..92f34dcf 100644 --- a/templates/fragments/applications/new_member_modal_content.html +++ b/templates/fragments/applications/new_member_modal_content.html @@ -1,33 +1,27 @@ {% from "components/icon.html" import Icon %} {% from "components/text_input.html" import TextInput %} {% from "components/checkbox_input.html" import CheckboxInput %} +{% from "components/phone_input.html" import PhoneInput %} {% macro MemberStepOne(new_member_form) %}
-
- {{ TextInput(new_member_form.user_data.first_name, validation='requiredField', optional=False) }} -
-
- {{ TextInput(new_member_form.user_data.last_name, validation='requiredField', optional=False) }} -
+ {{ TextInput(new_member_form.user_data.first_name, validation='requiredField', optional=False) }}
-
- {{ TextInput(new_member_form.user_data.email, validation='email', optional=False) }} -
-
- {{ TextInput(new_member_form.user_data.phone_number, validation='usPhone', optional=True) }} -
+ {{ TextInput(new_member_form.user_data.last_name, validation='requiredField', optional=False) }}
-
- {{ TextInput(new_member_form.user_data.dod_id, validation='dodId', optional=False) }} -
-
-
+ {{ TextInput(new_member_form.user_data.email, validation='email', optional=False) }} +
+
+ {{ PhoneInput(new_member_form.user_data.phone_number, new_member_form.user_data.phone_ext)}} +
+
+ {{ TextInput(new_member_form.user_data.dod_id, validation='dodId', optional=False) }}