diff --git a/js/components/date_selector.js b/js/components/date_selector.js index 05809b0b..6603cced 100644 --- a/js/components/date_selector.js +++ b/js/components/date_selector.js @@ -20,6 +20,10 @@ export default { mindate: { type: String }, maxdate: { type: String }, nameTag: { type: String }, + watch: { + type: Boolean, + default: false, + }, }, data: function() { @@ -138,7 +142,11 @@ export default { methods: { _emitChange: function(name, value, valid) { - emitEvent('field-change', this, { value, name }) + emitEvent('field-change', this, { + value: value, + name: name, + watch: this.watch, + }) }, }, diff --git a/js/components/forms/to_form.js b/js/components/forms/to_form.js index bf77f3c2..6903ebe4 100644 --- a/js/components/forms/to_form.js +++ b/js/components/forms/to_form.js @@ -1,3 +1,5 @@ +import stickybits from 'stickybits' + import ClinFields from '../clin_fields' import DateSelector from '../date_selector' import FormMixin from '../../mixins/form' @@ -40,4 +42,12 @@ export default { ++this.clinIndex }, }, + + directives: { + sticky: { + inserted: el => { + stickybits(el) + }, + }, + }, } diff --git a/js/components/text_input.js b/js/components/text_input.js index 09367d2d..c49bb075 100644 --- a/js/components/text_input.js +++ b/js/components/text_input.js @@ -27,6 +27,10 @@ export default { paragraph: String, noMaxWidth: String, optional: Boolean, + watch: { + type: Boolean, + default: false, + }, }, data: function() { @@ -122,6 +126,7 @@ export default { value: this._rawValue(value), valid, name: this.name, + watch: this.watch, }) }, diff --git a/js/components/upload_input.js b/js/components/upload_input.js index a94d394a..93c0eb8f 100644 --- a/js/components/upload_input.js +++ b/js/components/upload_input.js @@ -1,6 +1,7 @@ import createNumberMask from 'text-mask-addons/dist/createNumberMask' import { conformToMask } from 'vue-text-mask' +import { emitEvent } from '../lib/emitters' import FormMixin from '../mixins/form' import textinput from './text_input' import optionsinput from './options_input' @@ -22,6 +23,10 @@ export default { initialErrors: { type: Boolean, }, + watch: { + type: Boolean, + default: false, + }, }, data: function() { @@ -38,6 +43,12 @@ export default { this.attachment = e.target.value this.showErrors = false this.changed = true + + emitEvent('field-change', this, { + value: e.target.value, + name: this.name, + watch: this.watch, + }) }, removeAttachment: function(e) { e.preventDefault() @@ -47,6 +58,12 @@ export default { } this.showErrors = false this.changed = true + + emitEvent('field-change', this, { + value: e.target.value, + name: this.name, + watch: this.watch, + }) }, }, diff --git a/styles/sections/_task_order.scss b/styles/sections/_task_order.scss index fdef6c5a..1a52811a 100644 --- a/styles/sections/_task_order.scss +++ b/styles/sections/_task_order.scss @@ -74,7 +74,8 @@ max-width: unset; } - .usa-input__title, .usa-input__title-inline { + .usa-input__title, + .usa-input__title-inline { font-weight: $font-normal; } diff --git a/templates/components/date_picker.html b/templates/components/date_picker.html index 55b033bf..ee4edbaa 100644 --- a/templates/components/date_picker.html +++ b/templates/components/date_picker.html @@ -5,7 +5,8 @@ label=field.label | striptags, description=field.description, mindate=None, - maxdate=None) -%} + maxdate=None, + watch=False) -%}
diff --git a/templates/components/text_input.html b/templates/components/text_input.html index e64ed1c0..acbfae80 100644 --- a/templates/components/text_input.html +++ b/templates/components/text_input.html @@ -15,7 +15,8 @@ classes='', noMaxWidth=False, optional=False, - showLabel=True) -%} + showLabel=True, + watch=False) -%}
diff --git a/templates/task_orders/edit.html b/templates/task_orders/edit.html index a4e81f2b..e8e7fb14 100644 --- a/templates/task_orders/edit.html +++ b/templates/task_orders/edit.html @@ -12,7 +12,7 @@ {% macro LOAInput() %}
- +
- {{ OptionsInput(fields.jedi_clin_type) }} + {{ OptionsInput(fields.jedi_clin_type, watch=True) }}
- {{ TextInput(fields.number) }} + {{ TextInput(fields.number, watch=True) }}
@@ -77,16 +77,16 @@
{% for loa in fields.loas %} - {{ TextInput(loa, showLabel=False) }} + {{ TextInput(loa, showLabel=False, watch=True) }} {% endfor %} {{ LOAInput() }}
- {{ DatePicker(fields.start_date) }} - {{ DatePicker(fields.end_date) }} - {{ TextInput(fields.obligated_amount, validation='dollars') }} + {{ DatePicker(fields.start_date, watch=True) }} + {{ DatePicker(fields.end_date, watch=True) }} + {{ TextInput(fields.obligated_amount, validation='dollars', watch=True) }} {% endmacro %} @@ -101,277 +101,287 @@ {% endif %}
{{ form.csrf_token }} - - {% call StickyCTA(text="Add Funding") %} - - - - - {{ "common.cancel" | translate }} - - - {% endcall %} - -
-

- {{ "task_orders.new.form_help_text" | translate }} -

+
+ {% call StickyCTA(text="Add Funding") %} + + + + + + {{ "common.cancel" | translate }} + + + {% endcall %} -
+
+

+ {{ "task_orders.new.form_help_text" | translate }} +

- {% include "fragments/flash.html" %} +
-
-
-
Add your task order
- {{ TextInput(form.number, validation='taskOrderNumber') }} + {% include "fragments/flash.html" %} -
+
+
+
Add your task order
+ {{ TextInput(form.number, validation='taskOrderNumber') }} -
Add the summary of cloud funding
-
- Data must match with what is in your uploaded document. -
+
- {% for clin in form.clins %} - {{ CLINFields(clin, index=loop.index - 1) }} - {% endfor %} +
Add the summary of cloud funding
+
+ Data must match with what is in your uploaded document. +
-
-
- -
-
-
-
-
- -
- CLIN type -
-
- -
+ {% for clin in form.clins %} + {{ CLINFields(clin, index=loop.index - 1) }} + {% endfor %} + +
+
+ +
+
+
+ +
+
+ +
+ CLIN type +
+
+ +
+
+
+
+
+ +
+ + + + + + + + + +
+
-
- -
- - - - - - - - -
-
+
+
+ +
+ Line of accounting (43 characters) +
+
+ {{ LOAInput() }} +
+ + +
+ +
+ Start of period of performance (PoP) +
+
+ +
+ + +
+ + +
+ +
+ + +
+ +
+ + + +
+ +
+ {{ Icon("ok", classes="icon--green") }} +
+
+
+
+ + +
+ +
+ End of period of performance (PoP) +
+
+ +
+ + +
+ + +
+ +
+ + +
+ +
+ + + +
+ +
+ {{ Icon("ok", classes="icon--green") }} +
+
+
+
+ + +
+ + + + + + + + + +
+
+ +
-
-
- -
- Line of accounting (43 characters) -
-
- {{ LOAInput() }} -
-
+ - -
- -
- Start of period of performance (PoP) -
-
- -
- - -
- - -
- -
- - -
- -
- - - -
- -
- {{ Icon("ok", classes="icon--green") }} -
-
-
-
- - -
- -
- End of period of performance (PoP) -
-
- -
- - -
- - -
- -
- - -
- -
- - - -
- -
- {{ Icon("ok", classes="icon--green") }} -
-
-
-
- - -
- - - - - - - - - -
-
-
- -
- - - -
-
Upload your supporting documentation
-
- Upload a single PDF containing all relevant information. {{ Icon('help')}} -
- {{ UploadInput(form.pdf) }} +
+
Upload your supporting documentation
+
+ Upload a single PDF containing all relevant information. {{ Icon('help')}} +
+ {{ UploadInput(form.pdf, watch=True) }} +
+ {{ TotalsBox(task_order=task_order) }}
- {{ TotalsBox(task_order=task_order) }}