Skip to content

Commit

Permalink
UHF-10555: Merge branch 'dev' of github.com:City-of-Helsinki/drupal-h…
Browse files Browse the repository at this point in the history
…elfi-etusivu into UHF-10555
  • Loading branch information
teroelonen committed Dec 4, 2024
2 parents af5ed59 + 3cee5f7 commit 7e849f1
Show file tree
Hide file tree
Showing 17 changed files with 157 additions and 76 deletions.
2 changes: 1 addition & 1 deletion .platform/schema
Original file line number Diff line number Diff line change
@@ -1 +1 @@
10
12
1 change: 1 addition & 0 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@
},
"require-dev": {
"dealerdirect/phpcodesniffer-composer-installer": "^0.7.0",
"dg/bypass-finals": "^1.5",
"dmore/chrome-mink-driver": "^2.8",
"drupal/coder": "^8.3",
"drupal/core-dev": "^10.0",
Expand Down
123 changes: 86 additions & 37 deletions composer.lock

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

2 changes: 1 addition & 1 deletion conf/cmi/language/fi/social_media.settings.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
social_media:
facebook_share:
text: 'Jaa Facebook-palvelussa'
api_url: 'http://www.facebook.com/share.php?u=[current-page:url]&title=[current-page:title]'
api_url: 'https://www.facebook.com/share.php?u=[current-page:url]&title=[current-page:title]'
attributes: "target|_blank\r\nclass|facebook-share"
linkedin:
text: 'Jaa LinkedIn-palvelussa'
Expand Down
2 changes: 1 addition & 1 deletion conf/cmi/language/sv/social_media.settings.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
social_media:
facebook_share:
text: 'Dela på Facebook'
api_url: 'http://www.facebook.com/share.php?u=[current-page:url]&title=[current-page:title]'
api_url: 'https://www.facebook.com/share.php?u=[current-page:url]&title=[current-page:title]'
attributes: "target|_blank\r\nclass|facebook-share"
linkedin:
text: 'Dela på Linkedin'
Expand Down
4 changes: 2 additions & 2 deletions conf/cmi/search_api.index.news.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ dependencies:
- field.storage.node.field_news_item_tags
- field.storage.node.field_news_neighbourhoods
- field.storage.node.field_short_title
- search_api.server.news
- search_api.server.default
module:
- helfi_etusivu
- helfi_react_search
Expand Down Expand Up @@ -280,4 +280,4 @@ options:
cron_limit: 50
index_directly: true
track_changes_in_references: true
server: news
server: default
4 changes: 2 additions & 2 deletions conf/cmi/search_api.index.news_terms.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ langcode: en
status: true
dependencies:
config:
- search_api.server.news
- search_api.server.default
module:
- helfi_etusivu
- helfi_react_search
Expand Down Expand Up @@ -113,4 +113,4 @@ options:
cron_limit: 50
index_directly: true
track_changes_in_references: true
server: news
server: default
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ status: true
dependencies:
module:
- elasticsearch_connector
id: news
id: default
name: news
description: ''
backend: elasticsearch
Expand Down
4 changes: 2 additions & 2 deletions public/modules/custom/helfi_etusivu/helfi_etusivu.module
Original file line number Diff line number Diff line change
Expand Up @@ -244,9 +244,9 @@ function helfi_etusivu_helfi_hero_design_alter(array &$designs, FieldStorageDefi
function helfi_etusivu_preprocess_html(&$variables): void {
$route = \Drupal::routeMatch()->getRouteName();

// Set the theme color to engel on Helsinki near you landing page.
// Set the theme color to suomenlinna on Helsinki near you landing page.
if ($route === 'helfi_etusivu.helsinki_near_you') {
$variables['theme_color'] = 'engel';
$variables['theme_color'] = 'suomenlinna';
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,9 @@ public function content(Request $request) : array|RedirectResponse {
],
'#back_link_label' => $this->t('Edit address', [], ['context' => 'Helsinki near you']),
'#back_link_url' => $return_url,
'#cache' => [
'contexts' => ['url.query_args:q'],
],
'#coordinates' => $addressData ? $addressData['coordinates'] : NULL,
'#theme' => 'helsinki_near_you_results_page',
'#title' => $this->t(
Expand Down
12 changes: 11 additions & 1 deletion public/modules/custom/helfi_etusivu/src/Form/NearYouForm.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,22 @@ public function buildForm(array $form, FormStateInterface $form_state) {
'#required' => TRUE,
'#title' => $this->t('Address'),
'#type' => 'textfield',
'#wrapper_attributes' => [
'class' => ['helfi-etusivu-near-you-form__address-input'],
],
];

$form['actions']['#type'] = 'actions';
$form['actions']['submit'] = [
'#attributes' => [
'class' => [
'hds-button',
'hds-button--primary',
'helfi-search__submit-button',
],
],
'#type' => 'submit',
'#value' => $this->t('Search'),
'#value' => $this->t('Search', [], ['context' => 'Helsinki near you']),
];

return $form;
Expand Down
4 changes: 4 additions & 0 deletions public/modules/custom/helfi_etusivu/translations/fi.po
Original file line number Diff line number Diff line change
Expand Up @@ -84,3 +84,7 @@ msgstr "Esimerkiksi Vaasankatu 5"
msgctxt "Helsinki near you"
msgid "The address you input yielded no results. You may want to try a different address."
msgstr "Antamallasi osoitteella ei löytynyt tuloksia. Voit kokeilla muuttaa hakuehtojasi."

msgctxt "Helsinki near you"
msgid "Search"
msgstr "Hae"
4 changes: 4 additions & 0 deletions public/modules/custom/helfi_etusivu/translations/sv.po
Original file line number Diff line number Diff line change
Expand Up @@ -73,3 +73,7 @@ msgstr "Till exempel Vasagatan 5"
msgctxt "Helsinki near you"
msgid "The address you input yielded no results. You may want to try a different address."
msgstr "Adressen du angav gav inga resultat. Du kanske vill prova en annan adress."

msgctxt "Helsinki near you"
msgid "Search"
msgstr "Söka"
Loading

0 comments on commit 7e849f1

Please sign in to comment.