Skip to content

Commit

Permalink
Merge pull request #315 from City-of-Helsinki/dev
Browse files Browse the repository at this point in the history
Dev to main
  • Loading branch information
khalima authored Sep 27, 2023
2 parents f0e2e9c + 090dfa6 commit 5d1a9d4
Show file tree
Hide file tree
Showing 19 changed files with 292 additions and 119 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
136 changes: 68 additions & 68 deletions composer.lock

Large diffs are not rendered by default.

20 changes: 20 additions & 0 deletions conf/cmi/core.base_field_override.node.announcement.title.yml
Original file line number Diff line number Diff line change
@@ -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
27 changes: 18 additions & 9 deletions conf/cmi/core.entity_form_display.node.announcement.default.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -18,15 +19,15 @@ dependencies:
- select2
- text
_core:
default_config_hash: le2Wzlas0qZ9Bj-o6WlJbHDeisFrucs9F4B3VOK8t_w
default_config_hash: 0ewsu2ZhpNhAo4t7wkUgEa9ABQAkcsF7IXtR-kFeDUg
id: node.announcement.default
targetEntityType: node
bundle: announcement
mode: default
content:
body:
type: text_textarea_with_summary
weight: 15
weight: 18
region: content
settings:
rows: 9
Expand All @@ -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%
Expand All @@ -59,32 +60,40 @@ content:
third_party_settings: { }
field_announcement_link:
type: link_default
weight: 16
weight: 19
region: content
settings:
placeholder_url: ''
placeholder_title: ''
third_party_settings: { }
field_announcement_service_pages:
type: select2_entity_reference
weight: 14
weight: 16
region: content
settings:
width: 100%
autocomplete: true
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%
Expand Down Expand Up @@ -123,7 +132,7 @@ content:
settings: { }
third_party_settings: { }
simple_sitemap:
weight: 10
weight: 12
region: content
settings: { }
third_party_settings: { }
Expand Down
11 changes: 10 additions & 1 deletion conf/cmi/core.entity_view_display.node.announcement.default.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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
Expand All @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
@@ -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
23 changes: 23 additions & 0 deletions conf/cmi/field.storage.node.field_announcement_title.yml
Original file line number Diff line number Diff line change
@@ -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
6 changes: 6 additions & 0 deletions conf/cmi/helfi_api_base.delete_revisions.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
entity_types:
- node
- paragraph
- tpr_unit
- tpr_service
- tpr_errand_service
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
label: 'Poikkeusilmoituksen otsikko'
description: 'Tämä otsikko on avustavan teknologian käyttäjiä varten.'
13 changes: 0 additions & 13 deletions conf/cmi/search_api.index.job_listings.yml
Original file line number Diff line number Diff line change
Expand Up @@ -268,7 +268,6 @@ field_settings:
datasource_id: 'entity:node'
property_path: title
type: text
boost: !!float 2
dependencies:
module:
- node
Expand Down Expand Up @@ -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
Expand Down
16 changes: 0 additions & 16 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
19 changes: 19 additions & 0 deletions docker/openshift/crons/base.sh
Original file line number Diff line number Diff line change
@@ -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:
Expand Down Expand Up @@ -27,6 +45,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
Expand Down
6 changes: 5 additions & 1 deletion phpunit.xml.dist
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
<env name="DTT_MINK_DRIVER_ARGS" value='["chrome", {"chromeOptions":{"w3c": false }}, "http://127.0.0.1:4444"]'/>
<env name="DTT_API_OPTIONS" value='{"socketTimeout": 360, "domWaitTimeout": 3600000}' />
<env name="DTT_API_URL" value="http://127.0.0.1:9222"/>
<env name="DTT_BASE_URL" value="http://127.0.0.1:8080"/>
<env name="DTT_BASE_URL" value="http://127.0.0.1:8888"/>
</php>
<testsuites>
<testsuite name="unit">
Expand All @@ -41,9 +41,13 @@
</testsuite>
<testsuite name="existing-site">
<directory>./tests/dtt/src/ExistingSite</directory>
<directory>./public/modules/custom/*/tests/src/ExistingSite</directory>
<directory>./public/modules/contrib/*/tests/src/ExistingSite</directory>
</testsuite>
<testsuite name="existing-site-javascript">
<directory>./tests/dtt/src/ExistingSiteJavascript</directory>
<directory>./public/modules/custom/*/tests/src/ExistingSiteJavascript</directory>
<directory>./public/modules/contrib/*/tests/src/ExistingSiteJavascript</directory>
</testsuite>
</testsuites>
<listeners>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
Loading

0 comments on commit 5d1a9d4

Please sign in to comment.