Browse Source

CLDC-3066++: Show filters button bug (#2759)

* Ensure the app-filter-toggle class is always present regardless of the user's permissions, you can move it outside of the conditional logic
pull/2762/head
Manny Dinssa 2 months ago committed by GitHub
parent
commit
1ff5c0841a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 4
      app/components/create_log_actions_component.html.erb
  2. 7
      app/views/organisations/schemes.html.erb
  3. 5
      app/views/organisations/users.html.erb
  4. 7
      app/views/schemes/index.html.erb
  5. 7
      app/views/users/index.html.erb

4
app/components/create_log_actions_component.html.erb

@ -1,5 +1,5 @@
<div class="govuk-button-group app-filter-toggle <%= "govuk-!-margin-bottom-6" if display_actions? %>">
<% if display_actions? %>
<div class="govuk-button-group app-filter-toggle govuk-!-margin-bottom-6">
<%= govuk_button_to create_button_copy, create_button_href, class: "govuk-!-margin-right-3" %>
<% unless user.support? %>
<%= govuk_button_link_to upload_button_copy, upload_button_href, secondary: true %>
@ -7,5 +7,5 @@
<% if user.support? %>
<%= govuk_button_link_to view_uploads_button_copy, view_uploads_button_href, secondary: true %>
<% end %>
</div>
<% end %>
</div>

7
app/views/organisations/schemes.html.erb

@ -22,11 +22,12 @@
<% end %>
<div class="app-filter-layout" data-controller="filter-layout">
<% if SchemePolicy.new(current_user, nil).create? %>
<div class="govuk-button-group app-filter-toggle govuk-!-margin-bottom-6">
<% display_actions = SchemePolicy.new(current_user, nil).create? %>
<div class="govuk-button-group app-filter-toggle <%= "govuk-!-margin-bottom-6" if display_actions %>">
<% if display_actions %>
<%= govuk_button_link_to "Create a new supported housing scheme", new_scheme_path, html: { method: :post } %>
</div>
<% end %>
</div>
<%= govuk_details(
classes: "govuk-!-width-two-thirds",

5
app/views/organisations/users.html.erb

@ -13,8 +13,9 @@
<% end %>
<div class="app-filter-layout" data-controller="filter-layout">
<div class="govuk-button-group app-filter-toggle govuk-!-margin-bottom-6">
<% if current_user.data_coordinator? || current_user.support? %>
<% display_actions = current_user.data_coordinator? || current_user.support? %>
<div class="govuk-button-group app-filter-toggle <%= "govuk-!-margin-bottom-6" if display_actions %>">
<% if display_actions %>
<%= govuk_button_link_to "Invite user", new_user_path(organisation_id: @organisation.id), html: { method: :get } %>
<% end %>
</div>

7
app/views/schemes/index.html.erb

@ -6,11 +6,12 @@
<%= render partial: "organisations/headings", locals: current_user.support? ? { main: "Supported housing schemes", sub: nil } : { main: "Supported housing schemes", sub: current_user.organisation.name } %>
<div class="app-filter-layout" data-controller="filter-layout">
<% if SchemePolicy.new(current_user, nil).create? %>
<div class="govuk-button-group app-filter-toggle govuk-!-margin-bottom-6">
<% display_actions = SchemePolicy.new(current_user, nil).create? %>
<div class="govuk-button-group app-filter-toggle <%= "govuk-!-margin-bottom-6" if display_actions %>">
<% if display_actions %>
<%= govuk_button_link_to "Create a new supported housing scheme", new_scheme_path, html: { method: :post } %>
</div>
<% end %>
</div>
<%= render partial: "schemes/scheme_filters" %>
<div class="app-filter-layout__content">
<%= render SearchComponent.new(current_user:, search_label: "Search by postcode, scheme name, scheme code or location name", value: @searched) %>

7
app/views/users/index.html.erb

@ -6,11 +6,12 @@
<%= render partial: "organisations/headings", locals: current_user.support? ? { main: "Users", sub: nil } : { main: "Users", sub: current_user.organisation.name } %>
<div class="app-filter-layout" data-controller="filter-layout">
<% if current_user.data_coordinator? || current_user.support? %>
<div class="govuk-button-group app-filter-toggle govuk-!-margin-bottom-6">
<% display_actions = current_user.data_coordinator? || current_user.support? %>
<div class="govuk-button-group app-filter-toggle <%= "govuk-!-margin-bottom-6" if display_actions %>">
<% if display_actions %>
<%= govuk_button_link_to "Invite user", new_user_path, html: { method: :get } %>
</div>
<% end %>
</div>
<%= render partial: "users/user_filters" %>
<div class="app-filter-layout__content">
<%= render SearchComponent.new(current_user:, search_label: "Search by name or email address", value: @searched) %>

Loading…
Cancel
Save