From f096b107ab4e5db07935bddde7dc75824d852a7c Mon Sep 17 00:00:00 2001 From: Montana Date: Thu, 24 Jan 2019 14:40:02 -0500 Subject: [PATCH 1/3] Use keep-alive to preserve cor data on toggle --- js/components/forms/oversight.js | 22 ++++++++++++++++++++++ templates/task_orders/new/oversight.html | 19 ++++++++++++------- 2 files changed, 34 insertions(+), 7 deletions(-) diff --git a/js/components/forms/oversight.js b/js/components/forms/oversight.js index d1613b55..27227516 100644 --- a/js/components/forms/oversight.js +++ b/js/components/forms/oversight.js @@ -2,6 +2,27 @@ import FormMixin from '../../mixins/form' import textinput from '../text_input' import checkboxinput from '../checkbox_input' +const cordata = { + name: 'cordata', + + components: { + textinput, + checkboxinput, + }, + + mixins: [FormMixin], + + props: { + initialCorInvite: Boolean, + }, + + data: function() { + return { + cor_invite: this.initialCorInvite, + } + }, +} + export default { name: 'oversight', @@ -10,6 +31,7 @@ export default { components: { textinput, checkboxinput, + cordata, }, props: { diff --git a/templates/task_orders/new/oversight.html b/templates/task_orders/new/oversight.html index e3cb255e..77ed3e94 100644 --- a/templates/task_orders/new/oversight.html +++ b/templates/task_orders/new/oversight.html @@ -26,13 +26,18 @@

{{ "task_orders.new.oversight.cor_info_title" | translate }}

{{ "task_orders.new.oversight.cor_info_paragraph" | translate }}

{{ CheckboxInput(form.am_cor, classes="normal") }} - + + + +
+ {{ UserInfo(form.cor_first_name, form.cor_last_name, form.cor_email, form.cor_phone_number) }} + {{ CheckboxInput(form.cor_invite) }} + +
+
+

From b7c307c42fea2c7ebde4e1ddcfa5c948310af176 Mon Sep 17 00:00:00 2001 From: Montana Date: Thu, 24 Jan 2019 14:47:26 -0500 Subject: [PATCH 2/3] Persist DOD ID data on invite toggle --- js/components/forms/oversight.js | 27 ++++++++++++++++++++++-- templates/task_orders/new/oversight.html | 16 ++++++++------ 2 files changed, 35 insertions(+), 8 deletions(-) diff --git a/js/components/forms/oversight.js b/js/components/forms/oversight.js index 27227516..baaaff70 100644 --- a/js/components/forms/oversight.js +++ b/js/components/forms/oversight.js @@ -2,16 +2,38 @@ import FormMixin from '../../mixins/form' import textinput from '../text_input' import checkboxinput from '../checkbox_input' +const dodid = { + name: 'dodid', + + mixins: [FormMixin], + + components: { + textinput, + }, + + props: { + initialKoInvite: Boolean, + initialSoInvite: Boolean, + }, + + data: function() { + return { + ko_invite: this.initialKoInvite, + so_invite: this.initialSoInvite, + } + }, +} + const cordata = { name: 'cordata', + mixins: [FormMixin], + components: { textinput, checkboxinput, }, - mixins: [FormMixin], - props: { initialCorInvite: Boolean, }, @@ -32,6 +54,7 @@ export default { textinput, checkboxinput, cordata, + dodid, }, props: { diff --git a/templates/task_orders/new/oversight.html b/templates/task_orders/new/oversight.html index 77ed3e94..8aa7c43e 100644 --- a/templates/task_orders/new/oversight.html +++ b/templates/task_orders/new/oversight.html @@ -17,9 +17,11 @@
{{ UserInfo(form.ko_first_name, form.ko_last_name, form.ko_email, form.ko_phone_number) }} {{ CheckboxInput(form.ko_invite) }} - + + + {{ TextInput(form.ko_dod_id, placeholder="1234567890", tooltip="Why", tooltip_title='Why', validation='dodId', classes="task-order__invite-officer")}} + +
@@ -45,9 +47,11 @@

{{ "task_orders.new.oversight.so_info_paragraph" | translate }}

{{ UserInfo(form.so_first_name, form.so_last_name, form.so_email, form.so_phone_number) }} {{ CheckboxInput(form.so_invite) }} - + + + {{ TextInput(form.so_dod_id, placeholder="1234567890", tooltip="Why", tooltip_title='Why', validation='dodId', classes="task-order__invite-officer")}} + +
From 18a4293baf20be6aa1323999c10773807d5d14c2 Mon Sep 17 00:00:00 2001 From: Montana Date: Fri, 25 Jan 2019 09:54:03 -0500 Subject: [PATCH 3/3] Generalize dodid component --- js/components/forms/oversight.js | 6 ++---- templates/task_orders/new/oversight.html | 4 ++-- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/js/components/forms/oversight.js b/js/components/forms/oversight.js index baaaff70..2516fad1 100644 --- a/js/components/forms/oversight.js +++ b/js/components/forms/oversight.js @@ -12,14 +12,12 @@ const dodid = { }, props: { - initialKoInvite: Boolean, - initialSoInvite: Boolean, + initialInvite: Boolean, }, data: function() { return { - ko_invite: this.initialKoInvite, - so_invite: this.initialSoInvite, + invite: this.initialInvite, } }, } diff --git a/templates/task_orders/new/oversight.html b/templates/task_orders/new/oversight.html index 8aa7c43e..0841faf8 100644 --- a/templates/task_orders/new/oversight.html +++ b/templates/task_orders/new/oversight.html @@ -18,7 +18,7 @@ {{ UserInfo(form.ko_first_name, form.ko_last_name, form.ko_email, form.ko_phone_number) }} {{ CheckboxInput(form.ko_invite) }} - + {{ TextInput(form.ko_dod_id, placeholder="1234567890", tooltip="Why", tooltip_title='Why', validation='dodId', classes="task-order__invite-officer")}} @@ -48,7 +48,7 @@ {{ UserInfo(form.so_first_name, form.so_last_name, form.so_email, form.so_phone_number) }} {{ CheckboxInput(form.so_invite) }} - + {{ TextInput(form.so_dod_id, placeholder="1234567890", tooltip="Why", tooltip_title='Why', validation='dodId', classes="task-order__invite-officer")}}