diff --git a/alembic/versions/4a3122ffe898_remove_loas.py b/alembic/versions/4a3122ffe898_remove_loas.py new file mode 100644 index 00000000..27ba2084 --- /dev/null +++ b/alembic/versions/4a3122ffe898_remove_loas.py @@ -0,0 +1,32 @@ +"""Remove LOAs + +Revision ID: 4a3122ffe898 +Revises: fda6bd7e1b65 +Create Date: 2019-08-29 16:28:45.017550 + +""" +from alembic import op +import sqlalchemy as sa +from sqlalchemy.dialects import postgresql + +# revision identifiers, used by Alembic. +revision = '4a3122ffe898' # pragma: allowlist secret +down_revision = 'fda6bd7e1b65' # pragma: allowlist secret +branch_labels = None +depends_on = None + + +def upgrade(): + # ### commands auto generated by Alembic - please adjust! ### + op.drop_constraint('clins_task_order_id_fkey', 'clins', type_='foreignkey') + op.create_foreign_key('clins_task_order_id_fkey', 'clins', 'task_orders', ['task_order_id'], ['id']) + op.drop_column('clins', 'loas') + # ### end Alembic commands ### + + +def downgrade(): + # ### commands auto generated by Alembic - please adjust! ### + op.add_column('clins', sa.Column('loas', postgresql.ARRAY(sa.VARCHAR()), server_default=sa.text("'{}'::character varying[]"), autoincrement=False, nullable=True)) + op.drop_constraint('clins_task_order_id_fkey', 'clins', type_='foreignkey') + op.create_foreign_key('clins_task_order_id_fkey', 'clins', 'task_orders', ['task_order_id'], ['id'], ondelete='CASCADE') + # ### end Alembic commands ### diff --git a/atst/domain/task_orders.py b/atst/domain/task_orders.py index ee470395..2c27977c 100644 --- a/atst/domain/task_orders.py +++ b/atst/domain/task_orders.py @@ -56,7 +56,6 @@ class TaskOrders(BaseDomainClass): clin = CLIN( task_order_id=task_order_id, number=clin_data["number"], - loas=clin_data["loas"], start_date=clin_data["start_date"], end_date=clin_data["end_date"], obligated_amount=clin_data["obligated_amount"], diff --git a/atst/forms/task_order.py b/atst/forms/task_order.py index 47323319..e511d53f 100644 --- a/atst/forms/task_order.py +++ b/atst/forms/task_order.py @@ -47,7 +47,6 @@ class CLINForm(FlaskForm): label=translate("task_orders.form.obligated_funds_label"), validators=[Optional()], ) - loas = FieldList(StringField()) def validate(self, *args, **kwargs): valid = super().validate(*args, **kwargs) diff --git a/atst/models/clin.py b/atst/models/clin.py index 32ec7a82..2f5c3f1c 100644 --- a/atst/models/clin.py +++ b/atst/models/clin.py @@ -1,6 +1,5 @@ from enum import Enum from sqlalchemy import Column, Date, Enum as SQLAEnum, ForeignKey, Numeric, String -from sqlalchemy.dialects.postgresql import ARRAY from sqlalchemy.orm import relationship from atst.models import Base, mixins, types @@ -22,7 +21,6 @@ class CLIN(Base, mixins.TimestampsMixin): task_order = relationship("TaskOrder") number = Column(String, nullable=True) - loas = Column(ARRAY(String), server_default="{}", nullable=True) start_date = Column(Date, nullable=True) end_date = Column(Date, nullable=True) obligated_amount = Column(Numeric(scale=2), nullable=True) @@ -46,7 +44,6 @@ class CLIN(Base, mixins.TimestampsMixin): self.end_date, self.obligated_amount, self.jedi_clin_type, - len(self.loas), ] ) diff --git a/js/components/clin_fields.js b/js/components/clin_fields.js index b00666fa..6b948922 100644 --- a/js/components/clin_fields.js +++ b/js/components/clin_fields.js @@ -20,10 +20,6 @@ export default { props: { initialClinIndex: Number, - initialLoaCount: { - type: Number, - default: 0, - }, initialClinType: String, initialAmount: { type: Number, @@ -40,8 +36,6 @@ export default { }, data: function() { - const loas = this.initialLoaCount == 0 ? 1 : 0 - const indexOffset = this.initialLoaCount const start = !!this.initialStartDate ? new Date(this.initialStartDate) : undefined @@ -53,8 +47,6 @@ export default { return { clinIndex: this.initialClinIndex, - indexOffset: this.initialLoaCount, - loas: loas, clinType: this.initialClinType, amount: this.initialAmount || 0, startDate: start, @@ -82,14 +74,6 @@ export default { }, methods: { - addLoa: function(event) { - ++this.loas - }, - - loaIndex: function(index) { - return index + this.indexOffset - 1 - }, - clinChangeEvent: function() { emitEvent('clin-change', this, { id: this._uid, diff --git a/styles/sections/_task_order.scss b/styles/sections/_task_order.scss index 989f35cd..d874abd6 100644 --- a/styles/sections/_task_order.scss +++ b/styles/sections/_task_order.scss @@ -47,12 +47,6 @@ td { padding: 0.8rem; - - &.task-order__loa { - overflow: hidden; - white-space: nowrap; - text-overflow: ellipsis; - } } } @@ -117,29 +111,6 @@ button { margin-bottom: $gap * 3; } - - .task-order__loa-fieldset { - .usa-input__title { - padding: 0 0 0.4rem 0; - font-size: 1.7rem; - } - - .usa-input { - margin: 0; - } - - input { - margin: $gap 0; - - &:first-child { - margin-top: 0; - } - - &:last-child { - margin-bottom: 0; - } - } - } } .usa-input__title, diff --git a/templates/fragments/task_order_review.html b/templates/fragments/task_order_review.html index 563f9169..cf1d276b 100644 --- a/templates/fragments/task_order_review.html +++ b/templates/fragments/task_order_review.html @@ -43,7 +43,6 @@ {{ "task_orders.review.clins.obligated" | translate }} {{ "task_orders.review.clins.pop_start" | translate }} {{ "task_orders.review.clins.pop_end" | translate }} - {{ "task_orders.review.clins.loa" | translate }} @@ -59,14 +58,6 @@ {{ clin.start_date | formattedDate }} {{ clin.end_date | formattedDate }} - - {% for loa in clin.loas %} - - {{ loa }} - -
- {% endfor %} - diff --git a/templates/task_orders/step_3.html b/templates/task_orders/step_3.html index 76e6b6a6..daeee6b1 100644 --- a/templates/task_orders/step_3.html +++ b/templates/task_orders/step_3.html @@ -11,43 +11,10 @@ {% set previous_button_link = url_for("task_orders.form_step_two_add_number", task_order_id=task_order_id) %} {% set step = "3" %} -{% macro LOAInput() %} -
- -
- - - - -
-
-
- - -{% endmacro %} - {% macro CLINFields(fields=None, index=None) %} -
- -
- {{ 'task_orders.form.loa_label' | translate }} -
-
- {% for loa in fields.loas %} - {{ TextInput(loa, showLabel=False, watch=True, show_validation=False) }} - {% endfor %} - - {{ LOAInput() }} -
-
{% if fields %}
diff --git a/tests/domain/test_task_orders.py b/tests/domain/test_task_orders.py index 4c7c21c9..e718d58f 100644 --- a/tests/domain/test_task_orders.py +++ b/tests/domain/test_task_orders.py @@ -84,7 +84,6 @@ def test_create_adds_clins(): "start_date": date(2020, 1, 1), "end_date": date(2021, 1, 1), "obligated_amount": Decimal("5000"), - "loas": ["123123123123", "345345234"], }, { "jedi_clin_type": "JEDI_CLIN_1", @@ -92,7 +91,6 @@ def test_create_adds_clins(): "start_date": date(2020, 1, 1), "end_date": date(2021, 1, 1), "obligated_amount": Decimal("5000"), - "loas": ["78979087"], }, ] task_order = TaskOrders.create( @@ -115,7 +113,6 @@ def test_update_adds_clins(): "start_date": date(2020, 1, 1), "end_date": date(2021, 1, 1), "obligated_amount": Decimal("5000"), - "loas": ["123123123123", "345345234"], }, { "jedi_clin_type": "JEDI_CLIN_1", @@ -123,7 +120,6 @@ def test_update_adds_clins(): "start_date": date(2020, 1, 1), "end_date": date(2021, 1, 1), "obligated_amount": Decimal("5000"), - "loas": ["78979087"], }, ] task_order = TaskOrders.create( @@ -148,7 +144,6 @@ def test_update_does_not_duplicate_clins(): "start_date": date(2020, 1, 1), "end_date": date(2021, 1, 1), "obligated_amount": Decimal("5000"), - "loas": ["123123123123", "345345234"], }, { "jedi_clin_type": "JEDI_CLIN_1", @@ -156,7 +151,6 @@ def test_update_does_not_duplicate_clins(): "start_date": date(2020, 1, 1), "end_date": date(2021, 1, 1), "obligated_amount": Decimal("5000"), - "loas": ["78979087"], }, ] task_order = TaskOrders.update( diff --git a/tests/factories.py b/tests/factories.py index 91fe0566..7dd4a2f6 100644 --- a/tests/factories.py +++ b/tests/factories.py @@ -41,10 +41,6 @@ def random_future_date(year_min=1, year_max=5): return _random_date(year_min, year_max, operator.add) -def random_loa_numbers(): - return ["".join(random.choices(string.digits, k=43))] - - def _random_date(year_min, year_max, operation): if year_min == year_max: inc = year_min @@ -299,7 +295,6 @@ class CLINFactory(Base): jedi_clin_type = factory.LazyFunction( lambda *args: random.choice(list(clin.JEDICLINType)) ) - loas = factory.LazyFunction(random_loa_numbers) class NotificationRecipientFactory(Base): diff --git a/tests/models/test_clin.py b/tests/models/test_clin.py index 0f92103d..ff95f4dc 100644 --- a/tests/models/test_clin.py +++ b/tests/models/test_clin.py @@ -20,4 +20,3 @@ def test_is_obligated(): def test_is_completed(): assert CLINFactory.create().is_completed - assert not CLINFactory.create(loas=[]).is_completed diff --git a/tests/routes/task_orders/test_new.py b/tests/routes/task_orders/test_new.py index bdc3a76d..4d64ed38 100644 --- a/tests/routes/task_orders/test_new.py +++ b/tests/routes/task_orders/test_new.py @@ -194,14 +194,11 @@ def test_task_orders_submit_form_step_three_add_clins(client, user_session, task "clins-0-start_date": "01/01/2020", "clins-0-end_date": "01/01/2021", "clins-0-obligated_amount": "5000", - "clins-0-loas-0": "123123123123", - "clins-0-loas-1": "345345234", "clins-1-jedi_clin_type": "JEDI_CLIN_1", "clins-1-number": "12312", "clins-1-start_date": "01/01/2020", "clins-1-end_date": "01/01/2021", "clins-1-obligated_amount": "5000", - "clins-1-loas-0": "78979087", } response = client.post( url_for( @@ -224,7 +221,6 @@ def test_task_orders_submit_form_step_three_add_clins_existing_to( "start_date": "01/01/2020", "end_date": "01/01/2021", "obligated_amount": "5000", - "loas": ["123123123123", "345345234"], }, { "jedi_clin_type": "JEDI_CLIN_1", @@ -232,7 +228,6 @@ def test_task_orders_submit_form_step_three_add_clins_existing_to( "start_date": "01/01/2020", "end_date": "01/01/2021", "obligated_amount": "5000", - "loas": ["78979087"], }, ] TaskOrders.create_clins(task_order.id, clin_list) @@ -245,7 +240,6 @@ def test_task_orders_submit_form_step_three_add_clins_existing_to( "clins-0-start_date": "01/01/2020", "clins-0-end_date": "01/01/2021", "clins-0-obligated_amount": "5000", - "clins-0-loas-0": "123123123123", } response = client.post( url_for( diff --git a/tests/test_access.py b/tests/test_access.py index 7da4868e..4918afde 100644 --- a/tests/test_access.py +++ b/tests/test_access.py @@ -546,7 +546,6 @@ def test_task_orders_new_post_routes(post_url_assert_status): "clins-0-start_date": "01/01/2020", "clins-0-end_date": "01/01/2021", "clins-0-obligated_amount": "5000", - "clins-0-loas-0": "123123123123", }, ), ] diff --git a/translations.yaml b/translations.yaml index 98d6c400..a6b8debe 100644 --- a/translations.yaml +++ b/translations.yaml @@ -361,10 +361,8 @@ task_orders: obligated: Obligated pop_start: PoP Start pop_end: PoP End - loa: LOA form: add_clin: Enter another CLIN - add_loa: Enter another line of accounting add_to_header: Add your task order add_to_description: Now, refer to your document to find the 13-digit task order number. It should be located at lorem ipsum dolar. From now on we'll refer to this portion of funding by the recorded task order number. clin_title: Enter CLINs @@ -376,7 +374,6 @@ task_orders: cloud_funding_text: Data must match with what is in your uploaded document. draft_alert_title: Your information has been saved draft_alert_message: You can return to the Task Order Builder to enter missing information. Once you are finished, you’ll be ready to submit this request. - loa_label: 'Enter line of accounting (43 characters)' obligated_funds_label: Enter obligated funds for Base CLIN pop_end: 'Period of Performance (PoP) end date' pop_start: 'Period of Performance (PoP) start date'