Skip to content

Commit

Permalink
Merge pull request #475 from City-of-Helsinki/hakuvahti
Browse files Browse the repository at this point in the history
Hakuvahti Drupal Module
  • Loading branch information
sundflux authored May 29, 2024
2 parents 98d5dfb + d54bbb8 commit c94ff6c
Show file tree
Hide file tree
Showing 23 changed files with 720 additions and 4 deletions.
3 changes: 3 additions & 0 deletions .env
Original file line number Diff line number Diff line change
Expand Up @@ -29,3 +29,6 @@ HELBIT_CLIENT_ID=

# URL for Elasticsearch (for job search)
ELASTIC_PROXY_URL=https://elastic-helfi-rekry.docker.so

# Hakuvahti URL
HAKUVAHTI_URL=http://helfi-rekry.docker.so:3000
5 changes: 5 additions & 0 deletions compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,14 @@ services:
DRUPAL_VARNISH_PORT: 6081
REDIS_HOST: redis
PROJECT_NAME: "${PROJECT_NAME}"
HAKUVAHTI_URL: "${HAKUVAHTI_URL}"
extra_hosts:
- "host.docker.internal:host-gateway"
- "${DRUPAL_HOSTNAME}:host-gateway"
networks:
- internal
- stonehenge-network
- helfi-hakuvahti_helfi-hakuvahti-network
labels:
- "traefik.enable=true"
- "traefik.http.routers.${COMPOSE_PROJECT_NAME}-app.entrypoints=https"
Expand Down Expand Up @@ -139,6 +141,7 @@ services:
networks:
- internal
- stonehenge-network
- helfi-hakuvahti_helfi-hakuvahti-network
labels:
- "traefik.enable=true"
- "traefik.http.routers.${COMPOSE_PROJECT_NAME}-elastic.entrypoints=https"
Expand Down Expand Up @@ -173,6 +176,8 @@ networks:
external: false
stonehenge-network:
external: true
helfi-hakuvahti_helfi-hakuvahti-network:
external: true

volumes:
db_volume:
Expand Down
1 change: 1 addition & 0 deletions conf/cmi/core.extension.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ module:
helfi_ckeditor: 0
helfi_eu_cookie_compliance: 0
helfi_global_announcement: 0
helfi_hakuvahti: 0
helfi_image_styles: 0
helfi_media: 0
helfi_media_chart: 0
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
name: helfi_hakuvahti
type: module
description: 'Drupal-integration for hakuvahti.'
package: Custom
core_version_requirement: ^10
'interface translation project': helfi_hakuvahti
'interface translation server pattern': modules/custom/helfi_hakuvahti/translations/%language.po
36 changes: 36 additions & 0 deletions public/modules/custom/helfi_hakuvahti/helfi_hakuvahti.module
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
<?php

/**
* @file
* Helfi_hakuvahti.
*
* Helfi_hakuvahti.module.
*/

declare(strict_types=1);

/**
* Implements hook_theme().
*/
function helfi_hakuvahti_theme() {
return [
'hakuvahti_form' => [
'variables' => [
'title' => NULL,
'message' => NULL,
'button_text' => NULL,
'action_url' => NULL,
'id' => NULL,
'form_id' => NULL,
],
],
'hakuvahti_confirmation' => [
'variables' => [
'title' => NULL,
'message' => NULL,
'link_text' => NULL,
'link_url' => NULL,
],
],
];
}
21 changes: 21 additions & 0 deletions public/modules/custom/helfi_hakuvahti/helfi_hakuvahti.routing.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
helfi_hakuvahti.subscribe:
path: '/hakuvahti/subscribe'
defaults:
_title: 'Subscribe saved search'
_controller: '\Drupal\helfi_hakuvahti\Controller\HelfiHakuvahtiSubscribeController::post'
requirements:
_permission: 'access content'
helfi_hakuvahti.confirm:
path: '/hakuvahti/confirm'
defaults:
_title: 'Confirm saved search'
_controller: '\Drupal\helfi_hakuvahti\Controller\HelfiHakuvahtiController::confirm'
requirements:
_permission: 'access content'
helfi_hakuvahti.unsubscribe:
path: '/hakuvahti/unsubscribe'
defaults:
_title: 'Are you sure you wish to delete the saved search?'
_controller: '\Drupal\helfi_hakuvahti\Controller\HelfiHakuvahtiController::unsubscribe'
requirements:
_permission: 'access content'
Loading

0 comments on commit c94ff6c

Please sign in to comment.