Skip to content

Commit a682232

Browse files
authored
Merge pull request #67 from OS2Forms/develop
Release 3.13.0
2 parents 5a69f11 + 4ef268b commit a682232

Some content is hidden

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

49 files changed

+3119
-53
lines changed

.github/workflows/pr.yml

Lines changed: 30 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,6 @@ jobs:
5656
strategy:
5757
matrix:
5858
php-versions: [ '8.1' ]
59-
dependency-version: [ prefer-lowest, prefer-stable ]
6059
steps:
6160
- uses: actions/checkout@master
6261
- name: Setup PHP, with composer and extensions
@@ -83,6 +82,35 @@ jobs:
8382
run: |
8483
composer coding-standards-check/phpcs
8584
85+
php-code-analysis:
86+
name: PHP code analysis
87+
runs-on: ubuntu-latest
88+
strategy:
89+
matrix:
90+
php-versions: [ '8.1' ]
91+
steps:
92+
- uses: actions/checkout@master
93+
- name: Setup PHP, with composer and extensions
94+
uses: shivammathur/setup-php@v2
95+
with:
96+
php-version: ${{ matrix.php-versions }}
97+
extensions: json
98+
coverage: none
99+
tools: composer:v2
100+
# https://github.com/shivammathur/setup-php#cache-composer-dependencies
101+
- name: Get composer cache directory
102+
id: composer-cache
103+
run: echo "::set-output name=dir::$(composer config cache-files-dir)"
104+
- name: Cache dependencies
105+
uses: actions/cache@v2
106+
with:
107+
path: ${{ steps.composer-cache.outputs.dir }}
108+
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
109+
restore-keys: ${{ runner.os }}-composer-
110+
- name: Code analysis
111+
run: |
112+
./scripts/code-analysis
113+
86114
markdownlint:
87115
runs-on: ubuntu-latest
88116
name: markdownlint
@@ -103,7 +131,7 @@ jobs:
103131
- name: Yarn install
104132
uses: actions/setup-node@v2
105133
with:
106-
node-version: '18'
134+
node-version: '20'
107135
- run: yarn install
108136
- name: markdownlint
109137
run: yarn coding-standards-check/markdownlint

.markdownlintrc

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,15 @@
11
{
22
// @see https://github.com/DavidAnson/markdownlint/blob/main/schema/.markdownlint.jsonc
3-
// MD013/line-length - Line length
3+
// https://github.com/DavidAnson/markdownlint/blob/main/doc/md013.md
44
"MD013": {
55
// Exclude code blocks
66
"code_blocks": false
7+
},
8+
9+
// Prevent complaining on duplicated headings in CHANGELOG.md
10+
// https://github.com/DavidAnson/markdownlint/blob/main/doc/md024.md
11+
"MD024": {
12+
"siblings_only": true
713
}
814
}
915

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,11 @@ before starting to add changes. Use example [placed in the end of the page](#exa
1111

1212
## [Unreleased]
1313

14+
## [3.13.0] 2023-10-11
15+
16+
- [#62](https://github.com/OS2Forms/os2forms/pull/62)
17+
Added digital post module
18+
1419
## [3.12.2] 2023-10-03
1520

1621
- Removing webform_embed - fix

README.md

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -131,9 +131,20 @@ docker run --rm --volume ${PWD}:/app --workdir /app itkdev/php8.1-fpm composer c
131131
### Markdown
132132

133133
```sh
134-
docker run --rm --volume ${PWD}:/app --workdir /app node:18 yarn install
135-
docker run --rm --volume ${PWD}:/app --workdir /app node:18 yarn coding-standards-check/markdownlint
134+
docker run --rm --volume ${PWD}:/app --workdir /app node:20 yarn install
135+
docker run --rm --volume ${PWD}:/app --workdir /app node:20 yarn coding-standards-check/markdownlint
136136

137137
# Fix (some) coding standards issues.
138-
docker run --rm --volume ${PWD}:/app --workdir /app node:18 yarn coding-standards-apply/markdownlint
138+
docker run --rm --volume ${PWD}:/app --workdir /app node:20 yarn coding-standards-apply/markdownlint
139+
```
140+
141+
## Code analysis
142+
143+
We use [PHPStan](https://phpstan.org/) for static code analysis.
144+
145+
Running statis code analysis on a standalone Drupal module is a bit tricky, so
146+
we use a helper script to run the analysis:
147+
148+
```sh
149+
./scripts/code-analysis
139150
```

composer.json

Lines changed: 26 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,9 @@
1616
}
1717
},
1818
"require": {
19+
"php": "^8.1",
20+
"ext-dom": "*",
21+
"ext-soap": "*",
1922
"cweagans/composer-patches": "^1.6.5",
2023
"dompdf/dompdf": "^2.0",
2124
"drupal/admin_toolbar": "^3.0",
@@ -68,20 +71,28 @@
6871
"drupal/webform_validation": "^2.0",
6972
"drupal/webform_views": "^5.0@alpha",
7073
"drupal/workflow_participants": "^2.4",
71-
"os2web/os2web_datalookup": "^1.0",
74+
"http-interop/http-factory-guzzle": "^1.0.0",
75+
"itk-dev/beskedfordeler-drupal": "^1.0",
76+
"itk-dev/serviceplatformen": "dev-feature/guzzle6-adapter as 1.5",
77+
"os2web/os2web_datalookup": "^1.5",
7278
"os2web/os2web_nemlogin": "^1.0",
79+
"php-http/guzzle6-adapter": "^2.0",
7380
"phpoffice/phpword": "^0.18.2",
81+
"symfony/options-resolver": "^5.4 || ^6.0",
7482
"tecnickcom/tcpdf": "~6",
7583
"webmozart/path-util": "^2.3",
84+
"wsdltophp/packagebase": "^5.0",
7685
"zaporylie/composer-drupal-optimizations": "^1.2"
7786
},
78-
"suggest": {
79-
"os2forms/os2forms_digital_post": "Send Maestro notifications via digital post (see https://github.com/itk-dev/os2forms_digital_post/blob/main/README.md)"
80-
},
8187
"require-dev": {
8288
"dealerdirect/phpcodesniffer-composer-installer": "^0.7.1",
8389
"drupal/coder": "^8.3",
84-
"drupal/maillog": "^1.0"
90+
"drupal/maillog": "^1.0",
91+
"mglaman/phpstan-drupal": "^1.1",
92+
"phpstan/extension-installer": "^1.3",
93+
"phpstan/phpstan-deprecation-rules": "^1.1",
94+
"phpunit/phpunit": "^9.5",
95+
"wsdltophp/packagegenerator": "^4.0"
8596
},
8697
"extra" : {
8798
"composer-exit-on-patch-failure": false,
@@ -105,6 +116,12 @@
105116
}
106117
},
107118
"scripts": {
119+
"code-analysis/phpstan": [
120+
"phpstan analyse"
121+
],
122+
"code-analysis": [
123+
"@code-analysis/phpstan"
124+
],
108125
"coding-standards-check/phpcs": [
109126
"phpcs --standard=phpcs.xml.dist"
110127
],
@@ -121,9 +138,11 @@
121138
"config": {
122139
"sort-packages": true,
123140
"allow-plugins": {
124-
"simplesamlphp/composer-module-installer": true,
125-
"dealerdirect/phpcodesniffer-composer-installer": true,
126141
"cweagans/composer-patches": true,
142+
"dealerdirect/phpcodesniffer-composer-installer": true,
143+
"phpstan/extension-installer": true,
144+
"simplesamlphp/composer-module-installer": true,
145+
"vaimo/composer-patches": true,
127146
"zaporylie/composer-drupal-optimizations": true
128147
}
129148
}
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
vendor
2+
composer.lock
3+
node_modules
4+
yarn.lock
5+
6+
src/Controller/SF1601Controller.php.log
Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
# OS2Forms Digital Post
2+
3+
Send Digital Post to danish citizens from a webform.
4+
5+
This module uses the
6+
[SF1601](https://digitaliseringskataloget.dk/integration/sf1601) service from
7+
Serviceplatformen. Information and documentation can be obtained by following
8+
that link.
9+
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+
16+
## Installation
17+
18+
Enable the module with [`drush`](https://drush.org/)
19+
20+
```shell
21+
drush pm:enable os2forms_digital_post
22+
```
23+
24+
### Example forms
25+
26+
See [OS2Forms Digital Post
27+
examples](modules/os2forms_digital_post_examples/README.md).
28+
29+
## Configuration
30+
31+
Go to `/admin/os2forms_digital_post/settings` to set up global settings for
32+
digital post.
33+
34+
### Queue
35+
36+
The actual sending of digital post is handled by jobs in an [Advanced
37+
Queue](https://www.drupal.org/project/advancedqueue) queue.
38+
39+
The default queue, OSForms digital post (`os2forms_digital_post`), must be
40+
processed by a server `cron` job (cf.
41+
`/admin/config/system/queues/manage/os2forms_digital_post?destination=/en/admin/config/system/queues`),
42+
but this can be changed or a completely diffent queue can be used if nedd be.
43+
44+
If using the default queue, it can be processed by running the command
45+
46+
```sh
47+
drush advancedqueue:queue:process os2forms_digital_post
48+
```
49+
50+
List the queue (and all other queues) with
51+
52+
```sh
53+
drush advancedqueue:queue:list
54+
```
55+
56+
or go to `/admin/config/system/queues/jobs/os2forms_digital_post` for a
57+
graphical overview of jobs in the queue.
58+
59+
## Beskedfordeler
60+
61+
Thie digital post module depends on [Beskedfordeler for
62+
Drupal](https://github.com/itk-dev/beskedfordeler-drupalon) to get get
63+
information on how or why not a digital post has been delivered (cf.
64+
[BeskedfordelerEventSubscriber](src/EventSubscriber/BeskedfordelerEventSubscriber.php)).
65+
66+
See the [documentation for Beskedfordeler for
67+
Drupal](https://github.com/itk-dev/beskedfordeler-drupal#beskedfordeler) for
68+
details on how to set up the Beskedfordeler module.
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
langcode: en
2+
status: true
3+
dependencies:
4+
module:
5+
- os2forms_digital_post
6+
enforced:
7+
module:
8+
- os2forms_digital_post
9+
id: os2forms_digital_post
10+
label: 'OSForms digital post'
11+
backend: database
12+
backend_configuration:
13+
lease_time: 300
14+
processor: cron
15+
processing_time: 90
16+
locked: false
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# OS2Forms Digital Post examples
2+
3+
Examples for OS2Forms Digital Post.
4+
5+
## Installation
6+
7+
```sh
8+
drush pm:enable os2forms_digital_post_examples
9+
```
10+
11+
Go to `/admin/structure/webform?category=Example` to see the example forms.

0 commit comments

Comments
 (0)