Skip to content

Commit 0ce480d

Browse files
authored
Merge pull request #277 from jacquesbh/help-messages
Add help messages
2 parents 70a9955 + e59dcab commit 0ce480d

24 files changed

+725
-253
lines changed

dist/src/Form/Type/UiElement/GoogleMapsType.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ public function buildForm(FormBuilderInterface $builder, array $options): void
3434
$builder
3535
->add('link', TextType::class, [
3636
'label' => 'app.ui_element.google_maps.field.link',
37+
'help' => 'app.ui_element.google_maps.field.link_help',
3738
'required' => true,
3839
'constraints' => [
3940
new Assert\NotBlank(),

dist/translations/messages.en.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ app:
55
description: 'An element with a Google Maps link'
66
field:
77
link: 'Embed Link (The `src` of the iframe)'
8+
link_help: 'Google Maps embed iframe src URL. Locale automatically adjusted (hl parameter replaced).'
89
text_collection:
910
title: 'Text collection'
1011
description: 'Collection of text types'

src/Form/Type/AlignmentType.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ public function configureOptions(OptionsResolver $resolver): void
2525
$resolver->setDefaults([
2626
'show_justify' => false,
2727
'label' => 'monsieurbiz_richeditor_plugin.form.align.label',
28+
'help' => 'monsieurbiz_richeditor_plugin.form.align.help',
2829
'choices' => [
2930
'monsieurbiz_richeditor_plugin.form.align.default' => '',
3031
'monsieurbiz_richeditor_plugin.form.align.left' => 'left',

src/Form/Type/LevelType.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ public function configureOptions(OptionsResolver $resolver): void
2929
parent::configureOptions($resolver);
3030
$resolver->setDefaults([
3131
'label' => 'monsieurbiz_richeditor_plugin.form.level.label',
32+
'help' => 'monsieurbiz_richeditor_plugin.form.level.help',
3233
'choices' => [
3334
'monsieurbiz_richeditor_plugin.form.level.default' => '',
3435
'monsieurbiz_richeditor_plugin.form.level.primary' => self::PRIMARY_LEVEL,

src/Form/Type/LinkTypeType.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ public function configureOptions(OptionsResolver $resolver): void
2727
parent::configureOptions($resolver);
2828
$resolver->setDefaults([
2929
'label' => 'monsieurbiz_richeditor_plugin.common.link_type',
30+
'help' => 'monsieurbiz_richeditor_plugin.common.link_type_help',
3031
'choices' => [
3132
'monsieurbiz_richeditor_plugin.common.internal_link' => self::TYPE_INTERNAL,
3233
'monsieurbiz_richeditor_plugin.common.external_link' => self::TYPE_EXTERNAL,

src/Form/Type/TextSizeType.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ public function configureOptions(OptionsResolver $resolver): void
3535
parent::configureOptions($resolver);
3636
$resolver->setDefaults([
3737
'label' => 'monsieurbiz_richeditor_plugin.form.text_size.label',
38+
'help' => 'monsieurbiz_richeditor_plugin.form.text_size.help',
3839
'choices' => [
3940
'monsieurbiz_richeditor_plugin.form.text_size.default' => '',
4041
'monsieurbiz_richeditor_plugin.form.text_size.xs' => self::SIZE_XS,

src/Form/Type/UiElement/AnchorType.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ public function buildForm(FormBuilderInterface $builder, array $options): void
2828
$builder
2929
->add('name', TextType::class, [
3030
'label' => 'monsieurbiz_richeditor_plugin.ui_element.monsieurbiz.anchor.field.name',
31+
'help' => 'monsieurbiz_richeditor_plugin.ui_element.monsieurbiz.anchor.field.name_help',
3132
'required' => true,
3233
'constraints' => [
3334
new Assert\NotBlank(),

src/Form/Type/UiElement/ButtonLinkType.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,10 +72,12 @@ public function buildForm(FormBuilderInterface $builder, array $options): void
7272
->add('link', LinkType::class, [
7373
'required' => $required,
7474
'label' => 'monsieurbiz_richeditor_plugin.ui_element.monsieurbiz.button.field.link',
75+
'help' => 'monsieurbiz_richeditor_plugin.ui_element.monsieurbiz.button.field.link_help',
7576
'constraints' => $constraintsLink,
7677
])
7778
->add('link_type', LinkTypeType::class, [
7879
'required' => $required,
80+
'help' => 'monsieurbiz_richeditor_plugin.ui_element.monsieurbiz.button.field.link_type_help',
7981
'constraints' => $constraintsLinkType,
8082
])
8183
->add('align', AlignmentType::class)

src/Form/Type/UiElement/ImageType.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,14 +55,17 @@ public function addFields(FormBuilderInterface $builder, array $options): void
5555
->add('alt', FormTextType::class, [
5656
'required' => false,
5757
'label' => 'monsieurbiz_richeditor_plugin.ui_element.monsieurbiz.image.field.alt',
58+
'help' => 'monsieurbiz_richeditor_plugin.ui_element.monsieurbiz.image.field.alt_help',
5859
])
5960
->add('title', FormTextType::class, [
6061
'required' => false,
6162
'label' => 'monsieurbiz_richeditor_plugin.ui_element.monsieurbiz.image.field.title',
63+
'help' => 'monsieurbiz_richeditor_plugin.ui_element.monsieurbiz.image.field.title_help',
6264
])
6365
->add('link', LinkType::class, [
6466
'required' => false,
6567
'label' => 'monsieurbiz_richeditor_plugin.ui_element.monsieurbiz.image.field.link',
68+
'help' => 'monsieurbiz_richeditor_plugin.ui_element.monsieurbiz.image.field.link_help',
6669
'constraints' => [
6770
new Assert\AtLeastOneOf([
6871
'includeInternalMessages' => false,
@@ -76,6 +79,7 @@ public function addFields(FormBuilderInterface $builder, array $options): void
7679
])
7780
->add('link_type', LinkTypeType::class, [
7881
'required' => false,
82+
'help' => 'monsieurbiz_richeditor_plugin.ui_element.monsieurbiz.image.field.link_type_help',
7983
])
8084
->add('align', AlignmentType::class)
8185
;

src/Form/Type/UiElement/SeparatorType.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,10 +44,12 @@ public function buildForm(FormBuilderInterface $builder, array $options): void
4444
$builder
4545
->add('hidden', CheckboxType::class, [
4646
'label' => 'monsieurbiz_richeditor_plugin.ui_element.monsieurbiz.separator.field.hidden',
47+
'help' => 'monsieurbiz_richeditor_plugin.ui_element.monsieurbiz.separator.field.hidden_help',
4748
'required' => false,
4849
])
4950
->add('style', ChoiceType::class, [
5051
'label' => 'monsieurbiz_richeditor_plugin.ui_element.monsieurbiz.separator.field.style.label',
52+
'help' => 'monsieurbiz_richeditor_plugin.ui_element.monsieurbiz.separator.field.style.help',
5153
'choices' => [
5254
'monsieurbiz_richeditor_plugin.ui_element.monsieurbiz.separator.field.style.choices.solid' => self::SOLID_STYLE,
5355
'monsieurbiz_richeditor_plugin.ui_element.monsieurbiz.separator.field.style.choices.dashed' => self::DASHED_STYLE,
@@ -56,6 +58,7 @@ public function buildForm(FormBuilderInterface $builder, array $options): void
5658
])
5759
->add('thickness', ChoiceType::class, [
5860
'label' => 'monsieurbiz_richeditor_plugin.ui_element.monsieurbiz.separator.field.thickness.label',
61+
'help' => 'monsieurbiz_richeditor_plugin.ui_element.monsieurbiz.separator.field.thickness.help',
5962
'choices' => [
6063
'monsieurbiz_richeditor_plugin.ui_element.monsieurbiz.separator.field.thickness.choices.fine' => self::THICKNESS_FINE,
6164
'monsieurbiz_richeditor_plugin.ui_element.monsieurbiz.separator.field.thickness.choices.medium' => self::THICKNESS_MEDIUM,

0 commit comments

Comments
 (0)