Skip to content
This repository was archived by the owner on Nov 27, 2023. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from 24 commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
484655d
FORMS-821: Used OS2Web datalookup for CPR and CVR data
rimi-itk May 3, 2023
7d306cc
FORMS-821: Guzzle 7
rimi-itk May 8, 2023
23c060a
FORMS-821: Guzzle 6 HTTP Adapter
rimi-itk May 8, 2023
31a0b4e
FORMS-821: Cleaned up
rimi-itk May 8, 2023
b437949
FORMS-821: Cleaned up
rimi-itk May 8, 2023
058637e
FORMS-821: Used OS2Web datalookup for CPR and CVR data
rimi-itk May 8, 2023
aa70a99
FORMS-821: Used OS2Web datalookup for CPR and CVR data
rimi-itk May 8, 2023
1d7f27a
FORMS-821: Cleaned up
rimi-itk May 8, 2023
98fe6fc
FORMS-821: Handled “forsendelse” (physical post)
rimi-itk May 8, 2023
9ed71ec
FORMS-821: Cleaned up (after code analysis)
rimi-itk May 9, 2023
a80adbe
FORMS-821: Fixed service arguments
rimi-itk May 9, 2023
4911895
FORMS-821: Updated change log
rimi-itk May 9, 2023
9aeaf64
FORMS-821: Added code analysis to workflow
rimi-itk May 9, 2023
0546593
FORMS-821: Added missing requirement
rimi-itk May 9, 2023
bd4c08f
FORMS-821: Added code analysis to workflow
rimi-itk May 9, 2023
364103b
FORMS-821: Removed code analysis from workflow
rimi-itk May 9, 2023
a73ba72
FORDRIF-167: Removed support for SF1600
jekuaitk Jul 20, 2023
39c97dd
FORDRIF-167: Applied coding standards
jekuaitk Jul 20, 2023
f5b6d90
FORMS-821: Used OS2Web datalookup for CPR and CVR data
rimi-itk May 3, 2023
85cbf62
FORMS-821: Guzzle 7
rimi-itk May 8, 2023
0ca753d
FORMS-821: Cleaned up (after code analysis)
rimi-itk May 9, 2023
7dc7246
FORMS-774: Added API for sending digital post
rimi-itk Jun 2, 2023
0b9bec7
FORMS-821: Guzzle 6
rimi-itk Jul 14, 2023
7758a62
Allowed Drush 12
rimi-itk Aug 4, 2023
e775f9b
Added missing logger
rimi-itk Aug 7, 2023
e723aab
Merge branch 'main' into feature/FORMS-821-data-lookup
jekuaitk Aug 14, 2023
1357304
Fixed CHANGELOG
jekuaitk Aug 14, 2023
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
15 changes: 6 additions & 9 deletions .github/workflows/pr.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
php-versions: [ '7.4' ]
php-versions: [ '8.1' ]
dependency-version: [ prefer-stable ]
steps:
- uses: actions/checkout@master
Expand Down Expand Up @@ -55,7 +55,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
php-versions: [ '7.4' ]
php-versions: [ '8.1' ]
dependency-version: [ prefer-stable ]
steps:
- uses: actions/checkout@master
Expand Down Expand Up @@ -89,7 +89,7 @@ jobs:
# runs-on: ubuntu-latest
# strategy:
# matrix:
# php-versions: [ '7.4' ]
# php-versions: [ '8.1' ]
# dependency-version: [ prefer-stable ]
# steps:
# - uses: actions/checkout@master
Expand Down Expand Up @@ -117,16 +117,13 @@ jobs:
# composer --no-interaction create-project drupal/recommended-project:^9 drupal
# # Copy our module source code into the Drupal module folder.
# mkdir -p drupal/web/modules/contrib/os2forms_digital_post
# cp -r os2forms_digital_post.* composer.json src drupal/web/modules/contrib/os2forms_digital_post
# rsync --archive --compress . --exclude drupal --exclude .git drupal/web/modules/contrib/os2forms_digital_post

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

# # Add repositories from our composer.json (which see).
# # @see https://getcomposer.org/doc/03-cli.md#modifying-repositories
# composer --working-dir=drupal --no-interaction config repositories.drupal/webform_embed "$(composer config repositories.drupal/webform_embed)"

# # Allow plugins
# composer --working-dir=drupal config --no-plugins allow-plugins.vaimo/composer-patches true
# composer --working-dir=drupal config --no-plugins allow-plugins.cweagans/composer-patches true

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

# # Check code
# composer --working-dir=drupal --no-interaction require --dev drupal/core-dev
# # composer --working-dir=drupal --no-interaction require --dev drupal/core-dev
# cd drupal/web/modules/contrib/os2forms_digital_post
# # Remove our non-dev dependencies to prevent duplicated Drupal installation
# # 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
Expand Down
2 changes: 1 addition & 1 deletion .php-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
7.4
8.1
9 changes: 9 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,24 @@ Versioning](https://semver.org/spec/v2.0.0.html).

## [Unreleased]

### Removed

- Removed support for [SF-1600](https://digitaliseringskataloget.dk/integration/sf1600).

### Added

- Added the `CPR / Navn validering` element to allowed recipient element names
[PR-43](https://github.com/itk-dev/os2forms_digital_post/pull/43)
- Added API for sending digital post
[PR-40](https://github.com/itk-dev/os2forms_digital_post/pull/40)

## Changed

- Changed composer name to `os2forms/os2forms_digital_post`
[PR-47](https://github.com/itk-dev/os2forms_digital_post/pull/47)
- Changed dependency on CPR and CVR lookup modules. Handled physical post
(“forsendelse”)
[PR-37](https://github.com/itk-dev/os2forms_digital_post/pull/37)

## [2.0.1]

Expand Down
98 changes: 10 additions & 88 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,16 @@
Send Digital Post to danish citizens from a webform.

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

## Usage

This module provides functionality for sending digital post to danish citizens.
A WebformHandler is provided that you can add to your webform, and if configured
it will send the submitted data as digital post.

## Beskedfordeler endpoint

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

--------------------------------------------------------------------------------

<!-- markdownlint-disable MD013 -->
<!-- markdownlint-disable MD022 -->
<!-- markdownlint-disable MD025 -->
<!-- markdownlint-disable MD031 -->
<!-- markdownlint-disable MD032 -->
# Obsolete documentation

Add the following configuration:

```php
$config['os2forms_digital_post'] = [
'path_to_templates' => '',

'digital_post_system_id' => '',
'digital_post_afsender_system' => '',

'digital_post_materiale_id' => '',

'digital_post_forsendelses_type' => '',

'azure_tenant_id' => '',
'azure_application_id' => '',
'azure_client_secret' => '',

'azure_key_vault_name' => '',
'azure_key_vault_secret' => '',
'azure_key_vault_secret_version' => '',

'service_agreement_uuid' => '',
'user_system_uuid' => '',
'user_uuid' => '',

'service_uuid' => 'fd885b8b-4a3f-46cb-b367-6c9dda1c78f6',
'service_endpoint' => 'https://prod.serviceplatformen.dk/service/Print/Print/2',
'service_contract' => dirname(DRUPAL_ROOT) . '/web/modules/contrib/os2forms_digital_post/resources/contracts/PrintService/wsdl/context/PrintService.wsdl',
];

```

## Templating / Styling the PDF
You'll need to provide a PDF template, that will be rendered when sending letters via digital post.
The template has to be in the twig format and accessible by this module. Configure the path to your templates
in the settings mentioned above.

The following variables is present in the twig-template:
* logo - Path to the logo in your template.
* recipient - Which holds information about the recipient of the letter.
* elements - The elements submitted in the form.

### Structure of template
Your template folder structure has to be as following:
```shell
/templates-root # Set this folder as "path_to_templates" in the settings.
/name-of-template
index.html.twig # The actual twig template.
logo.png # Logo
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.
```

## Usage

This module provides functionality for sending digital post to danish citizens.
A WebformHandler is provided that you can add to your webform, and if configured
it will send the submitted data as digital post.

This module provides functionality for querying the danish CPR register and
showing the result in webforms.

<!-- markdownlint-enable MD013 -->
<!-- markdownlint-enable MD022 -->
<!-- markdownlint-enable MD025 -->
Expand All @@ -156,8 +92,8 @@ Actions](https://github.com/features/actions) when a pull request is made (cf.
Check coding standards:

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

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

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

docker run --rm --interactive --tty --volume ${PWD}:/app node:18 yarn --cwd /app coding-standards-apply
```

<!-- markdownlint-disable MD013 -->
<!-- markdownlint-disable MD022 -->
<!-- markdownlint-disable MD025 -->
<!-- markdownlint-disable MD031 -->
<!-- markdownlint-disable MD032 -->
## Drush command

A drush command is available for testing purposes. It creates a PDF from a template and a given submission.

Read more:
```shell
drush os2forms_digital_post:create_pdf --help
```
49 changes: 19 additions & 30 deletions composer.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "os2forms/os2forms_digital_post",
"description": "Provides integration to Print service provided by Serviceplatformen.",
"description": "Provides integration to Afsend post service provided by Serviceplatformen.",
"type": "drupal-module",
"license": "MIT",
"authors": [
Expand All @@ -13,22 +13,6 @@
}
],
"repositories": {
"drupal/webform_embed": {
"// ": "Lifted from https://github.com/itk-dev/os2forms_selvbetjening/blob/develop/composer.json, which see",
"//": "https://git.drupalcode.org/issue/webform_embed-3149360/-/tree/3149360-automated-drupal-9",
"type": "package",
"package": {
"name": "drupal/webform_embed",
"//": "@see https://github.com/OS2Forms/os2forms/blob/master/composer.json#L27",
"version": "1.x-dev",
"type": "drupal-module",
"source": {
"url": "https://git.drupalcode.org/issue/webform_embed-3149360.git",
"type": "git",
"reference": "3149360-automated-drupal-9"
}
}
},
"drupal": {
"type": "composer",
"url": "https://packages.drupal.org/8"
Expand All @@ -37,17 +21,20 @@
"minimum-stability": "dev",
"prefer-stable": true,
"require": {
"php": "^8.1",
"ext-dom": "*",
"ext-soap": "*",
"dompdf/dompdf": "^2.0",
"drupal/advancedqueue": "^1.0",
"drupal/webform": "^6.0",
"drush/drush": "^11 || ^12",
"http-interop/http-factory-guzzle": "^1.0.0",
"itk-dev/beskedfordeler-drupal": "^1.0",
"itk-dev/os2forms_cpr_lookup": "^1.6",
"itk-dev/serviceplatformen": "^1.2",
"itk-dev/serviceplatformen": "dev-feature/guzzle6-adapter as 1.5",
"os2forms/os2forms": "^3.0",
"php-http/guzzle6-adapter": "^2.0.1",
"os2web/os2web_datalookup": "^1.5",
"php-http/guzzle6-adapter": "^2.0",
"symfony/options-resolver": "^5.4 || ^6.0",
"symfony/property-access": "^4.4",
"wsdltophp/packagebase": "^5.0"
},
"autoload": {
Expand All @@ -56,19 +43,20 @@
}
},
"require-dev": {
"wsdltophp/packagegenerator": "^4.0",
"drupal/coder": "^8.3",
"dealerdirect/phpcodesniffer-composer-installer": "^0.7.1",
"mglaman/drupal-check": "^1.4",
"phpunit/phpunit": "^9.5"
"drupal/coder": "^8.3",
"mglaman/phpstan-drupal": "^1.1",
"phpstan/extension-installer": "^1.3",
"phpstan/phpstan-deprecation-rules": "^1.1",
"phpunit/phpunit": "^9.5",
"wsdltophp/packagegenerator": "^4.0"
},
"scripts": {
"code-analysis/drupal-check": [
"# @see https://github.com/mglaman/drupal-check/issues/261#issuecomment-1030141772 for details on exclude-dir value",
"drupal-check --deprecations --analysis --exclude-dir='vendor,*/Client/*' *.* src"
"code-analysis/phpstan": [
"phpstan analyse"
],
"code-analysis": [
"@code-analysis/drupal-check"
"@code-analysis/phpstan"
],
"coding-standards-check/phpcs": [
"phpcs --standard=phpcs.xml.dist"
Expand All @@ -90,7 +78,8 @@
"vaimo/composer-patches": true,
"cweagans/composer-patches": true,
"zaporylie/composer-drupal-optimizations": true,
"simplesamlphp/composer-module-installer": true
"simplesamlphp/composer-module-installer": true,
"phpstan/extension-installer": true
}
}
}
7 changes: 1 addition & 6 deletions drush.services.yml
Original file line number Diff line number Diff line change
@@ -1,13 +1,8 @@
services:
os2forms_digital_post.commands:
class: \Drupal\os2forms_digital_post\Commands\CreatePdf
arguments: ['@os2forms_digital_post.webform_helper', '@os2forms_digital_post.template_manager', '@entity_type.manager']
tags:
- { name: drush.command }

Drupal\os2forms_digital_post\Commands\CommandsSF1601:
arguments:
- '@Drupal\os2forms_digital_post\Helper\WebformHelperSF1601'
- '@Drupal\os2forms_digital_post\Helper\MeMoHelper'
- '@Drupal\os2forms_digital_post\Helper\ForsendelseHelper'
tags:
- { name: drush.command }

This file was deleted.

Loading