adapt search page
This commit is contained in:
parent
d287eac706
commit
96ee065046
2 changed files with 26 additions and 26 deletions
|
@ -27,23 +27,24 @@
|
||||||
%th.follow-col
|
%th.follow-col
|
||||||
%tbody
|
%tbody
|
||||||
- @projected_dossiers.each do |p|
|
- @projected_dossiers.each do |p|
|
||||||
|
- dossier = p.dossier
|
||||||
- procedure_libelle, user_email, procedure_id = p.columns
|
- procedure_libelle, user_email, procedure_id = p.columns
|
||||||
- instructeur_dossier = @instructeur_dossiers_ids.include?(p.dossier_id)
|
- instructeur_dossier = @instructeur_dossiers_ids.include?(dossier.id)
|
||||||
- expert_dossier = @dossier_avis_ids_h[p.dossier_id].present?
|
- expert_dossier = @dossier_avis_ids_h[dossier.id].present?
|
||||||
- hidden_by_administration = p.hidden_by_administration_at.present?
|
- hidden_by_administration = dossier.hidden_by_administration_at.present?
|
||||||
- instructeur_and_expert_dossier = instructeur_dossier && expert_dossier
|
- instructeur_and_expert_dossier = instructeur_dossier && expert_dossier
|
||||||
- path = instructeur_dossier ? instructeur_dossier_path(procedure_id, p.dossier_id) : expert_avis_path(procedure_id, @dossier_avis_ids_h[p.dossier_id])
|
- path = instructeur_dossier ? instructeur_dossier_path(procedure_id, dossier.id) : expert_avis_path(procedure_id, @dossier_avis_ids_h[dossier.id])
|
||||||
|
|
||||||
%tr{ class: [p.hidden_by_administration_at.present? && "file-hidden-by-user"] }
|
%tr{ class: [dossier.hidden_by_administration_at.present? && "file-hidden-by-user"] }
|
||||||
- if instructeur_and_expert_dossier
|
- if instructeur_and_expert_dossier
|
||||||
%td.fr-cell--numeric
|
%td.fr-cell--numeric
|
||||||
.relative
|
.relative
|
||||||
= p.dossier_id
|
= dossier.id
|
||||||
- if @notifications_dossier_ids.include?(p.dossier_id)
|
- if @notifications_dossier_ids.include?(dossier.id)
|
||||||
%span.notifications{ 'aria-label': 'notifications' }
|
%span.notifications{ 'aria-label': 'notifications' }
|
||||||
%td.fr-cell--multiline= procedure_libelle
|
%td.fr-cell--multiline= procedure_libelle
|
||||||
%td= user_email
|
%td= user_email
|
||||||
%td.flex.column= status_badge(p.state)
|
%td.flex.column= status_badge(dossier.state)
|
||||||
|
|
||||||
- elsif hidden_by_administration
|
- elsif hidden_by_administration
|
||||||
= render partial: "recherche/hidden_dossier", locals: {p: p, procedure_libelle: procedure_libelle, user_email: user_email}
|
= render partial: "recherche/hidden_dossier", locals: {p: p, procedure_libelle: procedure_libelle, user_email: user_email}
|
||||||
|
@ -51,8 +52,8 @@
|
||||||
- else
|
- else
|
||||||
%td.fr-cell--numeric
|
%td.fr-cell--numeric
|
||||||
%a.fr-link.relative{ href: path }
|
%a.fr-link.relative{ href: path }
|
||||||
= p.dossier_id
|
= dossier.id
|
||||||
- if @notifications_dossier_ids.include?(p.dossier_id)
|
- if @notifications_dossier_ids.include?(dossier.id)
|
||||||
%span.notifications{ 'aria-label': 'notifications' }
|
%span.notifications{ 'aria-label': 'notifications' }
|
||||||
|
|
||||||
%td
|
%td
|
||||||
|
@ -62,8 +63,7 @@
|
||||||
%a{ href: path }= user_email
|
%a{ href: path }= user_email
|
||||||
|
|
||||||
%td
|
%td
|
||||||
%a.flex.column{ href: path }= status_badge(p.state)
|
%a.flex.column{ href: path }= status_badge(dossier.state)
|
||||||
|
|
||||||
|
|
||||||
- if instructeur_dossier && expert_dossier
|
- if instructeur_dossier && expert_dossier
|
||||||
%td.follow-col
|
%td.follow-col
|
||||||
|
@ -72,13 +72,13 @@
|
||||||
Actions
|
Actions
|
||||||
|
|
||||||
- menu.with_item do
|
- menu.with_item do
|
||||||
= link_to(instructeur_dossier_path(procedure_id, p.dossier_id), role: 'menuitem') do
|
= link_to(instructeur_dossier_path(procedure_id, dossier.id), role: 'menuitem') do
|
||||||
= dsfr_icon('fr-icon-file-text-fill', :sm)
|
= dsfr_icon('fr-icon-file-text-fill', :sm)
|
||||||
.dropdown-description
|
.dropdown-description
|
||||||
Voir le dossier
|
Voir le dossier
|
||||||
|
|
||||||
- menu.with_item do
|
- menu.with_item do
|
||||||
= link_to(expert_avis_path(procedure_id, @dossier_avis_ids_h[p.dossier_id]), role: 'menuitem') do
|
= link_to(expert_avis_path(procedure_id, @dossier_avis_ids_h[dossier.id]), role: 'menuitem') do
|
||||||
= dsfr_icon('fr-icon-chat-3-fill', :sm)
|
= dsfr_icon('fr-icon-chat-3-fill', :sm)
|
||||||
.dropdown-description
|
.dropdown-description
|
||||||
Donner mon avis
|
Donner mon avis
|
||||||
|
@ -86,7 +86,7 @@
|
||||||
- elsif instructeur_dossier
|
- elsif instructeur_dossier
|
||||||
- if hidden_by_administration
|
- if hidden_by_administration
|
||||||
%td.follow-col
|
%td.follow-col
|
||||||
= link_to restore_instructeur_dossier_path(procedure_id, p.dossier_id), method: :patch, class: "button primary" do
|
= link_to restore_instructeur_dossier_path(procedure_id, dossier.id), method: :patch, class: "button primary" do
|
||||||
= t('views.instructeurs.dossiers.restore')
|
= t('views.instructeurs.dossiers.restore')
|
||||||
|
|
||||||
- else
|
- else
|
||||||
|
@ -94,15 +94,15 @@
|
||||||
%ul.fr-btns-group.fr-btns-group--sm.fr-btns-group--inline-lg.fr-btns-group--icon-right
|
%ul.fr-btns-group.fr-btns-group--sm.fr-btns-group--inline-lg.fr-btns-group--icon-right
|
||||||
= render partial: "instructeurs/procedures/dossier_actions",
|
= render partial: "instructeurs/procedures/dossier_actions",
|
||||||
locals: { procedure_id: procedure_id,
|
locals: { procedure_id: procedure_id,
|
||||||
dossier_id: p.dossier_id,
|
dossier_id: dossier.id,
|
||||||
state: p.state,
|
state: dossier.state,
|
||||||
archived: p.archived,
|
archived: dossier.archived,
|
||||||
dossier_is_followed: @followed_dossiers_id.include?(p.dossier_id),
|
dossier_is_followed: @followed_dossiers_id.include?(dossier.id),
|
||||||
close_to_expiration: nil,
|
close_to_expiration: nil,
|
||||||
hidden_by_administration: nil,
|
hidden_by_administration: nil,
|
||||||
hidden_by_expired: nil,
|
hidden_by_expired: nil,
|
||||||
sva_svr: p.sva_svr_decision_on.present?,
|
sva_svr: dossier.sva_svr_decision_on.present?,
|
||||||
has_blocking_pending_correction: p.pending_correction? && Flipper.enabled?(:blocking_pending_correction, ProcedureFlipperActor.new(procedure_id)),
|
has_blocking_pending_correction: dossier.pending_correction? && Flipper.enabled?(:blocking_pending_correction, ProcedureFlipperActor.new(procedure_id)),
|
||||||
turbo: false,
|
turbo: false,
|
||||||
with_menu: false }
|
with_menu: false }
|
||||||
|
|
||||||
|
|
|
@ -48,7 +48,7 @@ describe RechercheController, type: :controller do
|
||||||
|
|
||||||
it 'returns the expected dossier' do
|
it 'returns the expected dossier' do
|
||||||
expect(assigns(:projected_dossiers).count).to eq(1)
|
expect(assigns(:projected_dossiers).count).to eq(1)
|
||||||
expect(assigns(:projected_dossiers).first.dossier_id).to eq(dossier.id)
|
expect(assigns(:projected_dossiers).first.dossier).to eq(dossier)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -62,7 +62,7 @@ describe RechercheController, type: :controller do
|
||||||
|
|
||||||
it 'returns the expected dossier' do
|
it 'returns the expected dossier' do
|
||||||
expect(assigns(:projected_dossiers).count).to eq(1)
|
expect(assigns(:projected_dossiers).count).to eq(1)
|
||||||
expect(assigns(:projected_dossiers).first.dossier_id).to eq(dossier_with_expert.id)
|
expect(assigns(:projected_dossiers).first.dossier).to eq(dossier_with_expert)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -146,7 +146,7 @@ describe RechercheController, type: :controller do
|
||||||
it 'returns the expected dossier' do
|
it 'returns the expected dossier' do
|
||||||
subject
|
subject
|
||||||
expect(assigns(:projected_dossiers).count).to eq(1)
|
expect(assigns(:projected_dossiers).count).to eq(1)
|
||||||
expect(assigns(:projected_dossiers).first.dossier_id).to eq(dossier.id)
|
expect(assigns(:projected_dossiers).first.dossier).to eq(dossier)
|
||||||
end
|
end
|
||||||
|
|
||||||
context 'when dossier has notification' do
|
context 'when dossier has notification' do
|
||||||
|
@ -170,7 +170,7 @@ describe RechercheController, type: :controller do
|
||||||
it 'returns only the dossier available to the expert' do
|
it 'returns only the dossier available to the expert' do
|
||||||
subject
|
subject
|
||||||
expect(assigns(:projected_dossiers).count).to eq(1)
|
expect(assigns(:projected_dossiers).count).to eq(1)
|
||||||
expect(assigns(:projected_dossiers).first.dossier_id).to eq(dossier_with_expert.id)
|
expect(assigns(:projected_dossiers).first.dossier).to eq(dossier_with_expert)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
@ -184,7 +184,7 @@ describe RechercheController, type: :controller do
|
||||||
|
|
||||||
it 'returns the expected dossier' do
|
it 'returns the expected dossier' do
|
||||||
expect(assigns(:projected_dossiers).count).to eq(1)
|
expect(assigns(:projected_dossiers).count).to eq(1)
|
||||||
expect(assigns(:projected_dossiers).first.dossier_id).to eq(dossier_with_expert.id)
|
expect(assigns(:projected_dossiers).first.dossier).to eq(dossier_with_expert)
|
||||||
end
|
end
|
||||||
|
|
||||||
context 'as an expert' do
|
context 'as an expert' do
|
||||||
|
|
Loading…
Reference in a new issue