Skip to content

Commit

Permalink
Merge pull request #220 from City-of-Helsinki/dev
Browse files Browse the repository at this point in the history
Release 2022-11-17.1
  • Loading branch information
khalima authored Nov 17, 2022
2 parents b22cad6 + 9d69a13 commit a44eafb
Show file tree
Hide file tree
Showing 14 changed files with 134 additions and 85 deletions.
2 changes: 1 addition & 1 deletion .github/pull_request_template.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
## How to install

* Make sure your instance is up and running on correct branch.
* `git pull origin UHF-0000_insert_correct_branch`
* `git checkout UHF-0000_insert_correct_branch`
* `make fresh`
* Run `make drush-cr`

Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,12 +53,12 @@ jobs:
drush runserver $SIMPLETEST_BASE_URL > /dev/null 2>&1 &
chromedriver --port=4444 > /dev/null 2>&1 &
# Uncomment the line below to run 'existing-site-javascript' tests.
# chromium-browser --headless --disable-gpu --remote-debugging-port=9222 &
chromium-browser --headless --disable-gpu --no-sandbox --remote-debugging-port=9222 &
# Wait for drush server to start.
for i in {1..5}; do RESPONSE_CODE=$(curl -s -o /dev/null -w "%{http_code}" "$SIMPLETEST_BASE_URL" || true); if [ "$RESPONSE_CODE" -gt "301" ] || [ "$RESPONSE_CODE" -lt "200" ]; then sleep 2; fi; done
- name: Run PHPUnit tests
run: |
composer test-php public/modules/custom
# Uncomment the line below to run drupal-test-trait tests under tests/src/* folder.
# composer test-php tests/
composer test-php tests/
139 changes: 68 additions & 71 deletions composer.lock

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion conf/cmi/eu_cookie_compliance.settings.yml
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ enable_save_preferences_button: true
domain_all_sites: true
settings_tab_enabled: false
containing_element: body
cookie_policy_version: 1.0.0
cookie_policy_version: 1.1.0
close_button_action: close_banner
reject_button_label: ''
reject_button_enabled: false
Expand Down
3 changes: 2 additions & 1 deletion conf/cmi/hdbt.settings.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,5 @@ features:
logo:
use_default: 1
favicon:
use_default: 1
use_default: 0
path: ''
3 changes: 3 additions & 0 deletions conf/cmi/hdbt_subtheme.settings.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
favicon:
use_default: 0
path: ''
2 changes: 0 additions & 2 deletions conf/cmi/language/fi/views.view.media_library.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,6 @@ display:
group_items:
1:
title: Julkaistu
2:
title: Julkaisematon
name:
expose:
label: Nimi
Expand Down
2 changes: 0 additions & 2 deletions conf/cmi/language/sv/views.view.media_library.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,6 @@ display:
group_items:
1:
title: Publicerad
2:
title: 'Ej publicerad'
name:
expose:
label: Namn
Expand Down
23 changes: 22 additions & 1 deletion conf/cmi/views.view.media_library.yml
Original file line number Diff line number Diff line change
Expand Up @@ -1032,7 +1032,7 @@ display:
exclude: false
alter:
alter_text: true
text: '<a href="/media/{{ mid }}/edit" class="media-library-item__edit icon-link" title="{% trans %}Edit {{ name }}. Opens in a new tab.{% endtrans %}" target="_new">{% trans %}Edit {{ name }}{% endtrans %}</a>'
text: "<a href=\"{{ path('entity.media.edit_form', {'media': mid }) }}\" class=\"media-library-item__edit icon-link\" title=\"{% trans %}Edit {{ name }}. Opens in a new tab.{% endtrans %}\" target=\"_new\">{% trans %}Edit {{ name }}{% endtrans %}</a>\r\n"
make_link: false
path: ''
absolute: false
Expand Down Expand Up @@ -1275,6 +1275,27 @@ display:
rendering_language: '***LANGUAGE_language_interface***'
display_extenders: { }
path: admin/content/media-widget
pager:
type: full
options:
offset: 0
items_per_page: 24
total_pages: null
id: 0
tags:
next: ››
previous: ‹‹
first: '« First'
last: 'Last »'
expose:
items_per_page: false
items_per_page_label: 'Items per page'
items_per_page_options: '6, 12, 24, 48'
items_per_page_options_all: false
items_per_page_options_all_label: '- All -'
offset: false
offset_label: Offset
quantity: 9
cache_metadata:
max-age: -1
contexts:
Expand Down
2 changes: 1 addition & 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:8888"/>
<env name="DTT_BASE_URL" value="http://127.0.0.1:8080"/>
</php>
<testsuites>
<testsuite name="unit">
Expand Down
23 changes: 23 additions & 0 deletions public/modules/custom/helfi_etusivu/helfi_etusivu.module
Original file line number Diff line number Diff line change
Expand Up @@ -112,3 +112,26 @@ function helfi_etusivu_tokens(

return $replacements;
}

/**
* Implements hook_cron().
*/
function helfi_etusivu_cron() {
// Get promoted news_item nodes that are more than one month old.
$result = \Drupal::entityQuery('node')
->condition('type', 'news_item')
->condition('promote', 1)
->condition('created', strtotime('-1 month'), '<')
->range(0, 50)
->execute();

$promoted_nodes = \Drupal::entityTypeManager()
->getStorage('node')
->loadMultiple($result);

// Remove promotion.
foreach ($promoted_nodes as $node) {
$node->promote = 0;
$node->save();
}
}
2 changes: 2 additions & 0 deletions public/sites/default/azure.settings.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,5 @@

// Keep old assets for three months (default is one month).
$config['system.performance']['stale_file_threshold'] = 7776000;

$settings['is_azure'] = TRUE;
2 changes: 2 additions & 0 deletions public/sites/default/settings.php
Original file line number Diff line number Diff line change
Expand Up @@ -211,6 +211,8 @@
$settings['container_yamls'][] = 'modules/contrib/redis/redis.services.yml';
}

$settings['is_azure'] = FALSE;

// Environment specific overrides.
if (file_exists(__DIR__ . '/all.settings.php')) {
include __DIR__ . '/all.settings.php';
Expand Down
10 changes: 7 additions & 3 deletions tools/make/project/robo.mk
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
STONEHENGE_PATH ?= ${HOME}/stonehenge
PROJECT_DIR ?= ${GITHUB_WORKSPACE}
SITE_PREFIX ?=
SITE_PREFIX ?= /

SETUP_ROBO_TARGETS :=
CI_POST_INSTALL_TARGETS :=
Expand Down Expand Up @@ -50,7 +50,11 @@ install-drupal-from-dump:
PHONY += post-install-tasks
post-install-tasks:
$(call docker_run_ci,app,drush upwd helfi-admin Test_Automation)
$(call docker_run_ci,app,drush en helfi_etusivu_test_content syslog -y)
$(call docker_run_ci,app,drush en helfi_example_content syslog -y)
$(call docker_run_ci,app,drush helfi:migrate-fixture tpr_unit --publish)
$(call docker_run_ci,app,drush helfi:migrate-fixture tpr_service --publish)
$(call docker_run_ci,app,drush helfi:migrate-fixture tpr_errand_service --publish)
$(call docker_run_ci,app,drush helfi:migrate-fixture tpr_service_channel --publish)
$(call docker_run_ci,app,drush pmu editoria11y -y)

PHONY += save-dump
Expand Down Expand Up @@ -79,4 +83,4 @@ setup-robo: $(SETUP_ROBO_TARGETS)

PHONY += run-robo-tests
run-robo-tests:
$(call docker_run_ci,robo,cd /app/helfi-test-automation-python && chmod +x run_all_etusivu_tests.sh && PREFIX=$(SITE_PREFIX) BASE_URL=$(DRUPAL_HOSTNAME) ./run_all_etusivu_tests.sh)
$(call docker_run_ci,robo,cd /app/helfi-test-automation-python && chmod +x run_all_tests.sh && PREFIX=$(SITE_PREFIX) BASE_URL=$(DRUPAL_HOSTNAME) ./run_all_tests.sh)

0 comments on commit a44eafb

Please sign in to comment.