Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
de9a7a1
Added “Display on“ options to Map element
rimi-itk Mar 11, 2026
7c5e04e
Added documentation on fetching GeoJSON using the API
rimi-itk Mar 11, 2026
ff515e3
Updated changelog
rimi-itk Mar 11, 2026
3c9dffb
Handled "mail" display
rimi-itk Mar 11, 2026
31f4ca5
Updated URL
rimi-itk Mar 12, 2026
fcbd689
Merge branch 'develop' into feature/maps-element-display
jekuaitk Mar 23, 2026
333faf1
Merge branch 'develop' into feature/maps-element-display
jekuaitk Mar 23, 2026
c096da5
Merge branch 'develop' into feature/maps-element-display
jekuaitk Apr 13, 2026
4a88b16
Added first, middle and last name webform elements
jekuaitk May 1, 2026
15062f6
Update CHANGELOG
jekuaitk May 1, 2026
2bf2ec6
Adding 5.1.0 version
stankut Jun 3, 2026
e4a5e90
Merge pull request #330 from OS2Forms/release/5.1.0
stankut Jun 3, 2026
4901afb
Merge branch 'develop' into feature/maps-element-display
jekuaitk Jun 9, 2026
81d7c5e
Merge branch 'develop' into feature/maps-element-display
jekuaitk Jun 23, 2026
06fdf29
336: Avoided inheriting data on page transition
jekuaitk Jun 26, 2026
badc51f
336: Updated CHANGELOG
jekuaitk Jun 26, 2026
e001388
Merge branch 'develop' into feature/add-first-middle-and-last-name-ne…
jekuaitk Jun 26, 2026
f1217ec
Updated CHANGELOG
jekuaitk Jul 2, 2026
1a33e29
Merge remote-tracking branch 'origin/feature/maps-element-display' in…
jekuaitk Aug 27, 2026
4109071
Merge remote-tracking branch 'origin/fix/336-avoid-inheriting-data-on…
jekuaitk Aug 27, 2026
1d9b6d3
Merge remote-tracking branch 'origin/feature/add-first-middle-and-las…
jekuaitk Aug 27, 2026
3252935
Updated CHANGELOG
jekuaitk Aug 27, 2026
093d173
Added build script
jekuaitk Aug 27, 2026
8054008
Dev required os2web_datalookup with nemid elements data
jekuaitk Aug 28, 2026
05aceb5
Ignored advisories
jekuaitk Aug 28, 2026
5b76663
Normalized composer
jekuaitk Aug 28, 2026
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
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
This is a hack so the CHANGELOG is messed up.
Generated by build_release.sh
<!-- markdownlint-disable MD024 -->
# OS2Forms Change Log

Expand All @@ -11,6 +13,9 @@ before starting to add changes. Use example [placed in the end of the page](#exa

## [Unreleased]

- [PR-325](https://github.com/OS2Forms/os2forms/pull/325)
Added NemID first name, middle name and last name webform elements.

## [5.1.0] 2026-06-03

- [PR-326](https://github.com/OS2Forms/os2forms/pull/326)
Expand Down
23 changes: 23 additions & 0 deletions build_release.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
#!/usr/bin/env bash

# selvbetjening.aarhuskommune.dk branch
# Setup upstream with OS2Forms CORE
git remote add upstream https://github.com/OS2Forms/os2forms.git
git fetch
git reset --hard 5.1.0
git merge --no-ff origin/feature/maps-element-display
git checkout --theirs CHANGELOG.md
git add CHANGELOG.md
git commit -m "Merge remote-tracking branch 'origin/feature/maps-element-display' into selvbetjening.aarhuskommune.dk"
git merge --no-ff origin/fix/336-avoid-inheriting-data-on-page-transition
git checkout --theirs CHANGELOG.md
git add CHANGELOG.md
git commit -m "Merge remote-tracking branch 'origin/fix/336-avoid-inheriting-data-on-page-transition' into selvbetjening.aarhuskommune.dk"
git merge --no-ff origin/feature/add-first-middle-and-last-name-nemid-elements
git checkout --theirs CHANGELOG.md
git add CHANGELOG.md
git commit -m "Merge remote-tracking branch 'origin/feature/add-first-middle-and-last-name-nemid-elements' into selvbetjening.aarhuskommune.dk"

docker run --rm --volume .:/app itkdev/php8.4-fpm:latest sed --in-place '1i This is a hack so the CHANGELOG is messed up. \nGenerated by build_release.sh' CHANGELOG.md
git add CHANGELOG.md
git commit -m "Updated CHANGELOG"
22 changes: 17 additions & 5 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@
"itk-dev/serviceplatformen": "^1.7.1",
"mglaman/composer-drupal-lenient": "^1.0",
"os2web/os2web_audit": "^1.0",
"os2web/os2web_datalookup": "^3.0",
"os2web/os2web_datalookup": "dev-selvbetjening.aarhuskommune.dk as 3.4.0",
"os2web/os2web_key": "^1.0",
"os2web/os2web_nemlogin": "^1.0",
"os2web/os2web_simplesaml": "dev-master",
Expand All @@ -76,16 +76,23 @@
"phpunit/phpunit": "^9.5",
"wsdltophp/packagegenerator": "^4.0"
},
"repositories": {
"drupal": {
"repositories": [
{
"name": "os2web/os2web_datalookup",
"type": "vcs",
"url": "https://github.com/itk-dev/os2web_datalookup"
},
{
"name": "drupal",
"type": "composer",
"url": "https://packages.drupal.org/8"
},
"assets": {
{
"name": "assets",
"type": "composer",
"url": "https://asset-packagist.org"
}
},
],
"minimum-stability": "dev",
"prefer-stable": true,
"config": {
Expand All @@ -100,6 +107,11 @@
"vaimo/composer-patches": true,
"zaporylie/composer-drupal-optimizations": true
},
"policy": {
"advisories": {
"block": false
}
},
"sort-packages": true
},
"extra": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,13 @@ public function prepareTaskForSave(array &$form, FormStateInterface $form_state,
* Implements hook_webform_submission_form_alter().
*/
public static function webformSubmissionFormAlter(array &$form, FormStateInterface $formState, string $formId) {
// Only inherit values on the initial form load. This skip condition is the
// complement of webform's own prepopulate guard.
// @see \Drupal\webform\WebformSubmissionForm::buildForm()
if ($formState->isRebuilding() && !$formState->get('is_ajax_restart')) {
return;
}

// @todo Clean up and align with MaestroHelper::maestroZeroUserNotification().
if ($queueID = self::getQueueIdFromRequest()) {
$templateTask = MaestroEngine::getTemplateTaskByQueueID($queueID);
Expand Down
64 changes: 64 additions & 0 deletions modules/os2forms_nemid/src/Element/NemidFirstName.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
<?php

namespace Drupal\os2forms_nemid\Element;

use Drupal\Core\Form\FormStateInterface;

/**
* Provides a 'os2forms_nemid_first_name'.
*
* @FormElement("os2forms_nemid_first_name")
*
* @see \Drupal\Core\Render\Element\FormElement
* @see https://api.drupal.org/api/drupal/core%21lib%21Drupal%21Core%21Render%21Element%21FormElement.php/class/FormElement
* @see \Drupal\Core\Render\Element\RenderElement
* @see https://api.drupal.org/api/drupal/namespace/Drupal%21Core%21Render%21Element
* @see \Drupal\os2forms_nemid\Element\NemidFirstName
*/
class NemidFirstName extends NemidElementBase {

/**
* {@inheritdoc}
*/
public function getInfo() {
$class = get_class($this);
return parent::getInfo() + [
'#process' => [
[$class, 'processNemidFirstName'],
[$class, 'processAjaxForm'],
],
'#element_validate' => [
[$class, 'validateNemidFirstName'],
],
'#pre_render' => [
[$class, 'preRenderNemidFirstName'],
],
'#theme' => 'input__os2forms_nemid_first_name',
];
}

/**
* Processes a 'os2forms_nemid_first_name' element.
*/
public static function processNemidFirstName(&$element, FormStateInterface $form_state, &$complete_form) {
// Here you can add and manipulate your element's properties and callbacks.
return $element;
}

/**
* Webform element validation handler for #type 'os2forms_nemid_first_name'.
*/
public static function validateNemidFirstName(&$element, FormStateInterface $form_state, &$complete_form) {
// Here you can add custom validation logic.
}

/**
* {@inheritdoc}
*/
public static function preRenderNemidFirstName(array $element) {
$element = parent::prerenderNemidElementBase($element);
static::setAttributes($element, ['form-text', 'os2forms-nemid-first-name']);
return $element;
}

}
64 changes: 64 additions & 0 deletions modules/os2forms_nemid/src/Element/NemidLastName.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
<?php

namespace Drupal\os2forms_nemid\Element;

use Drupal\Core\Form\FormStateInterface;

/**
* Provides a 'os2forms_nemid_last_name'.
*
* @FormElement("os2forms_nemid_last_name")
*
* @see \Drupal\Core\Render\Element\FormElement
* @see https://api.drupal.org/api/drupal/core%21lib%21Drupal%21Core%21Render%21Element%21FormElement.php/class/FormElement
* @see \Drupal\Core\Render\Element\RenderElement
* @see https://api.drupal.org/api/drupal/namespace/Drupal%21Core%21Render%21Element
* @see \Drupal\os2forms_nemid\Element\NemidLastName
*/
class NemidLastName extends NemidElementBase {

/**
* {@inheritdoc}
*/
public function getInfo() {
$class = get_class($this);
return parent::getInfo() + [
'#process' => [
[$class, 'processNemidLastName'],
[$class, 'processAjaxForm'],
],
'#element_validate' => [
[$class, 'validateNemidLastName'],
],
'#pre_render' => [
[$class, 'preRenderNemidLastName'],
],
'#theme' => 'input__os2forms_nemid_last_name',
];
}

/**
* Processes a 'os2forms_nemid_last_name' element.
*/
public static function processNemidLastName(&$element, FormStateInterface $form_state, &$complete_form) {
// Here you can add and manipulate your element's properties and callbacks.
return $element;
}

/**
* Webform element validation handler for #type 'os2forms_nemid_last_name'.
*/
public static function validateNemidLastName(&$element, FormStateInterface $form_state, &$complete_form) {
// Here you can add custom validation logic.
}

/**
* {@inheritdoc}
*/
public static function preRenderNemidLastName(array $element) {
$element = parent::prerenderNemidElementBase($element);
static::setAttributes($element, ['form-text', 'os2forms-nemid-last-name']);
return $element;
}

}
64 changes: 64 additions & 0 deletions modules/os2forms_nemid/src/Element/NemidMiddleName.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
<?php

namespace Drupal\os2forms_nemid\Element;

use Drupal\Core\Form\FormStateInterface;

/**
* Provides a 'os2forms_nemid_middle_name'.
*
* @FormElement("os2forms_nemid_middle_name")
*
* @see \Drupal\Core\Render\Element\FormElement
* @see https://api.drupal.org/api/drupal/core%21lib%21Drupal%21Core%21Render%21Element%21FormElement.php/class/FormElement
* @see \Drupal\Core\Render\Element\RenderElement
* @see https://api.drupal.org/api/drupal/namespace/Drupal%21Core%21Render%21Element
* @see \Drupal\os2forms_nemid\Element\NemidMiddleName
*/
class NemidMiddleName extends NemidElementBase {

/**
* {@inheritdoc}
*/
public function getInfo() {
$class = get_class($this);
return parent::getInfo() + [
'#process' => [
[$class, 'processNemidMiddleName'],
[$class, 'processAjaxForm'],
],
'#element_validate' => [
[$class, 'validateNemidMiddleName'],
],
'#pre_render' => [
[$class, 'preRenderNemidMiddleName'],
],
'#theme' => 'input__os2forms_nemid_middle_name',
];
}

/**
* Processes a 'os2forms_nemid_middle_name' element.
*/
public static function processNemidMiddleName(&$element, FormStateInterface $form_state, &$complete_form) {
// Here you can add and manipulate your element's properties and callbacks.
return $element;
}

/**
* Webform element validation handler for #type 'os2forms_nemid_middle_name'.
*/
public static function validateNemidMiddleName(&$element, FormStateInterface $form_state, &$complete_form) {
// Here you can add custom validation logic.
}

/**
* {@inheritdoc}
*/
public static function preRenderNemidMiddleName(array $element) {
$element = parent::prerenderNemidElementBase($element);
static::setAttributes($element, ['form-text', 'os2forms-nemid-middle-name']);
return $element;
}

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
<?php

namespace Drupal\os2forms_nemid\Plugin\WebformElement;

use Drupal\os2web_datalookup\LookupResult\CprLookupResult;

/**
* Provides a 'os2forms_nemid_first_name' element.
*
* @WebformElement(
* id = "os2forms_nemid_first_name",
* label = @Translation("NemID First name"),
* description = @Translation("Provides a NemID First name element."),
* category = @Translation("NemID"),
* )
*
* @see \Drupal\os2forms_nemid\Plugin\NemidElementBase
* @see \Drupal\os2forms_nemid\Element\NemidFirstName
*/
class NemidFirstName extends ServiceplatformenCprElementBase implements NemidElementPersonalInterface {

/**
* {@inheritdoc}
*/
public function getPrepopulateFieldFieldKey(array &$element) {
return CprLookupResult::FIRST_NAME;
}

}
29 changes: 29 additions & 0 deletions modules/os2forms_nemid/src/Plugin/WebformElement/NemidLastName.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
<?php

namespace Drupal\os2forms_nemid\Plugin\WebformElement;

use Drupal\os2web_datalookup\LookupResult\CprLookupResult;

/**
* Provides a 'os2forms_nemid_last_name' element.
*
* @WebformElement(
* id = "os2forms_nemid_last_name",
* label = @Translation("NemID Last name"),
* description = @Translation("Provides a NemID Last name element."),
* category = @Translation("NemID"),
* )
*
* @see \Drupal\os2forms_nemid\Plugin\NemidElementBase
* @see \Drupal\os2forms_nemid\Element\NemidLastName
*/
class NemidLastName extends ServiceplatformenCprElementBase implements NemidElementPersonalInterface {

/**
* {@inheritdoc}
*/
public function getPrepopulateFieldFieldKey(array &$element) {
return CprLookupResult::LAST_NAME;
}

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
<?php

namespace Drupal\os2forms_nemid\Plugin\WebformElement;

use Drupal\os2web_datalookup\LookupResult\CprLookupResult;

/**
* Provides a 'os2forms_nemid_middle_name' element.
*
* @WebformElement(
* id = "os2forms_nemid_middle_name",
* label = @Translation("NemID Middle name"),
* description = @Translation("Provides a NemID Middle name element."),
* category = @Translation("NemID"),
* )
*
* @see \Drupal\os2forms_nemid\Plugin\NemidElementBase
* @see \Drupal\os2forms_nemid\Element\NemidMiddleName
*/
class NemidMiddleName extends ServiceplatformenCprElementBase implements NemidElementPersonalInterface {

/**
* {@inheritdoc}
*/
public function getPrepopulateFieldFieldKey(array &$element) {
return CprLookupResult::MIDDLE_NAME;
}

}
Loading
Loading