fix: split into smaller PR

This commit is contained in:
seb-by-ouidou 2023-08-29 14:44:49 +00:00 committed by seb-by-ouidou
parent e2f792b44b
commit e9c143f226
7 changed files with 0 additions and 177 deletions

View file

@ -1,16 +0,0 @@
#breadcrumbs.sub-header
.fr-container.flex.justify-between.align-baseline.column
%nav.fr-breadcrumb.mt-0{ role: "navigation", aria: { label: t('you_are_here', scope: [:layouts, :breadcrumb]) } }
%button.fr-breadcrumb__button{ aria: { expanded: "false", controls: "breadcrumb-1" } }
= t('show', scope: [:layouts, :breadcrumb])
.fr-collapse#breadcrumb-1
%ol.fr-breadcrumb__list
%li= link_to t('root', scope: [:layouts, :breadcrumb]), root_path, class: 'fr-breadcrumb__link'
- steps.each.with_index do |step, i|
- if i == steps.size - 1
%li{ aria: { current: "page" } }
%span.fr-breadcrumb__link= step[0]
- else
%li= link_to step[0], step[1], class: 'fr-breadcrumb__link'

View file

@ -1,17 +0,0 @@
= render partial: 'admins_group_managers/breadcrumbs',
locals: { steps: [['Groupes d\'administrateurs', admins_group_manager_admins_groups_path]] }
#admins_groups-index.container
%h1.fr-h1 Liste des groupes d'administrateurs
%table.fr-table.width-100.mt-3
%thead
%tr
%th{ scope: "col" }
Nom
%tbody
- @admins_groups.each do |admins_group|
%tr
%td
= admins_group.name

View file

@ -1,57 +0,0 @@
<%#
# Show
This view is the template for the show page.
It renders the attributes of a resource,
as well as a link to its edit page.
## Local variables:
- `page`:
An instance of [Administrate::Page::Show][1].
Contains methods for accessing the resource to be displayed on the page,
as well as helpers for describing how each attribute of the resource
should be displayed.
[1]: http://www.rubydoc.info/gems/administrate/Administrate/Page/Show
%>
<% content_for(:title) { t("administrate.actions.show_resource", name: page.page_title) } %>
<% admins_group = page.resource %>
<header class="main-content__header" role="banner">
<h1 class="main-content__page-title">
<%= content_for(:title) %>
</h1>
<div>
<%= link_to(
t("administrate.actions.edit_resource", name: page.page_title),
[:edit, namespace, page.resource],
class: "button",
) if valid_action? :edit %>
</div>
</header>
<section class="main-content__body">
<dl>
<% page.attributes.each do |attribute| %>
<dt class="attribute-label" id="<%= attribute.name %>">
<%= t(
"helpers.label.#{resource_name}.#{attribute.name}",
default: attribute.name.titleize,
) %>
</dt>
<dd class="attribute-data attribute-data--<%=attribute.html_class%>">
<%= render_field attribute, page: page %>
<% if attribute.name == 'admins_group_managers' %>
<%= form_tag(add_admins_group_manager_manager_admins_group_path(admins_group), style: 'margin-top: 1rem;') do %>
<%= email_field_tag(:emails, '', placeholder: 'Emails', autocapitalize: 'off', autocorrect: 'off', spellcheck: 'false', style: 'margin-bottom: 1rem;width:24rem;') %>
<button>Ajouter un gestionnaire</button>
<% end %>
<% end %>
</dd>
<% end %>
</dl>
</section>

View file

@ -1,12 +0,0 @@
describe AdminsGroupManagers::AdminsGroupManagerController, type: :controller do
describe 'before actions: authenticate_admins_group_manager!' do
it 'is present' do
before_actions = AdminsGroupManagers::AdminsGroupManagerController
._process_action_callbacks
.filter { |process_action_callbacks| process_action_callbacks.kind == :before }
.map(&:filter)
expect(before_actions).to include(:authenticate_admins_group_manager!)
end
end
end

View file

@ -1,23 +0,0 @@
describe AdminsGroupManagers::AdminsGroupsController, type: :controller do
let(:admins_group_manager) { create(:admins_group_manager) }
describe "#index" do
subject { get :index }
context "when not logged" do
before { subject }
it { expect(response).to redirect_to(new_user_session_path) }
end
context "when logged in" do
let!(:admins_group) { create(:admins_group, admins_group_managers: [admins_group_manager]) }
before do
sign_in(admins_group_manager.user)
subject
end
it { expect(response).to have_http_status(:ok) }
it { expect(assigns(:admins_groups)).to include(admins_group) }
end
end
end

View file

@ -1,25 +0,0 @@
describe Manager::AdminsGroupManagersController, type: :controller do
let(:super_admin) { create(:super_admin) }
let(:admins_group_manager) { create(:admins_group_manager) }
before { sign_in super_admin }
describe '#index' do
render_views
it 'searches admin by email' do
get :index, params: { search: admins_group_manager.email }
expect(response).to have_http_status(:success)
end
end
describe '#show' do
render_views
before do
get :show, params: { id: admins_group_manager.id }
end
it { expect(response.body).to include(admins_group_manager.email) }
end
end

View file

@ -1,27 +0,0 @@
describe Manager::AdminsGroupsController, type: :controller do
let(:super_admin) { create(:super_admin) }
let(:admins_group) { create(:admins_group) }
before { sign_in super_admin }
describe '#index' do
render_views
before do
admins_group
get :index
end
it { expect(response.body).to include(admins_group.name) }
end
describe '#show' do
render_views
before do
get :show, params: { id: admins_group.id }
end
it { expect(response.body).to include(admins_group.name) }
end
end