Merge pull request #8351 from mfo/US/8199/accessibilite-du-js

Us/8199/accessibilite du js
This commit is contained in:
mfo 2023-02-07 07:23:47 +01:00 committed by GitHub
commit f3f6cb100e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
9 changed files with 28 additions and 17 deletions

View file

@ -154,6 +154,13 @@ export class MenuButtonController extends ApplicationController {
switch (event.key) {
case ' ':
case 'Enter':
if (this.isOpen) {
this.close();
} else {
this.open();
}
stopPropagation = true;
break;
case 'ArrowDown':
case 'Down':
this.open();

View file

@ -2,5 +2,6 @@
- if @champ_id
= turbo_stream.show "attachment-multiple-empty-#{@champ_id}"
= turbo_stream.focus_all "#attachment-multiple-empty-#{@champ_id} input"
= turbo_stream.show_all ".attachment-input-#{@attachment.id}"

View file

@ -2,5 +2,6 @@
= turbo_stream.replace @champ.input_group_id do
= render EditableChamp::EditableChampComponent.new champ: @champ, form: form
- @champ.piece_justificative_file.attachments.each do |attachment|
= turbo_stream.focus_all "button[data-toggle-target=\".attachment-input-#{attachment.id}\"]"
- last_attached_file = @champ.piece_justificative_file.attachments.last
- if last_attached_file
= turbo_stream.focus_all "#persisted_row_attachment_#{last_attached_file.id} .attachment-filename a"

View file

@ -11,4 +11,4 @@
- else
= t('views.invites.dropdown.invite_to_edit')
- menu.with_form do
= render partial: "invites/form", locals: { dossier: dossier, invites: invites }
= render partial: "invites/form", locals: { dossier: dossier, invites: invites, morphing: morphing }

View file

@ -1,12 +1,14 @@
#invites-form
- if invites.present?
%h4= t('views.invites.form.invite_to_participate')
%ul
- invites.each do |invite|
%li
= invite.email
%small{ 'data-turbo': 'true' }
= link_to t('views.invites.form.withdraw_permission'), invite_path(invite), data: { turbo_method: :delete, turbo_confirm: t('views.invites.form.want_to_withdraw_permission') }
#invite-list{ morphing ? { tabindex: "-1" } : {} }
%h4= t('views.invites.form.invite_to_participate')
%ul
- invites.each do |invite|
%li
= invite.email
%small{ 'data-turbo': 'true' }
= link_to t('views.invites.form.withdraw_permission'), invite_path(invite), data: { turbo_method: :delete, turbo_confirm: t('views.invites.form.want_to_withdraw_permission') }
%p= t('views.invites.form.edit_dossier')
- if dossier.brouillon?
%p= t('views.invites.form.submit_dossier_yourself')

View file

@ -1,2 +1,2 @@
= turbo_stream.replace_all '.invite-user-action', partial: 'invites/dropdown', locals: { dossier: @dossier }
= turbo_stream.focus 'invite_email'
= turbo_stream.replace_all '.invite-user-action', partial: 'invites/dropdown', locals: { dossier: @dossier, morphing: true }
= turbo_stream.focus 'invite-list'

View file

@ -1,6 +1,6 @@
- if @dossier.present?
= turbo_stream.replace_all '.invite-user-action', partial: 'invites/dropdown', locals: { dossier: @dossier }
= turbo_stream.replace_all '.invite-user-action', partial: 'invites/dropdown', locals: { dossier: @dossier, morphing: true }
- if @dossier.invites.empty?
= turbo_stream.focus 'invite_email'
= turbo_stream.focus 'invite-list'
- else
= turbo_stream.focus_all '#invites-form ul a:first-child'
= turbo_stream.focus 'invite_email'

View file

@ -12,7 +12,7 @@
= render(partial: 'users/dossiers/procedure_removed_banner', locals: { dossier: dossier })
- elsif current_user.owns?(dossier)
.header-actions
= render partial: 'invites/dropdown', locals: { dossier: dossier }
= render partial: 'invites/dropdown', locals: { dossier: dossier, morphing: false }
- unless dossier.read_only?
= render partial: 'users/dossiers/identity_dropdown', locals: { dossier: dossier }

View file

@ -16,7 +16,7 @@
= render(partial: 'users/dossiers/procedure_removed_banner', locals: { dossier: dossier })
- elsif current_user.owns?(dossier)
.header-actions
= render partial: 'invites/dropdown', locals: { dossier: dossier }
= render partial: 'invites/dropdown', locals: { dossier: dossier, morphing: false }
- if dossier.can_be_updated_by_user? && !current_page?(modifier_dossier_path(dossier))
= link_to t('views.users.dossiers.show.header.edit_dossier'), modifier_dossier_path(dossier), class: 'fr-btn fr-btn-sm',
title: { label: t('views.users.dossiers.show.header.edit_dossier_title') }