diff --git a/app/views/insured/families/_family_member_row.html.erb b/app/views/insured/families/_family_member_row.html.erb index cda9b32f14c..883af85e890 100644 --- a/app/views/insured/families/_family_member_row.html.erb +++ b/app/views/insured/families/_family_member_row.html.erb @@ -8,10 +8,19 @@ <% edit_url = member.is_primary_applicant ? personal_insured_families_path({bs4: @bs4}) : main_app.edit_insured_family_member_path({id: member.id, bs4: @bs4}) %> - <%= h(link_to l10n("edit_member"), edit_url, remote: true, id: "edit-member-#{person_id}", class: 'btn button outline close-2') %> + <%= h(link_to l10n("edit_member"), edit_url, remote: true, class: 'edit-member btn button outline close-2') %> + - - - + + + diff --git a/app/views/insured/families/manage_family.html.erb b/app/views/insured/families/manage_family.html.erb index a4c4fea1461..0ac291a6b15 100644 --- a/app/views/insured/families/manage_family.html.erb +++ b/app/views/insured/families/manage_family.html.erb @@ -13,21 +13,23 @@

<%= l10n("my_household") %>

<%= l10n("my_household_desc")%>

- - - - - - - - - - - - - <%= render partial: 'insured/families/manage_family_table', locals: {members: @family.active_family_members} %> - -
<%= l10n("name") %><%= l10n("hbx_id") %><%= l10n("age") %><%= l10n("sex") %><%= l10n("relationship") %>
+
+ + + + + + + + + + + + + <%= render partial: 'insured/families/manage_family_table', locals: {members: @family.active_family_members} %> + +
<%= l10n("name") %><%= l10n("hbx_id") %><%= l10n("age") %><%= l10n("sex") %><%= l10n("relationship") %>
+
<%= h(link_to l10n("add_new_member"), new_insured_family_member_path({family_id: @family.id, bs4: @bs4}), remote: true, id: 'add-new-member', class: 'btn button close-2') %> diff --git a/app/views/insured/families/personal.js.erb b/app/views/insured/families/personal.js.erb index c0ebf04497e..5463c2532c2 100644 --- a/app/views/insured/families/personal.js.erb +++ b/app/views/insured/families/personal.js.erb @@ -11,11 +11,16 @@ } else { // manage family/ my household page - var personContainer = $("#person-<%= @person.id %>") - $("#person-<%= @person.id %> .append_consumer_info").html("<%= escape_javascript(render partial: "personal")%>"); + var id = "<%= @person.id %>"; + var personContainer = $("#person-" + id); + $("#person-" + id + " .append_consumer_info").html("<%= escape_javascript(render partial: "personal")%>"); personContainer.removeClass('hidden'); if ($("#family_information").length == 0) { - $("a[id^=edit-member]").addClass('disabled').attr('tabindex', -1).blur(); + var memberContainer = $(".member-" + id + "-row"); + console.log(".member-" + id + "-row") + $(".edit-member").addClass('disabled').attr('tabindex', -1); + memberContainer.find(".edit-member").addClass('hidden'); + memberContainer.find(".edit-buttons").removeClass('hidden'); } } applyListeners(); diff --git a/app/views/insured/family_members/_dependent_form.html.erb b/app/views/insured/family_members/_dependent_form.html.erb index bff6a708be4..5628d04d992 100644 --- a/app/views/insured/family_members/_dependent_form.html.erb +++ b/app/views/insured/family_members/_dependent_form.html.erb @@ -139,25 +139,22 @@ <%= f.hidden_field :family_id %>
- - <% if !dependent.persisted? %> - - <%= l10n("cancel") %> - - <% else %> - <%= link_to('#', class: 'btn outline mr-2') do %> - <%= l10n("cancel") %> + <% if !dependent.persisted? %> + + <%= l10n("cancel") %> + + <% else %> + <%= h(link_to l10n('remove_member_from_household'), insured_family_member_path(dependent, {bs4: @bs4}), class: 'btn button-error outline mr-2', :method => :delete, :remote => true, data: {confirm: l10n("confirm_remove_dependent"), ok: l10n("yes"), cancel: l10n("no")}) %> + <%= link_to('#', class: 'btn outline mr-2') do %> + <%= l10n("discard_changes") %> + <% end %> <% end %> - <%= h(link_to l10n('remove_member'), insured_family_member_path(dependent, {bs4: @bs4}), class: 'btn button-error outline mr-2', :method => :delete, :remote => true, data: {confirm: l10n("confirm_remove_dependent"), ok: l10n("yes"), cancel: l10n("no")}) %> - <% end %> - <%= f.button(id: 'confirm-member', class: "btn btn-primary hidden", onclick: "$('#btn-continue').removeClass('disabled');") do %> - <%= l10n("confirm_member") %> - <% end %> - - - <%= l10n("confirm_member") %> - -
+ + <%= f.button(id: 'confirm-member', class: "btn btn-primary hidden", onclick: "$('#btn-continue').removeClass('disabled');") %> + + <%= l10n("save_changes") %> + + @@ -199,6 +196,11 @@ }); <% end %> + $(document).off('click', '.confirm-member'); + $(document).on('click', '.confirm-member', function(e) { + $("#confirm-dependent").click(); + }); + $(document).off('click', '#confirm-dependent'); $(document).on('click', '#confirm-dependent', function(e) { if ($("input#dependent_same_with_primary").is(":checked")){ diff --git a/app/views/insured/family_members/destroyed.js.erb b/app/views/insured/family_members/destroyed.js.erb index c8dbc6ffac5..9dd4440cca3 100644 --- a/app/views/insured/family_members/destroyed.js.erb +++ b/app/views/insured/family_members/destroyed.js.erb @@ -9,7 +9,7 @@ $('#family_error_messages').append("<%= escape_javascript render partial: 'destr <% person_id = @dependent.family_member.person.id %> $("#person-<%= person_id %>").remove(); $(".member-<%= person_id %>-row").remove(); -$("a[id^=edit-member]").removeClass('disabled').removeClass('hidden'); +$(".edit-member").removeClass('disabled').attr('tabindex', 0); $("#add-new-member").removeClass("hidden"); <% if ::EnrollRegistry.feature_enabled?(:financial_assistance) && (['destroy'].include? controller.action_name) && (@person.consumer_role.present?) %> diff --git a/app/views/insured/family_members/edit.js.erb b/app/views/insured/family_members/edit.js.erb index b9a8d682731..3c496678a3c 100644 --- a/app/views/insured/family_members/edit.js.erb +++ b/app/views/insured/family_members/edit.js.erb @@ -25,12 +25,15 @@ if ($(".my-household-page").length == 0) { var id = "<%= @dependent.id %>"; } - var personContainer = $("#person-"+id) - if (personContainer) { + var personContainer = $("#person-" + id) + if (personContainer.length) { personContainer.find('.append_consumer_info').html("<%= escape_javascript(render 'dependent_form', dependent: @dependent, person: @person) %>"); personContainer.removeClass('hidden'); + var memberContainer = $(".member-" + id + "-row"); if ($("#family_information").length == 0) { - $("a[id^=edit-member]").addClass('disabled').attr('tabindex', -1).blur(); + $(".edit-member").addClass('disabled').attr('tabindex', -1); + memberContainer.find(".edit-member").addClass('hidden'); + memberContainer.find(".edit-buttons").removeClass('hidden'); } } else { $(".append_consumer_info").replaceWith("<%= escape_javascript(render 'dependent_form', dependent: @dependent, person: @person) %>"); diff --git a/app/views/insured/family_members/new.js.erb b/app/views/insured/family_members/new.js.erb index 46c6f6be0d1..ccf1c2cf74b 100644 --- a/app/views/insured/family_members/new.js.erb +++ b/app/views/insured/family_members/new.js.erb @@ -46,7 +46,6 @@ if (bs4 == "true") { isApplyingCoverage("dependent"); $("a[id^=edit-member]").addClass('disabled'); $("#add-new-member").addClass("hidden"); - $("#edit-member-" + "<%= @dependent.id %>").addClass("hidden"); } } else { $('#dependents_info_wrapper h4:first').text("Please enter the information requested below. When you\'re finished, select \'Confirm Member\' at the bottom of the page."); diff --git a/app/views/insured/family_members/show.js.erb b/app/views/insured/family_members/show.js.erb index 3216071e10b..ca4a3cf29a4 100644 --- a/app/views/insured/family_members/show.js.erb +++ b/app/views/insured/family_members/show.js.erb @@ -7,7 +7,7 @@ if (!$(".my-household-page").length) { $("#dependent_buttons").removeClass('hidden'); } else { - $("a[id^=edit-member]").removeClass('disabled').removeClass('hidden').attr('tabindex', 0); + $(".edit-member").removeClass('disabled').attr('tabindex', 0); $("#add-new-member").removeClass("hidden"); $("#new_employee_dependent_form").html($(document.createElement("div")).attr("id", "append_consumer_info")); <% member = @dependent.family_member %> diff --git a/app/views/people/landing_pages/_personal.html.erb b/app/views/people/landing_pages/_personal.html.erb index 89a7d17c25c..cc646158390 100644 --- a/app/views/people/landing_pages/_personal.html.erb +++ b/app/views/people/landing_pages/_personal.html.erb @@ -107,11 +107,11 @@ <% end %>
- <%= link_to l10n("cancel"), '#', class: "btn button outline remove-personal-form" %> + <%= link_to l10n("discard_changes"), '#', class: "btn button outline remove-personal-form mr-2" %> - <%= l10n("confirm_member") %> + <%= l10n("save_changes") %>
<% end %> @@ -128,6 +128,11 @@ $('#manage_family_content').html(family_table); } }); + + $(document).off('click', '.confirm-member'); + $(document).on('click', '.confirm-member', function(e) { + $("#save_personal").click(); + }); <% else %> diff --git a/db/seedfiles/translations/en/cca/insured.rb b/db/seedfiles/translations/en/cca/insured.rb index c1d583e2638..8f5a447ea0f 100644 --- a/db/seedfiles/translations/en/cca/insured.rb +++ b/db/seedfiles/translations/en/cca/insured.rb @@ -443,6 +443,10 @@ :'en.this_person_is_name' => "This Person Is %{name}'s", :'en.live_with_primary_subscriber' => "Lives with primary subscriber", :'en.confirm_member' => "Confirm Member", + :'en.remove_member_from_household' => "Remove Member from Household", + :'en.discard_changes' => "Discard Changes", + :'en.cancel_edit' => "Cancel Edit", + :'en.save_changes' => "Save Changes", :'en.household_info' => "Household Info", :'en.plan_selection' => "Plan Selection", :'en.review' => "Review", diff --git a/db/seedfiles/translations/en/dc/insured.rb b/db/seedfiles/translations/en/dc/insured.rb index e0d33e1cdf6..03b4de5feb8 100644 --- a/db/seedfiles/translations/en/dc/insured.rb +++ b/db/seedfiles/translations/en/dc/insured.rb @@ -501,6 +501,10 @@ :'en.live_with_primary_subscriber' => "Lives with primary subscriber", :'en.dependent_lives_with_primary_subscriber' => "This person lives with primary subscriber", :'en.confirm_member' => "Confirm Member", + :'en.remove_member_from_household' => "Remove Member from Household", + :'en.discard_changes' => "Discard Changes", + :'en.cancel_edit' => "Cancel Edit", + :'en.save_changes' => "Save Changes", :'en.household_info' => "Household Info", :'en.plan_selection' => "Plan Selection", :'en.review' => "Review", diff --git a/db/seedfiles/translations/en/me/insured.rb b/db/seedfiles/translations/en/me/insured.rb index 1bfcc027a26..7eef8fe35a9 100644 --- a/db/seedfiles/translations/en/me/insured.rb +++ b/db/seedfiles/translations/en/me/insured.rb @@ -515,6 +515,10 @@ :'en.this_person_is_name' => "This Person Is %{name}'s", :'en.live_with_primary_subscriber' => "Lives with primary subscriber", :'en.confirm_member' => "Confirm Member", + :'en.remove_member_from_household' => "Remove Member from Household", + :'en.discard_changes' => "Discard Changes", + :'en.cancel_edit' => "Cancel Edit", + :'en.save_changes' => "Save Changes", :'en.household_info' => "Household Info", :'en.choose_plan' => "Choose Plan", :'en.plan_selection' => "Plan Selection",