Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dev to main #524

Merged
merged 50 commits into from
Aug 14, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
50 commits
Select commit Hold shift + click to select a range
44a2061
UHF-9708: Grant defined ad role the drupal role survey_editor
teroelonen Jun 10, 2024
cc59be0
UHF-10311: updated settings.php
rpnykanen Jul 8, 2024
8c07067
Merge pull request #523 from City-of-Helsinki/UHF-10311
rpnykanen Jul 8, 2024
1ee1707
initial commit for the fix. Recursively find the parameters from the …
rpnykanen Jul 12, 2024
02a52ae
added contexts
rpnykanen Jul 15, 2024
8b527dd
refactored the controller. Added recursive array search to fix the pr…
rpnykanen Jul 15, 2024
355f279
Added text when no search filters selected
rpnykanen Jul 15, 2024
2066e63
code fixes
rpnykanen Jul 15, 2024
2e63924
code fixes
rpnykanen Jul 15, 2024
3b84dfe
commas
rpnykanen Jul 15, 2024
68d5389
phpstan fixes
rpnykanen Jul 15, 2024
86dbea7
phpstan fixes
rpnykanen Jul 15, 2024
bca244d
added compose override
rpnykanen Jul 15, 2024
58e8e5e
removed useless code
rpnykanen Jul 15, 2024
f970786
parameters in wrong order
rpnykanen Jul 15, 2024
f6b5306
swedish translations, fixed one bad translation
rpnykanen Jul 16, 2024
9dcc2cc
bad logic caused extra comma, fixed the logic
rpnykanen Jul 16, 2024
af2839c
wrong key in translations, removed duplicate translation
rpnykanen Jul 16, 2024
9fd98ce
Merge pull request #525 from City-of-Helsinki/UHF-X_hav_fixes
rpnykanen Jul 16, 2024
ca3a7b4
UHF-9660: Add some documentation about instance customizations to readme
teroelonen Jul 16, 2024
9e45191
UHF-9660: Remove the obsolte helfi_rekry_job_search module that has b…
teroelonen Jul 16, 2024
4f8343f
UHF-9660: Added more documentation about Rekry instance specific feat…
teroelonen Jul 16, 2024
b7a6fdc
UHF-9660: Added more documentation about Rekry instance specific feat…
teroelonen Jul 16, 2024
8fb9a48
UHF-9660: Added more documentation about Rekry instance specific feat…
teroelonen Jul 17, 2024
1bccded
UHF-9660: Added more documentation about Rekry instance specific feat…
teroelonen Jul 17, 2024
f3e9373
UHF-9660: Add mention of the custom role
teroelonen Jul 17, 2024
ca71486
Merge pull request #526 from City-of-Helsinki/UHF-9660
teroelonen Jul 18, 2024
da164b7
Update configuration
hel-platta-automation Jul 19, 2024
f256869
UHF-9660: Remove manual anchors from readme
teroelonen Jul 19, 2024
7a82b8f
Merge pull request #527 from City-of-Helsinki/UHF-9660
teroelonen Jul 19, 2024
6571cd2
Merge pull request #519 from City-of-Helsinki/update-configuration
teroelonen Jul 22, 2024
3efcb72
UHF-10341: remove the publication_starts_today from backend and alway…
rpnykanen Jul 25, 2024
daa66cf
UHF-10341: javascript to process the datetime string
rpnykanen Jul 25, 2024
3726c99
UHF-10341: add the javascript to job_listing pages
rpnykanen Jul 25, 2024
f0afb94
UHF-10341: added comment to the template
rpnykanen Jul 25, 2024
0de4539
Converted double quotes to single quotes.
khalima Jul 30, 2024
dd98fac
Minified the helfi_datetime_comparison.js and use the minified versio…
khalima Jul 30, 2024
7eddb74
Merge pull request #529 from City-of-Helsinki/UHF-10341
khalima Jul 30, 2024
364fe2a
Update configuration
hel-platta-automation Aug 6, 2024
b2f73a8
UHF-10354: Test new cron entrypoint
hyrsky Aug 12, 2024
02388f7
UHF-10354: Fix sonarcloud
hyrsky Aug 12, 2024
4490f4b
Merge pull request #528 from City-of-Helsinki/update-configuration
tuutti Aug 12, 2024
ee73b62
UHF-10409: TFA settings
tuutti Aug 12, 2024
0a58947
UHF-10354: Merge remote-tracking branch 'origin/UHF-10409' into UHF-1…
hyrsky Aug 12, 2024
fce8ac8
Merge pull request #532 from City-of-Helsinki/UHF-10409
tuutti Aug 12, 2024
1ade5ea
UHF-10354: Merge remote-tracking branch 'origin/dev' into UHF-10354-t…
hyrsky Aug 12, 2024
e2ce135
Merge pull request #531 from City-of-Helsinki/UHF-10354-test-new-cron…
hyrsky Aug 12, 2024
803988c
Update configuration
hel-platta-automation Aug 14, 2024
ae56926
Merge pull request #496 from City-of-Helsinki/UHF-9708
hyrsky Aug 14, 2024
94ca456
Merge pull request #533 from City-of-Helsinki/update-configuration
hyrsky Aug 14, 2024
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
113 changes: 107 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# City of Helsinki - Rekry Drupal 9 project
# City of Helsinki - Rekry Drupal project

Description of your project.
Rekry, which is short for recruitment in Finnish, is a site integrated with Helbit. It migrates job listings to the job
search found on the site and provides other recruitment information for the city of Helsinki.

## Environments

Expand Down Expand Up @@ -41,10 +42,110 @@ This will log you inside the app container:
$ make shell
```

## Enable Hakuvahti features
## Instance specific features

To enable [Hakuvahti features](https://github.com/City-of-Helsinki/helfi-hakuvahti) for local development or usage, you need to first install Hakuvahti and then enable Hakuvahti network in compose.yaml.
Some instance specific configuration can be found in Rekry-instance configuration page in the
`/admin/tools/rekry-content` url.

These lines are commented out with comment `# Uncomment to enable Hakuvahti:`
### Custom node types

Specifically what is commented out: `HAKUVAHTI_URL` environment variable, `helfi-hakuvahti_helfi-hakuvahti-network` for `app` and `elastic` containers. Finally it needs to be listed under `networks`. This enables Hakuvahti server to access ElasticSearch.
#### Job listing (job_listing)

A _job listing_ is custom node type used to migrate job listings from Helbit, meaning all nodes are created
automatically. While you can create a _job listing_ node manually through the user interface, this is not the standard
workflow on the site. These listings appear in the `job_search` paragraph and a view called `of_interest`displayed in a
block on _job listing_ nodes. The _job listings_ utilize multiple taxonomies to categorize the content. Some job listings
include media such as images and videos and there is much processing going into these on the `helfi_rekry_content`
module. Read more about the [Helbit integration](#helbit-integration) that creates these nodes and the [Job search](#job-search-job_search)
feature that displays them below.

### Custom paragraphs

#### Job search (job_search)

_Job search_ is a paragraph with two modes. The first mode provides a few filters and a submit button that redirects to
the node specified in the _Search result page_ field, using the applied filters as parameters. If the
_Search result page_ field is not filled, the full _job search_ is displayed. _Job search_is a React-based search that
uses the (`job_listing_search`) view as a fallback when JavaScript is not enabled. All React searches are part of the
`hdbt` theme, where most related logic is also located. The _job search_ paragraph includes an editable title,
description, and the _Search result page_ field. There is also a saved search feature called _Hakuvahti_ embedded on the
_job search_. Read more about this feature on the [Hakuvahti section](#hakuvahti) of this document.

- React search code can be found under the `hdbt` theme [here](https://github.com/City-of-Helsinki/drupal-hdbt/tree/main/src/js/react/apps/job-search).
- Check the `hdbt_subtheme` preprocesses for _job search_ related configuration [here](https://github.com/City-of-Helsinki/drupal-helfi-rekry/tree/dev/public/themes/custom/hdbt_subtheme).
- Fallback view when JavaScript is not enabled can be found in the `/conf/cim` folder [here](https://github.com/City-of-Helsinki/drupal-helfi-rekry/blob/dev/conf/cmi/views.view.job_listing_search.yml).
- The saved search feature _Hakuvahti_ uses a separate server and the code related to it can be found [here](https://github.com/City-of-Helsinki/helfi-hakuvahti).

##### Common issues

Sometimes on local the search dropdowns don't have any content. In this case usually running the indexing helps:

1. Run `make shell` on the root of the project
2. Inside the shell run `drush sapi-rt; drush sapi-c; drush sapi-i; drush cr` to clear the Elastic index and reindex it
and clear Drupal caches after the indexing is done.
3. Now retry the search dropdowns and they should have options.

### Custom media types

#### Job listing image (job_listing_image)

_Job listing image_ is a media type that is used to save the imported images from Helbit. The original idea behind this
separate media type has perhaps been a way to separate images used for normal content and job listings.

### Custom roles

#### HR (hr)

User role for viewing and editing only the job listings on the site.

### Helbit integration

_Helbit_ is the source from which job listings are migrated to this instance. The `helfi_rekry_content` module handles
the migration and data processing. It retrieves job listing information from the API and saves it as job listing nodes
in the database. Media such as images and videos are processed and stored as media entities, with unsupported video
types being skipped. Categorization is achieved using taxonomy terms created from the API data, which are then linked
to the job listing nodes. The migrations run periodically as a cron jobs. Both published and unpublished job listings
from the API are migrated, with future publish dates scheduled accordingly. A separate cron job ensures scheduled job
listings are published for indexing.

- The `helfi_rekry_content` module code can be found from [here](https://github.com/City-of-Helsinki/drupal-helfi-rekry/tree/dev/public/modules/custom/helfi_rekry_content).
- The migration interval for the new job listings can be checked from the cron configuration [here](https://github.com/City-of-Helsinki/drupal-helfi-rekry/blob/dev/docker/openshift/crons/migrate-job-listings.sh).
- The migration interval for changed job listings poll is written on this cron configuration [here](https://github.com/City-of-Helsinki/drupal-helfi-rekry/blob/dev/docker/openshift/crons/migrate-changed-job-listings.sh).
- The scheduled publishing interval can be checked from this cron configuration [here](https://github.com/City-of-Helsinki/drupal-helfi-rekry/blob/dev/docker/openshift/crons/content-scheduler.sh).

### Hakuvahti

_Hakuvahti_ is feature of the [Job search](#job-search-job_search) that allows users to save their job search criteria. Users will
receive automatic email notifications whenever new job listings that match their criteria are posted on the site.

Hakuvahti consists of three main components: a Node.js server, `helfi_hakuvahti` custom module and a React part
integrated with the Job search. The Node.js server handles most of the heavy lifting, including sending emails. The
Drupal custom module manages communication between the Node.js server and the React form, which displays the
feature to users.

- The Drupal code for hakuvahti can be found from the `helfi_hakuvahti` custom module [here](https://github.com/City-of-Helsinki/drupal-helfi-rekry/tree/dev/public/modules/custom/helfi_hakuvahti).
- The hakuvahti Node.js server is on a separate repository [here](https://github.com/City-of-Helsinki/helfi-hakuvahti).
- The React part is under the Job search in `hdbt` theme _react_ folder. The functionality is written in [this file](https://github.com/City-of-Helsinki/drupal-hdbt/blob/main/src/js/react/apps/job-search/containers/SearchMonitorContainer.tsx).
- The React form has configurable texts that can be found from the Rekry instance configuration in
`/admin/tools/rekry-content` url. You can translate these configurations for the three main languages using the
_Translate_ tab.

#### How to enable Hakuvahti features on local

To enable Hakuvahti features for local development or usage, you need to:

1. Install [Hakuvahti Node.js server]((https://github.com/City-of-Helsinki/helfi-hakuvahti) locally.
2. Start the server on your local. Instructions are on the [Hakuvahti server README](https://github.com/City-of-Helsinki/helfi-hakuvahti?tab=readme-ov-file#installing-and-running-hakuvahti).
3. Now clear the caches on your Rekry instance, and you should be able to see the Hakuvahti on the Job search on you
local site.
4. To test the functionality, you should use the Mailpit running on your local in the `https://mailpit.docker.so/` url
to view the emails being sent by the feature.

## Customizations

### Not part of global navigation

Unlike other instances the link to the instance is in the header top navigation and the main menu of the instance is not
part of the global navigation. There is however a link to this instance located under another instance's menu tree on
the global navigation too. The logic that dictates if the menu is added to the global navigation or not can be found
[here](https://github.com/City-of-Helsinki/drupal-module-helfi-navigation/blob/main/src/Plugin/rest/resource/GlobalMobileMenu.php).
7 changes: 7 additions & 0 deletions compose.override.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
services:
app:
environment:
HAKUVAHTI_URL: 'http://helfi-rekry.docker.so:3000'
networks:
hakuvahti-network:
external: true
Loading