Skip to content

Commit 2de4b28

Browse files
committed
Merge branch 'develop' into hotfix/missing_cpr
2 parents 6bd46db + 4569857 commit 2de4b28

4 files changed

Lines changed: 76 additions & 9 deletions

File tree

CHANGELOG.md

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,13 @@ before starting to add changes. Use example [placed in the end of the page](#exa
1111

1212
## [Unreleased]
1313

14-
- [192](https://github.com/OS2Forms/os2forms/pull/192)
14+
- [PR-192](https://github.com/OS2Forms/os2forms/pull/192)
1515
Fix bug in MitidChildrenSelectAjaxBehaviour.php
16+
- [PR-228](https://github.com/OS2Forms/os2forms/pull/228)
17+
Added Drupal Core patch ensuring conditionals based upon computed twig
18+
works as intended.
19+
- [PR-215](https://github.com/OS2Forms/os2forms/pull/215)
20+
Added condition to maestro notification submission handler
1621
- [PR-101](https://github.com/OS2Forms/os2forms/pull/101)
1722
- Added support for `os2web_key` in Digital post
1823
- Switched from saving settings in key value store to config, i.e
@@ -24,6 +29,12 @@ before starting to add changes. Use example [placed in the end of the page](#exa
2429
Remove unused and abandoned package `webmozart/path-util`.
2530
- [PR-167](https://github.com/OS2Forms/os2forms/pull/167)
2631
Adding os2forms_digital_signature module
32+
- [PR-184](https://github.com/OS2Forms/os2forms/pull/184)
33+
- Patches `coc_forms_auto_export` to ensure settings can be saved upon initial
34+
attempt, cf. [Unable to save initial settings due to unfocusable form control](https://www.drupal.org/project/coc_forms_auto_export/issues/3531004)
35+
- [PR-222](https://github.com/OS2Forms/os2forms/pull/222)
36+
Correctly sets sender label on Maestro digital post notifications.
37+
- [OS-199] Remove modules that are not used and not covered by central maintenance from OS2forms
2738

2839
## [4.1.0] 2025-06-03
2940

composer.json

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,9 @@
1212
"drupal/admin_toolbar": "^3.0",
1313
"drupal/advancedqueue": "^1.0",
1414
"drupal/cache_control_override": "^1.1 || ^2.0",
15-
"drupal/clientside_validation": "^4.0",
1615
"drupal/coc_forms_auto_export": "^3.0@alpha",
1716
"drupal/config_entity_revisions": "2.0.x-dev",
1817
"drupal/diff": "^1.0",
19-
"drupal/embed": "^1.4",
2018
"drupal/entity_print": "^2.1",
2119
"drupal/eu_cookie_compliance": "^1.8",
2220
"drupal/events_logging": "^2.0@beta",
@@ -115,7 +113,11 @@
115113
"enable-patching": true,
116114
"patches": {
117115
"drupal/coc_forms_auto_export": {
118-
"3256951: - Unable to receive attachments in emails sent": "https://git.drupalcode.org/project/coc_forms_auto_export/-/merge_requests/11.diff"
116+
"3256951: - Unable to receive attachments in emails sent": "https://git.drupalcode.org/project/coc_forms_auto_export/-/merge_requests/11.diff",
117+
"3531004: Unable to save initial settings due to unfocusable form control": "https://www.drupal.org/files/issues/2025-06-19/text_area_with_text_edit_always_fails_reqired_set_via_states.patch"
118+
},
119+
"drupal/core": {
120+
"Allow conditionals based on computed twig (https://www.drupal.org/project/webform/issues/3481569)": "https://www.drupal.org/files/issues/2024-11-05/revert-core-states.patch"
119121
},
120122
"drupal/entity_print": {
121123
"2733781 - Add Export to Word Support": "https://www.drupal.org/files/issues/2019-11-22/2733781-47.patch"

modules/os2forms_forloeb/src/MaestroHelper.php

Lines changed: 17 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -239,6 +239,7 @@ private function sendNotification(
239239
|| $handler->isDisabled()
240240
|| $handler->isExcluded()
241241
|| !$handler->isNotificationEnabled($notificationType)
242+
|| !$handler->checkConditions($submission)
242243
) {
243244
continue;
244245
}
@@ -250,13 +251,14 @@ private function sendNotification(
250251
'subject' => $subject,
251252
'taskUrl' => $taskUrl,
252253
'actionLabel' => $actionLabel,
254+
'senderLabel' => $senderLabel,
253255
] = $this->renderNotification($submission, $handler->getHandlerId(), $notificationType, $templateTask, $maestroQueueID);
254256

255257
if ('email' === $contentType) {
256258
$this->sendNotificationEmail($recipient, $subject, $content, $submission, $notificationType);
257259
}
258260
else {
259-
$this->sendNotificationDigitalPost($recipient, $subject, $content, $taskUrl, $actionLabel, $submission, $notificationType);
261+
$this->sendNotificationDigitalPost($recipient, $subject, $content, $taskUrl, $actionLabel, $submission, $notificationType, $senderLabel);
260262
}
261263
}
262264
}
@@ -368,7 +370,9 @@ private function sendNotificationEmail(
368370
* @param \Drupal\webform\WebformSubmissionInterface $submission
369371
* The webform submission.
370372
* @param string $notificationType
371-
* The notification type (one of the NOTIFICATION_* constannts).
373+
* The notification type (one of the NOTIFICATION_* constants).
374+
* @param string $senderLabel
375+
* The sender label.
372376
*/
373377
private function sendNotificationDigitalPost(
374378
string $recipient,
@@ -378,6 +382,7 @@ private function sendNotificationDigitalPost(
378382
string $actionLabel,
379383
WebformSubmissionInterface $submission,
380384
string $notificationType,
385+
string $senderLabel,
381386
): void {
382387
try {
383388
$document = new Document(
@@ -386,7 +391,6 @@ private function sendNotificationDigitalPost(
386391
$subject . '.pdf'
387392
);
388393

389-
$senderLabel = $subject;
390394
$messageLabel = $subject;
391395

392396
$recipientLookupResult = $this->digitalPostHelper->lookupRecipient($recipient);
@@ -436,13 +440,13 @@ private function sendNotificationDigitalPost(
436440
* @param string $handlerId
437441
* The handler ID.
438442
* @param string $notificationType
439-
* The notification type (one of the NOTIFICATION_* constannts).
443+
* The notification type (one of the NOTIFICATION_* constants).
440444
* @param array $templateTask
441445
* The Maestro template task.
442446
* @param int $maestroQueueID
443447
* The Maestro queue ID.
444448
* @param string|null $contentType
445-
* Optional content type. If not set the content type will be compoted based
449+
* Optional content type. If not set the content type will be computed based
446450
* on the recipient.
447451
*
448452
* @return array
@@ -453,13 +457,20 @@ private function sendNotificationDigitalPost(
453457
* - subject
454458
* - taskUrl (for digital post)
455459
* - actionLabel (for digital post)
460+
* - senderLabel (for digital post)
456461
*
457462
* @see self::renderHtml()
458463
*/
459464
public function renderNotification(WebformSubmissionInterface $submission, string $handlerId, string $notificationType, array $templateTask, int $maestroQueueID, ?string $contentType = NULL): array {
460465
$handler = $submission->getWebform()->getHandler($handlerId);
461466
$settings = $handler->getSettings();
462467

468+
$senderLabel = $settings[MaestroNotificationHandler::NOTIFICATION][MaestroNotificationHandler::SENDER_LABEL] ?? NULL;
469+
470+
if (NULL === $senderLabel) {
471+
throw new RuntimeException(sprintf('Cannot get setting for Maestro notification: %s', MaestroNotificationHandler::SENDER_LABEL));
472+
}
473+
463474
$data = $submission->getData();
464475
$recipientElement = $settings[MaestroNotificationHandler::NOTIFICATION][MaestroNotificationHandler::RECIPIENT_ELEMENT] ?? NULL;
465476
// Handle os2forms_person_lookup element.
@@ -558,6 +569,7 @@ public function renderNotification(WebformSubmissionInterface $submission, strin
558569
'subject' => $subject,
559570
'taskUrl' => $taskUrl,
560571
'actionLabel' => $actionLabel,
572+
'senderLabel' => $senderLabel,
561573
];
562574
}
563575

templates/opgavebeskrivelse.md

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
---
2+
name: Opgavebeskrivelse
3+
description: Standard skabelon for definition af opgaver
4+
title: ''
5+
labels: ''
6+
assignees: ''
7+
---
8+
9+
# Kort titel, der repræsenterer opgaven, påkrævet
10+
11+
**Opgavebeskrivelse**: {venligst henvis til eventuelle danske ord, der bruges til at definere aktiviteten i omfanget.}
12+
13+
**Møde eller møderække**: {en eventuel henvisning til mødet, hvor opgaven blev aftalt, inklusive dato og tidspunkt.}
14+
15+
**Opdragsgiver**: {henvis til beslutningsorganet, der er enige om opgaven.}
16+
17+
## Overordnet opgavebeskrivelse
18+
19+
{Beskriv konteksten og problemstillingen, fx i fri form med to til tre sætninger eller i form af en illustrativ historie.}
20+
21+
## Kontekst og problem at løse
22+
23+
{Beskriv konteksten og problemstillingen, fx i fri form med to til tre sætninger eller i form af en illustrativ historie.}
24+
25+
## Vigtige milepæle
26+
27+
* {titel på milepæl 1}
28+
* {titel på milepæl 2}
29+
30+
## Aktiviteter eller underopgaver (sub-issues)
31+
32+
* [ ] {titel på opgave 1}
33+
* [ ] {titel på opgave 2}
34+
* [ ] {titel på opgave 3}
35+
36+
## Accept kriterier
37+
38+
{Beskriv med enkle ord, hvornår opgaven betragtes som fuldført, og angiv eventuelle formelle godkendelseskrav.}
39+
40+
## Risici & konsekvenser, hvis opgaven ikke udføres
41+
42+
{Beskriv med enkle ord, hvilke risici og konsekvenser det har, hvis opgaven ikke udføres.}

0 commit comments

Comments
 (0)