Skip to content

Commit

Permalink
Merge pull request #3764 from betagouv/improve-sas-and-effectif-label…
Browse files Browse the repository at this point in the history
…-and-manager-bal

Label Effectifs manquant + info SAS + modif BAL responsable
  • Loading branch information
clairezed authored Jan 20, 2025
2 parents 2eb8be7 + 1df90d3 commit a93c07d
Show file tree
Hide file tree
Showing 17 changed files with 27 additions and 29 deletions.
4 changes: 3 additions & 1 deletion app/controllers/concerns/inbox.rb
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,10 @@ def antenne_retrieve_needs(antenne, collection_name, view: :index, order: :desc)

@needs = @recipient.perimeter_received_needs.merge!(@recipient.send(:"territory_needs_#{@collection_name}"))

# on reject antenne_id, sinon le filtre by_antenne peut venir enlever des besoins
# (cas des antennes régionales)
@needs = @needs.includes(:company, :advisor, :subject)
.apply_filters(needs_search_params)
.apply_filters(needs_search_params.except(:antenne_id))
.order(created_at: order)
.page params[:page]
render view
Expand Down
5 changes: 3 additions & 2 deletions app/policies/report_policy.rb
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
class ReportPolicy < ApplicationPolicy
def index?
@user&.is_admin? ||
(@user&.is_manager? && @user.managed_antennes.include?(@record))
(@user&.is_manager? && @user.supervised_antennes.include?(@record))
end

def show_navbar?
@user&.is_manager?
end

def download?
@user&.is_admin? || @user.managed_antennes.include?(@record.antenne)
@user&.is_admin? ||
(@user&.is_manager? && @user.supervised_antennes.include?(@record.antenne))
end
end
2 changes: 1 addition & 1 deletion app/services/effectif/code_effectif.rb
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ def initialize(code)

def intitule_effectif
if @code.blank?
return I18n.t('other')
I18n.t(:missing, scope: 'codes_effectif')
end

I18n.t(@code, scope: 'codes_effectif', default: I18n.t('other'))
Expand Down
2 changes: 1 addition & 1 deletion app/views/about/cgu.fr.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@
<li>
<strong>Réceptionner un besoin d’entreprise</strong>
<p>Le « Conseiller » reçoit un besoin d’entreprise directement sur sa boîte mail. Le mail de notification du besoin contient un lien sécurisé vers une fiche détaillée du besoin exprimé par l'entreprise. Le « Conseiller » vérifie que le besoin entre dans son champ d’intervention.</p>
<p>Chaque « Conseiller » peut accéder à l’ensemble des besoins d’entreprises qui lui ont été adressés sur son compte « Conseillers-Entreprises », dans l’onglet « Besoins reçus ».</p>
<p>Chaque « Conseiller » peut accéder à l’ensemble des besoins d’entreprises qui lui ont été adressés sur son compte « Conseillers-Entreprises », dans l’onglet « Mes besoins ».</p>
</li>
<li>
<strong>Prendre en charge ou refuser un besoin d’entreprise</strong>
Expand Down
2 changes: 1 addition & 1 deletion app/views/application/_navbar.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
- if policy(User).manager?
= active_link_to manager_needs_path, class: 'fr-nav__link', wrap_tag: :li, wrap_class: 'fr-nav__item', class_active: 'fr-nav__item--active' do
%span.ri-inbox-fill.fr-mr-1w{ 'aria-hidden': 'true' }
= current_user.managed_antennes.many? ? t('.antennes_needs') : t('.antenne_needs')
= t('manager.needs.index.title')
- if policy(:shared_satisfaction).show_navbar?
= active_link_to conseiller_shared_satisfactions_path, class: 'fr-nav__link', wrap_tag: :li, wrap_class: 'fr-nav__item', class_active: 'fr-nav__item--active' do
%span.ri-chat-heart-line.fr-mr-1w{ 'aria-hidden': 'true' }
Expand Down
4 changes: 4 additions & 0 deletions app/views/experts/_expert.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,10 @@
%li
%span.picto.ri-nurse-fill{ 'aria-hidden': 'true' }
= t('.manager_name', name: manager.full_name)
- if manager.job.present?
%li
%span.picto.ri-contacts-book-fill{ 'aria-hidden': 'true' }
= manager.job
%li
%span.picto.ri-mail-fill{ 'aria-hidden': 'true' }
= mail_to manager.email, manager.email, class: 'break-word'
Expand Down
2 changes: 1 addition & 1 deletion app/views/reports/index.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
.fr-col-12.fr-col-md-6
.fr-select-group
= f.label :antenne_id, t('filters.select_antenne'), class: 'fr-label'
= f.select :antenne_id, options_for_select(build_manager_antennes_collection(current_user).pluck(:name, :id), selected: @antenne), {}, class: "fr-select"
= f.select :antenne_id, options_for_select(build_manager_antennes_collection(current_user).pluck(:name, :id), selected: @antenne.id), {}, class: "fr-select"

.fr-col-12.fr-col-md-6
.fr-input-group
Expand Down
1 change: 1 addition & 0 deletions config/locales/data/codes_effectif.fr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ fr:
'53': 10 000 salariés et plus
NN: Unités non employeuses
NR: Non répertorié sur api entreprise
missing: Données manquantes
other: nil
simple_effectif:
'0': 0 salarié, entreprise non employeuse et auto-entrepreneur
Expand Down
7 changes: 4 additions & 3 deletions config/locales/views.fr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -314,7 +314,7 @@ fr:
solicitation:
from_intermediary: Sollicitation provenant d’un intermédiaire
needs_historic: 'Historique de l’entreprise :'
not_sas_explanation: La forme juridique de l’entreprise n’est pas une SAS ou SASU
not_sas_explanation: Si formation métier -> mail TNS (La forme juridique de l’entreprise n’est pas une SAS ou SASU)
not_sas_html: "<span class='crossed-out-text'>SAS</span>"
similar_abandonned_solicitations_explanation: 'Cycle d’abandon suspecté : cette entreprise a déjà déposé au moins 3 demandes qui n’ont pas été mises en relation'
solicitation_doublon_explanation: 'Doublon suspecté : cette entreprise a déposé d’autres besoins récemment'
Expand Down Expand Up @@ -499,8 +499,9 @@ fr:
manager:
needs:
index:
many_antennes_title: Tous les besoins reçus des antennes
many_antennes_title: Tous les besoins reçus par les antennes
one_antenne_title: Antenne %{name} - tous les besoins
title: Vue responsable
stats:
index:
antenne_title: Statistiques de l’antenne %{name}
Expand Down Expand Up @@ -548,7 +549,7 @@ fr:
other: Lorsqu’un chef d’entreprise déposera un besoin relevant de votre champ d’intervention, vous recevrez automatiquement un mail de notification sur les adresses %{emails}.
welcome_title: Bienvenue sur Conseillers-Entreprises, un service de Service-Public.fr
index:
title: Besoins reçus
title: Mes besoins
match_actions:
call_company: 1. J’appelle l’entreprise
can_you_help: Pouvez-vous aider l’entreprise %{company} ?
Expand Down
11 changes: 0 additions & 11 deletions db/schema.rb
Original file line number Diff line number Diff line change
Expand Up @@ -656,17 +656,6 @@
t.index ["theme_id"], name: "index_subjects_on_theme_id"
end

create_table "territorial_zones", force: :cascade do |t|
t.string "code", null: false
t.string "zone_type", null: false
t.string "zoneable_type", null: false
t.bigint "zoneable_id", null: false
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
t.index ["code", "zone_type", "zoneable_type", "zoneable_id"], name: "idx_on_code_zone_type_zoneable_type_zoneable_id_0c5f85b4e4", unique: true
t.index ["zoneable_type", "zoneable_id"], name: "index_territorial_zones_on_zoneable"
end

create_table "territories", force: :cascade do |t|
t.string "name"
t.datetime "created_at", precision: nil, null: false
Expand Down
Binary file modified doc/domain_model.pdf
Binary file not shown.
4 changes: 2 additions & 2 deletions spec/features/application_controller_feature_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
click_on 'Domaines d’intervention'
click_on 'Tutoriel'
visit 'entreprises/search'
expect(page.html).to include 'Besoins reçus'
expect(page.html).to include 'Mes besoins'
expect(page.html).not_to include 'Administration'
expect(page.html).not_to include 'Annuaire'
expect(page.html).not_to include 'Tags'
Expand All @@ -54,7 +54,7 @@
visit '/besoins'
visit '/manager/besoins-des-antennes'
visit '/export-des-donnees'
expect(page.html).to include 'Besoins reçus'
expect(page.html).to include 'Mes besoins'
end
end

Expand Down
4 changes: 2 additions & 2 deletions spec/features/signin_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
click_on 'Accès conseillers', class: 'fr-btn'
end

expect(page.html).to include 'Besoins reçus'
expect(page.html).to include 'Mes besoins'
end
end
end
Expand All @@ -36,7 +36,7 @@
click_on 'Accès conseillers', class: 'fr-btn'
end

expect(page.html).not_to include 'Besoins reçus'
expect(page.html).not_to include 'Mes besoins'
expect(current_url).to eq new_user_session_url
end
end
Expand Down
2 changes: 1 addition & 1 deletion spec/features/users/needs_feature_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

it 'shows the need to user' do
visit needs_path
expect(page.html).to include 'Besoins reçus'
expect(page.html).to include 'Mes besoins'
expect(page.html).to include match.diagnosis.company.name
page.click_on(need_subject)
expect(page.html).to include need_subject
Expand Down
2 changes: 1 addition & 1 deletion spec/system/manager/needs_system_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
it 'displays all user received needs pages' do
visit '/'
click_on 'Accès conseillers'
click_on 'Besoins reçus'
click_on 'Mes besoins'
expect(page).to have_current_path(quo_active_needs_path, ignore_query: true)
expect(page).to have_css('.fr-card__c-container--need', count: 1)

Expand Down
2 changes: 1 addition & 1 deletion spec/system/needs_system_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
it 'displays all user received needs pages' do
visit '/'
click_on 'Accès conseillers'
click_on 'Besoins reçus'
click_on 'Mes besoins'
expect(page).to have_current_path(quo_active_needs_path, ignore_query: true)
expect(page).to have_css('.fr-card__c-container--need', count: 2)

Expand Down
2 changes: 1 addition & 1 deletion spec/system/users/passwords_controller_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
within '.new_user' do
click_on 'Accès conseillers', class: 'fr-btn'
end
expect(page).to have_content 'Besoins reçus'
expect(page).to have_content 'Mes besoins'
end
end
end

0 comments on commit a93c07d

Please sign in to comment.