Skip to content

Commit

Permalink
Merge branch 'feature/import-2023-06-01'
Browse files Browse the repository at this point in the history
  • Loading branch information
maatinito committed Aug 24, 2023
2 parents a1a18b2 + f3ec40f commit 0b5fb96
Show file tree
Hide file tree
Showing 132 changed files with 2,580 additions and 763 deletions.
3 changes: 2 additions & 1 deletion app/assets/stylesheets/dossiers_table.scss
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,8 @@
}
}

.number-col {
.number-col,
.fr-badge {
white-space: nowrap;
}

Expand Down
36 changes: 14 additions & 22 deletions app/assets/stylesheets/forms.scss
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,6 @@
@import "placeholders";

.form {
h1 {
text-align: center;
margin-bottom: 20px;

@media (max-width: $two-columns-breakpoint) {
font-size: 26px;
}
}

p {
margin-bottom: $default-spacer;
}

ul {
list-style-type: square;
list-style-position: outside;
Expand Down Expand Up @@ -57,7 +44,7 @@
color: $dark-red;
}

label,
label:not(.fr-label),
legend.form-label {
font-size: 18px;
margin-bottom: $default-padding;
Expand All @@ -83,6 +70,9 @@
margin-top: - $default-spacer;
margin-bottom: $default-padding;

p {
margin-bottom: $default-spacer;
}

input[type='date'] {
display: inline-block;
Expand Down Expand Up @@ -392,10 +382,6 @@
margin-bottom: $default-fields-spacer;
}

input[type=date] {
max-width: 180px;
}

select {
// hack found here: https://stackoverflow.com/questions/1895476/how-to-style-a-select-dropdown-with-css-only-without-javascript
-webkit-appearance: none;
Expand Down Expand Up @@ -527,11 +513,9 @@
}

.explication-libelle {
color: $black;
font-weight: bold;
font-size: 20px;
margin-bottom: $default-padding;
border-bottom: none;
}

.explication {
Expand Down Expand Up @@ -727,6 +711,14 @@ textarea::placeholder {
color: $dark-grey;
}

.send-wrapper--with-border-top {
border-top: 2px solid rgba(0, 0, 145, 1);
.sticky-action-footer {
border-top: 2px solid $blue-france-500;
position: sticky;
// scss-lint:disable VendorPrefix
position: -webkit-sticky; // This is needed on Safari (tested on 12.1)
// scss-lint:enable VendorPrefix
bottom: 0;
padding: $default-padding 0;
background-color: $white;
z-index: 2;
}
1 change: 0 additions & 1 deletion app/assets/stylesheets/motivation.scss
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
@import "constants";

.motivation {
padding: $default-padding;
color: $black;
width: 450px;

Expand Down
2 changes: 0 additions & 2 deletions app/assets/stylesheets/procedure_form.scss
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,6 @@

.procedure-form__actions {
display: flex;
margin-left: -$default-padding;
margin-right: -$default-padding;
padding: $default-spacer $default-padding;
background: $light-grey;
border-top: 1px solid $border-grey;
Expand Down
2 changes: 1 addition & 1 deletion app/components/attachment/edit_component.rb
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ def file_field_options
aria: { describedby: champ&.describedby_id },
data: {
auto_attach_url:,
turbo_force: true
turbo_force: :server
}.merge(has_file_size_validator? ? { max_file_size: } : {})
.merge(user_can_replace? ? { replace_attachment_target: "input" } : {})
}.merge(has_content_type_validator? ? { accept: accept_content_type } : {})
Expand Down
3 changes: 2 additions & 1 deletion app/components/dossiers/edit_footer_component.rb
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,8 @@ def submit_en_construction_button_options
{
class: 'fr-btn fr-btn--sm',
method: :post,
data: { 'disable-with': t('.submitting'), controller: 'autosave-submit' }
data: { 'disable-with': t('.submitting'), controller: 'autosave-submit' },
form: { id: "form-submit-en-construction" }
}
end

Expand Down
7 changes: 7 additions & 0 deletions app/components/dossiers/message_component.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,13 @@ def initialize(commentaire:, connected_user:, messagerie_seen_at: nil, show_repl

attr_reader :commentaire, :connected_user, :messagerie_seen_at

def correction_badge
return if commentaire.dossier_correction.nil?
return helpers.correction_resolved_badge if commentaire.dossier_correction.resolved?

helpers.pending_correction_badge(connected_user.is_a?(Instructeur) ? :for_instructeur : :for_user)
end

private

def show_reply_button?
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@
= commentaire_issuer
- if commentaire_from_guest?
%span.fr-text--xs.fr-text-mention--grey.font-weight-normal= t('.guest')

= correction_badge

%span.date{ class: ["fr-text--xs", "fr-text-mention--grey", "font-weight-normal", highlight_if_unseen_class], data: scroll_to_target }
= commentaire_date
.rich-text
Expand Down
24 changes: 24 additions & 0 deletions app/components/instructeurs/en_construction_menu_component.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# frozen_string_literal: true

class Instructeurs::EnConstructionMenuComponent < ApplicationComponent
attr_reader :dossier

def initialize(dossier:)
@dossier = dossier
end

def render?
return true if dossier.may_repasser_en_construction?
return true if dossier.may_flag_as_pending_correction?

false
end

def menu_label
if dossier.en_construction?
t('.request_correction')
else
t(".revert_en_construction")
end
end
end
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
---
en:
revert_en_construction: Revert to in progress
request_correction: Request a correction
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
---
fr:
revert_en_construction: Repasser en construction
request_correction: Demander une correction
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
= render Dropdown::MenuComponent.new(wrapper: :div, menu_options: { id: "menu-en-construction" }, button_options: { class: "fr-btn--secondary" }, role: :region) do |menu|
- menu.with_button_inner_html do
= menu_label

- if dossier.may_repasser_en_construction?
= menu.with_item do
= link_to(repasser_en_construction_instructeur_dossier_path(dossier.procedure.id, dossier.id), method: :post, role: 'menuitem') do
%span.fr-icon.fr-icon-draft-line.fr-text-default--info.fr-mt-1v{ "aria-hidden": "true" }
.dropdown-description
%h4= t('.revert_en_construction')
L’usager sera notifié qu’il peut modifier son dossier
- menu.with_item do
= link_to('#', onclick: "DS.showMotivation(event, 'pending_correction');", role: 'menuitem') do
%span.fr-icon.fr-icon-error-warning-line.fr-text-default--info.fr-mt-1v{ "aria-hidden": "true" }
.dropdown-description
%h4= t('.request_correction')
L’usager sera notifié que des modifications sont attendues
- menu.with_item(class: "inactive form-inside fr-pt-1v") do
= render partial: 'instructeurs/dossiers/instruction_button_motivation', locals: { dossier:,
visible: true,
form_path: pending_correction_instructeur_dossier_path(dossier.procedure, dossier),
placeholder: 'Expliquez au demandeur quelle(s) correction(s) sont attendues',
popup_class: 'pending_correction',
button_justificatif_label: "Ajouter une pièce jointe (facultatif)",
process_button: dossier.en_construction? ? 'Valider' : 'Valider et repasser en construction',
process_action: nil,
title: 'Marquer en attente de corrections',
confirm: 'Envoyer la demande de corrections ?'}
17 changes: 17 additions & 0 deletions app/components/instructeurs/instruction_menu_component.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# frozen_string_literal: true

class Instructeurs::InstructionMenuComponent < ApplicationComponent
attr_reader :dossier

def initialize(dossier:)
@dossier = dossier
end

def render?
dossier.en_instruction?
end

def menu_label
t(".instruct")
end
end
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
---
en:
instruct: Instruct the file
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
---
fr:
instruct: Instruire le dossier
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
= render Dropdown::MenuComponent.new(wrapper: :div, wrapper_options: { data: { turbo_force: :server } }, role: :region) do |menu|
- menu.with_button_inner_html do
= menu_label

- menu.with_item do
= link_to('#', onclick: "DS.showMotivation(event, 'accept');", role: 'menuitem') do
%span.icon.accept
.dropdown-description
%h4 Accepter
L’usager sera informé que son dossier a été accepté

- menu.with_item(class: "hidden inactive form-inside fr-pt-1v") do
= render partial: 'instructeurs/dossiers/instruction_button_motivation', locals: { dossier: dossier, placeholder: 'Expliquez au demandeur pourquoi ce dossier est accepté (facultatif)', popup_class: 'accept', process_action: 'accepter', title: 'Accepter', confirm: "Confirmez-vous l'acceptation ce dossier ?" }

- menu.with_item do
= link_to('#', onclick: "DS.showMotivation(event, 'without-continuation');", role: 'menuitem') do
%span.icon.without-continuation
.dropdown-description
%h4 Classer sans suite
L’usager sera informé que son dossier a été classé sans suite

- menu.with_item(class: "hidden inactive form-inside fr-pt-1v") do
= render partial: 'instructeurs/dossiers/instruction_button_motivation', locals: { dossier: dossier, placeholder: 'Expliquez au demandeur pourquoi ce dossier est classé sans suite (obligatoire)', popup_class: 'without-continuation', process_action: 'classer_sans_suite', title: 'Classer sans suite', confirm: 'Confirmez-vous le classement sans suite de ce dossier ?' }

- menu.with_item do
= link_to('#', onclick: "DS.showMotivation(event, 'refuse');", role: 'menuitem') do
%span.icon.refuse
.dropdown-description
%h4 Refuser
L’usager sera informé que son dossier a été refusé

- menu.with_item(class: "hidden inactive form-inside fr-pt-1v") do
= render partial: 'instructeurs/dossiers/instruction_button_motivation', locals: { dossier: dossier, placeholder: 'Expliquez au demandeur pourquoi ce dossier est refusé (obligatoire)', popup_class: 'refuse', process_action: 'refuser', title: 'Refuser', confirm: 'Confirmez-vous le refus de ce dossier ?' }

Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,13 @@ en:
allowed_procedures_html:
zero: This token has no access to <strong>any</strong> process.
one: This token has access to a selected process
other: This token has access to %{count} selected steps
other: This token has access to %{count} selected procedures
security_one: For security reasons, it will not be re-posted, please note.
security_two: For security reasons, we can only show it to you when it is created.
prompt_choose_procedure: "-- Please, choose a procedure --"
security_title: "Security options"
action_all: Allow access to all procedures
action_choice: Allow access only to selected steps
action_choice: "If you want to grant access to selected procedures only :"
add: Add
delete: Delete
token_procedures: This token has access to the procedures
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,10 @@ fr:
other: Ce jeton a accès a %{count} démarches sélectionnées
security_one: Pour des raisons de sécurité, il ne sera plus ré-affiché, notez-le bien.
security_two: Pour des raisons de sécurité, nous ne pouvons vous l’afficher que lors de sa création.
security_title: "Options de sécurité"
action_all: Autoriser l’accès a toutes les démarches
action_choice: Autoriser l’accès seulement a des démarches choisies
prompt_choose_procedure: "-- Veuillez sélectionner une procédure à ajouter --"
action_choice: Si vous souhaitez autoriser l’accès seulement a des démarches choisies, ajouter les au jeton
add: Ajouter
delete: Supprimer
token_procedures: Ce jeton a accès aux démarches
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,31 +20,33 @@
%p
= t('.security_two')

- if @api_token.full_access?
%p.fr-text--lg
= t('.allowed_full_access_html')
- else
%p.fr-text--lg
= t('.allowed_procedures_html', count: @api_token.allowed_procedures.size)

- if @api_token.allowed_procedures.empty?
= button_to t('.action_all'), @api_token, method: :patch, params: { api_token: { disallow_procedure_id: '0' } }, class: "fr-btn fr-btn--secondary"
- else
%ul
- @api_token.allowed_procedures.each do |procedure|
%li.flex.justify-between.align-center
.truncate-80
= "#{procedure.id}#{procedure.libelle}"
= button_to t('.delete'), @api_token, method: :patch, params: { api_token: { disallow_procedure_id: procedure.id } }, class: "fr-btn fr-btn--secondary"
= render Dsfr::AlertComponent.new(state: :info, title: t(".security_title"), heading_level: :h4) do |c|
- c.body do
- if @api_token.full_access?
%p.fr-text--lg
= t('.allowed_full_access_html')
- else
%p.fr-text--lg
= t('.allowed_procedures_html', count: @api_token.allowed_procedures.size)

- if @api_token.allowed_procedures.empty?
= button_to t('.action_all'), @api_token, method: :patch, params: { api_token: { disallow_procedure_id: '0' } }, class: "fr-btn fr-btn--secondary"
- else
%ul
- @api_token.allowed_procedures.each do |procedure|
%li.flex.justify-between.align-center
.truncate-80
= "#{procedure.id}#{procedure.libelle}"
= button_to t('.delete'), @api_token, method: :patch, params: { api_token: { disallow_procedure_id: procedure.id } }, class: "fr-btn fr-btn--secondary"

.fr-card__end
= form_for @api_token, namespace: dom_id(@api_token, :allowed_procedures), html: { class: 'form form-ds-fr-white mb-3', data: { turbo: true } } do |f|
= f.label :allowed_procedure_ids do
= t('.action_choice')
- @api_token.allowed_procedures.each do |procedure|
= f.hidden_field :allowed_procedure_ids, value: procedure.id, multiple: true, id: dom_id(procedure, :allowed_procedure)
.flex.justify-between.align-center{ 'data-turbo-force': true }
= f.select :allowed_procedure_ids, procedures_to_allow_options, procedures_to_allow_select_options, { class: 'no-margin width-66 small', name: "api_token[allowed_procedure_ids][]" }
.flex.justify-between.align-center{ 'data-turbo-force': :server }
= f.select :allowed_procedure_ids, procedures_to_allow_options, {prompt: t('.prompt_choose_procedure')}, { class: 'no-margin width-66 small', name: "api_token[allowed_procedure_ids][]" }
= f.button type: :submit, class: "fr-btn fr-btn--secondary" do
= t('.add')

Expand Down
Loading

0 comments on commit 0b5fb96

Please sign in to comment.