Skip to content

Commit

Permalink
HPC-9269: Add mandatory short title field to article content type, ad…
Browse files Browse the repository at this point in the history
…d maxlength module and use it for article, document and chapter short title fields
  • Loading branch information
berliner committed Oct 26, 2023
1 parent 65017c9 commit e2abf1b
Show file tree
Hide file tree
Showing 19 changed files with 152 additions and 9 deletions.
1 change: 1 addition & 0 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@
"drupal/inline_entity_form": "^1.0@RC",
"drupal/layout_paragraphs": "^2",
"drupal/maintenance200": "^1.1",
"drupal/maxlength": "^2.1",
"drupal/metatag": "^1.16",
"drupal/override_node_options": "^2.6",
"drupal/paragraphs": "^1.15",
Expand Down
77 changes: 76 additions & 1 deletion composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

20 changes: 17 additions & 3 deletions config/core.entity_form_display.node.article.default.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ dependencies:
- field.field.node.article.field_pdf
- field.field.node.article.field_report_link
- field.field.node.article.field_section
- field.field.node.article.field_short_title
- field.field.node.article.field_summary
- field.field.node.article.field_tags
- field.field.node.article.field_thumbnail_image
Expand Down Expand Up @@ -86,6 +87,7 @@ third_party_settings:
group_content:
children:
- title
- field_short_title
- field_summary
- field_paragraphs
label: Content
Expand Down Expand Up @@ -178,7 +180,7 @@ content:
third_party_settings: { }
field_paragraphs:
type: layout_paragraphs
weight: 5
weight: 7
region: content
settings:
preview_view_mode: preview
Expand All @@ -199,9 +201,21 @@ content:
region: content
settings: { }
third_party_settings: { }
field_short_title:
type: string_textfield
weight: 5
region: content
settings:
size: 60
placeholder: ''
third_party_settings:
maxlength:
maxlength_js: 45
maxlength_js_label: 'Content limited to @limit characters, remaining: <strong>@remaining</strong>'
maxlength_js_enforce: true
field_summary:
type: text_textarea
weight: 4
weight: 6
region: content
settings:
rows: 5
Expand Down Expand Up @@ -235,7 +249,7 @@ content:
third_party_settings: { }
title:
type: string_textfield
weight: 3
weight: 4
region: content
settings:
size: 60
Expand Down
6 changes: 5 additions & 1 deletion config/core.entity_form_display.node.document.default.yml
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,11 @@ content:
settings:
size: 60
placeholder: ''
third_party_settings: { }
third_party_settings:
maxlength:
maxlength_js: 32
maxlength_js_label: 'Content limited to @limit characters, remaining: <strong>@remaining</strong>'
maxlength_js_enforce: true
field_summary:
type: text_textarea
weight: 28
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,11 @@ content:
settings:
size: 60
placeholder: ''
third_party_settings: { }
third_party_settings:
maxlength:
maxlength_js: 20
maxlength_js_label: 'Content limited to @limit characters, remaining: <strong>@remaining</strong>'
maxlength_js_enforce: true
field_summary:
type: string_textarea
weight: 5
Expand Down
9 changes: 9 additions & 0 deletions config/core.entity_view_display.node.article.default.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ dependencies:
- field.field.node.article.field_pdf
- field.field.node.article.field_report_link
- field.field.node.article.field_section
- field.field.node.article.field_short_title
- field.field.node.article.field_summary
- field.field.node.article.field_tags
- field.field.node.article.field_thumbnail_image
Expand Down Expand Up @@ -83,6 +84,14 @@ content:
third_party_settings: { }
weight: 3
region: content
field_short_title:
type: string
label: above
settings:
link_to_entity: false
third_party_settings: { }
weight: 4
region: content
links:
settings: { }
third_party_settings: { }
Expand Down
2 changes: 2 additions & 0 deletions config/core.entity_view_display.node.article.full.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ dependencies:
- field.field.node.article.field_pdf
- field.field.node.article.field_report_link
- field.field.node.article.field_section
- field.field.node.article.field_short_title
- field.field.node.article.field_summary
- field.field.node.article.field_tags
- field.field.node.article.field_thumbnail_image
Expand Down Expand Up @@ -113,6 +114,7 @@ hidden:
field_content_space: true
field_pdf: true
field_report_link: true
field_short_title: true
field_summary: true
field_tags: true
field_thumbnail_image: true
Expand Down
2 changes: 2 additions & 0 deletions config/core.entity_view_display.node.article.home_page.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ dependencies:
- field.field.node.article.field_pdf
- field.field.node.article.field_report_link
- field.field.node.article.field_section
- field.field.node.article.field_short_title
- field.field.node.article.field_summary
- field.field.node.article.field_tags
- field.field.node.article.field_thumbnail_image
Expand Down Expand Up @@ -110,6 +111,7 @@ hidden:
field_content_space: true
field_pdf: true
field_section: true
field_short_title: true
field_tags: true
field_thumbnail_image: true
langcode: true
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ dependencies:
- field.field.node.article.field_pdf
- field.field.node.article.field_report_link
- field.field.node.article.field_section
- field.field.node.article.field_short_title
- field.field.node.article.field_summary
- field.field.node.article.field_tags
- field.field.node.article.field_thumbnail_image
Expand Down Expand Up @@ -77,6 +78,7 @@ hidden:
field_paragraphs: true
field_pdf: true
field_report_link: true
field_short_title: true
field_summary: true
field_thumbnail_image: true
langcode: true
Expand Down
2 changes: 2 additions & 0 deletions config/core.entity_view_display.node.article.preview.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ dependencies:
- field.field.node.article.field_pdf
- field.field.node.article.field_report_link
- field.field.node.article.field_section
- field.field.node.article.field_short_title
- field.field.node.article.field_summary
- field.field.node.article.field_tags
- field.field.node.article.field_thumbnail_image
Expand Down Expand Up @@ -94,6 +95,7 @@ hidden:
field_pdf: true
field_report_link: true
field_section: true
field_short_title: true
field_summary: true
field_tags: true
field_thumbnail_image: true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ dependencies:
- field.field.node.article.field_pdf
- field.field.node.article.field_report_link
- field.field.node.article.field_section
- field.field.node.article.field_short_title
- field.field.node.article.field_summary
- field.field.node.article.field_tags
- field.field.node.article.field_thumbnail_image
Expand Down Expand Up @@ -78,6 +79,7 @@ hidden:
field_pdf: true
field_report_link: true
field_section: true
field_short_title: true
field_tags: true
langcode: true
links: true
2 changes: 2 additions & 0 deletions config/core.entity_view_display.node.article.sub_article.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ dependencies:
- field.field.node.article.field_pdf
- field.field.node.article.field_report_link
- field.field.node.article.field_section
- field.field.node.article.field_short_title
- field.field.node.article.field_summary
- field.field.node.article.field_tags
- field.field.node.article.field_thumbnail_image
Expand Down Expand Up @@ -86,6 +87,7 @@ hidden:
field_pdf: true
field_report_link: true
field_section: true
field_short_title: true
field_summary: true
field_tags: true
field_thumbnail_image: true
Expand Down
2 changes: 2 additions & 0 deletions config/core.entity_view_display.node.article.teaser.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ dependencies:
- field.field.node.article.field_pdf
- field.field.node.article.field_report_link
- field.field.node.article.field_section
- field.field.node.article.field_short_title
- field.field.node.article.field_summary
- field.field.node.article.field_tags
- field.field.node.article.field_thumbnail_image
Expand Down Expand Up @@ -73,6 +74,7 @@ hidden:
field_pdf: true
field_report_link: true
field_section: true
field_short_title: true
field_tags: true
langcode: true
links: true
2 changes: 2 additions & 0 deletions config/core.entity_view_display.node.article.teaser_card.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ dependencies:
- field.field.node.article.field_pdf
- field.field.node.article.field_report_link
- field.field.node.article.field_section
- field.field.node.article.field_short_title
- field.field.node.article.field_summary
- field.field.node.article.field_tags
- field.field.node.article.field_thumbnail_image
Expand Down Expand Up @@ -87,6 +88,7 @@ hidden:
field_paragraphs: true
field_pdf: true
field_report_link: true
field_short_title: true
field_tags: true
field_thumbnail_image: true
langcode: true
Expand Down
1 change: 1 addition & 0 deletions config/core.extension.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ module:
linked_responsive_image_media_formatter: 0
locale: 0
maintenance200: 0
maxlength: 0
media: 0
media_library: 0
menu_link_content: 0
Expand Down
19 changes: 19 additions & 0 deletions config/field.field.node.article.field_short_title.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
uuid: d7ed133f-fd02-4aa0-989a-ca42c8f8c705
langcode: en
status: true
dependencies:
config:
- field.storage.node.field_short_title
- node.type.article
id: node.article.field_short_title
field_name: field_short_title
entity_type: node
bundle: article
label: 'Short title'
description: ''
required: true
translatable: false
default_value: { }
default_value_callback: ''
settings: { }
field_type: string
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ field_name: field_embed_code
entity_type: paragraph
bundle: interactive_content
label: 'Embed code'
description: 'Embed code from datawrapper or PowerBi. <strong>Do not include a <em>script</em>, only the <em>iframe</em>.</strong>'
description: 'Embed code from datawrapper (responsive image). <strong>Do not include the <em>script</em>, only the <em>iframe</em>.</strong>'
required: false
translatable: true
default_value: { }
Expand Down
2 changes: 1 addition & 1 deletion config/field.storage.node.field_short_title.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ field_name: field_short_title
entity_type: node
type: string
settings:
max_length: 32
max_length: 255
case_sensitive: false
is_ascii: false
module: core
Expand Down
2 changes: 1 addition & 1 deletion config/field.storage.paragraph.field_short_title.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ field_name: field_short_title
entity_type: paragraph
type: string
settings:
max_length: 16
max_length: 20
case_sensitive: false
is_ascii: false
module: core
Expand Down

0 comments on commit e2abf1b

Please sign in to comment.