Skip to content
This repository was archived by the owner on Nov 27, 2023. It is now read-only.

Commit 876afc7

Browse files
authored
Merge pull request #37 from itk-dev/feature/FORMS-821-data-lookup
FORMS-821: Used OS2Web datalookup for CPR and CVR data
2 parents c8b72d0 + 1357304 commit 876afc7

File tree

257 files changed

+816
-16987
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

257 files changed

+816
-16987
lines changed

.github/workflows/pr.yaml

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ jobs:
2323
runs-on: ubuntu-latest
2424
strategy:
2525
matrix:
26-
php-versions: [ '7.4' ]
26+
php-versions: [ '8.1' ]
2727
dependency-version: [ prefer-stable ]
2828
steps:
2929
- uses: actions/checkout@master
@@ -55,7 +55,7 @@ jobs:
5555
runs-on: ubuntu-latest
5656
strategy:
5757
matrix:
58-
php-versions: [ '7.4' ]
58+
php-versions: [ '8.1' ]
5959
dependency-version: [ prefer-stable ]
6060
steps:
6161
- uses: actions/checkout@master
@@ -89,7 +89,7 @@ jobs:
8989
# runs-on: ubuntu-latest
9090
# strategy:
9191
# matrix:
92-
# php-versions: [ '7.4' ]
92+
# php-versions: [ '8.1' ]
9393
# dependency-version: [ prefer-stable ]
9494
# steps:
9595
# - uses: actions/checkout@master
@@ -117,16 +117,13 @@ jobs:
117117
# composer --no-interaction create-project drupal/recommended-project:^9 drupal
118118
# # Copy our module source code into the Drupal module folder.
119119
# mkdir -p drupal/web/modules/contrib/os2forms_digital_post
120-
# cp -r os2forms_digital_post.* composer.json src drupal/web/modules/contrib/os2forms_digital_post
120+
# rsync --archive --compress . --exclude drupal --exclude .git drupal/web/modules/contrib/os2forms_digital_post
121121

122122
# composer --working-dir=drupal --no-interaction config minimum-stability dev
123123

124-
# # Add repositories from our composer.json (which see).
125-
# # @see https://getcomposer.org/doc/03-cli.md#modifying-repositories
126-
# composer --working-dir=drupal --no-interaction config repositories.drupal/webform_embed "$(composer config repositories.drupal/webform_embed)"
127-
128124
# # Allow plugins
129125
# composer --working-dir=drupal config --no-plugins allow-plugins.vaimo/composer-patches true
126+
# composer --working-dir=drupal config --no-plugins allow-plugins.cweagans/composer-patches true
130127

131128
# # Add our module as a composer repository.
132129
# composer --working-dir=drupal --no-interaction config --append repositories.itk-dev/os2forms_digital_post path web/modules/contrib/os2forms_digital_post
@@ -137,7 +134,7 @@ jobs:
137134
# composer --working-dir=drupal --no-interaction require 'itk-dev/os2forms_digital_post:*'
138135

139136
# # Check code
140-
# composer --working-dir=drupal --no-interaction require --dev drupal/core-dev
137+
# # composer --working-dir=drupal --no-interaction require --dev drupal/core-dev
141138
# cd drupal/web/modules/contrib/os2forms_digital_post
142139
# # Remove our non-dev dependencies to prevent duplicated Drupal installation
143140
# # PHP Fatal error: Cannot redeclare drupal_get_filename() (previously declared in /home/runner/work/os2forms_digital_post/os2forms_digital_post/drupal/web/modules/contrib/os2forms_digital_post/vendor/drupal/core/includes/bootstrap.inc:190) in /home/runner/work/os2forms_digital_post/os2forms_digital_post/drupal/web/core/includes/bootstrap.inc on line 190

.php-version

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
7.4
1+
8.1

CHANGELOG.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,21 @@ Versioning](https://semver.org/spec/v2.0.0.html).
99

1010
## [Unreleased]
1111

12+
### Added
13+
14+
- Added API for sending digital post
15+
[PR-40](https://github.com/itk-dev/os2forms_digital_post/pull/40)
16+
17+
### Changed
18+
19+
- Changed dependency on CPR and CVR lookup modules. Handled physical post
20+
(“forsendelse”)
21+
[PR-37](https://github.com/itk-dev/os2forms_digital_post/pull/37)
22+
23+
### Removed
24+
25+
- Removed support for [SF-1600](https://digitaliseringskataloget.dk/integration/sf1600).
26+
1227
## [2.0.2]
1328

1429
### Added

README.md

Lines changed: 10 additions & 88 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,16 @@
33
Send Digital Post to danish citizens from a webform.
44

55
This module uses the
6-
[SF1600](https://digitaliseringskataloget.dk/integration/sf1600) service from
6+
[SF1601](https://digitaliseringskataloget.dk/integration/sf1601) service from
77
Serviceplatformen. Information and documentation can be obtained by following
88
that link.
99

10+
## Usage
11+
12+
This module provides functionality for sending digital post to danish citizens.
13+
A WebformHandler is provided that you can add to your webform, and if configured
14+
it will send the submitted data as digital post.
15+
1016
## Beskedfordeler endpoint
1117

1218
This module provides an endpoint,
@@ -72,76 +78,6 @@ drush advancedqueue:queue:list
7278
or go to `/admin/config/system/queues/jobs/os2forms_digital_post` for a
7379
graphical overview of jobs in the queue.
7480

75-
--------------------------------------------------------------------------------
76-
77-
<!-- markdownlint-disable MD013 -->
78-
<!-- markdownlint-disable MD022 -->
79-
<!-- markdownlint-disable MD025 -->
80-
<!-- markdownlint-disable MD031 -->
81-
<!-- markdownlint-disable MD032 -->
82-
# Obsolete documentation
83-
84-
Add the following configuration:
85-
86-
```php
87-
$config['os2forms_digital_post'] = [
88-
'path_to_templates' => '',
89-
90-
'digital_post_system_id' => '',
91-
'digital_post_afsender_system' => '',
92-
93-
'digital_post_materiale_id' => '',
94-
95-
'digital_post_forsendelses_type' => '',
96-
97-
'azure_tenant_id' => '',
98-
'azure_application_id' => '',
99-
'azure_client_secret' => '',
100-
101-
'azure_key_vault_name' => '',
102-
'azure_key_vault_secret' => '',
103-
'azure_key_vault_secret_version' => '',
104-
105-
'service_agreement_uuid' => '',
106-
'user_system_uuid' => '',
107-
'user_uuid' => '',
108-
109-
'service_uuid' => 'fd885b8b-4a3f-46cb-b367-6c9dda1c78f6',
110-
'service_endpoint' => 'https://prod.serviceplatformen.dk/service/Print/Print/2',
111-
'service_contract' => dirname(DRUPAL_ROOT) . '/web/modules/contrib/os2forms_digital_post/resources/contracts/PrintService/wsdl/context/PrintService.wsdl',
112-
];
113-
114-
```
115-
116-
## Templating / Styling the PDF
117-
You'll need to provide a PDF template, that will be rendered when sending letters via digital post.
118-
The template has to be in the twig format and accessible by this module. Configure the path to your templates
119-
in the settings mentioned above.
120-
121-
The following variables is present in the twig-template:
122-
* logo - Path to the logo in your template.
123-
* recipient - Which holds information about the recipient of the letter.
124-
* elements - The elements submitted in the form.
125-
126-
### Structure of template
127-
Your template folder structure has to be as following:
128-
```shell
129-
/templates-root # Set this folder as "path_to_templates" in the settings.
130-
/name-of-template
131-
index.html.twig # The actual twig template.
132-
logo.png # Logo
133-
styles.css # The styles. Be aware that this module uses DomPDF to render the PDF, and therefore are submitted to the CSS rules defined in DomPDF.
134-
```
135-
136-
## Usage
137-
138-
This module provides functionality for sending digital post to danish citizens.
139-
A WebformHandler is provided that you can add to your webform, and if configured
140-
it will send the submitted data as digital post.
141-
142-
This module provides functionality for querying the danish CPR register and
143-
showing the result in webforms.
144-
14581
<!-- markdownlint-enable MD013 -->
14682
<!-- markdownlint-enable MD022 -->
14783
<!-- markdownlint-enable MD025 -->
@@ -156,8 +92,8 @@ Actions](https://github.com/features/actions) when a pull request is made (cf.
15692
Check coding standards:
15793

15894
```sh
159-
docker run --rm --interactive --tty --volume ${PWD}:/app itkdev/php7.4-fpm:latest composer install
160-
docker run --rm --interactive --tty --volume ${PWD}:/app itkdev/php7.4-fpm:latest composer coding-standards-check
95+
docker run --rm --interactive --tty --volume ${PWD}:/app itkdev/php8.1-fpm:latest composer install
96+
docker run --rm --interactive --tty --volume ${PWD}:/app itkdev/php8.1-fpm:latest composer coding-standards-check
16197

16298
docker run --rm --interactive --tty --volume ${PWD}:/app node:18 yarn --cwd /app install
16399
docker run --rm --interactive --tty --volume ${PWD}:/app node:18 yarn --cwd /app coding-standards-check
@@ -166,21 +102,7 @@ docker run --rm --interactive --tty --volume ${PWD}:/app node:18 yarn --cwd /app
166102
Apply coding standards:
167103

168104
```shell
169-
docker run --rm --interactive --tty --volume ${PWD}:/app itkdev/php7.4-fpm:latest composer coding-standards-apply
105+
docker run --rm --interactive --tty --volume ${PWD}:/app itkdev/php8.1-fpm:latest composer coding-standards-apply
170106

171107
docker run --rm --interactive --tty --volume ${PWD}:/app node:18 yarn --cwd /app coding-standards-apply
172108
```
173-
174-
<!-- markdownlint-disable MD013 -->
175-
<!-- markdownlint-disable MD022 -->
176-
<!-- markdownlint-disable MD025 -->
177-
<!-- markdownlint-disable MD031 -->
178-
<!-- markdownlint-disable MD032 -->
179-
## Drush command
180-
181-
A drush command is available for testing purposes. It creates a PDF from a template and a given submission.
182-
183-
Read more:
184-
```shell
185-
drush os2forms_digital_post:create_pdf --help
186-
```

composer.json

Lines changed: 19 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "os2forms/os2forms_digital_post",
3-
"description": "Provides integration to Print service provided by Serviceplatformen.",
3+
"description": "Provides integration to Afsend post service provided by Serviceplatformen.",
44
"type": "drupal-module",
55
"license": "MIT",
66
"authors": [
@@ -13,22 +13,6 @@
1313
}
1414
],
1515
"repositories": {
16-
"drupal/webform_embed": {
17-
"// ": "Lifted from https://github.com/itk-dev/os2forms_selvbetjening/blob/develop/composer.json, which see",
18-
"//": "https://git.drupalcode.org/issue/webform_embed-3149360/-/tree/3149360-automated-drupal-9",
19-
"type": "package",
20-
"package": {
21-
"name": "drupal/webform_embed",
22-
"//": "@see https://github.com/OS2Forms/os2forms/blob/master/composer.json#L27",
23-
"version": "1.x-dev",
24-
"type": "drupal-module",
25-
"source": {
26-
"url": "https://git.drupalcode.org/issue/webform_embed-3149360.git",
27-
"type": "git",
28-
"reference": "3149360-automated-drupal-9"
29-
}
30-
}
31-
},
3216
"drupal": {
3317
"type": "composer",
3418
"url": "https://packages.drupal.org/8"
@@ -37,17 +21,20 @@
3721
"minimum-stability": "dev",
3822
"prefer-stable": true,
3923
"require": {
24+
"php": "^8.1",
25+
"ext-dom": "*",
4026
"ext-soap": "*",
4127
"dompdf/dompdf": "^2.0",
28+
"drupal/advancedqueue": "^1.0",
4229
"drupal/webform": "^6.0",
30+
"drush/drush": "^11 || ^12",
4331
"http-interop/http-factory-guzzle": "^1.0.0",
4432
"itk-dev/beskedfordeler-drupal": "^1.0",
45-
"itk-dev/os2forms_cpr_lookup": "^1.6",
46-
"itk-dev/serviceplatformen": "^1.2",
33+
"itk-dev/serviceplatformen": "dev-feature/guzzle6-adapter as 1.5",
4734
"os2forms/os2forms": "^3.0",
48-
"php-http/guzzle6-adapter": "^2.0.1",
35+
"os2web/os2web_datalookup": "^1.5",
36+
"php-http/guzzle6-adapter": "^2.0",
4937
"symfony/options-resolver": "^5.4 || ^6.0",
50-
"symfony/property-access": "^4.4",
5138
"wsdltophp/packagebase": "^5.0"
5239
},
5340
"autoload": {
@@ -56,19 +43,20 @@
5643
}
5744
},
5845
"require-dev": {
59-
"wsdltophp/packagegenerator": "^4.0",
60-
"drupal/coder": "^8.3",
6146
"dealerdirect/phpcodesniffer-composer-installer": "^0.7.1",
62-
"mglaman/drupal-check": "^1.4",
63-
"phpunit/phpunit": "^9.5"
47+
"drupal/coder": "^8.3",
48+
"mglaman/phpstan-drupal": "^1.1",
49+
"phpstan/extension-installer": "^1.3",
50+
"phpstan/phpstan-deprecation-rules": "^1.1",
51+
"phpunit/phpunit": "^9.5",
52+
"wsdltophp/packagegenerator": "^4.0"
6453
},
6554
"scripts": {
66-
"code-analysis/drupal-check": [
67-
"# @see https://github.com/mglaman/drupal-check/issues/261#issuecomment-1030141772 for details on exclude-dir value",
68-
"drupal-check --deprecations --analysis --exclude-dir='vendor,*/Client/*' *.* src"
55+
"code-analysis/phpstan": [
56+
"phpstan analyse"
6957
],
7058
"code-analysis": [
71-
"@code-analysis/drupal-check"
59+
"@code-analysis/phpstan"
7260
],
7361
"coding-standards-check/phpcs": [
7462
"phpcs --standard=phpcs.xml.dist"
@@ -90,7 +78,8 @@
9078
"vaimo/composer-patches": true,
9179
"cweagans/composer-patches": true,
9280
"zaporylie/composer-drupal-optimizations": true,
93-
"simplesamlphp/composer-module-installer": true
81+
"simplesamlphp/composer-module-installer": true,
82+
"phpstan/extension-installer": true
9483
}
9584
}
9685
}

drush.services.yml

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,8 @@
11
services:
2-
os2forms_digital_post.commands:
3-
class: \Drupal\os2forms_digital_post\Commands\CreatePdf
4-
arguments: ['@os2forms_digital_post.webform_helper', '@os2forms_digital_post.template_manager', '@entity_type.manager']
5-
tags:
6-
- { name: drush.command }
7-
82
Drupal\os2forms_digital_post\Commands\CommandsSF1601:
93
arguments:
104
- '@Drupal\os2forms_digital_post\Helper\WebformHelperSF1601'
115
- '@Drupal\os2forms_digital_post\Helper\MeMoHelper'
6+
- '@Drupal\os2forms_digital_post\Helper\ForsendelseHelper'
127
tags:
138
- { name: drush.command }

generated-sources/PrintService/ItkDev/OS2Forms_Digital_Post/PrintService/ClassMap.php

Lines changed: 0 additions & 51 deletions
This file was deleted.

0 commit comments

Comments
 (0)