Skip to content

Commit

Permalink
Minor fixes on plan shopping filtering.
Browse files Browse the repository at this point in the history
  • Loading branch information
TreyE committed Jan 9, 2025
1 parent 6d04512 commit 4267058
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 13 deletions.
10 changes: 8 additions & 2 deletions app/assets/javascripts/plan_shopping.js.erb
Original file line number Diff line number Diff line change
Expand Up @@ -356,7 +356,8 @@ $(function() {
});
}

$(document).on('click', '.all-filters-row .apply-btn', function(){
$(document).on('click', '.all-filters-row .apply-btn', function(event){
event.preventDefault();
applyPlanFilters();

const sort_by = $('#sort_by input:checked').data('sort-by');
Expand All @@ -383,7 +384,8 @@ $(function() {
};
});

$(document).on('click', '.all-filters-row .reset-btn', function(){
$(document).on('click', '.all-filters-row .reset-btn', function(event){
event.preventDefault();
resetAptc();
resetFilters();
applyPlanFilters();
Expand Down Expand Up @@ -441,6 +443,10 @@ function disableSelectricInModal() {
})
}

$("document").on("click", ".plan-metal-level-selection-filter", function(event) {
filterMetalLevel($(this));
});

// show the dependent table when the primary's name is clicked
$(document).on("click", "#dependentList", function(event) {
event.preventDefault();
Expand Down
4 changes: 2 additions & 2 deletions app/views/insured/plan_shoppings/_plan_filters.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -306,8 +306,8 @@
<% end %>
<div class="checkbox-filter-wrapper">
<div class="form-inline search-apply-wrapper">
<a href="javascript:void(0);" class="btn btn-primary apply-btn mz"><%= l10n("apply") %></a>
<a href="javascript:void(0);" class="btn btn-default reset-btn"><%= l10n("reset") %></a>
<a href="#" class="btn btn-primary apply-btn mz"><%= l10n("apply") %></a>
<a href="#" class="btn btn-default reset-btn"><%= l10n("reset") %></a>
</div>
</div>
</div>
Expand Down
18 changes: 9 additions & 9 deletions app/views/ui-components/v1/filters/_plan_filters.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<legend class="bb"><%= render partial:"shared/glossary", locals: {key: "metal_level", term: "Metal Level", question_mark: true } %></legend>
<% @metal_levels.each do |level| %>
<label for="plan-metal-level-<%= level %>" class="weight-n d-flex align-items-center mb-2">
<input id="plan-metal-level-<%= level %>" class="plan-metal-level-selection-filter checkbox-custom mr-2" name="plan-metal-level-<%= level %>" type="checkbox" onClick="filterMetalLevel(this)" data-plan-metal-level="<%= level %>" data-category="planMetalLevel">
<input id="plan-metal-level-<%= level %>" class="plan-metal-level-selection-filter checkbox-custom mr-2" name="plan-metal-level-<%= level %>" type="checkbox" data-plan-metal-level="<%= level %>" data-category="planMetalLevel">
<span data-toggle="tooltip" data-placement="right" data-container="body" title="<%= l10n('insured.plan_shoppings.plan_filters_'"#{level}"'_title_info') %>"></span>
<%= l10n("#{level}") %>
</label>
Expand Down Expand Up @@ -131,13 +131,13 @@
<div class="mt-2">
<% if @market_kind == 'shop' || @market_kind == 'fehb' %>
<div class="form-inline search-apply-wrapper mt-1">
<a class="btn btn-primary mz" href="javascript:void(0)" onclick="filterResults()" title="Apply all filters"><%= l10n("apply") %></a>
<a class="btn btn-primary mz" href="#" onclick="filterResults()" title="Apply all filters"><%= l10n("apply") %></a>
<a class="btn btn-default" id="reset-btn" onclick="resetAllFilters()"><%= l10n("reset") %></a>
</div>
<% else %>
<div class="form-inline search-apply-wrapper">
<a class="btn outline reset-btn mr-2" id="reset-btn" href="javascript:void(0);"><%= l10n("reset") %></a>
<a class="btn btn-primary apply-btn mz" href="javascript:void(0);" title="Apply all filters"><%= l10n("apply") %></a>
<a class="btn outline reset-btn mr-2" id="reset-btn" href="#"><%= l10n("reset") %></a>
<a class="btn btn-primary apply-btn mz" href="#" title="Apply all filters"><%= l10n("apply") %></a>
</div>
<% end %>
</div>
Expand Down Expand Up @@ -327,8 +327,8 @@
</div>
<% else %>
<div class="form-inline search-apply-wrapper">
<a class="btn btn-primary apply-btn mz" href="javascript:void(0);" title="Apply all filters"><%= l10n("apply") %></a>
<a id="reset-btn" class="btn btn-default reset-btn" href="javascript:void(0);"><%= l10n("reset") %></a>
<a class="btn btn-primary apply-btn mz" href="#" title="Apply all filters"><%= l10n("apply") %></a>
<a id="reset-btn" class="btn btn-default reset-btn" href="#"><%= l10n("reset") %></a>
</div>
<% end %>
</div>
Expand Down Expand Up @@ -419,7 +419,7 @@
<li>
<div class="filter-input-block" style="text-align:left">
<label>
<input id="plan-metal-level-<%= level %>" class="plan-metal-level-selection-filter checkbox-custom" name="plan-metal-level-<%= level %>" type="checkbox" onClick="filterMetalLevel(this)" data-plan-metal-level="<%= level %>" data-category="planMetalLevel">
<input id="plan-metal-level-<%= level %>" class="plan-metal-level-selection-filter checkbox-custom" name="plan-metal-level-<%= level %>" type="checkbox" data-plan-metal-level="<%= level %>" data-category="planMetalLevel">
<label for="plan-metal-level-<%= level %>" class="checkbox-custom-label">
<span data-toggle="tooltip" data-placement="right" data-container="body" title="<%= l10n('insured.plan_shoppings.plan_filters_'"#{level}"'_title_info') %>"></span>
<%= l10n("#{level}") %>
Expand Down Expand Up @@ -566,8 +566,8 @@
</div>
<% else %>
<div class="form-inline search-apply-wrapper">
<a class="btn btn-primary apply-btn mz" href="javascript:void(0);" title="Apply all filters"><%= l10n("apply") %></a>
<a class="btn btn-default reset-btn" id="reset-btn" href="javascript:void(0);"><%= l10n("reset") %></a>
<a class="btn btn-primary apply-btn mz" href="#" title="Apply all filters"><%= l10n("apply") %></a>
<a class="btn btn-default reset-btn" id="reset-btn" href="#"><%= l10n("reset") %></a>
</div>
<% end %>
</div>
Expand Down

0 comments on commit 4267058

Please sign in to comment.