From 12030cd936c9379e08e1612ef617a1c88b0eec58 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Markus=20Kalij=C3=A4rvi?= Date: Tue, 10 Dec 2024 08:29:40 +0200 Subject: [PATCH 01/19] Revert "UHF-10908: Reverted the changes for functional cookie banner tests until the CI pipeline is updated." This reverts commit 983959a15ff7d160258b365ddb59f665bae2ccac. --- .../hdbt_cookie_banner_test.info.yml | 4 + .../hdbt_cookie_banner_test.module | 18 ++ .../hdbt_cookie_banner_test.routing.yml | 7 + .../src/Controller/TestController.php | 25 +++ .../FunctionalJavascript/CookieBannerTest.php | 159 ++++++++++++++++++ 5 files changed, 213 insertions(+) create mode 100644 modules/hdbt_cookie_banner/tests/modules/hdbt_cookie_banner_test/hdbt_cookie_banner_test.info.yml create mode 100644 modules/hdbt_cookie_banner/tests/modules/hdbt_cookie_banner_test/hdbt_cookie_banner_test.module create mode 100644 modules/hdbt_cookie_banner/tests/modules/hdbt_cookie_banner_test/hdbt_cookie_banner_test.routing.yml create mode 100644 modules/hdbt_cookie_banner/tests/modules/hdbt_cookie_banner_test/src/Controller/TestController.php create mode 100644 modules/hdbt_cookie_banner/tests/src/FunctionalJavascript/CookieBannerTest.php diff --git a/modules/hdbt_cookie_banner/tests/modules/hdbt_cookie_banner_test/hdbt_cookie_banner_test.info.yml b/modules/hdbt_cookie_banner/tests/modules/hdbt_cookie_banner_test/hdbt_cookie_banner_test.info.yml new file mode 100644 index 000000000..7fd1aa085 --- /dev/null +++ b/modules/hdbt_cookie_banner/tests/modules/hdbt_cookie_banner_test/hdbt_cookie_banner_test.info.yml @@ -0,0 +1,4 @@ +name: 'HDBT cookie banner test module' +type: module +package: Custom +core_version_requirement: ^10 || ^11 diff --git a/modules/hdbt_cookie_banner/tests/modules/hdbt_cookie_banner_test/hdbt_cookie_banner_test.module b/modules/hdbt_cookie_banner/tests/modules/hdbt_cookie_banner_test/hdbt_cookie_banner_test.module new file mode 100644 index 000000000..18b44ab4a --- /dev/null +++ b/modules/hdbt_cookie_banner/tests/modules/hdbt_cookie_banner_test/hdbt_cookie_banner_test.module @@ -0,0 +1,18 @@ + 'inline_template', + '#template' => '

Test Content

', + ]; + } + +} diff --git a/modules/hdbt_cookie_banner/tests/src/FunctionalJavascript/CookieBannerTest.php b/modules/hdbt_cookie_banner/tests/src/FunctionalJavascript/CookieBannerTest.php new file mode 100644 index 000000000..39c449ec5 --- /dev/null +++ b/modules/hdbt_cookie_banner/tests/src/FunctionalJavascript/CookieBannerTest.php @@ -0,0 +1,159 @@ +getPath('hdbt_cookie_banner'); + $json_file_path = $module_path . '/assets/json/siteSettingsTemplate.json'; + + // Assert the file exists. + $this->assertTrue(file_exists($json_file_path)); + + // Load and decode the JSON. + $json_content = file_get_contents($json_file_path); + $this->assertNotEmpty($json_content, 'Decoded JSON data is not empty.'); + + // Get the public base URL (in a FunctionalJavascript test). + // Construct a URL for the hds-cookie-consent.min.js file. + $cookie_js_url = "/$module_path/assets/js/hds-cookie-consent.min.js"; + + // Change configuration value before the test runs. + $config = $this->config('hdbt_cookie_banner.settings'); + $config + ->set('use_custom_settings', TRUE) + ->set('site_settings', $json_content) + ->set('use_custom_settings', TRUE) + ->set('use_internal_hds_cookie_js', FALSE) + ->set('hds_cookie_js_override', $cookie_js_url) + ->save(); + + \Drupal::service('cache.default')->deleteAll(); + } + + /** + * Tests the cookie banner visibility and interaction. + */ + public function testCookieBanner() { + $this->drupalGet('/test-page'); + $this->assertSession()->pageTextContains('Test Content'); + $this->assertSession()->elementExists('css', '.test-footer'); + + // Get the web driver. + $driver = $this->getSession()->getDriver(); + + // Check if the driver is an instance of DrupalSelenium2Driver. + if ($driver instanceof Selenium2Driver) { + // Get all cookies from the browser. + $cookies = $driver->getWebDriverSession()->getCookie(); + + // Extract only the 'name' keys from all the cookies, as we want to check + // if a specific cookie "change-me" exists. + $cookieNames = array_column($cookies, 'name'); + $this->assertNotContains( + 'change-me', + $cookieNames, + 'The cookie "change-me" was found, but it should not exist.', + ); + } + else { + $this->fail('The driver is not an instance of Selenium2Driver.'); + } + + // Assert that the cookie banner is visible and click the accept button. + $this->assertCookieBannerIsVisible(); + + // Get the new cookies from the browser. + $new_cookies = $driver->getWebDriverSession()->getCookie(); + + // There should be a new cookie called "change-me". + $cookieNames = array_column($new_cookies, 'name'); + $this->assertContains( + 'change-me', + $cookieNames, + 'The cookie "change-me" was not found after clicking the button.', + ); + + // Reload the page and assert that the cookie banner is not visible. + $this->drupalGet('/test-page'); + $this->assertSession()->pageTextContains('Test Content'); + $this->assertCookieBannerNotVisible(); + } + + /** + * Asserts that the cookie banner is visible. + */ + protected function assertCookieBannerIsVisible() { + // Get the Shadow DOM host and button selectors. + $shadowHostSelector = '.hds-cc__target'; + $buttonSelector = '.hds-cc__all-cookies-button'; + + // Verify that the cookie banner is visible and click the accept button. + $js = <<getSession()->executeScript($js); + } + + /** + * Asserts that the cookie banner is not visible. + */ + protected function assertCookieBannerNotVisible() { + // Get the Shadow DOM host and button selectors. + $shadowHostSelector = '.hds-cc__target'; + + // Verify that the cookie banner is not visible. + $js = <<getSession()->executeScript($js); + } + +} From 647498ba6a5db11b401f66733bf9cc7696c7572f Mon Sep 17 00:00:00 2001 From: tuutti Date: Tue, 10 Dec 2024 09:37:36 +0200 Subject: [PATCH 02/19] UHF-10908: Support for functional js tests --- .github/workflows/ci.yml | 21 +++++++++++++-------- phpunit.xml | 7 +++---- 2 files changed, 16 insertions(+), 12 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 2ddbade5e..b8c69cb95 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -6,15 +6,15 @@ on: name: CI env: SYMFONY_DEPRECATIONS_HELPER: disabled - SIMPLETEST_BASE_URL: http://app:8888 + SIMPLETEST_BASE_URL: https://app jobs: tests: runs-on: ubuntu-latest strategy: matrix: - php-versions: ['8.1', '8.2', '8.3'] + php-versions: ['8.4'] container: - image: ghcr.io/city-of-helsinki/drupal-php-docker:${{ matrix.php-versions }}-alpine + image: ghcr.io/city-of-helsinki/drupal-web:${{ matrix.php-versions }} options: --hostname app services: db: @@ -26,6 +26,15 @@ jobs: MYSQL_ROOT_PASSWORD: drupal ports: - 3306:3306 + chromium: + image: selenium/standalone-chromium + env: + SE_NODE_OVERRIDE_MAX_SESSIONS: "true" + SE_NODE_MAX_SESSIONS: "16" + SE_START_XVFB: "false" + SE_START_VNC: "false" + SE_SESSION_RETRY_INTERVAL: "1" + SE_SESSION_REQUEST_TIMEOUT: "10" steps: - uses: actions/checkout@v4 @@ -45,7 +54,7 @@ jobs: - name: Clone platform run: | - git clone --depth=1 https://github.com/City-of-Helsinki/drupal-helfi-platform.git $DRUPAL_ROOT + git clone -b UHF-11031 --depth=1 https://github.com/City-of-Helsinki/drupal-helfi-platform.git $DRUPAL_ROOT rm -rf $DRUPAL_ROOT/.git - name: Install required composer dependencies @@ -73,10 +82,6 @@ jobs: working-directory: ${{ env.DRUPAL_ROOT }} run: vendor/bin/phpstan analyze -c $MODULE_FOLDER/phpstan.neon $MODULE_FOLDER - - name: Start services - working-directory: ${{ env.DRUPAL_ROOT }} - run: vendor/bin/drush runserver $SIMPLETEST_BASE_URL --dns & - - name: Run PHPUnit tests working-directory: ${{ env.DRUPAL_ROOT }} run: | diff --git a/phpunit.xml b/phpunit.xml index 562c1070b..f888cd7ac 100644 --- a/phpunit.xml +++ b/phpunit.xml @@ -17,11 +17,10 @@ - - - + + - + From 932cb5aacc87f3238a430b5260cdd9446bf002a7 Mon Sep 17 00:00:00 2001 From: tuutti Date: Tue, 10 Dec 2024 09:45:40 +0200 Subject: [PATCH 03/19] UHF-10908: Run as root --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index b8c69cb95..8387a2da5 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -15,7 +15,7 @@ jobs: php-versions: ['8.4'] container: image: ghcr.io/city-of-helsinki/drupal-web:${{ matrix.php-versions }} - options: --hostname app + options: --hostname app --user root services: db: image: mysql:8 From b30e98d2fb8546555826ece27e8f16d8c9ab6e69 Mon Sep 17 00:00:00 2001 From: tuutti Date: Tue, 10 Dec 2024 14:21:09 +0200 Subject: [PATCH 04/19] UHF-10908: Use updated test image --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 8387a2da5..b8c69cb95 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -15,7 +15,7 @@ jobs: php-versions: ['8.4'] container: image: ghcr.io/city-of-helsinki/drupal-web:${{ matrix.php-versions }} - options: --hostname app --user root + options: --hostname app services: db: image: mysql:8 From c27db4ebbcb8453a18e19ae66991986cea0a6f85 Mon Sep 17 00:00:00 2001 From: tuutti Date: Tue, 10 Dec 2024 14:28:15 +0200 Subject: [PATCH 05/19] UHF-10908: Set user --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index b8c69cb95..39ce64aec 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -15,7 +15,7 @@ jobs: php-versions: ['8.4'] container: image: ghcr.io/city-of-helsinki/drupal-web:${{ matrix.php-versions }} - options: --hostname app + options: --hostname app --user 1001 services: db: image: mysql:8 From 3d92dc36819f145d35afde5e6be3dfc5fc3e615b Mon Sep 17 00:00:00 2001 From: tuutti Date: Tue, 10 Dec 2024 15:11:10 +0200 Subject: [PATCH 06/19] UHF-10908: Use ci images again --- .github/workflows/ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 39ce64aec..4e545d28a 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -14,8 +14,8 @@ jobs: matrix: php-versions: ['8.4'] container: - image: ghcr.io/city-of-helsinki/drupal-web:${{ matrix.php-versions }} - options: --hostname app --user 1001 + image: ghcr.io/city-of-helsinki/drupal-php-docker:${{ matrix.php-versions }}-alpine + options: --hostname app services: db: image: mysql:8 From ce65b727b2844ab3215091feb845c0d063ea21da Mon Sep 17 00:00:00 2001 From: tuutti Date: Tue, 10 Dec 2024 15:26:52 +0200 Subject: [PATCH 07/19] UHF-10908: Use local image again --- .github/workflows/ci.yml | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 4e545d28a..9674f3373 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -6,7 +6,8 @@ on: name: CI env: SYMFONY_DEPRECATIONS_HELPER: disabled - SIMPLETEST_BASE_URL: https://app + COMPOSER_DISCARD_CHANGES: true + COMPOSER_MIRROR_PATH_REPOS: 1 jobs: tests: runs-on: ubuntu-latest @@ -14,8 +15,8 @@ jobs: matrix: php-versions: ['8.4'] container: - image: ghcr.io/city-of-helsinki/drupal-php-docker:${{ matrix.php-versions }}-alpine - options: --hostname app + image: ghcr.io/city-of-helsinki/drupal-web:${{ matrix.php-versions }} + options: --hostname app --user 1001 services: db: image: mysql:8 @@ -91,9 +92,12 @@ jobs: --coverage-clover=$MODULE_FOLDER/coverage.xml \ $MODULE_FOLDER - - name: Run codecov - working-directory: ${{ env.MODULE_FOLDER }} - run: codecov + - uses: codecov/codecov-action@v5 + with: + fail_ci_if_error: true + directory: ${{ env.MODULE_FOLDER }} + token: ${{ secrets.CODECOV_TOKEN }} + verbose: true - name: Create an artifact from test report uses: actions/upload-artifact@v4 From e4089eb72451edf88652de93075599f66bb6ef13 Mon Sep 17 00:00:00 2001 From: tuutti Date: Tue, 10 Dec 2024 16:06:35 +0200 Subject: [PATCH 08/19] UHF-10908: Test 8.3 --- .github/workflows/ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 9674f3373..7e2f5c704 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -13,9 +13,9 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - php-versions: ['8.4'] + php-versions: ['8.3'] container: - image: ghcr.io/city-of-helsinki/drupal-web:${{ matrix.php-versions }} + image: ghcr.io/city-of-helsinki/drupal-web:${{ matrix.php-versions }}-dev options: --hostname app --user 1001 services: db: From b1cbe2685f361821b6f5c3c73dbaa669f0e38497 Mon Sep 17 00:00:00 2001 From: tuutti Date: Tue, 10 Dec 2024 16:24:24 +0200 Subject: [PATCH 09/19] UHF-10908: Debug --- .github/workflows/ci.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 7e2f5c704..5982822b4 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -42,6 +42,9 @@ jobs: with: fetch-depth: 0 + - name: Debug + run: ps aux + - name: Parse $MODULE_NAME from composer.json run: echo "MODULE_NAME=$(cat composer.json | jq -r .name | awk -F/ '{print $NF}')" >> $GITHUB_ENV From dce37b25f7dba060858bbb4bd3c6953ade7cde41 Mon Sep 17 00:00:00 2001 From: tuutti Date: Tue, 10 Dec 2024 17:11:46 +0200 Subject: [PATCH 10/19] UHF-10908: Empty commit to trigger test From 632cbe9af29e7c752ed457328e87134e644a3a65 Mon Sep 17 00:00:00 2001 From: tuutti Date: Tue, 10 Dec 2024 17:28:59 +0200 Subject: [PATCH 11/19] UHF-10908: Override entrypoint --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 5982822b4..97e749204 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -16,7 +16,7 @@ jobs: php-versions: ['8.3'] container: image: ghcr.io/city-of-helsinki/drupal-web:${{ matrix.php-versions }}-dev - options: --hostname app --user 1001 + options: --hostname app --user 1001 --entrypoint entrypoint services: db: image: mysql:8 From 7a6774edb20b3b3caceec39fb40b4e5118e61f27 Mon Sep 17 00:00:00 2001 From: tuutti Date: Tue, 10 Dec 2024 17:35:23 +0200 Subject: [PATCH 12/19] UHF-10908: Testing --- .github/workflows/ci.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 97e749204..bdb79431d 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -16,7 +16,7 @@ jobs: php-versions: ['8.3'] container: image: ghcr.io/city-of-helsinki/drupal-web:${{ matrix.php-versions }}-dev - options: --hostname app --user 1001 --entrypoint entrypoint + options: --hostname app --user 1001 services: db: image: mysql:8 @@ -42,6 +42,9 @@ jobs: with: fetch-depth: 0 + - name: Start services + run: entrypoint & + - name: Debug run: ps aux From 098f5c647c105f37c2bf17b7c547a35765dfc38d Mon Sep 17 00:00:00 2001 From: tuutti Date: Wed, 11 Dec 2024 10:03:13 +0200 Subject: [PATCH 13/19] UHF-10908: Install drupal after lint checks --- .github/workflows/ci.yml | 25 ++++++++++++------------- 1 file changed, 12 insertions(+), 13 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index bdb79431d..8999e73ab 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -42,12 +42,11 @@ jobs: with: fetch-depth: 0 + # Actions worker overrides the default entrypoint with "tail -f /dev/null", so + # we have to start services manually. - name: Start services run: entrypoint & - - name: Debug - run: ps aux - - name: Parse $MODULE_NAME from composer.json run: echo "MODULE_NAME=$(cat composer.json | jq -r .name | awk -F/ '{print $NF}')" >> $GITHUB_ENV @@ -64,23 +63,17 @@ jobs: git clone -b UHF-11031 --depth=1 https://github.com/City-of-Helsinki/drupal-helfi-platform.git $DRUPAL_ROOT rm -rf $DRUPAL_ROOT/.git + # We use COMPOSER_MIRROR_PATH_REPOS=1 to mirror local repository + # instead of symlinking it to prevent code coverage issues with + # phpunit. Copy .git folder manually so codecov can generate line by + # line coverage. - name: Install required composer dependencies working-directory: ${{ env.DRUPAL_ROOT }} run: | composer config repositories.5 path $GITHUB_WORKSPACE composer require drupal/$MODULE_NAME -W - # We use COMPOSER_MIRROR_PATH_REPOS=1 to mirror local repository - # instead of symlinking it to prevent code coverage issues with - # phpunit. Copy .git folder manually so codecov can generate line by - # line coverage. cp -r $GITHUB_WORKSPACE/.git $MODULE_FOLDER/ - - name: Install Drupal - working-directory: ${{ env.DRUPAL_ROOT }} - run: | - php -d sendmail_path=$(which true); vendor/bin/drush --yes -v site-install minimal --db-url="$SIMPLETEST_DB" - vendor/bin/drush en $MODULE_NAME helfi_platform_config_base -y - - name: Run PHPCS working-directory: ${{ env.DRUPAL_ROOT }} run: vendor/bin/phpcs $MODULE_FOLDER --standard=$MODULE_FOLDER/phpcs.xml --extensions=php,module,inc,install,test,info @@ -89,6 +82,12 @@ jobs: working-directory: ${{ env.DRUPAL_ROOT }} run: vendor/bin/phpstan analyze -c $MODULE_FOLDER/phpstan.neon $MODULE_FOLDER + - name: Install Drupal + working-directory: ${{ env.DRUPAL_ROOT }} + run: | + php -d sendmail_path=$(which true); vendor/bin/drush --yes -v site-install minimal --db-url="$SIMPLETEST_DB" + vendor/bin/drush en $MODULE_NAME helfi_platform_config_base -y + - name: Run PHPUnit tests working-directory: ${{ env.DRUPAL_ROOT }} run: | From b44c917b8c5ae3e71ca32dcf9669a324f0708c74 Mon Sep 17 00:00:00 2001 From: tuutti Date: Wed, 11 Dec 2024 12:51:13 +0200 Subject: [PATCH 14/19] UHF-10908: Correct webroot --- .github/workflows/ci.yml | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 8999e73ab..72344d826 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -42,17 +42,19 @@ jobs: with: fetch-depth: 0 - # Actions worker overrides the default entrypoint with "tail -f /dev/null", so - # we have to start services manually. - - name: Start services - run: entrypoint & - - name: Parse $MODULE_NAME from composer.json run: echo "MODULE_NAME=$(cat composer.json | jq -r .name | awk -F/ '{print $NF}')" >> $GITHUB_ENV - name: Set Drupal root run: echo "DRUPAL_ROOT=$HOME/drupal" >> $GITHUB_ENV + # Actions worker overrides the default entrypoint with "tail -f /dev/null", so + # we have to start services manually. + - name: Start services + env: + WEBROOT: ${{ DRUPAL_ROOT }}/public + run: entrypoint & + - name: Set module folder run: | echo "MODULE_FOLDER=$DRUPAL_ROOT/public/modules/contrib/$MODULE_NAME" >> $GITHUB_ENV From 7839a69039314204e139158049657a27e26c218a Mon Sep 17 00:00:00 2001 From: tuutti Date: Wed, 11 Dec 2024 12:53:58 +0200 Subject: [PATCH 15/19] UHF-10908: Fixed env variable --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 72344d826..e544f98ba 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -52,7 +52,7 @@ jobs: # we have to start services manually. - name: Start services env: - WEBROOT: ${{ DRUPAL_ROOT }}/public + WEBROOT: ${{ env.DRUPAL_ROOT }}/public run: entrypoint & - name: Set module folder From 2e360142ed20a67892ab745ece84186892d9364f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Markus=20Kalij=C3=A4rvi?= Date: Thu, 12 Dec 2024 10:29:14 +0200 Subject: [PATCH 16/19] Update CookieBannerTest.php --- .../tests/src/FunctionalJavascript/CookieBannerTest.php | 1 - 1 file changed, 1 deletion(-) diff --git a/modules/hdbt_cookie_banner/tests/src/FunctionalJavascript/CookieBannerTest.php b/modules/hdbt_cookie_banner/tests/src/FunctionalJavascript/CookieBannerTest.php index 39c449ec5..da5781cad 100644 --- a/modules/hdbt_cookie_banner/tests/src/FunctionalJavascript/CookieBannerTest.php +++ b/modules/hdbt_cookie_banner/tests/src/FunctionalJavascript/CookieBannerTest.php @@ -52,7 +52,6 @@ protected function setUp(): void { $config ->set('use_custom_settings', TRUE) ->set('site_settings', $json_content) - ->set('use_custom_settings', TRUE) ->set('use_internal_hds_cookie_js', FALSE) ->set('hds_cookie_js_override', $cookie_js_url) ->save(); From 146ff074c9b5e3719ce86944da011790f230045b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Markus=20Kalij=C3=A4rvi?= Date: Thu, 12 Dec 2024 11:34:01 +0200 Subject: [PATCH 17/19] UHF-10908: Fixed translations for the views pager to prevent race conditions in conf/cmi translations. --- .../config/install/views.view.helfi_redirect.yml | 8 ++++---- .../optional/language/fi/views.view.helfi_redirect.yml | 6 +++++- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/modules/helfi_base_content/config/install/views.view.helfi_redirect.yml b/modules/helfi_base_content/config/install/views.view.helfi_redirect.yml index 02c9962ea..6fa1c6de7 100644 --- a/modules/helfi_base_content/config/install/views.view.helfi_redirect.yml +++ b/modules/helfi_base_content/config/install/views.view.helfi_redirect.yml @@ -298,10 +298,10 @@ display: total_pages: null id: 0 tags: - next: 'next ›' - previous: '‹ previous' - first: '« first' - last: 'last »' + next: 'Next ›' + previous: '‹ Previous' + first: '« First' + last: 'Last »' expose: items_per_page: false items_per_page_label: 'Items per page' diff --git a/modules/helfi_base_content/config/optional/language/fi/views.view.helfi_redirect.yml b/modules/helfi_base_content/config/optional/language/fi/views.view.helfi_redirect.yml index df012b442..c847c963f 100644 --- a/modules/helfi_base_content/config/optional/language/fi/views.view.helfi_redirect.yml +++ b/modules/helfi_base_content/config/optional/language/fi/views.view.helfi_redirect.yml @@ -37,7 +37,11 @@ display: sort_desc_label: Laskevasti pager: options: - tags: { } + tags: + next: 'Seuraava ›' + previous: '‹ Edellinen' + first: '« Ensimmäinen' + last: 'Viimeinen »' expose: items_per_page_label: 'Merkintöjä sivua kohti' items_per_page_options_all_label: '- Kaikki -' From 17fd4ee9ea26b91d9763cc39de63a601c8294256 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Markus=20Kalij=C3=A4rvi?= Date: Thu, 12 Dec 2024 14:28:56 +0200 Subject: [PATCH 18/19] Revert "UHF-10908: Fixed translations for the views pager to prevent race conditions in conf/cmi translations." This reverts commit 146ff074c9b5e3719ce86944da011790f230045b. --- .../config/install/views.view.helfi_redirect.yml | 8 ++++---- .../optional/language/fi/views.view.helfi_redirect.yml | 6 +----- 2 files changed, 5 insertions(+), 9 deletions(-) diff --git a/modules/helfi_base_content/config/install/views.view.helfi_redirect.yml b/modules/helfi_base_content/config/install/views.view.helfi_redirect.yml index 6fa1c6de7..02c9962ea 100644 --- a/modules/helfi_base_content/config/install/views.view.helfi_redirect.yml +++ b/modules/helfi_base_content/config/install/views.view.helfi_redirect.yml @@ -298,10 +298,10 @@ display: total_pages: null id: 0 tags: - next: 'Next ›' - previous: '‹ Previous' - first: '« First' - last: 'Last »' + next: 'next ›' + previous: '‹ previous' + first: '« first' + last: 'last »' expose: items_per_page: false items_per_page_label: 'Items per page' diff --git a/modules/helfi_base_content/config/optional/language/fi/views.view.helfi_redirect.yml b/modules/helfi_base_content/config/optional/language/fi/views.view.helfi_redirect.yml index c847c963f..df012b442 100644 --- a/modules/helfi_base_content/config/optional/language/fi/views.view.helfi_redirect.yml +++ b/modules/helfi_base_content/config/optional/language/fi/views.view.helfi_redirect.yml @@ -37,11 +37,7 @@ display: sort_desc_label: Laskevasti pager: options: - tags: - next: 'Seuraava ›' - previous: '‹ Edellinen' - first: '« Ensimmäinen' - last: 'Viimeinen »' + tags: { } expose: items_per_page_label: 'Merkintöjä sivua kohti' items_per_page_options_all_label: '- Kaikki -' From aa91b085dcaa6fddbe3d905dc2d9a3580773fed0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Markus=20Kalij=C3=A4rvi?= Date: Thu, 12 Dec 2024 14:30:19 +0200 Subject: [PATCH 19/19] UHF-10908: Reverted helfi_platform to main branch. --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index e544f98ba..ea5806bff 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -62,7 +62,7 @@ jobs: - name: Clone platform run: | - git clone -b UHF-11031 --depth=1 https://github.com/City-of-Helsinki/drupal-helfi-platform.git $DRUPAL_ROOT + git clone --depth=1 https://github.com/City-of-Helsinki/drupal-helfi-platform.git $DRUPAL_ROOT rm -rf $DRUPAL_ROOT/.git # We use COMPOSER_MIRROR_PATH_REPOS=1 to mirror local repository