From 43807126cb4505e8f6c38faf3adb7d1e6d756e1d Mon Sep 17 00:00:00 2001 From: rpnykanen Date: Wed, 13 Sep 2023 14:36:37 +0300 Subject: [PATCH 01/23] UHF-8946: if user tries to access job listing with wrong language, redirect them to the existing translation if one can be found --- .../JobListingRedirectSubscriber.php | 32 +++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/public/modules/custom/helfi_rekry_content/src/EventSubscriber/JobListingRedirectSubscriber.php b/public/modules/custom/helfi_rekry_content/src/EventSubscriber/JobListingRedirectSubscriber.php index 5b917ae6..1032702f 100644 --- a/public/modules/custom/helfi_rekry_content/src/EventSubscriber/JobListingRedirectSubscriber.php +++ b/public/modules/custom/helfi_rekry_content/src/EventSubscriber/JobListingRedirectSubscriber.php @@ -70,4 +70,36 @@ public function on403(ExceptionEvent $event): void { $event->setResponse($response); } + /** + * If trying to access non-existing translation, redirect to existing one. + * + * @param \Symfony\Component\HttpKernel\Event\ExceptionEvent $event + * The Event to process. + */ + public function on404(ExceptionEvent $event) { + $uri = $event->getRequest()->getRequestUri(); + $redirectFrom = 'avoimet-tyopaikat/avoimet-tyopaikat/'; + if (!str_contains($uri, $redirectFrom)) { + return; + } + + $recruitmentId = array_reverse(explode('/', $uri))[0]; + $nodes = \Drupal::entityTypeManager() + ->getStorage('node') + ->loadByProperties(['field_recruitment_id' => $recruitmentId]); + + if (!$nodes || !$node = reset($nodes)) { + return; + } + + // Since we are listening to 404 exception, + // the node loaded is automatically existing translation. + // We can just redirect without worrying whether the translation exists. + $response = new RedirectResponse( + $node->toUrl('canonical', ['language' => $node->language()])->toString(), + 302 + ); + $event->setResponse($response); + } + } From b64c1005823778fea55ef1adf7dc68572b7c5673 Mon Sep 17 00:00:00 2001 From: rpnykanen Date: Wed, 13 Sep 2023 15:20:00 +0300 Subject: [PATCH 02/23] UHF-8946: change redirectresponse to trustedredirectresponse --- .../src/EventSubscriber/JobListingRedirectSubscriber.php | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/public/modules/custom/helfi_rekry_content/src/EventSubscriber/JobListingRedirectSubscriber.php b/public/modules/custom/helfi_rekry_content/src/EventSubscriber/JobListingRedirectSubscriber.php index 1032702f..5349d14e 100644 --- a/public/modules/custom/helfi_rekry_content/src/EventSubscriber/JobListingRedirectSubscriber.php +++ b/public/modules/custom/helfi_rekry_content/src/EventSubscriber/JobListingRedirectSubscriber.php @@ -6,10 +6,10 @@ use Drupal\Core\Config\ConfigFactoryInterface; use Drupal\Core\EventSubscriber\HttpExceptionSubscriberBase; +use Drupal\Core\Routing\TrustedRedirectResponse; use Drupal\Core\Session\AccountInterface; use Drupal\Core\Url; use Drupal\node\NodeInterface; -use Symfony\Component\HttpFoundation\RedirectResponse; use Symfony\Component\HttpKernel\Event\ExceptionEvent; /** @@ -66,7 +66,7 @@ public function on403(ExceptionEvent $event): void { $url = Url::fromRoute('entity.node.canonical', ['node' => $redirectNode])->toString(); // Set temporary redirect. - $response = new RedirectResponse($url, 307); + $response = new TrustedRedirectResponse($url, 307); $event->setResponse($response); } @@ -95,9 +95,8 @@ public function on404(ExceptionEvent $event) { // Since we are listening to 404 exception, // the node loaded is automatically existing translation. // We can just redirect without worrying whether the translation exists. - $response = new RedirectResponse( + $response = new TrustedRedirectResponse( $node->toUrl('canonical', ['language' => $node->language()])->toString(), - 302 ); $event->setResponse($response); } From 70b20a4bef79f57c46dba59bc240ca3d6daf9bc1 Mon Sep 17 00:00:00 2001 From: rpnykanen Date: Wed, 13 Sep 2023 15:23:30 +0300 Subject: [PATCH 03/23] UHF-8946: add cacheable dependecy --- .../src/EventSubscriber/JobListingRedirectSubscriber.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/public/modules/custom/helfi_rekry_content/src/EventSubscriber/JobListingRedirectSubscriber.php b/public/modules/custom/helfi_rekry_content/src/EventSubscriber/JobListingRedirectSubscriber.php index 5349d14e..7d0eecca 100644 --- a/public/modules/custom/helfi_rekry_content/src/EventSubscriber/JobListingRedirectSubscriber.php +++ b/public/modules/custom/helfi_rekry_content/src/EventSubscriber/JobListingRedirectSubscriber.php @@ -95,9 +95,9 @@ public function on404(ExceptionEvent $event) { // Since we are listening to 404 exception, // the node loaded is automatically existing translation. // We can just redirect without worrying whether the translation exists. - $response = new TrustedRedirectResponse( - $node->toUrl('canonical', ['language' => $node->language()])->toString(), - ); + $url = $node->toUrl('canonical', ['language' => $node->language()])->toString(); + $response = new TrustedRedirectResponse($url); + $response->addCacheableDependency($url); $event->setResponse($response); } From 5a38830f3f3180835a5a864ac5062c029010c667 Mon Sep 17 00:00:00 2001 From: rpnykanen Date: Wed, 13 Sep 2023 15:47:26 +0300 Subject: [PATCH 04/23] UHF-8946: inject entitytypemanager, code fixes --- .../helfi_rekry_content.services.yml | 2 +- .../EventSubscriber/JobListingRedirectSubscriber.php | 10 ++++++---- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/public/modules/custom/helfi_rekry_content/helfi_rekry_content.services.yml b/public/modules/custom/helfi_rekry_content/helfi_rekry_content.services.yml index 174cf26d..3c763898 100644 --- a/public/modules/custom/helfi_rekry_content/helfi_rekry_content.services.yml +++ b/public/modules/custom/helfi_rekry_content/helfi_rekry_content.services.yml @@ -15,7 +15,7 @@ services: - { name: 'event_subscriber' } helfi_rekry_content.job_listing_redirect_subscriber: class: Drupal\helfi_rekry_content\EventSubscriber\JobListingRedirectSubscriber - arguments: ['@config.factory', '@current_user'] + arguments: ['@config.factory', '@current_user', '@entity_type.manager'] tags: - { name: 'event_subscriber' } logger.channel.helfi_rekry_content: diff --git a/public/modules/custom/helfi_rekry_content/src/EventSubscriber/JobListingRedirectSubscriber.php b/public/modules/custom/helfi_rekry_content/src/EventSubscriber/JobListingRedirectSubscriber.php index 7d0eecca..2a59e71c 100644 --- a/public/modules/custom/helfi_rekry_content/src/EventSubscriber/JobListingRedirectSubscriber.php +++ b/public/modules/custom/helfi_rekry_content/src/EventSubscriber/JobListingRedirectSubscriber.php @@ -5,6 +5,7 @@ namespace Drupal\helfi_rekry_content\EventSubscriber; use Drupal\Core\Config\ConfigFactoryInterface; +use Drupal\Core\Entity\EntityTypeManager; use Drupal\Core\EventSubscriber\HttpExceptionSubscriberBase; use Drupal\Core\Routing\TrustedRedirectResponse; use Drupal\Core\Session\AccountInterface; @@ -27,7 +28,8 @@ class JobListingRedirectSubscriber extends HttpExceptionSubscriberBase { */ public function __construct( protected ConfigFactoryInterface $configFactory, - protected AccountInterface $currentUser + protected AccountInterface $currentUser, + protected EntityTypeManager $entityTypeManager, ) {} /** @@ -73,10 +75,10 @@ public function on403(ExceptionEvent $event): void { /** * If trying to access non-existing translation, redirect to existing one. * - * @param \Symfony\Component\HttpKernel\Event\ExceptionEvent $event + * @param ExceptionEvent $event * The Event to process. */ - public function on404(ExceptionEvent $event) { + public function on404(ExceptionEvent $event) : void { $uri = $event->getRequest()->getRequestUri(); $redirectFrom = 'avoimet-tyopaikat/avoimet-tyopaikat/'; if (!str_contains($uri, $redirectFrom)) { @@ -84,7 +86,7 @@ public function on404(ExceptionEvent $event) { } $recruitmentId = array_reverse(explode('/', $uri))[0]; - $nodes = \Drupal::entityTypeManager() + $nodes = $this->entityTypeManager ->getStorage('node') ->loadByProperties(['field_recruitment_id' => $recruitmentId]); From 1c0ca9103743f457da8bb78ae4083d3be1a89751 Mon Sep 17 00:00:00 2001 From: rpnykanen Date: Thu, 14 Sep 2023 08:27:10 +0300 Subject: [PATCH 05/23] UHF-8946: added all of the job listing pages to the redirect logic --- .../JobListingRedirectSubscriber.php | 20 ++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/public/modules/custom/helfi_rekry_content/src/EventSubscriber/JobListingRedirectSubscriber.php b/public/modules/custom/helfi_rekry_content/src/EventSubscriber/JobListingRedirectSubscriber.php index 2a59e71c..0a510f25 100644 --- a/public/modules/custom/helfi_rekry_content/src/EventSubscriber/JobListingRedirectSubscriber.php +++ b/public/modules/custom/helfi_rekry_content/src/EventSubscriber/JobListingRedirectSubscriber.php @@ -80,8 +80,21 @@ public function on403(ExceptionEvent $event): void { */ public function on404(ExceptionEvent $event) : void { $uri = $event->getRequest()->getRequestUri(); - $redirectFrom = 'avoimet-tyopaikat/avoimet-tyopaikat/'; - if (!str_contains($uri, $redirectFrom)) { + $redirectPaths = [ + 'avoimet-tyopaikat/avoimet-tyopaikat/', + 'lediga-jobb/lediga-jobb/', + 'open-jobs/open-jobs/', + ]; + + $redirectFrom = NULL; + foreach($redirectPaths as $path) { + if (str_contains($uri, $path)) { + $redirectFrom = $path; + break; + } + } + + if (!$redirectFrom) { return; } @@ -94,9 +107,6 @@ public function on404(ExceptionEvent $event) : void { return; } - // Since we are listening to 404 exception, - // the node loaded is automatically existing translation. - // We can just redirect without worrying whether the translation exists. $url = $node->toUrl('canonical', ['language' => $node->language()])->toString(); $response = new TrustedRedirectResponse($url); $response->addCacheableDependency($url); From 4ee5d43a0af90f529f18ff1dd9158c9bc02b1a72 Mon Sep 17 00:00:00 2001 From: rpnykanen Date: Thu, 14 Sep 2023 08:43:16 +0300 Subject: [PATCH 06/23] UHF-8946: code fixes --- .../EventSubscriber/JobListingRedirectSubscriber.php | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/public/modules/custom/helfi_rekry_content/src/EventSubscriber/JobListingRedirectSubscriber.php b/public/modules/custom/helfi_rekry_content/src/EventSubscriber/JobListingRedirectSubscriber.php index 0a510f25..5dca6072 100644 --- a/public/modules/custom/helfi_rekry_content/src/EventSubscriber/JobListingRedirectSubscriber.php +++ b/public/modules/custom/helfi_rekry_content/src/EventSubscriber/JobListingRedirectSubscriber.php @@ -25,6 +25,8 @@ class JobListingRedirectSubscriber extends HttpExceptionSubscriberBase { * The configuration factory. * @param \Drupal\Core\Session\AccountInterface $currentUser * The current user. + * @param \Drupal\Core\Entity\EntityTypeManager $entityTypeManager + * The entity type manager. */ public function __construct( protected ConfigFactoryInterface $configFactory, @@ -75,19 +77,19 @@ public function on403(ExceptionEvent $event): void { /** * If trying to access non-existing translation, redirect to existing one. * - * @param ExceptionEvent $event + * @param \Symfony\Component\HttpKernel\Event\ExceptionEvent $event * The Event to process. */ public function on404(ExceptionEvent $event) : void { $uri = $event->getRequest()->getRequestUri(); $redirectPaths = [ - 'avoimet-tyopaikat/avoimet-tyopaikat/', - 'lediga-jobb/lediga-jobb/', - 'open-jobs/open-jobs/', + 'fi' => 'avoimet-tyopaikat/avoimet-tyopaikat/', + 'sv' => 'lediga-jobb/lediga-jobb/', + 'en' => 'open-jobs/open-jobs/', ]; $redirectFrom = NULL; - foreach($redirectPaths as $path) { + foreach ($redirectPaths as $path) { if (str_contains($uri, $path)) { $redirectFrom = $path; break; From 76ce2318cacb43216fbc2f68383cc772dc50400a Mon Sep 17 00:00:00 2001 From: rpnykanen Date: Thu, 14 Sep 2023 09:12:18 +0300 Subject: [PATCH 07/23] UHF-8946: updated comments --- .../src/EventSubscriber/JobListingRedirectSubscriber.php | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/public/modules/custom/helfi_rekry_content/src/EventSubscriber/JobListingRedirectSubscriber.php b/public/modules/custom/helfi_rekry_content/src/EventSubscriber/JobListingRedirectSubscriber.php index 5dca6072..c7420bc1 100644 --- a/public/modules/custom/helfi_rekry_content/src/EventSubscriber/JobListingRedirectSubscriber.php +++ b/public/modules/custom/helfi_rekry_content/src/EventSubscriber/JobListingRedirectSubscriber.php @@ -14,7 +14,7 @@ use Symfony\Component\HttpKernel\Event\ExceptionEvent; /** - * Redirect job listing 403s for anonymous users. + * Http exception event subscribers for job listings. */ class JobListingRedirectSubscriber extends HttpExceptionSubscriberBase { @@ -75,7 +75,11 @@ public function on403(ExceptionEvent $event): void { } /** - * If trying to access non-existing translation, redirect to existing one. + * The 404 exception listener. + * + * #UHF-8946 External service's automation is only capable of creating links to + * finnish job listings. If finnish translation doesn't exist the user will be + * automatically redirected to existing translation with matching job ID. * * @param \Symfony\Component\HttpKernel\Event\ExceptionEvent $event * The Event to process. From aaff2c691379f4082997064ed34ae3930216186f Mon Sep 17 00:00:00 2001 From: rpnykanen Date: Thu, 14 Sep 2023 09:15:18 +0300 Subject: [PATCH 08/23] UHF-8946: code fixes --- .../src/EventSubscriber/JobListingRedirectSubscriber.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/public/modules/custom/helfi_rekry_content/src/EventSubscriber/JobListingRedirectSubscriber.php b/public/modules/custom/helfi_rekry_content/src/EventSubscriber/JobListingRedirectSubscriber.php index c7420bc1..716cd709 100644 --- a/public/modules/custom/helfi_rekry_content/src/EventSubscriber/JobListingRedirectSubscriber.php +++ b/public/modules/custom/helfi_rekry_content/src/EventSubscriber/JobListingRedirectSubscriber.php @@ -77,7 +77,7 @@ public function on403(ExceptionEvent $event): void { /** * The 404 exception listener. * - * #UHF-8946 External service's automation is only capable of creating links to + * #UHF8946 External service's automation is only capable of creating links to * finnish job listings. If finnish translation doesn't exist the user will be * automatically redirected to existing translation with matching job ID. * From 13e0bcffaf344c6c69b324911756ef56e3c10e5e Mon Sep 17 00:00:00 2001 From: rpnykanen Date: Thu, 14 Sep 2023 11:09:41 +0300 Subject: [PATCH 09/23] UHF-8946: redirect test --- .../ExistingSite/JoblistingRedirectTest.php | 37 +++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 public/modules/custom/helfi_rekry_content/tests/dtt/src/ExistingSite/JoblistingRedirectTest.php diff --git a/public/modules/custom/helfi_rekry_content/tests/dtt/src/ExistingSite/JoblistingRedirectTest.php b/public/modules/custom/helfi_rekry_content/tests/dtt/src/ExistingSite/JoblistingRedirectTest.php new file mode 100644 index 00000000..21684351 --- /dev/null +++ b/public/modules/custom/helfi_rekry_content/tests/dtt/src/ExistingSite/JoblistingRedirectTest.php @@ -0,0 +1,37 @@ +createNode([ + 'type' => 'job_listing', + 'langcode' => 'sv', + 'title' => 'en jobb', + 'field_recruitment_id' => 'TESTI-1234-56-7890' + ]); + + $path = $node->toUrl()->toString(); + $recruitmentId = array_reverse(explode('/', $path))[0]; + + $this->drupalGet("/fi/avoimet-tyopaikat/avoimet-tyopaikat/$recruitmentId"); + + $url = $this->getSession()->getCurrentUrl(); + + $this->assertTrue(str_ends_with($url, '/sv/lediga-jobb/lediga-jobb/testi-1234-56-7890')); + } + +} From 0cc7bb19b675f35b37137ba834da23638d5be9ab Mon Sep 17 00:00:00 2001 From: rpnykanen Date: Thu, 14 Sep 2023 11:11:43 +0300 Subject: [PATCH 10/23] UHF-8946: code fixes --- .../tests/dtt/src/ExistingSite/JoblistingRedirectTest.php | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/public/modules/custom/helfi_rekry_content/tests/dtt/src/ExistingSite/JoblistingRedirectTest.php b/public/modules/custom/helfi_rekry_content/tests/dtt/src/ExistingSite/JoblistingRedirectTest.php index 21684351..c326fb70 100644 --- a/public/modules/custom/helfi_rekry_content/tests/dtt/src/ExistingSite/JoblistingRedirectTest.php +++ b/public/modules/custom/helfi_rekry_content/tests/dtt/src/ExistingSite/JoblistingRedirectTest.php @@ -21,16 +21,14 @@ public function test404Redirect(): void { 'type' => 'job_listing', 'langcode' => 'sv', 'title' => 'en jobb', - 'field_recruitment_id' => 'TESTI-1234-56-7890' + 'field_recruitment_id' => 'TESTI-1234-56-7890', ]); $path = $node->toUrl()->toString(); $recruitmentId = array_reverse(explode('/', $path))[0]; $this->drupalGet("/fi/avoimet-tyopaikat/avoimet-tyopaikat/$recruitmentId"); - $url = $this->getSession()->getCurrentUrl(); - $this->assertTrue(str_ends_with($url, '/sv/lediga-jobb/lediga-jobb/testi-1234-56-7890')); } From 3002caef25b2290e0a1d9ecd52598bd1dbee2fbd Mon Sep 17 00:00:00 2001 From: rpnykanen Date: Thu, 14 Sep 2023 12:14:00 +0300 Subject: [PATCH 11/23] UHF-8946: update & fix dtt test --- .github/workflows/test.yml | 2 +- phpunit.xml.dist | 2 +- .../tests/dtt/src/ExistingSite/JoblistingRedirectTest.php | 8 +++++--- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 975c3a4e..0684d88d 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -65,4 +65,4 @@ jobs: - name: Run PHPUnit tests run: | composer test-php public/modules/custom - [ -d "tests/" ] && composer test-php tests/ || echo "No DTT tests found. Ignoring..." + if [ -d "tests/" ]; then composer test-php tests/; else echo "No DTT tests found. Ignoring..."; fi diff --git a/phpunit.xml.dist b/phpunit.xml.dist index 603e6d95..1a56d5be 100644 --- a/phpunit.xml.dist +++ b/phpunit.xml.dist @@ -16,7 +16,7 @@ - + diff --git a/public/modules/custom/helfi_rekry_content/tests/dtt/src/ExistingSite/JoblistingRedirectTest.php b/public/modules/custom/helfi_rekry_content/tests/dtt/src/ExistingSite/JoblistingRedirectTest.php index c326fb70..387224c1 100644 --- a/public/modules/custom/helfi_rekry_content/tests/dtt/src/ExistingSite/JoblistingRedirectTest.php +++ b/public/modules/custom/helfi_rekry_content/tests/dtt/src/ExistingSite/JoblistingRedirectTest.php @@ -4,14 +4,16 @@ namespace Drupal\helfi_rekry_content\Tests\dtt\src\ExistingSite; -use weitzman\DrupalTestTraits\ExistingSiteBase; + + +use Drupal\Tests\helfi_api_base\Functional\ExistingSiteTestBase; /** * Test job listing redirect. * * @group dtt */ -class JoblistingRedirectTest extends ExistingSiteBase { +class JoblistingRedirectTest extends ExistingSiteTestBase { /** * Test job listing 404 redirect. @@ -27,7 +29,7 @@ public function test404Redirect(): void { $path = $node->toUrl()->toString(); $recruitmentId = array_reverse(explode('/', $path))[0]; - $this->drupalGet("/fi/avoimet-tyopaikat/avoimet-tyopaikat/$recruitmentId"); + $this->drupalGetWithLanguage("/fi/avoimet-tyopaikat/avoimet-tyopaikat/$recruitmentId", 'fi'); $url = $this->getSession()->getCurrentUrl(); $this->assertTrue(str_ends_with($url, '/sv/lediga-jobb/lediga-jobb/testi-1234-56-7890')); } From 62c439d18ae39f983ef33520e7a004b2977a26e0 Mon Sep 17 00:00:00 2001 From: rpnykanen Date: Thu, 14 Sep 2023 12:14:42 +0300 Subject: [PATCH 12/23] UHF-8946: updated api base to have working tests in this pr --- composer.lock | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/composer.lock b/composer.lock index 6d6cc1a8..e9acffc9 100644 --- a/composer.lock +++ b/composer.lock @@ -3931,16 +3931,16 @@ }, { "name": "drupal/helfi_api_base", - "version": "2.5.2", + "version": "2.5.4", "source": { "type": "git", "url": "https://github.com/City-of-Helsinki/drupal-module-helfi-api-base.git", - "reference": "10f5700e4c38c403d2cc54d2733cadaff72d67c1" + "reference": "2a0a4fb2ea863232dc3eed32a3e8104fdffab178" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/City-of-Helsinki/drupal-module-helfi-api-base/zipball/10f5700e4c38c403d2cc54d2733cadaff72d67c1", - "reference": "10f5700e4c38c403d2cc54d2733cadaff72d67c1", + "url": "https://api.github.com/repos/City-of-Helsinki/drupal-module-helfi-api-base/zipball/2a0a4fb2ea863232dc3eed32a3e8104fdffab178", + "reference": "2a0a4fb2ea863232dc3eed32a3e8104fdffab178", "shasum": "" }, "require": { @@ -3966,10 +3966,10 @@ ], "description": "Helfi - API Base", "support": { - "source": "https://github.com/City-of-Helsinki/drupal-module-helfi-api-base/tree/2.5.2", + "source": "https://github.com/City-of-Helsinki/drupal-module-helfi-api-base/tree/2.5.4", "issues": "https://github.com/City-of-Helsinki/drupal-module-helfi-api-base/issues" }, - "time": "2023-09-08T09:03:20+00:00" + "time": "2023-09-14T09:11:02+00:00" }, { "name": "drupal/helfi_azure_fs", From bb823de706431845c2aef38fab137354671bfc91 Mon Sep 17 00:00:00 2001 From: rpnykanen Date: Thu, 14 Sep 2023 12:35:04 +0300 Subject: [PATCH 13/23] UHF-8946: conflict merge fix --- composer.lock | 4 ---- 1 file changed, 4 deletions(-) diff --git a/composer.lock b/composer.lock index a24be67c..93d642d4 100644 --- a/composer.lock +++ b/composer.lock @@ -3970,10 +3970,6 @@ "issues": "https://github.com/City-of-Helsinki/drupal-module-helfi-api-base/issues" }, "time": "2023-09-14T09:11:02+00:00" - "source": "https://github.com/City-of-Helsinki/drupal-module-helfi-api-base/tree/2.5.3", - "issues": "https://github.com/City-of-Helsinki/drupal-module-helfi-api-base/issues" - }, - "time": "2023-09-13T05:29:57+00:00" }, { "name": "drupal/helfi_azure_fs", From b1220351399439d93956c18e75a408cf08d7ba12 Mon Sep 17 00:00:00 2001 From: rpnykanen Date: Thu, 14 Sep 2023 12:40:59 +0300 Subject: [PATCH 14/23] UHF-8946: code fixes --- .../tests/dtt/src/ExistingSite/JoblistingRedirectTest.php | 2 -- 1 file changed, 2 deletions(-) diff --git a/public/modules/custom/helfi_rekry_content/tests/dtt/src/ExistingSite/JoblistingRedirectTest.php b/public/modules/custom/helfi_rekry_content/tests/dtt/src/ExistingSite/JoblistingRedirectTest.php index 387224c1..64aaa966 100644 --- a/public/modules/custom/helfi_rekry_content/tests/dtt/src/ExistingSite/JoblistingRedirectTest.php +++ b/public/modules/custom/helfi_rekry_content/tests/dtt/src/ExistingSite/JoblistingRedirectTest.php @@ -4,8 +4,6 @@ namespace Drupal\helfi_rekry_content\Tests\dtt\src\ExistingSite; - - use Drupal\Tests\helfi_api_base\Functional\ExistingSiteTestBase; /** From 7307a5ab92863d857db02408096c0dba6dd3de82 Mon Sep 17 00:00:00 2001 From: tuutti Date: Mon, 18 Sep 2023 11:00:34 +0300 Subject: [PATCH 15/23] UHF-8527: Start PubSub cron --- docker/openshift/crons/base.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/docker/openshift/crons/base.sh b/docker/openshift/crons/base.sh index e42f5b5b..a45e411f 100644 --- a/docker/openshift/crons/base.sh +++ b/docker/openshift/crons/base.sh @@ -27,6 +27,7 @@ exec "/crons/content-scheduler.sh" & # Job listing migration cron exec "/crons/migrate-job-listings.sh" & exec "/crons/migrate-changed-job-listings.sh" & +exec "/crons/pubsub.sh" & while true do From ce03ce29dc7426f5d59d37399db16b902f7e5a7d Mon Sep 17 00:00:00 2001 From: Jussi Leskinen Date: Wed, 20 Sep 2023 15:22:18 +0300 Subject: [PATCH 16/23] UHF-8948: Remove tokenizer and field boost processors from job_listing index as those are not used and Elastic 8 doesn't support index time boosting. --- conf/cmi/search_api.index.job_listings.yml | 13 ------------- 1 file changed, 13 deletions(-) diff --git a/conf/cmi/search_api.index.job_listings.yml b/conf/cmi/search_api.index.job_listings.yml index ed582647..61e82246 100644 --- a/conf/cmi/search_api.index.job_listings.yml +++ b/conf/cmi/search_api.index.job_listings.yml @@ -268,7 +268,6 @@ field_settings: datasource_id: 'entity:node' property_path: title type: text - boost: !!float 2 dependencies: module: - node @@ -335,24 +334,12 @@ processor_settings: - field_recruitment_id - field_search_id - langcode - - title language_with_fallback: { } - number_field_boost: - weights: - preprocess_index: 0 - boosts: { } project_execution_schedule: { } project_image_absolute_url: { } project_plan_schedule: { } rendered_item: { } reverse_entity_references: { } - tokenizer: - all_fields: false - fields: { } - spaces: '' - ignored: ._- - overlap_cjk: 1 - minimum_word_size: '3' tracker_settings: default: indexing_order: fifo From d0742410b9c758f0faf6aba93b3f69d859e30d73 Mon Sep 17 00:00:00 2001 From: actions-bot Date: Mon, 25 Sep 2023 07:31:23 +0000 Subject: [PATCH 17/23] Update configuration --- composer.lock | 122 +++++++++---------- conf/cmi/helfi_api_base.delete_revisions.yml | 6 + docker-compose.yml | 16 --- phpunit.xml.dist | 4 + 4 files changed, 71 insertions(+), 77 deletions(-) create mode 100644 conf/cmi/helfi_api_base.delete_revisions.yml diff --git a/composer.lock b/composer.lock index 93d642d4..e8de79e6 100644 --- a/composer.lock +++ b/composer.lock @@ -2035,16 +2035,16 @@ }, { "name": "drupal/core", - "version": "9.5.10", + "version": "9.5.11", "source": { "type": "git", "url": "https://github.com/drupal/core.git", - "reference": "c84bab7403943fbc4ed90ffcdde4460a94642b06" + "reference": "8afcb233c2a71501b35fed2713167c37831d5c19" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/drupal/core/zipball/c84bab7403943fbc4ed90ffcdde4460a94642b06", - "reference": "c84bab7403943fbc4ed90ffcdde4460a94642b06", + "url": "https://api.github.com/repos/drupal/core/zipball/8afcb233c2a71501b35fed2713167c37831d5c19", + "reference": "8afcb233c2a71501b35fed2713167c37831d5c19", "shasum": "" }, "require": { @@ -2196,9 +2196,9 @@ ], "description": "Drupal is an open source content management platform powering millions of websites and applications.", "support": { - "source": "https://github.com/drupal/core/tree/9.5.10" + "source": "https://github.com/drupal/core/tree/9.5.11" }, - "time": "2023-07-05T09:26:59+00:00" + "time": "2023-09-19T17:58:28+00:00" }, { "name": "drupal/core-composer-scaffold", @@ -3812,16 +3812,16 @@ }, { "name": "drupal/hdbt", - "version": "5.6.1", + "version": "5.6.8", "source": { "type": "git", "url": "https://github.com/City-of-Helsinki/drupal-hdbt.git", - "reference": "d4eeff38bc61f431613c8fa9a4d92a8755f66b09" + "reference": "e8a3b4554e0d87a35cb49aba4c1f581c47fbbd2a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/City-of-Helsinki/drupal-hdbt/zipball/d4eeff38bc61f431613c8fa9a4d92a8755f66b09", - "reference": "d4eeff38bc61f431613c8fa9a4d92a8755f66b09", + "url": "https://api.github.com/repos/City-of-Helsinki/drupal-hdbt/zipball/e8a3b4554e0d87a35cb49aba4c1f581c47fbbd2a", + "reference": "e8a3b4554e0d87a35cb49aba4c1f581c47fbbd2a", "shasum": "" }, "require": { @@ -3839,10 +3839,10 @@ "Drupal" ], "support": { - "source": "https://github.com/City-of-Helsinki/drupal-hdbt/tree/5.6.1", + "source": "https://github.com/City-of-Helsinki/drupal-hdbt/tree/5.6.8", "issues": "https://github.com/City-of-Helsinki/drupal-hdbt/issues" }, - "time": "2023-09-11T12:42:43+00:00" + "time": "2023-09-22T10:02:05+00:00" }, { "name": "drupal/hdbt_admin", @@ -3931,16 +3931,16 @@ }, { "name": "drupal/helfi_api_base", - "version": "2.5.4", + "version": "2.5.5", "source": { "type": "git", "url": "https://github.com/City-of-Helsinki/drupal-module-helfi-api-base.git", - "reference": "2a0a4fb2ea863232dc3eed32a3e8104fdffab178" + "reference": "7ffd5b029f1d85590dc8966007f3936f14cb3c35" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/City-of-Helsinki/drupal-module-helfi-api-base/zipball/2a0a4fb2ea863232dc3eed32a3e8104fdffab178", - "reference": "2a0a4fb2ea863232dc3eed32a3e8104fdffab178", + "url": "https://api.github.com/repos/City-of-Helsinki/drupal-module-helfi-api-base/zipball/7ffd5b029f1d85590dc8966007f3936f14cb3c35", + "reference": "7ffd5b029f1d85590dc8966007f3936f14cb3c35", "shasum": "" }, "require": { @@ -3966,10 +3966,10 @@ ], "description": "Helfi - API Base", "support": { - "source": "https://github.com/City-of-Helsinki/drupal-module-helfi-api-base/tree/2.5.4", + "source": "https://github.com/City-of-Helsinki/drupal-module-helfi-api-base/tree/2.5.5", "issues": "https://github.com/City-of-Helsinki/drupal-module-helfi-api-base/issues" }, - "time": "2023-09-14T09:11:02+00:00" + "time": "2023-09-18T06:55:18+00:00" }, { "name": "drupal/helfi_azure_fs", @@ -4016,12 +4016,12 @@ "source": { "type": "git", "url": "https://github.com/City-of-Helsinki/drupal-tools.git", - "reference": "0ebc9e72b92b37fa37bd3eb003c4f4d0db329bfa" + "reference": "640edf67a34bf37e44c24b75e45e946c7ddb8ef0" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/City-of-Helsinki/drupal-tools/zipball/0ebc9e72b92b37fa37bd3eb003c4f4d0db329bfa", - "reference": "0ebc9e72b92b37fa37bd3eb003c4f4d0db329bfa", + "url": "https://api.github.com/repos/City-of-Helsinki/drupal-tools/zipball/640edf67a34bf37e44c24b75e45e946c7ddb8ef0", + "reference": "640edf67a34bf37e44c24b75e45e946c7ddb8ef0", "shasum": "" }, "default-branch": true, @@ -4034,20 +4034,20 @@ "source": "https://github.com/City-of-Helsinki/drupal-tools/tree/main", "issues": "https://github.com/City-of-Helsinki/drupal-tools/issues" }, - "time": "2023-09-06T06:27:11+00:00" + "time": "2023-09-19T05:58:55+00:00" }, { "name": "drupal/helfi_navigation", - "version": "2.0.13", + "version": "2.1.1", "source": { "type": "git", "url": "https://github.com/City-of-Helsinki/drupal-module-helfi-navigation.git", - "reference": "c2497e87c7b4242354c323aad5c21ec09e37d3a7" + "reference": "5c0f648a21220a6e8b6c14543f8e60b4b843a918" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/City-of-Helsinki/drupal-module-helfi-navigation/zipball/c2497e87c7b4242354c323aad5c21ec09e37d3a7", - "reference": "c2497e87c7b4242354c323aad5c21ec09e37d3a7", + "url": "https://api.github.com/repos/City-of-Helsinki/drupal-module-helfi-navigation/zipball/5c0f648a21220a6e8b6c14543f8e60b4b843a918", + "reference": "5c0f648a21220a6e8b6c14543f8e60b4b843a918", "shasum": "" }, "require": { @@ -4065,23 +4065,23 @@ ], "description": "Helfi - Navigation", "support": { - "source": "https://github.com/City-of-Helsinki/drupal-module-helfi-navigation/tree/2.0.13", + "source": "https://github.com/City-of-Helsinki/drupal-module-helfi-navigation/tree/2.1.1", "issues": "https://github.com/City-of-Helsinki/drupal-module-helfi-navigation/issues" }, - "time": "2023-09-13T05:51:44+00:00" + "time": "2023-09-21T08:34:22+00:00" }, { "name": "drupal/helfi_platform_config", - "version": "3.4.5", + "version": "3.4.14", "source": { "type": "git", "url": "https://github.com/City-of-Helsinki/drupal-helfi-platform-config.git", - "reference": "90394a0feab45409ed2c2101ef3d48c02906714e" + "reference": "f3a9eff8df01870a1b3124a87465ae62bb7c47ba" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/City-of-Helsinki/drupal-helfi-platform-config/zipball/90394a0feab45409ed2c2101ef3d48c02906714e", - "reference": "90394a0feab45409ed2c2101ef3d48c02906714e", + "url": "https://api.github.com/repos/City-of-Helsinki/drupal-helfi-platform-config/zipball/f3a9eff8df01870a1b3124a87465ae62bb7c47ba", + "reference": "f3a9eff8df01870a1b3124a87465ae62bb7c47ba", "shasum": "" }, "require": { @@ -4184,10 +4184,10 @@ ], "description": "HELfi platform config", "support": { - "source": "https://github.com/City-of-Helsinki/drupal-helfi-platform-config/tree/3.4.5", + "source": "https://github.com/City-of-Helsinki/drupal-helfi-platform-config/tree/3.4.14", "issues": "https://github.com/City-of-Helsinki/drupal-helfi-platform-config/issues" }, - "time": "2023-09-13T06:57:57+00:00" + "time": "2023-09-25T07:25:21+00:00" }, { "name": "drupal/helfi_proxy", @@ -4235,16 +4235,16 @@ }, { "name": "drupal/helfi_tpr", - "version": "2.2.6", + "version": "2.2.7", "source": { "type": "git", "url": "https://github.com/City-of-Helsinki/drupal-module-helfi-tpr.git", - "reference": "f73c27c4d30522303dfadf1228c7331e120f04ac" + "reference": "68a4e65acffc2038e5006f1d4b2763bc52017184" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/City-of-Helsinki/drupal-module-helfi-tpr/zipball/f73c27c4d30522303dfadf1228c7331e120f04ac", - "reference": "f73c27c4d30522303dfadf1228c7331e120f04ac", + "url": "https://api.github.com/repos/City-of-Helsinki/drupal-module-helfi-tpr/zipball/68a4e65acffc2038e5006f1d4b2763bc52017184", + "reference": "68a4e65acffc2038e5006f1d4b2763bc52017184", "shasum": "" }, "require": { @@ -4270,10 +4270,10 @@ ], "description": "TPR integration", "support": { - "source": "https://github.com/City-of-Helsinki/drupal-module-helfi-tpr/tree/2.2.6", + "source": "https://github.com/City-of-Helsinki/drupal-module-helfi-tpr/tree/2.2.7", "issues": "https://github.com/City-of-Helsinki/drupal-module-helfi-tpr/issues" }, - "time": "2023-09-01T12:09:30+00:00" + "time": "2023-09-14T11:48:29+00:00" }, { "name": "drupal/helfi_tunnistamo", @@ -8129,30 +8129,30 @@ }, { "name": "laminas/laminas-stdlib", - "version": "3.17.0", + "version": "3.18.0", "source": { "type": "git", "url": "https://github.com/laminas/laminas-stdlib.git", - "reference": "dd35c868075bad80b6718959740913e178eb4274" + "reference": "e85b29076c6216e7fc98e72b42dbe1bbc3b95ecf" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/laminas/laminas-stdlib/zipball/dd35c868075bad80b6718959740913e178eb4274", - "reference": "dd35c868075bad80b6718959740913e178eb4274", + "url": "https://api.github.com/repos/laminas/laminas-stdlib/zipball/e85b29076c6216e7fc98e72b42dbe1bbc3b95ecf", + "reference": "e85b29076c6216e7fc98e72b42dbe1bbc3b95ecf", "shasum": "" }, "require": { - "php": "~8.1.0 || ~8.2.0" + "php": "~8.1.0 || ~8.2.0 || ~8.3.0" }, "conflict": { "zendframework/zend-stdlib": "*" }, "require-dev": { "laminas/laminas-coding-standard": "^2.5", - "phpbench/phpbench": "^1.2.9", - "phpunit/phpunit": "^10.0.16", + "phpbench/phpbench": "^1.2.14", + "phpunit/phpunit": "^10.3.3", "psalm/plugin-phpunit": "^0.18.4", - "vimeo/psalm": "^5.8" + "vimeo/psalm": "^5.15.0" }, "type": "library", "autoload": { @@ -8184,7 +8184,7 @@ "type": "community_bridge" } ], - "time": "2023-03-20T13:51:37+00:00" + "time": "2023-09-19T10:15:21+00:00" }, { "name": "league/container", @@ -10082,16 +10082,16 @@ }, { "name": "psr/http-client", - "version": "1.0.2", + "version": "1.0.3", "source": { "type": "git", "url": "https://github.com/php-fig/http-client.git", - "reference": "0955afe48220520692d2d09f7ab7e0f93ffd6a31" + "reference": "bb5906edc1c324c9a05aa0873d40117941e5fa90" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/php-fig/http-client/zipball/0955afe48220520692d2d09f7ab7e0f93ffd6a31", - "reference": "0955afe48220520692d2d09f7ab7e0f93ffd6a31", + "url": "https://api.github.com/repos/php-fig/http-client/zipball/bb5906edc1c324c9a05aa0873d40117941e5fa90", + "reference": "bb5906edc1c324c9a05aa0873d40117941e5fa90", "shasum": "" }, "require": { @@ -10128,9 +10128,9 @@ "psr-18" ], "support": { - "source": "https://github.com/php-fig/http-client/tree/1.0.2" + "source": "https://github.com/php-fig/http-client" }, - "time": "2023-04-10T20:12:12+00:00" + "time": "2023-09-23T14:17:50+00:00" }, { "name": "psr/http-factory", @@ -15972,16 +15972,16 @@ }, { "name": "phpstan/phpdoc-parser", - "version": "1.24.0", + "version": "1.24.1", "source": { "type": "git", "url": "https://github.com/phpstan/phpdoc-parser.git", - "reference": "3510b0a6274cc42f7219367cb3abfc123ffa09d6" + "reference": "9f854d275c2dbf84915a5c0ec9a2d17d2cd86b01" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpstan/phpdoc-parser/zipball/3510b0a6274cc42f7219367cb3abfc123ffa09d6", - "reference": "3510b0a6274cc42f7219367cb3abfc123ffa09d6", + "url": "https://api.github.com/repos/phpstan/phpdoc-parser/zipball/9f854d275c2dbf84915a5c0ec9a2d17d2cd86b01", + "reference": "9f854d275c2dbf84915a5c0ec9a2d17d2cd86b01", "shasum": "" }, "require": { @@ -16013,9 +16013,9 @@ "description": "PHPDoc parser with support for nullable, intersection and generic types", "support": { "issues": "https://github.com/phpstan/phpdoc-parser/issues", - "source": "https://github.com/phpstan/phpdoc-parser/tree/1.24.0" + "source": "https://github.com/phpstan/phpdoc-parser/tree/1.24.1" }, - "time": "2023-09-07T20:46:32+00:00" + "time": "2023-09-18T12:18:02+00:00" }, { "name": "phpstan/phpstan", diff --git a/conf/cmi/helfi_api_base.delete_revisions.yml b/conf/cmi/helfi_api_base.delete_revisions.yml new file mode 100644 index 00000000..6955f667 --- /dev/null +++ b/conf/cmi/helfi_api_base.delete_revisions.yml @@ -0,0 +1,6 @@ +entity_types: + - node + - paragraph + - tpr_unit + - tpr_service + - tpr_errand_service diff --git a/docker-compose.yml b/docker-compose.yml index e8b20509..c9be64c7 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -82,22 +82,6 @@ services: - "traefik.http.routers.${COMPOSE_PROJECT_NAME}-varnish.tls=true" - "traefik.http.services.${COMPOSE_PROJECT_NAME}-varnish.loadbalancer.server.port=6081" - "traefik.docker.network=stonehenge-network" - robo: - image: ghcr.io/city-of-helsinki/drupal-robo:latest - shm_size: '2gb' - tty: true - volumes: - - .:/app:delegated - networks: - - internal - - stonehenge-network - depends_on: - - app - profiles: - - testing - extra_hosts: - - "${DRUPAL_HOSTNAME}:host-gateway" - - "varnish-${DRUPAL_HOSTNAME}:host-gateway" networks: internal: external: false diff --git a/phpunit.xml.dist b/phpunit.xml.dist index 1a56d5be..0ae082a9 100644 --- a/phpunit.xml.dist +++ b/phpunit.xml.dist @@ -41,9 +41,13 @@ ./tests/dtt/src/ExistingSite + ./public/modules/custom/*/tests/src/ExistingSite + ./public/modules/contrib/*/tests/src/ExistingSite ./tests/dtt/src/ExistingSiteJavascript + ./public/modules/custom/*/tests/src/ExistingSiteJavascript + ./public/modules/contrib/*/tests/src/ExistingSiteJavascript From 76cfa13ca29db10f980374157bcfdf92d61eb721 Mon Sep 17 00:00:00 2001 From: actions-bot Date: Mon, 25 Sep 2023 12:29:37 +0000 Subject: [PATCH 18/23] Update configuration --- composer.lock | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/composer.lock b/composer.lock index e8de79e6..80bcc44e 100644 --- a/composer.lock +++ b/composer.lock @@ -3812,16 +3812,16 @@ }, { "name": "drupal/hdbt", - "version": "5.6.8", + "version": "5.6.10", "source": { "type": "git", "url": "https://github.com/City-of-Helsinki/drupal-hdbt.git", - "reference": "e8a3b4554e0d87a35cb49aba4c1f581c47fbbd2a" + "reference": "c811827bc4ccf10b6d2312902f9821172d7b8b48" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/City-of-Helsinki/drupal-hdbt/zipball/e8a3b4554e0d87a35cb49aba4c1f581c47fbbd2a", - "reference": "e8a3b4554e0d87a35cb49aba4c1f581c47fbbd2a", + "url": "https://api.github.com/repos/City-of-Helsinki/drupal-hdbt/zipball/c811827bc4ccf10b6d2312902f9821172d7b8b48", + "reference": "c811827bc4ccf10b6d2312902f9821172d7b8b48", "shasum": "" }, "require": { @@ -3839,10 +3839,10 @@ "Drupal" ], "support": { - "source": "https://github.com/City-of-Helsinki/drupal-hdbt/tree/5.6.8", + "source": "https://github.com/City-of-Helsinki/drupal-hdbt/tree/5.6.10", "issues": "https://github.com/City-of-Helsinki/drupal-hdbt/issues" }, - "time": "2023-09-22T10:02:05+00:00" + "time": "2023-09-25T12:26:46+00:00" }, { "name": "drupal/hdbt_admin", From ff47aa86dd27eed358eeda104ee1d85c08229577 Mon Sep 17 00:00:00 2001 From: mmyllynen <4696381+dire@users.noreply.github.com> Date: Tue, 26 Sep 2023 08:06:17 +0300 Subject: [PATCH 19/23] UHF-8702: Switched the code to 410 on unpublished job listings. --- .../src/EventSubscriber/JobListingRedirectSubscriber.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/public/modules/custom/helfi_rekry_content/src/EventSubscriber/JobListingRedirectSubscriber.php b/public/modules/custom/helfi_rekry_content/src/EventSubscriber/JobListingRedirectSubscriber.php index 716cd709..618668dc 100644 --- a/public/modules/custom/helfi_rekry_content/src/EventSubscriber/JobListingRedirectSubscriber.php +++ b/public/modules/custom/helfi_rekry_content/src/EventSubscriber/JobListingRedirectSubscriber.php @@ -69,8 +69,9 @@ public function on403(ExceptionEvent $event): void { $url = Url::fromRoute('entity.node.canonical', ['node' => $redirectNode])->toString(); - // Set temporary redirect. - $response = new TrustedRedirectResponse($url, 307); + // Set status code to 410. + $response = new TrustedRedirectResponse($url); + $response->setStatusCode(410); $event->setResponse($response); } From c724fafc24d6db1dc471d176124d2ddaf1226ffe Mon Sep 17 00:00:00 2001 From: actions-bot Date: Tue, 26 Sep 2023 09:53:25 +0000 Subject: [PATCH 20/23] Update configuration --- composer.lock | 32 +++++++++---------- ...field_override.node.announcement.title.yml | 20 ++++++++++++ ...form_display.node.announcement.default.yml | 27 ++++++++++------ ...view_display.node.announcement.default.yml | 11 ++++++- ..._view_display.node.announcement.teaser.yml | 4 ++- ...ternal_entity_type.helfi_announcements.yml | 6 ++-- ....announcement.field_announcement_title.yml | 21 ++++++++++++ ....storage.node.field_announcement_title.yml | 23 +++++++++++++ ....announcement.field_announcement_title.yml | 2 ++ 9 files changed, 117 insertions(+), 29 deletions(-) create mode 100644 conf/cmi/core.base_field_override.node.announcement.title.yml create mode 100644 conf/cmi/field.field.node.announcement.field_announcement_title.yml create mode 100644 conf/cmi/field.storage.node.field_announcement_title.yml create mode 100644 conf/cmi/language/fi/field.field.node.announcement.field_announcement_title.yml diff --git a/composer.lock b/composer.lock index 80bcc44e..265098c9 100644 --- a/composer.lock +++ b/composer.lock @@ -3812,16 +3812,16 @@ }, { "name": "drupal/hdbt", - "version": "5.6.10", + "version": "5.6.12", "source": { "type": "git", "url": "https://github.com/City-of-Helsinki/drupal-hdbt.git", - "reference": "c811827bc4ccf10b6d2312902f9821172d7b8b48" + "reference": "c24eecd637d0373f9da2bcc01336feee376fcaf1" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/City-of-Helsinki/drupal-hdbt/zipball/c811827bc4ccf10b6d2312902f9821172d7b8b48", - "reference": "c811827bc4ccf10b6d2312902f9821172d7b8b48", + "url": "https://api.github.com/repos/City-of-Helsinki/drupal-hdbt/zipball/c24eecd637d0373f9da2bcc01336feee376fcaf1", + "reference": "c24eecd637d0373f9da2bcc01336feee376fcaf1", "shasum": "" }, "require": { @@ -3839,10 +3839,10 @@ "Drupal" ], "support": { - "source": "https://github.com/City-of-Helsinki/drupal-hdbt/tree/5.6.10", + "source": "https://github.com/City-of-Helsinki/drupal-hdbt/tree/5.6.12", "issues": "https://github.com/City-of-Helsinki/drupal-hdbt/issues" }, - "time": "2023-09-25T12:26:46+00:00" + "time": "2023-09-26T09:47:13+00:00" }, { "name": "drupal/hdbt_admin", @@ -4016,12 +4016,12 @@ "source": { "type": "git", "url": "https://github.com/City-of-Helsinki/drupal-tools.git", - "reference": "640edf67a34bf37e44c24b75e45e946c7ddb8ef0" + "reference": "8dfd9dda99f0934070119547e7f950d3f90a9ebc" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/City-of-Helsinki/drupal-tools/zipball/640edf67a34bf37e44c24b75e45e946c7ddb8ef0", - "reference": "640edf67a34bf37e44c24b75e45e946c7ddb8ef0", + "url": "https://api.github.com/repos/City-of-Helsinki/drupal-tools/zipball/8dfd9dda99f0934070119547e7f950d3f90a9ebc", + "reference": "8dfd9dda99f0934070119547e7f950d3f90a9ebc", "shasum": "" }, "default-branch": true, @@ -4034,7 +4034,7 @@ "source": "https://github.com/City-of-Helsinki/drupal-tools/tree/main", "issues": "https://github.com/City-of-Helsinki/drupal-tools/issues" }, - "time": "2023-09-19T05:58:55+00:00" + "time": "2023-09-26T09:45:28+00:00" }, { "name": "drupal/helfi_navigation", @@ -4072,16 +4072,16 @@ }, { "name": "drupal/helfi_platform_config", - "version": "3.4.14", + "version": "3.4.15", "source": { "type": "git", "url": "https://github.com/City-of-Helsinki/drupal-helfi-platform-config.git", - "reference": "f3a9eff8df01870a1b3124a87465ae62bb7c47ba" + "reference": "4c85285f69a08e58e04f9da7e27e410881793896" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/City-of-Helsinki/drupal-helfi-platform-config/zipball/f3a9eff8df01870a1b3124a87465ae62bb7c47ba", - "reference": "f3a9eff8df01870a1b3124a87465ae62bb7c47ba", + "url": "https://api.github.com/repos/City-of-Helsinki/drupal-helfi-platform-config/zipball/4c85285f69a08e58e04f9da7e27e410881793896", + "reference": "4c85285f69a08e58e04f9da7e27e410881793896", "shasum": "" }, "require": { @@ -4184,10 +4184,10 @@ ], "description": "HELfi platform config", "support": { - "source": "https://github.com/City-of-Helsinki/drupal-helfi-platform-config/tree/3.4.14", + "source": "https://github.com/City-of-Helsinki/drupal-helfi-platform-config/tree/3.4.15", "issues": "https://github.com/City-of-Helsinki/drupal-helfi-platform-config/issues" }, - "time": "2023-09-25T07:25:21+00:00" + "time": "2023-09-26T09:47:18+00:00" }, { "name": "drupal/helfi_proxy", diff --git a/conf/cmi/core.base_field_override.node.announcement.title.yml b/conf/cmi/core.base_field_override.node.announcement.title.yml new file mode 100644 index 00000000..0e175083 --- /dev/null +++ b/conf/cmi/core.base_field_override.node.announcement.title.yml @@ -0,0 +1,20 @@ +uuid: f73a43d3-1103-44c8-9cfd-42b87fbed589 +langcode: en +status: true +dependencies: + config: + - node.type.announcement +_core: + default_config_hash: v0rg9ztfYRnKz2PXAcGD_Q52rTcPbwqaZLw3tXWd4rM +id: node.announcement.title +field_name: title +entity_type: node +bundle: announcement +label: 'Administrative title' +description: '' +required: true +translatable: true +default_value: { } +default_value_callback: '' +settings: { } +field_type: string diff --git a/conf/cmi/core.entity_form_display.node.announcement.default.yml b/conf/cmi/core.entity_form_display.node.announcement.default.yml index f6ea6adc..b9dd98da 100644 --- a/conf/cmi/core.entity_form_display.node.announcement.default.yml +++ b/conf/cmi/core.entity_form_display.node.announcement.default.yml @@ -7,6 +7,7 @@ dependencies: - field.field.node.announcement.field_announcement_all_pages - field.field.node.announcement.field_announcement_content_pages - field.field.node.announcement.field_announcement_link + - field.field.node.announcement.field_announcement_title - field.field.node.announcement.field_announcement_type - node.type.announcement module: @@ -18,7 +19,7 @@ dependencies: - select2 - text _core: - default_config_hash: le2Wzlas0qZ9Bj-o6WlJbHDeisFrucs9F4B3VOK8t_w + default_config_hash: 0ewsu2ZhpNhAo4t7wkUgEa9ABQAkcsF7IXtR-kFeDUg id: node.announcement.default targetEntityType: node bundle: announcement @@ -26,7 +27,7 @@ mode: default content: body: type: text_textarea_with_summary - weight: 15 + weight: 18 region: content settings: rows: 9 @@ -42,14 +43,14 @@ content: third_party_settings: { } field_announcement_all_pages: type: boolean_checkbox - weight: 11 + weight: 13 region: content settings: display_label: true third_party_settings: { } field_announcement_content_pages: type: select2_entity_reference - weight: 12 + weight: 14 region: content settings: width: 100% @@ -59,7 +60,7 @@ content: third_party_settings: { } field_announcement_link: type: link_default - weight: 16 + weight: 19 region: content settings: placeholder_url: '' @@ -67,7 +68,7 @@ content: third_party_settings: { } field_announcement_service_pages: type: select2_entity_reference - weight: 14 + weight: 16 region: content settings: width: 100% @@ -75,16 +76,24 @@ content: match_operator: CONTAINS match_limit: 20 third_party_settings: { } + field_announcement_title: + type: string_textfield + weight: 17 + region: content + settings: + size: 60 + placeholder: '' + third_party_settings: { } field_announcement_type: type: select2 - weight: 10 + weight: 11 region: content settings: width: 100% third_party_settings: { } field_announcement_unit_pages: type: select2_entity_reference - weight: 13 + weight: 15 region: content settings: width: 100% @@ -123,7 +132,7 @@ content: settings: { } third_party_settings: { } simple_sitemap: - weight: 10 + weight: 12 region: content settings: { } third_party_settings: { } diff --git a/conf/cmi/core.entity_view_display.node.announcement.default.yml b/conf/cmi/core.entity_view_display.node.announcement.default.yml index 0f463e40..6c4463aa 100644 --- a/conf/cmi/core.entity_view_display.node.announcement.default.yml +++ b/conf/cmi/core.entity_view_display.node.announcement.default.yml @@ -7,6 +7,7 @@ dependencies: - field.field.node.announcement.field_announcement_all_pages - field.field.node.announcement.field_announcement_content_pages - field.field.node.announcement.field_announcement_link + - field.field.node.announcement.field_announcement_title - field.field.node.announcement.field_announcement_type - node.type.announcement module: @@ -15,7 +16,7 @@ dependencies: - text - user _core: - default_config_hash: IHF-sP4Gq6tdTyWDxQDDEdLbHz3-QzklMNE1QA2mQU0 + default_config_hash: LQ9K_wCbd758UCcNEORQvFUQ7gNJddkukiwwYHrZv4c id: node.announcement.default targetEntityType: node bundle: announcement @@ -40,6 +41,14 @@ content: third_party_settings: { } weight: 3 region: content + field_announcement_title: + type: string + label: hidden + settings: + link_to_entity: false + third_party_settings: { } + weight: 4 + region: content field_announcement_type: type: list_default label: hidden diff --git a/conf/cmi/core.entity_view_display.node.announcement.teaser.yml b/conf/cmi/core.entity_view_display.node.announcement.teaser.yml index 6aaf4d5e..1531031d 100644 --- a/conf/cmi/core.entity_view_display.node.announcement.teaser.yml +++ b/conf/cmi/core.entity_view_display.node.announcement.teaser.yml @@ -8,13 +8,14 @@ dependencies: - field.field.node.announcement.field_announcement_all_pages - field.field.node.announcement.field_announcement_content_pages - field.field.node.announcement.field_announcement_link + - field.field.node.announcement.field_announcement_title - field.field.node.announcement.field_announcement_type - node.type.announcement module: - text - user _core: - default_config_hash: FhIJpRvY90w782EYtR2V2Yfppyglwp191xkVdXEEbbM + default_config_hash: OwH532HYBVjDOUW0iJnoDWc2yFGZwwGJnAZEmZPjLCA id: node.announcement.teaser targetEntityType: node bundle: announcement @@ -38,6 +39,7 @@ hidden: field_announcement_content_pages: true field_announcement_link: true field_announcement_service_pages: true + field_announcement_title: true field_announcement_type: true field_announcement_unit_pages: true langcode: true diff --git a/conf/cmi/external_entities.external_entity_type.helfi_announcements.yml b/conf/cmi/external_entities.external_entity_type.helfi_announcements.yml index 5fbdb31c..84b02800 100644 --- a/conf/cmi/external_entities.external_entity_type.helfi_announcements.yml +++ b/conf/cmi/external_entities.external_entity_type.helfi_announcements.yml @@ -3,13 +3,13 @@ langcode: en status: true dependencies: { } _core: - default_config_hash: XBOd0Lfy5FpXJkeuZi75vBaT7ffFCENINrui5kCVygo + default_config_hash: ZjzZvHTvsEfBX_dhlTXEZmLbS_ELM5uV7xbXTaR7D7g id: helfi_announcements label: 'Helfi: Announcements' label_plural: 'Helfi: Announcements' description: '' -read_only: true generate_aliases: null +read_only: true field_mapper_id: jsonpath field_mapper_config: field_mappings: @@ -37,6 +37,8 @@ field_mapper_config: value: '$.attributes["field_announcement_link"]["title"]' announcement_link_url: value: '$.attributes["field_announcement_link"]["uri"]' + announcement_assistive_technology_close_button_title: + value: '$.attributes["field_announcement_title"]' storage_client_id: helfi_announcements storage_client_config: { } persistent_cache_max_age: 600 diff --git a/conf/cmi/field.field.node.announcement.field_announcement_title.yml b/conf/cmi/field.field.node.announcement.field_announcement_title.yml new file mode 100644 index 00000000..cae80c7e --- /dev/null +++ b/conf/cmi/field.field.node.announcement.field_announcement_title.yml @@ -0,0 +1,21 @@ +uuid: 70edd643-ebf7-474f-93e5-99c463aacce4 +langcode: en +status: true +dependencies: + config: + - field.storage.node.field_announcement_title + - node.type.announcement +_core: + default_config_hash: f0piVjyoLRnZfc5fbRP6BdQ6_iMw7az35Req0V6Z4mg +id: node.announcement.field_announcement_title +field_name: field_announcement_title +entity_type: node +bundle: announcement +label: 'Announcement title' +description: 'This title is only available to users of assistive technology. ' +required: true +translatable: false +default_value: { } +default_value_callback: '' +settings: { } +field_type: string diff --git a/conf/cmi/field.storage.node.field_announcement_title.yml b/conf/cmi/field.storage.node.field_announcement_title.yml new file mode 100644 index 00000000..8e2fa33a --- /dev/null +++ b/conf/cmi/field.storage.node.field_announcement_title.yml @@ -0,0 +1,23 @@ +uuid: ee7fae45-f338-46d1-a471-1fda1930f9c9 +langcode: en +status: true +dependencies: + module: + - node +_core: + default_config_hash: dDVMTZxf5aD5P9HjLJX_6ThWFSclPORpZMThR3dd_XY +id: node.field_announcement_title +field_name: field_announcement_title +entity_type: node +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 diff --git a/conf/cmi/language/fi/field.field.node.announcement.field_announcement_title.yml b/conf/cmi/language/fi/field.field.node.announcement.field_announcement_title.yml new file mode 100644 index 00000000..8d33f85f --- /dev/null +++ b/conf/cmi/language/fi/field.field.node.announcement.field_announcement_title.yml @@ -0,0 +1,2 @@ +label: 'Poikkeusilmoituksen otsikko' +description: 'Tämä otsikko on avustavan teknologian käyttäjiä varten.' From f6d816f873acd19777425f6a98c14888fea96233 Mon Sep 17 00:00:00 2001 From: rpnykanen Date: Wed, 27 Sep 2023 08:53:22 +0300 Subject: [PATCH 21/23] UHF-8921: added deployment cron prevention script in cron base.sh --- docker/openshift/crons/base.sh | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/docker/openshift/crons/base.sh b/docker/openshift/crons/base.sh index a45e411f..6844e8ab 100644 --- a/docker/openshift/crons/base.sh +++ b/docker/openshift/crons/base.sh @@ -1,5 +1,23 @@ #!/bin/bash +# Checking if a new deployment is in progress, as we should not run cron while deploying. +if [ ! -n "$OPENSHIFT_BUILD_NAME" ]; then + echo "OPENSHIFT_BUILD_NAME is not defined. Exiting early." + exit 1 +fi + +while [ "$(drush state:get deploy_id)" != "$OPENSHIFT_BUILD_NAME" ] +do + echo "Current deploy_id $OPENSHIFT_BUILD_NAME not found in state. Probably a deployment is in progress - waiting for completion..." + sleep 60 +done + +while [ "$(drush state:get system.maintenance_mode)" = "1" ] +do + echo "Maintenance mode on. Probably a deployment is in progress - waiting for completion..." + sleep 60 +done + echo "Starting cron: $(date)" # You can add any additional cron "daemons" here: From 21b0a0f5a84d55465c429bbf497af1de9ec04526 Mon Sep 17 00:00:00 2001 From: Tero Elonen Date: Wed, 27 Sep 2023 10:03:30 +0300 Subject: [PATCH 22/23] UHF-9060: Update helfi_tunnistamo to 3.0.0 version --- composer.json | 2 +- composer.lock | 14 +++++++------- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/composer.json b/composer.json index a856d7b0..2b39bfe6 100644 --- a/composer.json +++ b/composer.json @@ -20,7 +20,7 @@ "drupal/helfi_platform_config": "^3.0", "drupal/helfi_proxy": "^3.0", "drupal/helfi_tpr": "^2.0", - "drupal/helfi_tunnistamo": "^2.0", + "drupal/helfi_tunnistamo": "^3.0", "drupal/migrate_plus": "^6.0", "drupal/raven": "^4.0", "drupal/redis": "^1.5", diff --git a/composer.lock b/composer.lock index 265098c9..0afd5eaa 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "20b2dea98266fdb211309b3281b3099a", + "content-hash": "e31ccf56e88f3f0fc262b302b80ff616", "packages": [ { "name": "asm89/stack-cors", @@ -4277,16 +4277,16 @@ }, { "name": "drupal/helfi_tunnistamo", - "version": "2.2.4", + "version": "3.0.0", "source": { "type": "git", "url": "https://github.com/City-of-Helsinki/drupal-module-helfi-tunnistamo.git", - "reference": "17badf64ebfcc6a30458634b19a4387cb4ce3d34" + "reference": "29e98d8a1c9fd39a98da7ce2b44fdc28a614bd99" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/City-of-Helsinki/drupal-module-helfi-tunnistamo/zipball/17badf64ebfcc6a30458634b19a4387cb4ce3d34", - "reference": "17badf64ebfcc6a30458634b19a4387cb4ce3d34", + "url": "https://api.github.com/repos/City-of-Helsinki/drupal-module-helfi-tunnistamo/zipball/29e98d8a1c9fd39a98da7ce2b44fdc28a614bd99", + "reference": "29e98d8a1c9fd39a98da7ce2b44fdc28a614bd99", "shasum": "" }, "require": { @@ -4303,10 +4303,10 @@ ], "description": "Tunnistamo integration", "support": { - "source": "https://github.com/City-of-Helsinki/drupal-module-helfi-tunnistamo/tree/2.2.4", + "source": "https://github.com/City-of-Helsinki/drupal-module-helfi-tunnistamo/tree/3.0.0", "issues": "https://github.com/City-of-Helsinki/drupal-module-helfi-tunnistamo/issues" }, - "time": "2023-05-17T11:53:24+00:00" + "time": "2023-08-28T07:28:23+00:00" }, { "name": "drupal/image_style_quality", From 886458daea5d75de9b0bc3143500e02927672229 Mon Sep 17 00:00:00 2001 From: actions-bot Date: Wed, 27 Sep 2023 08:17:56 +0000 Subject: [PATCH 23/23] Update configuration --- composer.lock | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/composer.lock b/composer.lock index 265098c9..0e9559a2 100644 --- a/composer.lock +++ b/composer.lock @@ -4072,16 +4072,16 @@ }, { "name": "drupal/helfi_platform_config", - "version": "3.4.15", + "version": "3.4.17", "source": { "type": "git", "url": "https://github.com/City-of-Helsinki/drupal-helfi-platform-config.git", - "reference": "4c85285f69a08e58e04f9da7e27e410881793896" + "reference": "46244701cdef62af87c7e376b4e43391ee6c870c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/City-of-Helsinki/drupal-helfi-platform-config/zipball/4c85285f69a08e58e04f9da7e27e410881793896", - "reference": "4c85285f69a08e58e04f9da7e27e410881793896", + "url": "https://api.github.com/repos/City-of-Helsinki/drupal-helfi-platform-config/zipball/46244701cdef62af87c7e376b4e43391ee6c870c", + "reference": "46244701cdef62af87c7e376b4e43391ee6c870c", "shasum": "" }, "require": { @@ -4184,10 +4184,10 @@ ], "description": "HELfi platform config", "support": { - "source": "https://github.com/City-of-Helsinki/drupal-helfi-platform-config/tree/3.4.15", + "source": "https://github.com/City-of-Helsinki/drupal-helfi-platform-config/tree/3.4.17", "issues": "https://github.com/City-of-Helsinki/drupal-helfi-platform-config/issues" }, - "time": "2023-09-26T09:47:18+00:00" + "time": "2023-09-27T08:15:04+00:00" }, { "name": "drupal/helfi_proxy", @@ -15972,16 +15972,16 @@ }, { "name": "phpstan/phpdoc-parser", - "version": "1.24.1", + "version": "1.24.2", "source": { "type": "git", "url": "https://github.com/phpstan/phpdoc-parser.git", - "reference": "9f854d275c2dbf84915a5c0ec9a2d17d2cd86b01" + "reference": "bcad8d995980440892759db0c32acae7c8e79442" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpstan/phpdoc-parser/zipball/9f854d275c2dbf84915a5c0ec9a2d17d2cd86b01", - "reference": "9f854d275c2dbf84915a5c0ec9a2d17d2cd86b01", + "url": "https://api.github.com/repos/phpstan/phpdoc-parser/zipball/bcad8d995980440892759db0c32acae7c8e79442", + "reference": "bcad8d995980440892759db0c32acae7c8e79442", "shasum": "" }, "require": { @@ -16013,9 +16013,9 @@ "description": "PHPDoc parser with support for nullable, intersection and generic types", "support": { "issues": "https://github.com/phpstan/phpdoc-parser/issues", - "source": "https://github.com/phpstan/phpdoc-parser/tree/1.24.1" + "source": "https://github.com/phpstan/phpdoc-parser/tree/1.24.2" }, - "time": "2023-09-18T12:18:02+00:00" + "time": "2023-09-26T12:28:12+00:00" }, { "name": "phpstan/phpstan",