Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
44 commits
Select commit Hold shift + click to select a range
1a63ea6
UHF-12520: Hyte search finalization
jeremysteerio Nov 27, 2025
f2bc90d
UHF-12520: Fix phpcs
jeremysteerio Nov 27, 2025
bad82d0
UHF-12571: Created hero block for hyte search
annadruid Nov 28, 2025
c81212a
UHF-12571: Configs for block
annadruid Nov 28, 2025
f29b836
UHF-12571: Fix tests
annadruid Dec 1, 2025
71e358a
UHF-12571: Changes to block build and tests
annadruid Dec 1, 2025
6ecc180
UHF-12571: Fixed block
annadruid Dec 1, 2025
55082ca
UHF-12571: Fixed tests
annadruid Dec 1, 2025
d476863
UHF-12520: Add missing translation
jeremysteerio Dec 1, 2025
4b4f5ff
Merge pull request #908 from City-of-Helsinki/UHF-12520
jeremysteerio Dec 1, 2025
ca619fa
UHF-12571: Linter fixes
annadruid Dec 1, 2025
58cc12c
UHF-12571: Fixed conflicts
annadruid Dec 1, 2025
ea0ad47
UHF-12571: Fixed missing line
annadruid Dec 1, 2025
efd0406
UHF-12571: fixed block langcode
annadruid Dec 1, 2025
6b1092f
UHF-12571: Linter fixes and translation fixes
annadruid Dec 1, 2025
35a4f83
UHF-12571: Removed unnecessary buildHero function
annadruid Dec 1, 2025
ceae715
UHF-12571: Added first gray check to block
annadruid Dec 1, 2025
9dc3689
UHF-12571: hide page title correct way
annadruid Dec 1, 2025
d236187
UHF-12571: Removed route match and cache context
annadruid Dec 1, 2025
eef12ce
UHF-12571: Removed route match and cache context
annadruid Dec 2, 2025
a502a84
UHF-12571: Enable helfi_Strategia module
annadruid Dec 2, 2025
01ca1c8
UHF-12571: Fixed namespace
annadruid Dec 2, 2025
ab774a1
UHF-12571: Fixed folder structure
annadruid Dec 2, 2025
5c30e03
Merge pull request #909 from City-of-Helsinki/UHF-12571
annadruid Dec 2, 2025
d8aab71
Updating elastic proxy csp subscriber to make it compatible with late…
wktohesi Dec 4, 2025
cedf85b
Making csp event subscriber registration conditional to only register…
wktohesi Dec 4, 2025
929cca9
Removing an unnecessary use statement.
wktohesi Dec 4, 2025
75f1a29
Updating dependencies for tests.
wktohesi Dec 4, 2025
bbda10a
Merge pull request #911 from City-of-Helsinki/UHF-X_csp_subscriber
wktohesi Dec 5, 2025
7d4d434
UHF-12520: Fix issues from AC-testing
jeremysteerio Dec 5, 2025
542a3a1
UHF-12520: Additional sanity check
jeremysteerio Dec 5, 2025
889505c
UHF-12520: Remove console.log
jeremysteerio Dec 5, 2025
d0c386b
Merge pull request #912 from City-of-Helsinki/UHF-12520
jeremysteerio Dec 9, 2025
0e0730d
Update configuration
hel-platta-service Dec 9, 2025
8495f76
UHF-12520: Remove unused interface
jeremysteerio Dec 9, 2025
23b33ca
Merge pull request #907 from City-of-Helsinki/update-configuration
khalima Dec 9, 2025
e74c77e
UHF-12520: Change path aliases for service search
jeremysteerio Dec 9, 2025
658a5b4
UHF-12520: Fix typo
jeremysteerio Dec 9, 2025
4f3f1b7
UHF-12520: Fix phpcs
jeremysteerio Dec 9, 2025
e72a170
UHF-12520: Call update 9002 when installing helfi_strategia
jeremysteerio Dec 9, 2025
e07bdc1
UHF-12520: Fix phpcs
jeremysteerio Dec 9, 2025
f16188c
UHF-12520: Fix search block configs
jeremysteerio Dec 9, 2025
51609ec
UHF-12520: Remove quotes
jeremysteerio Dec 9, 2025
d3c290a
Merge pull request #913 from City-of-Helsinki/UHF-12520
jeremysteerio Dec 9, 2025
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
3 changes: 3 additions & 0 deletions .deprecation-ignore.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# This file contains patterns to be ignored while testing for use of
# deprecated code.
# See https://www.drupal.org/node/3285162 for more details.
2 changes: 1 addition & 1 deletion .platform/schema
Original file line number Diff line number Diff line change
@@ -1 +1 @@
24
25
550 changes: 300 additions & 250 deletions composer.lock

Large diffs are not rendered by default.

25 changes: 25 additions & 0 deletions conf/cmi/block.block.hdbt_subtheme_hyte_search_hero_block.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
uuid: 6e8544b7-3420-41bd-9f48-8ec5978eef78
langcode: en
status: true
dependencies:
module:
- helfi_strategia
- system
theme:
- hdbt_subtheme
id: hdbt_subtheme_hyte_search_hero_block
theme: hdbt_subtheme
region: before_content
weight: 0
provider: null
plugin: hyte_search_hero_block
settings:
id: hyte_search_hero_block
label: 'Hyte search hero block'
label_display: '0'
provider: helfi_strategia
visibility:
request_path:
id: request_path
negate: false
pages: "/information-om-helsingfors/valbefinnande-i-helsingfors/sok-tjanster\r\n/tietoa-helsingista/hyvinvoiva-helsinki/palveluhaku\r\n/information-on-helsinki/wellbeing-in-helsinki/find-services"
1 change: 1 addition & 0 deletions conf/cmi/core.extension.yml
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@ module:
helfi_react_search: 0
helfi_recommendations: 0
helfi_search: 0
helfi_strategia: 0
helfi_tfa: 0
helfi_toc: 0
helfi_tpr: 0
Expand Down
1 change: 0 additions & 1 deletion conf/cmi/csp.settings.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ enforce:
flags:
- report-sample
- unsafe-inline
- unsafe-eval
- wasm-unsafe-eval
style-src:
base: self
Expand Down
2 changes: 1 addition & 1 deletion conf/cmi/search_api.index.embeddings.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ field_settings:
type: string
title:
label: Title
datasource_id: 'uuid_entity:node'
datasource_id: 'entity:node'
property_path: title
type: string
dependencies:
Expand Down
57 changes: 0 additions & 57 deletions phpunit.platform.xml

This file was deleted.

84 changes: 48 additions & 36 deletions phpunit.xml.dist
Original file line number Diff line number Diff line change
@@ -1,27 +1,43 @@
<?xml version="1.0" encoding="UTF-8"?>
<phpunit bootstrap="./public/core/tests/bootstrap.php" colors="true"
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
bootstrap="./public/core/tests/bootstrap.php"
colors="true"
beStrictAboutTestsThatDoNotTestAnything="true"
beStrictAboutOutputDuringTests="true"
beStrictAboutChangesToGlobalState="true"
beStrictAboutCoversAnnotation="false"
failOnRisky="true"
failOnWarning="true"
failOnSkipped="true"
verbose="true"
printerClass="\Drupal\Tests\Listeners\HtmlOutputPrinter"
>
<php>
<!-- Set error reporting to E_ALL. -->
<ini name="error_reporting" value="32767"/>
displayDetailsOnTestsThatTriggerErrors="true"
displayDetailsOnTestsThatTriggerWarnings="true"
displayDetailsOnTestsThatTriggerDeprecations="true"
cacheResult="false"
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/10.5/phpunit.xsd"
cacheDirectory=".phpunit.cache">
<php>
<!-- Set error reporting to E_ALL. -->
<ini name="error_reporting" value="32767"/>
<!-- Do not limit the amount of memory tests take to run. -->
<ini name="memory_limit" value="-1"/>
<env name="MINK_DRIVER_ARGS_WEBDRIVER" value='["chrome", {"browserName":"chrome", "goog:chromeOptions":{"w3c": true, "args":["--no-sandbox", "--ignore-certificate-errors", "--allow-insecure-localhost", "--headless", "--dns-prefetch-disable"]}}, "http://chromium:4444"]' />
<env name="DTT_MINK_DRIVER_ARGS" value='["chrome", {"browserName":"chrome", "goog:chromeOptions":{"w3c": true, "args":["--no-sandbox","--ignore-certificate-errors", "--allow-insecure-localhost", "--headless", "--dns-prefetch-disable"]}}, "http://chromium:4444"]'/>
<env name="DTT_API_OPTIONS" value='{"socketTimeout": 360, "domWaitTimeout": 3600000}' />
<env name="DTT_API_URL" value="http://chromium:9222"/>
<env name="DTT_BASE_URL" value="https://app"/>
</php>
<testsuites>
<ini name="memory_limit" value="-1"/>
<env name="MINK_DRIVER_ARGS_WEBDRIVER" value='["chrome", {"browserName":"chrome", "goog:chromeOptions":{"w3c": true, "args":["--no-sandbox", "--ignore-certificate-errors", "--allow-insecure-localhost", "--headless", "--dns-prefetch-disable"]}}, "http://chromium:4444"]' />
<env name="DTT_MINK_DRIVER_ARGS" value='["chrome", {"browserName":"chrome", "goog:chromeOptions":{"w3c": true, "args":["--no-sandbox","--ignore-certificate-errors", "--allow-insecure-localhost", "--headless", "--dns-prefetch-disable"]}}, "http://chromium:4444"]'/>
<env name="DTT_API_OPTIONS" value='{"socketTimeout": 360, "domWaitTimeout": 3600000}' />
<env name="DTT_API_URL" value="http://chromium:9222"/>
<env name="DTT_BASE_URL" value="https://app"/>
<env name="SYMFONY_DEPRECATIONS_HELPER" value="ignoreFile=../.deprecation-ignore.txt" />
</php>
<extensions>
<!-- Functional tests HTML output logging. -->
<bootstrap class="Drupal\TestTools\Extension\HtmlLogging\HtmlOutputLogger">
<!-- By default browser tests print the individual links in the test run
report. To avoid overcrowding the output in CI environments, you can
set the "verbose" parameter or the "BROWSERTEST_OUTPUT_VERBOSE"
environment variable to "false". In GitLabCI, the output is saved
anyway as an artifact that can be browsed or downloaded from Gitlab.
-->
<parameter name="verbose" value="true"/>
</bootstrap>
<bootstrap class="DG\BypassFinals\PHPUnitExtension"/>
</extensions><testsuites>
<testsuite name="unit">
<directory>./public/modules/custom/*/tests/src/Unit</directory>
<directory>./public/themes/custom/*/tests/src/Unit</directory>
Expand Down Expand Up @@ -55,23 +71,19 @@
<directory>./public/profiles/custom/*/tests/src/ExistingSiteJavascript</directory>
</testsuite>
</testsuites>
<listeners>
<listener class="\Drupal\Tests\Listeners\DrupalListener">
</listener>
</listeners>
<coverage processUncoveredFiles="true">
<include>
<directory suffix=".php">./public/modules/custom/*/src</directory>
<directory suffix=".php">./public/themes/custom/*/src</directory>
<directory suffix=".php">./public/profiles/custom/*/src</directory>
<file>./public/modules/custom/*/*.module</file>
<file>./public/themes/custom/*/*.theme</file>
<file>./public/profiles/custom/*/*.profile</file>
</include>
<exclude>
<directory>./public/modules/custom/*/src/Tests</directory>
<directory>./public/themes/custom/*/src/Tests</directory>
<directory>./public/profiles/custom/*/src/Tests</directory>
</exclude>
</coverage>
<source ignoreSuppressionOfDeprecations="true">
<include>
<directory suffix=".php">./public/modules/custom/*/src</directory>
<directory suffix=".php">./public/themes/custom/*/src</directory>
<directory suffix=".php">./public/profiles/custom/*/src</directory>
<file>./public/modules/custom/*/*.module</file>
<file>./public/themes/custom/*/*.theme</file>
<file>./public/profiles/custom/*/*.profile</file>
</include>
<exclude>
<directory>./public/modules/custom/*/src/Tests</directory>
<directory>./public/themes/custom/*/src/Tests</directory>
<directory>./public/profiles/custom/*/src/Tests</directory>
</exclude>
</source>
</phpunit>
47 changes: 47 additions & 0 deletions public/modules/custom/helfi_strategia/helfi_strategia.install
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
<?php

/**
* @file
* Contains helfi_strategia installation hooks.
*/

declare(strict_types=1);

use Drupal\path_alias\Entity\PathAlias;

/**
* Implements hook_install().
*/
function helfi_strategia_install(): void {
helfi_strategia_update_9002();
}

/**
* UHF-12520: Edit path aliases.
*/
function helfi_strategia_update_9002(): void {
$storage = \Drupal::entityTypeManager()->getStorage('path_alias');

$old_aliases = $storage->loadByProperties(['path' => '/find-services']);
foreach ($old_aliases as $alias) {
$alias->delete();
}

$new_path = '/information-on-helsinki/wellbeing-in-helsinki/find-services';
$new_aliases = [
[
'path' => $new_path,
'alias' => '/tietoa-helsingista/hyvinvoiva-helsinki/palveluhaku',
'langcode' => 'fi',
],
[
'path' => $new_path,
'alias' => '/information-om-helsingfors/valbefinnande-i-helsingfors/sok-tjanster',
'langcode' => 'sv',
],
];

foreach ($new_aliases as $path) {
PathAlias::create($path)->save();
}
}
36 changes: 36 additions & 0 deletions public/modules/custom/helfi_strategia/helfi_strategia.module
Original file line number Diff line number Diff line change
Expand Up @@ -19,5 +19,41 @@ function helfi_strategia_theme(): array {
],
'template' => 'hyte-search',
],
'hyte_search_hero_block' => [
'variables' => [
'hero_title' => NULL,
'first_paragraph_bg' => NULL,
],
'template' => 'hyte-search-hero-block',
],
];
}

/**
* Implements hook_preprocess_html().
*/
function helfi_strategia_preprocess_html(&$variables): void {
$route = \Drupal::routeMatch()->getRouteName();

// Set the theme color to suomenlinna on Helsinki near you landing pages.
$hyte_search = [
'helfi_strategia.hyte_search',
];

if (in_array($route, $hyte_search)) {
$variables['theme_color'] = 'copper';
}
}

/**
* Implements hook_preprocess_HOOK().
*/
function helfi_strategia_preprocess_page(&$variables): void {
$route = \Drupal::routeMatch()->getRouteName();

// There is hero block on Hyte search page but
// since it isn't a paragraph we must set this variable manually.
if ($route === 'helfi_strategia.hyte_search') {
$variables['has_hero'] = TRUE;
}
}
23 changes: 3 additions & 20 deletions public/modules/custom/helfi_strategia/helfi_strategia.routing.yml
Original file line number Diff line number Diff line change
@@ -1,24 +1,7 @@
helfi_strategia.hyte_search.fi:
path: 'palveluhaku'
defaults:
_controller: '\Drupal\helfi_strategia\Controller\HyteSearchController::searchPage'
_title: 'Etsi hyvinvointia edistäviä palveluita'
requirements:
# Change to _permission: 'access content' when enabling the route
_access: 'FALSE'

helfi_strategia.hyte_search.sv:
path: 'söktjänster'
defaults:
_controller: '\Drupal\helfi_strategia\Controller\HyteSearchController::searchPage'
_title: 'Hitta tjänster som främjar välbefinnande'
requirements:
_access: 'FALSE'

helfi_strategia.hyte_search_en:
path: 'find-services'
helfi_strategia.hyte_search:
path: 'information-on-helsinki/wellbeing-in-helsinki/find-services'
defaults:
_controller: '\Drupal\helfi_strategia\Controller\HyteSearchController::searchPage'
_title: 'Find wellbeing services'
requirements:
_access: 'FALSE'
_permission: 'access content'
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,6 @@ services:
_defaults:
autowire: true
autoconfigure: true

Drupal\helfi_strategia\ElasticProxyResolver:
class: Drupal\helfi_strategia\ElasticProxyResolver
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,31 @@
namespace Drupal\helfi_strategia\Controller;

use Drupal\Core\Controller\ControllerBase;
use Drupal\helfi_strategia\ElasticProxyResolver;

/**
* Controller for Hyte search page.
*/
class HyteSearchController extends ControllerBase {

public function __construct(
private readonly ElasticProxyResolver $elasticProxyResolver,
) {
}

/**
* Returns the search page render array.
*/
public function searchPage(): array {
return [
'#attached' => [
'drupalSettings' => [
'helfi_strategia' => [
'hyte_search' => [
'elastic_proxy_url' => $this->elasticProxyResolver->getElasticProxyUrl(),
],
],
],
'library' => [
'hdbt_subtheme/hyte-search',
],
Expand All @@ -32,7 +45,6 @@ public function searchPage(): array {
'#tag' => 'div',
'#attributes' => [
'id' => 'hyte-search',
'data-url' => $this->config('elastic_proxy.settings')?->get('elastic_proxy_url'),
],
],
];
Expand Down
Loading
Loading