fix(attestation): various tiptap & axe fixes

This commit is contained in:
Colin Darie 2024-01-10 18:20:12 +01:00
parent 39d00c81de
commit d92200f80b
No known key found for this signature in database
GPG key ID: 8C76CADD40253590
2 changed files with 22 additions and 18 deletions

View file

@ -77,31 +77,35 @@ function getEditorOptions(
case 'orderedList':
extensions.push(OrderedList);
break;
case 'left':
case 'center':
case 'right':
case 'justify':
extensions.push(
TextAlign.configure({
types: actions.includes('title')
? ['headerColumn', 'title', 'heading', 'paragraph']
: ['heading', 'paragraph']
})
);
break;
case 'title':
extensions.push(Header, HeaderColumn, Title);
break;
case 'heading2':
case 'heading3':
extensions.push(Heading.configure({ levels: [2, 3] }));
break;
}
}
if (actions.includes('bulletList') || actions.includes('orderedList')) {
extensions.push(ListItem);
}
if (actions.includes('heading2') || actions.includes('heading3')) {
extensions.push(Heading.configure({ levels: [2, 3] }));
}
if (
actions.includes('left') ||
actions.includes('center') ||
actions.includes('right') ||
actions.includes('justify')
) {
extensions.push(
TextAlign.configure({
types: actions.includes('title')
? ['headerColumn', 'title', 'heading', 'paragraph']
: ['heading', 'paragraph']
})
);
}
if (tags.length > 0) {
extensions.push(
Mention.configure({

View file

@ -27,7 +27,7 @@
Je souhaite générer une attestation à la charte de létat (logo avec Marianne)
.fr-fieldset__element.fr-mt-2w
%h6 En-tête
%h2.fr-h6 En-tête
.fr-fieldset__element{ class: class_names("hidden" => !@attestation_template.official_layout?), data: { "attestation-target": 'logoMarianneLabelFieldset'} }
= render Dsfr::InputComponent.new(form: f, attribute: :label_logo, input_type: :text_area, required: false, opts: { rows: 3, data: { controller: :textarea, textarea_max_rows_value: 3 } }) do |c|
@ -74,7 +74,7 @@
= tag[:libelle]
.fr-fieldset__element.fr-mt-2w
%h6 Pied de page
%h2.fr-h6 Pied de page
.fr-fieldset__element
%label.fr-label{ for: field_id(@attestation_template, :signature) } Tampon ou signature