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 @@