Skip to content

Commit

Permalink
Merge branch 'fix/SRL-614-label-to-be-translated' into deployment/202…
Browse files Browse the repository at this point in the history
…20928
  • Loading branch information
melwong-jcc committed Sep 28, 2022
2 parents b35a8a9 + d1fa2d3 commit eb3b046
Show file tree
Hide file tree
Showing 7 changed files with 147 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ dependencies:
config:
- field.field.paragraph.card_form.field_body
- field.field.paragraph.card_form.field_dropdown_menu
- field.field.paragraph.card_form.field_dropdown_menu_default_opt2
- field.field.paragraph.card_form.field_dropdown_menu_default_opti
- field.field.paragraph.card_form.field_item
- field.field.paragraph.card_form.field_title_display
- paragraphs.paragraphs_type.card_form
Expand Down Expand Up @@ -53,6 +55,22 @@ content:
third_party_settings:
cc:
status: 0
field_dropdown_menu_default_opt2:
type: string_textfield
weight: 14
region: content
settings:
size: 60
placeholder: ''
third_party_settings: { }
field_dropdown_menu_default_opti:
type: string_textfield
weight: 13
region: content
settings:
size: 60
placeholder: ''
third_party_settings: { }
field_item:
type: entity_reference_paragraphs
weight: 4
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ dependencies:
config:
- field.field.paragraph.card_form.field_body
- field.field.paragraph.card_form.field_dropdown_menu
- field.field.paragraph.card_form.field_dropdown_menu_default_opt2
- field.field.paragraph.card_form.field_dropdown_menu_default_opti
- field.field.paragraph.card_form.field_item
- field.field.paragraph.card_form.field_title_display
- paragraphs.paragraphs_type.card_form
Expand All @@ -25,12 +27,28 @@ content:
region: content
field_dropdown_menu:
type: entity_reference_label
label: above
label: hidden
settings:
link: true
third_party_settings: { }
weight: 5
region: content
field_dropdown_menu_default_opt2:
type: string
label: hidden
settings:
link_to_entity: false
third_party_settings: { }
weight: 7
region: content
field_dropdown_menu_default_opti:
type: string
label: hidden
settings:
link_to_entity: false
third_party_settings: { }
weight: 6
region: content
field_item:
type: entity_reference_revisions_entity_view
label: hidden
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
uuid: 6b19f34b-fad5-4df8-a8b3-1dfd38d62b60
langcode: en
status: true
dependencies:
config:
- field.storage.paragraph.field_dropdown_menu_default_opt2
- paragraphs.paragraphs_type.card_form
module:
- datalayer
- tmgmt_content
third_party_settings:
datalayer:
expose: 0
label: field_dropdown_menu_default_opt2
tmgmt_content:
excluded: false
id: paragraph.card_form.field_dropdown_menu_default_opt2
field_name: field_dropdown_menu_default_opt2
entity_type: paragraph
bundle: card_form
label: 'Dropdown sub-menu default option'
description: ''
required: false
translatable: true
default_value:
-
value: Choose...
default_value_callback: ''
settings: { }
field_type: string
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
uuid: 2c4772c7-80f0-4429-a48a-acd164a353a9
langcode: en
status: true
dependencies:
config:
- field.storage.paragraph.field_dropdown_menu_default_opti
- paragraphs.paragraphs_type.card_form
module:
- datalayer
- tmgmt_content
third_party_settings:
datalayer:
expose: 0
label: field_dropdown_menu_default_opti
tmgmt_content:
excluded: false
id: paragraph.card_form.field_dropdown_menu_default_opti
field_name: field_dropdown_menu_default_opti
entity_type: paragraph
bundle: card_form
label: 'Dropdown menu default option'
description: ''
required: false
translatable: true
default_value:
-
value: Choose...
default_value_callback: ''
settings: { }
field_type: string
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
uuid: 86f35ac8-06ab-41bb-9612-fd6e594bbf4a
langcode: en
status: true
dependencies:
module:
- paragraphs
id: paragraph.field_dropdown_menu_default_opt2
field_name: field_dropdown_menu_default_opt2
entity_type: paragraph
type: string
settings:
max_length: 255
case_sensitive: false
is_ascii: false
module: core
locked: false
cardinality: 1
translatable: true
indexes: { }
persist_with_no_fields: false
custom_storage: false
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
uuid: 21e4335d-b53f-4783-b904-7b4b476ada30
langcode: en
status: true
dependencies:
module:
- paragraphs
id: paragraph.field_dropdown_menu_default_opti
field_name: field_dropdown_menu_default_opti
entity_type: paragraph
type: string
settings:
max_length: 255
case_sensitive: false
is_ascii: false
module: core
locked: false
cardinality: 1
translatable: true
indexes: { }
persist_with_no_fields: false
custom_storage: false
Original file line number Diff line number Diff line change
Expand Up @@ -49,14 +49,17 @@

{% if dropdown_menu %}
{% set menu_id = card.field_dropdown_menu.get(0).entity.id %}
{% set default_label = card.field_dropdown_menu_default_opti.0.value %}
{% set default_sub_label = card.field_dropdown_menu_default_opt2.0.value %}
{% if menu_links[menu_id]['second_level'] %}

{% set menu_type = 'cascading' %}
{% set menu_label = menu.field_label.value ?: '' %}
{% set menu_default_option = menu.field_default_option.value ?: '' %}
{% set menu_default_option = default_label ?: '' %}

{% set menu_child_label = default_label ?: '' %}
{% set menu_default_child_option = default_sub_label ?: '' %}

{% set menu_child_label = menu.field_label2.value ?: '' %}
{% set menu_default_child_option = menu.field_default_child_option.value ?: '' %}

{% for key, link in menu_links[menu_id] %}
{% if link.title %}
Expand All @@ -70,7 +73,7 @@
{% endfor %}
{% set links = links|merge([{
name: link.title,
default_option: 'Choose option',
default_option: menu_default_child_option,
items: cascading_links,
}]) %}
{% endif %}
Expand All @@ -84,7 +87,7 @@
{% endfor %}
{% set menu_type = 'single' %}
{% set menu_label = menu.field_label.value ?: '' %}
{% set menu_default_option = menu.field_default_option.value ?: '' %}
{% set menu_default_option = default_label ?: '' %}
{% endif %}
{% else %}
{% if type == 'menu_links' %}
Expand Down

0 comments on commit eb3b046

Please sign in to comment.