Skip to content

Commit

Permalink
Little improvments following review
Browse files Browse the repository at this point in the history
  • Loading branch information
clairezed committed Jun 5, 2024
1 parent fcb6ce0 commit 74838a2
Show file tree
Hide file tree
Showing 11 changed files with 58 additions and 47 deletions.
12 changes: 6 additions & 6 deletions app/admin/helpers/links.rb
Original file line number Diff line number Diff line change
Expand Up @@ -16,17 +16,17 @@ def diagnosis_link(diagnosis)
end

def shared_satisfactions_links(shared_satisfactions)
shared_satisfactions.map do |us|
user = us.user
"#{admin_link_to us.company_satisfaction.done_experts.joins(:users).where(users: user).first} - #{admin_link_to user}"
shared_satisfactions.map do |ss|
user = ss.user
"#{admin_link_to ss.company_satisfaction.done_experts.joins(:users).where(users: user).first} - #{admin_link_to user}"
end.join('<br/>')
end

def admin_link_to_expert_shared_satisfaction(e)
count = e.shared_company_satisfactions.count
def admin_link_to_expert_shared_satisfaction(expert)
count = expert.shared_company_satisfactions.count
if count > 0
text = "#{count} #{Expert.human_attribute_name(:shared_company_satisfactions, count: count).downcase}"
div link_to text, admin_company_satisfactions_path('q[matches_expert_id_eq]': e.id, 'q[shared_eq]': 'shared')
div link_to text, admin_company_satisfactions_path('q[matches_expert_id_eq]': expert.id, 'q[shared_eq]': 'shared')
end
end
end
Expand Down
12 changes: 11 additions & 1 deletion app/front/stylesheets/components/cards.sass
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,20 @@
margin-left: -13px
margin-bottom: -26px
.comment__meta
font-size: 0.875rem
font-size: 0.75rem
line-height: 1.5rem
margin-top: 0.5rem
text-align: right
.comment__title
position: relative
&::before
content: open-quote
margin-right: 0.5rem
&::after
content: close-quote
margin-left: 0.5rem
&::before, &::after
font-size: 2rem

// Carte reminders need =================================
.card-reminders-need
Expand Down
4 changes: 0 additions & 4 deletions app/models/match_filter.rb
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,6 @@
#
# index_match_filters_on_antenne_id (antenne_id)
#
# Foreign Keys
#
# fk_rails_... (antenne_id => antennes.id)
#
class MatchFilter < ApplicationRecord
## Associations
#
Expand Down
58 changes: 30 additions & 28 deletions app/views/conseiller/shared_satisfactions/_need.haml
Original file line number Diff line number Diff line change
@@ -1,29 +1,31 @@
.fr-mb-2w
.fr-card__c-container.fr-card__c-container--need
.fr-card.fr-card--sm.fr-card--horizontal
.fr-card__body
.fr-card__content
%h3.fr-h4.fr-card__title
= need.subject
%p.fr-card__desc
= [need.company.name, need.facility.commune_name].join(', ')
.comment__container
.comment__title
= need.company_satisfaction.comment
.comment__meta
- date = I18n.l(need.company_satisfaction.created_at, format: :sentence)
= t('.comment_date', date: date, author: need.visitee.full_name)
.fr-card__start
%p.fr-card__detail
= I18n.l(need.created_at, format: :sentence)
- if params[:query].present?
%span.label.grey-blue= t(need.status, scope: 'needs.collections_single')
.fr-card__footer
%ul.fr-btns-group.fr-btns-group--inline-reverse.fr-btns-group--inline-lg
%li
= link_to "Voir le besoin", need_path(need), class: "fr-btn fr-btn--secondary"
- shared_satisfaction = need.shared_satisfactions.find_by(user: current_user)
- if shared_satisfaction.unseen?
- cache [need, need.shared_satisfactions.find_by(user: current_user).updated_at] do
.fr-mb-2w
.fr-card__c-container.fr-card__c-container--need
.fr-card.fr-card--sm.fr-card--horizontal
.fr-card__body
.fr-card__content
%h3.fr-h4.fr-card__title
= need.subject
%p.fr-card__desc
= [need.company.name, need.facility.commune_name].join(', ')
.comment__container
.comment__title
= need.company_satisfaction.comment
.comment__meta
- date = I18n.l(need.company_satisfaction.created_at, format: :sentence)
= t('.comment_date', date: date, author: need.visitee.full_name)
.fr-card__start
%p.fr-card__detail
- date = I18n.l(need.created_at, format: :sentence)
= t('.need_date', date: date)
- if params[:query].present?
%span.label.grey-blue= t(need.status, scope: 'needs.collections_single')
.fr-card__footer
%ul.fr-btns-group.fr-btns-group--inline-reverse.fr-btns-group--inline-lg
%li
= form_with model: shared_satisfaction, url: mark_as_seen_conseiller_shared_satisfaction_path(shared_satisfaction), method: :patch, local: true, data: { turbo: false } do |f|
= f.submit t('.process'), class: 'fr-btn fr-mr-2v'
= link_to t('.see_need'), need_path(need), class: "fr-btn fr-btn--secondary"
- shared_satisfaction = need.shared_satisfactions.find_by(user: current_user)
- if shared_satisfaction.unseen?
%li
= form_with model: shared_satisfaction, url: mark_as_seen_conseiller_shared_satisfaction_path(shared_satisfaction), method: :patch, local: true, data: { turbo: false } do |f|
= f.submit t('.process'), class: 'fr-btn fr-mr-2v'
2 changes: 1 addition & 1 deletion app/views/conseiller/shared_satisfactions/index.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,6 @@
- else
= paginate @needs

= render partial: 'need', collection: @needs, cached: true
= render partial: 'need', collection: @needs

= paginate @needs
2 changes: 1 addition & 1 deletion app/views/shared/_user_impersonate.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,4 @@

.impersonate-buttons
= form_with url: impersonate_engine.revert_impersonate_user_url, method: :delete, local: true, class: 'revert-form' do |f|
= f.submit 'Retourner à l’admin'
= f.submit t('back_to_admin')
4 changes: 4 additions & 0 deletions config/locales/models.fr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -221,6 +221,7 @@ fr:
contacted_by_expert: Contacté par un expert
landing: Page d’atterrissage
shared: Partagé
shared_satisfactions: Le partage de satisfaction
solicitation_email_cont: Email du contact
solicitation_mtm_campaign: Campagne
solicitation_mtm_kwd: Mots-clés
Expand Down Expand Up @@ -712,6 +713,9 @@ fr:
search:
one: Recherche
other: Recherches
shared_satisfaction:
one: Le partage de satisfaction
other: Le partage des satisfactions
solicitation:
one: Sollicitation
other: Sollicitations
Expand Down
5 changes: 4 additions & 1 deletion config/locales/views.fr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,7 @@ fr:
attributes:
is_global_zone: Territoire national
autocomplete_assistive_hint: Lorsque les résultats de l’auto-complétion sont disponibles, utilisez les flèches haut et bas pour les examiner et Entrée pour sélectionner une option. Les utilisateurs d’appareils tactiles peuvent sélectionner une option par en glissant et tapotant l'écran.
back_to_admin: Retourner à l’admin
badges:
create:
badge_created: Le tag a bien été créé
Expand Down Expand Up @@ -272,8 +273,10 @@ fr:
short_title: Retours
title: Retours des entreprises aidées
need:
comment_date: "%{author}, le %{date}"
comment_date: Retour de %{author}, le %{date}
need_date: Besoin du %{date}
process: Marquer comme "vu"
see_need: Voir le besoin
satifaction_seen: Le retour a été marqué comme vu
titles:
seen: Retours vus
Expand Down
3 changes: 1 addition & 2 deletions db/schema.rb
Original file line number Diff line number Diff line change
Expand Up @@ -451,13 +451,13 @@
t.integer "effectif_min"
t.integer "effectif_max"
t.integer "min_years_of_existence"
t.bigint "antenne_id"
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
t.integer "max_years_of_existence"
t.string "accepted_legal_forms", array: true
t.string "excluded_legal_forms", array: true
t.string "excluded_naf_codes", array: true
t.bigint "antenne_id"
t.index ["antenne_id"], name: "index_match_filters_on_antenne_id"
end

Expand Down Expand Up @@ -711,7 +711,6 @@
add_foreign_key "landing_subjects", "subjects"
add_foreign_key "landings", "institutions"
add_foreign_key "logos", "institutions"
add_foreign_key "match_filters", "antennes"
add_foreign_key "matches", "experts"
add_foreign_key "matches", "needs"
add_foreign_key "matches", "subjects"
Expand Down
Binary file modified doc/domain_model.pdf
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,6 @@

it { expect(response).to redirect_to(unseen_conseiller_shared_satisfactions_path) }
it { expect(expert.shared_satisfactions.unseen.size).to eq(0) }

end

end

end

0 comments on commit 74838a2

Please sign in to comment.