Skip to content

Commit f24e4db

Browse files
authored
Merge pull request #13326 from demarche-numerique/push-muznruslznky
ETQ instructeur, je peux modifier le dossier d'un usager
2 parents 5f861a0 + 6cbf128 commit f24e4db

84 files changed

Lines changed: 1266 additions & 181 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

app/assets/stylesheets/demande.scss

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,15 @@
4343

4444
.champ-updated {
4545
float: right;
46+
align-items: center;
47+
48+
// The tooltip trigger (only present for instructeur edits) is taller than
49+
// the badge by default and would stretch the row. Shrink it to the badge
50+
// height so instructeur and usager badges keep the same slim appearance.
51+
.fr-btn--tooltip {
52+
min-height: 0;
53+
padding: 0;
54+
}
4655
}
4756

4857
.champ-repetition {

app/assets/stylesheets/dossier_edit.scss

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,3 +16,17 @@
1616
text-align: right;
1717
}
1818
}
19+
20+
.readonly-text-area {
21+
max-height: 200px;
22+
background-color: var(--background-contrast-grey);
23+
overflow-y: scroll;
24+
25+
p {
26+
margin-bottom: $default-padding;
27+
}
28+
29+
dl {
30+
margin-bottom: $default-padding;
31+
}
32+
}

app/components/dossiers/champ_updated_component/champ_updated_component.html.erb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@
66
<% if updated_by_instructeur? %>
77
<button
88
class="
9-
fr-btn--tooltip fr-icon-question-line fr-btn--sm
10-
fr-btn--tertiary-no-outline
9+
fr-btn--tooltip fr-icon-information-line fr-btn--sm
10+
fr-btn--tertiary-no-outline fr-pl-1v
1111
"
1212
type="button"
1313
aria-describedby="<%= tooltip_id %>"

app/components/dossiers/champs_rows_show_component.rb

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,23 @@ def repetition_heading_tag
1616

1717
private
1818

19+
def row_show_component(champ)
20+
Dossiers::RowShowComponent.new(label: champ.libelle,
21+
seen_at:, profile:,
22+
content_class: champ.type_champ,
23+
updated_at: updated_at_after_deposer(champ),
24+
updated_by: updated_by(champ),
25+
source_stream: champ.source_stream)
26+
end
27+
28+
def updated_by(champ)
29+
if usager? && champ.source_stream == Champ::INSTRUCTEUR_BUFFER_STREAM && champ.procedure.hide_instructeurs_email?
30+
nil
31+
else
32+
champ.updated_by
33+
end
34+
end
35+
1936
def updated_at_after_deposer(champ)
2037
return if champ.dossier.depose_at.blank?
2138
return if champ.new_record?
@@ -51,4 +68,8 @@ def visible?(champ)
5168
def each_champ(&block)
5269
@champs.filter { visible?(_1) }.each(&block)
5370
end
71+
72+
def usager?
73+
@profile == 'usager'
74+
end
5475
end

app/components/dossiers/champs_rows_show_component/champs_rows_show_component.html.erb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
</div>
99
<% end %>
1010
<% else %>
11-
<%= render Dossiers::RowShowComponent.new(label: champ.libelle, seen_at:, profile:, content_class: champ.type_champ, updated_at: updated_at_after_deposer(champ), updated_by: champ.updated_by, source_stream: champ.source_stream) do |c| %>
11+
<%= render row_show_component(champ) do |c| %>
1212
<% if champ.blank? %>
1313
<% c.with_blank do %>
1414
<%= t(blank_key(champ)) %>

app/components/dossiers/changes_component/changes_component.html.erb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<dl class="dossiers-changes-component fr-mb-0">
1+
<dl class="dossiers-changes-component">
22
<% changed_columns.each do |changed_column| %>
33
<dt><%= changed_column.label %> :</dt>
44
<dd><%= change_content(changed_column) %></dd>
Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
---
22
en:
3-
changes_to_save: 'modifications to submit'
3+
changes_to_save: 'modifications to save'
4+
changes_to_submit: 'modifications to submit'
45
modified_at: 'modified on %{datetime}'
56
check_content_rebased: 'Information: field updated by administration. Check its content.'
Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
---
22
fr:
3-
changes_to_save: 'modification à déposer'
3+
changes_to_save: 'modification à enregistrer'
4+
changes_to_submit: 'modification à déposer'
45
modified_at: 'modifié le %{datetime}'
56
check_content_rebased: 'Information : champ actualisé par l’administration. Vérifier son contenu.'

app/components/editable_champ/champ_label_content_component/champ_label_content_component.html.haml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,12 @@
66
- if @champ.mandatory?
77
= render EditableChamp::AsteriskMandatoryComponent.new
88

9-
- if @champ.user_buffer_changes?
9+
- if @champ.buffer_stream?
1010
%span.updated-at.highlighted
11-
= t('.changes_to_save')
11+
- if @champ.user_buffer_stream?
12+
= t('.changes_to_submit')
13+
- else
14+
= t('.changes_to_save')
1215
- elsif @champ.updated_at.present? && @seen_at.present?
1316
%span.updated-at{ class: highlight_if_unseen_class }
1417
= t('.modified_at', datetime: try_format_datetime(@champ.updated_at))

app/components/editable_champ/editable_champ_component.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,8 @@ def stimulus_values
100100
def turbo_poll_url_value
101101
if @champ.private?
102102
annotation_instructeur_dossier_path(@champ.dossier.procedure, @champ.dossier, @champ.stable_id, row_id: @champ.row_id)
103+
elsif @champ.dossier.stream == Champ::INSTRUCTEUR_BUFFER_STREAM
104+
champ_instructeur_dossier_path(@champ.dossier.procedure, @champ.dossier, @champ.stable_id, row_id: @champ.row_id)
103105
else
104106
champ_dossier_path(@champ.dossier, @champ.stable_id, row_id: @champ.row_id)
105107
end

0 commit comments

Comments
 (0)