Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

UHF-9311: Unit search paragraph changes and improvements #686

Merged
merged 6 commits into from
Feb 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ dependencies:
- field.field.paragraph.unit_search.field_search_results_terms
- field.field.paragraph.unit_search.field_unit_search_description
- field.field.paragraph.unit_search.field_unit_search_meta_button
- field.field.paragraph.unit_search.field_unit_search_meta_desc
- field.field.paragraph.unit_search.field_unit_search_meta_label
- field.field.paragraph.unit_search.field_unit_search_meta_placehold
- field.field.paragraph.unit_search.field_unit_search_title
Expand All @@ -21,6 +22,7 @@ third_party_settings:
children:
- field_unit_search_meta_label
- field_unit_search_meta_placehold
- field_unit_search_meta_desc
- field_unit_search_meta_button
- field_search_results_term
- field_search_results_terms
Expand All @@ -42,15 +44,15 @@ mode: default
content:
field_search_results_term:
type: string_textfield
weight: 7
weight: 8
region: content
settings:
size: 60
placeholder: ''
third_party_settings: { }
field_search_results_terms:
type: string_textfield
weight: 8
weight: 9
region: content
settings:
size: 60
Expand All @@ -66,12 +68,20 @@ content:
third_party_settings: { }
field_unit_search_meta_button:
type: string_textfield
weight: 6
weight: 7
region: content
settings:
size: 60
placeholder: ''
third_party_settings: { }
field_unit_search_meta_desc:
type: string_textarea
weight: 6
region: content
settings:
rows: 5
placeholder: ''
third_party_settings: { }
field_unit_search_meta_label:
type: string_textfield
weight: 4
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ dependencies:
- field.field.paragraph.unit_search.field_search_results_terms
- field.field.paragraph.unit_search.field_unit_search_description
- field.field.paragraph.unit_search.field_unit_search_meta_button
- field.field.paragraph.unit_search.field_unit_search_meta_desc
- field.field.paragraph.unit_search.field_unit_search_meta_label
- field.field.paragraph.unit_search.field_unit_search_meta_placehold
- field.field.paragraph.unit_search.field_unit_search_title
Expand Down Expand Up @@ -49,6 +50,13 @@ content:
third_party_settings: { }
weight: 5
region: content
field_unit_search_meta_desc:
type: basic_string
label: above
settings: { }
third_party_settings: { }
weight: 8
region: content
field_unit_search_meta_label:
type: string
label: hidden
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ id: paragraph.unit_search.field_search_results_term
field_name: field_search_results_term
entity_type: paragraph
bundle: unit_search
label: 'Search results singular term'
description: 'Term used on the search results title when there is exactly one result from the search.'
label: 'Search results title for one result without the number'
description: 'For example: beach'
required: false
translatable: false
default_value: { }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ id: paragraph.unit_search.field_search_results_terms
field_name: field_search_results_terms
entity_type: paragraph
bundle: unit_search
label: 'Search results plural term'
description: 'Term used on the search results title when there is zero or more than one result from the search.'
label: 'Search results title for multiple results without the number'
description: 'For example: beaches'
required: false
translatable: false
default_value: { }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ id: paragraph.unit_search.field_unit_search_description
field_name: field_unit_search_description
entity_type: paragraph
bundle: unit_search
label: Description
description: ''
label: 'Search description'
description: 'For example: You can search for the closest playground by address.'
required: false
translatable: false
default_value: { }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,11 @@ id: paragraph.unit_search.field_unit_search_meta_button
field_name: field_unit_search_meta_button
entity_type: paragraph
bundle: unit_search
label: 'Search button'
description: ''
label: 'Search button text'
description: "The button's text is set to 'Search' by default. It is not recommended to change the text."
required: false
translatable: false
default_value:
-
value: 'Search for units'
default_value: { }
default_value_callback: ''
settings: { }
field_type: string
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
langcode: en
status: true
dependencies:
config:
- field.storage.paragraph.field_unit_search_meta_desc
- paragraphs.paragraphs_type.unit_search
id: paragraph.unit_search.field_unit_search_meta_desc
field_name: field_unit_search_meta_desc
entity_type: paragraph
bundle: unit_search
label: 'Additional description under the search input'
description: 'For example: Street name and house number'
required: false
translatable: false
default_value: { }
default_value_callback: ''
settings: { }
field_type: string_long
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,10 @@ field_name: field_unit_search_meta_label
entity_type: paragraph
bundle: unit_search
label: 'Search label'
description: ''
description: 'For example: Address'
required: false
translatable: false
default_value:
-
value: 'Search for a unit'
default_value: { }
default_value_callback: ''
settings: { }
field_type: string
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,11 @@ id: paragraph.unit_search.field_unit_search_meta_placehold
field_name: field_unit_search_meta_placehold
entity_type: paragraph
bundle: unit_search
label: 'Search placeholder'
description: ''
label: 'Placeholder text for the search input'
description: 'For example: Kotikatu 1'
required: false
translatable: false
default_value:
-
value: 'Enter name, address or postal code'
default_value: { }
default_value_callback: ''
settings: { }
field_type: string
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ id: paragraph.unit_search.field_unit_search_title
field_name: field_unit_search_title
entity_type: paragraph
bundle: unit_search
label: Title
description: ''
label: 'Search title (H2)'
description: 'For example: Search for beaches'
required: true
translatable: false
default_value: { }
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
langcode: en
status: true
dependencies:
module:
- paragraphs
id: paragraph.field_unit_search_meta_desc
field_name: field_unit_search_meta_desc
entity_type: paragraph
type: string_long
settings:
case_sensitive: 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 @@ -303,7 +303,7 @@ display:
exposed_form:
type: basic
options:
submit_button: Use
submit_button: Search
reset_button: false
reset_button_label: Reset
exposed_sorts_label: Sort
Expand Down
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
label: 'Hakutulosten yksikkötermi'
description: 'Termi jota käytetään hakutulosten otsikossa kun tuloksia on tasan yksi.'
label: 'Hakutulosten otsikko (H3) yhdelle hakutulokselle ilman numeroa'
description: 'Esim. uimaranta'
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
label: 'Hakutulosten monikkotermi'
description: 'Termi jota käytetään hakutulosten otsikossa kun tuloksia on nolla tai enemmän kuin yksi.'
label: 'Hakutulosten otsikko (H3) monelle hakutulokselle ilman numeroa'
description: 'Esim. uimarantaa'
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
label: Kuvaus
label: 'Haun kuvausteksti'
description: 'Esim. Voit etsiä lähintä leikkipuistoa osoitteen mukaan.'
Original file line number Diff line number Diff line change
@@ -1,4 +1,2 @@
label: 'Hakukentän painike'
default_value:
-
value: 'Hae toimipisteitä'
label: 'Suodata painikkeen teksti'
description: 'Painikkeen tekstiksi tulee oletuksena "Etsi". Suositus on, että tekstiä ei muuteta.'
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
label: 'Lisäohjeistus hakukentän alle'
description: 'Esim. Kadunnimi ja talonumero'
Original file line number Diff line number Diff line change
@@ -1,4 +1,2 @@
label: 'Hakukentän otsikko'
default_value:
-
value: 'Hae toimipisteitä'
label: 'Hakukentän otsikko (label)'
description: 'Esim. Osoite'
Original file line number Diff line number Diff line change
@@ -1,4 +1,2 @@
label: 'Hakukentän oletusteksti'
default_value:
-
value: 'Syötä nimi, osoite tai postinumero'
label: 'Esimerkkiteksti hakukenttään (placeholder)'
description: 'Esim. Kotikatu 1'
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
label: Otsikko
label: 'Haun otsikko (H2)'
description: 'Esim. Etsi uimarantoja'
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ display:
items_per_page_options_all_label: '- Kaikki -'
exposed_form:
options:
submit_button: Käytä
submit_button: Etsi
reset_button_label: Palauta
exposed_sorts_label: Järjestä
sort_asc_label: Nouseva
Expand Down
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
label: Beskrivning
label: Sök beskrivning
description: 'T.ex. Du kan söka efter närmaste lekplats efter adress.'
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
label: Titel
label: Sök titel
description: 'T.ex. Sök badstränder'
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ display:
offset_label: Kompensera
exposed_form:
options:
submit_button: Verkställ
submit_button: Sök
reset_button_label: Återställ
exposed_sorts_label: 'Sortera efter'
sort_asc_label: Stigande
Expand Down
9 changes: 9 additions & 0 deletions modules/helfi_tpr_config/helfi_tpr_config.install
Original file line number Diff line number Diff line change
Expand Up @@ -388,3 +388,12 @@ function helfi_tpr_config_update_9054(): void {
\Drupal::service('helfi_platform_config.config_update_helper')
->update('helfi_tpr_config');
}

/**
* UHF-9311: Add new field for Unit Search paragraph and update labels.
*/
function helfi_tpr_config_update_9055(): void {
// Re-import 'helfi_tpr_config' configuration.
\Drupal::service('helfi_platform_config.config_update_helper')
->update('helfi_tpr_config');
}
8 changes: 7 additions & 1 deletion modules/helfi_tpr_config/helfi_tpr_config.module
Original file line number Diff line number Diff line change
Expand Up @@ -465,7 +465,7 @@ function helfi_tpr_config_form_views_exposed_form_alter(&$form, $form_state) : v
return;
}

if ($paragraph->hasField('field_unit_search_meta_button')) {
if ($paragraph->hasField('field_unit_search_meta_button') && isset($paragraph->get('field_unit_search_meta_button')->value)) {
$form['actions']['submit']['#value'] = $paragraph
->get('field_unit_search_meta_button')
->value;
Expand All @@ -482,6 +482,12 @@ function helfi_tpr_config_form_views_exposed_form_alter(&$form, $form_state) : v
->get('field_unit_search_meta_placehold')
->value;
}

if ($paragraph->hasField('field_unit_search_meta_desc')) {
$form['#info']['filter-combine']['description'] = $paragraph
->get('field_unit_search_meta_desc')
->value;
}
}

/**
Expand Down
Loading