Skip to content
Merged
Show file tree
Hide file tree
Changes from 19 commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
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
37 changes: 13 additions & 24 deletions .github/workflows/pr.yml
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: [ '8.1' ]
php-versions: [ '8.3' ]
dependency-version: [ prefer-lowest, prefer-stable ]
steps:
- uses: actions/checkout@master
Expand All @@ -50,13 +50,16 @@ jobs:
composer validate --strict composer.json
# Check that dependencies resolve.
composer update --${{ matrix.dependency-version }} --prefer-dist --no-interaction
- name: Check that composer file is normalized
run: |
composer normalize --dry-run

php-coding-standards:
name: PHP coding standards
runs-on: ubuntu-latest
strategy:
matrix:
php-versions: [ '8.1' ]
php-versions: [ '8.3' ]
steps:
- uses: actions/checkout@master
- name: Setup PHP, with composer and extensions
Expand Down Expand Up @@ -89,7 +92,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
php-versions: [ '8.1' ]
php-versions: [ '8.3' ]
steps:
- uses: actions/checkout@master
- name: Setup PHP, with composer and extensions
Expand All @@ -113,27 +116,13 @@ jobs:
run: |
./scripts/code-analysis

markdownlint:
coding-standards-markdown:
name: Markdown coding standards
runs-on: ubuntu-latest
name: markdownlint
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "::set-output name=dir::$(yarn cache dir)"
- name: Cache yarn packages
uses: actions/cache@v2
id: yarn-cache
with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-
- name: Yarn install
uses: actions/setup-node@v2
with:
node-version: '20'
- run: yarn install
- name: markdownlint
run: yarn coding-standards-check/markdownlint
uses: actions/checkout@master

- name: Coding standards
run: |
docker run --rm --volume $PWD:/md peterdavehello/markdownlint markdownlint --ignore vendor --ignore LICENSE.md '**/*.md'
2 changes: 0 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,3 @@
composer.lock
vendor

node_modules/
yarn.lock
13 changes: 13 additions & 0 deletions .markdownlint.jsonc
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"default": true,
// https://github.com/DavidAnson/markdownlint/blob/main/doc/md013.md
"line-length": {
"line_length": 120,
"code_blocks": false,
"tables": false
},
// https://github.com/DavidAnson/markdownlint/blob/main/doc/md024.md
"no-duplicate-heading": {
"siblings_only": true
}
}
18 changes: 0 additions & 18 deletions .markdownlintrc

This file was deleted.

12 changes: 11 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,15 @@ before starting to add changes. Use example [placed in the end of the page](#exa

## [Unreleased]

- [#101](https://github.com/OS2Forms/os2forms/pull/101)
- Added support for `os2web_key` in Digital post
- Added support for `os2web_key` in Fasit handler.

## [3.21.1] 2025-01-06

- Updated Maestro notification handler assignment message format.
- Updated `os2forms_fbs_handler` to use latest endpoints and operations.

## [3.21.0] 2024-12-17

- Updated `os2web_audit`.
Expand Down Expand Up @@ -323,7 +332,8 @@ before starting to add changes. Use example [placed in the end of the page](#exa
- Security in case of vulnerabilities.
```

[Unreleased]: https://github.com/OS2Forms/os2forms/compare/3.21.0...HEAD
[Unreleased]: https://github.com/OS2Forms/os2forms/compare/3.21.1...HEAD
[3.21.1]: https://github.com/OS2Forms/os2forms/compare/3.21.0...3.21.1
[3.21.0]: https://github.com/OS2Forms/os2forms/compare/3.20.1...3.21.0
[3.20.1]: https://github.com/OS2Forms/os2forms/compare/3.20.0...3.20.1
[3.20.0]: https://github.com/OS2Forms/os2forms/compare/3.19.0...3.20.0
Expand Down
21 changes: 10 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -122,29 +122,28 @@ run the checks locally.

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

# Fix (some) coding standards issues.
docker run --rm --volume ${PWD}:/app --workdir /app itkdev/php8.1-fpm composer coding-standards-apply
docker run --rm --volume ${PWD}:/app --workdir /app itkdev/php8.1-fpm composer coding-standards-check
```

### Markdown

```sh
docker run --rm --volume ${PWD}:/app --workdir /app node:20 yarn install
docker run --rm --volume ${PWD}:/app --workdir /app node:20 yarn coding-standards-check/markdownlint

# Fix (some) coding standards issues.
docker run --rm --volume ${PWD}:/app --workdir /app node:20 yarn coding-standards-apply/markdownlint
docker pull peterdavehello/markdownlint
docker run --rm --volume $PWD:/md peterdavehello/markdownlint markdownlint --ignore vendor --ignore LICENSE.md '**/*.md' --fix
docker run --rm --volume $PWD:/md peterdavehello/markdownlint markdownlint --ignore vendor --ignore LICENSE.md '**/*.md'
```

## Code analysis

We use [PHPStan](https://phpstan.org/) for static code analysis.

Running statis code analysis on a standalone Drupal module is a bit tricky, so
we use a helper script to run the analysis:
Running statis code analysis on a standalone Drupal module is a bit tricky, so we use a helper script to run the
analysis:

```sh
./scripts/code-analysis
```shell
docker run --rm --volume ${PWD}:/app --workdir /app itkdev/php8.1-fpm ./scripts/code-analysis
```

**Note**: Currently the code analysis is only run on the `os2forms_digital_post` sub-module (cf. [`phpstan.neon`](./phpstan.neon)).
116 changes: 61 additions & 55 deletions composer.json
Original file line number Diff line number Diff line change
@@ -1,20 +1,8 @@
{
"name": "os2forms/os2forms",
"type": "drupal-module",
"description": "Drupal 8 OS2Form module provides advanced webform functionality for Danish Municipalities",
"minimum-stability": "dev",
"prefer-stable": true,
"license": "EUPL-1.2",
"repositories": {
"drupal": {
"type": "composer",
"url": "https://packages.drupal.org/8"
},
"assets": {
"type": "composer",
"url": "https://asset-packagist.org"
}
},
"type": "drupal-module",
"require": {
"php": "^8.1",
"ext-dom": "*",
Expand Down Expand Up @@ -43,7 +31,7 @@
"drupal/mailsystem": "^4.1",
"drupal/masquerade": "^2.0@RC",
"drupal/pathauto": "^1.5",
"drupal/permissions_by_term": "^3.1 || ^2.25",
"drupal/permissions_by_term": "^2.25 || ^3.1",
"drupal/queue_mail": "^1.4",
"drupal/r4032login": "^2.1",
"drupal/redirect": "^1.4",
Expand All @@ -68,90 +56,108 @@
"http-interop/http-factory-guzzle": "^1.0.0",
"itk-dev/beskedfordeler-drupal": "^1.0",
"itk-dev/serviceplatformen": "^1.5",
"mglaman/composer-drupal-lenient": "^1.0",
"os2web/os2web_audit": "^0.1.6",
"os2web/os2web_datalookup": "^2.0",
"os2web/os2web_datalookup": "dev-feature/os2web_key as 2.0.0",
"os2web/os2web_key": "^1.0",
"os2web/os2web_nemlogin": "^1.0",
"php-http/guzzle7-adapter": "^1.0",
"phpoffice/phpword": "^0.18.2",
"symfony/options-resolver": "^5.4 || ^6.0",
"webmozart/path-util": "^2.3",
"wsdltophp/packagebase": "^5.0",
"zaporylie/composer-drupal-optimizations": "^1.2",
"mglaman/composer-drupal-lenient": "^1.0"
"zaporylie/composer-drupal-optimizations": "^1.2"
},
"require-dev": {
"dealerdirect/phpcodesniffer-composer-installer": "^0.7.1",
"drupal/coder": "^8.3",
"drupal/maillog": "^1.0",
"ergebnis/composer-normalize": "^2.42",
"mglaman/phpstan-drupal": "^1.1",
"phpstan/extension-installer": "^1.3",
"phpstan/phpstan-deprecation-rules": "^1.1",
"phpunit/phpunit": "^9.5",
"wsdltophp/packagegenerator": "^4.0"
},
"extra" : {
"repositories": {
"os2web/os2web_datalookup": {
"type": "vcs",
"url": "https://github.com/itk-dev/os2web_datalookup"
},
"drupal": {
"type": "composer",
"url": "https://packages.drupal.org/8"
},
"assets": {
"type": "composer",
"url": "https://asset-packagist.org"
}
},
"minimum-stability": "dev",
"prefer-stable": true,
"config": {
"allow-plugins": {
"cweagans/composer-patches": true,
"dealerdirect/phpcodesniffer-composer-installer": true,
"ergebnis/composer-normalize": true,
"mglaman/composer-drupal-lenient": true,
"phpstan/extension-installer": true,
"simplesamlphp/composer-module-installer": true,
"vaimo/composer-patches": true,
"zaporylie/composer-drupal-optimizations": true
},
"sort-packages": true
},
"extra": {
"composer-exit-on-patch-failure": false,
"enable-patching" : true,
"drupal-lenient": {
"allowed-list": [
"drupal/coc_forms_auto_export",
"drupal/webform_node_element"
]
},
"enable-patching": true,
"patches": {
"drupal/coc_forms_auto_export": {
"3240592 - Problem with phpseclib requirement in 2.x (https://www.drupal.org/project/coc_forms_auto_export/issues/3240592)": "https://www.drupal.org/files/issues/2021-10-04/requirement-namespace-3240592-1.patch",
"3286562 - Automated Drupal 10 compatibility fixes": "https://www.drupal.org/files/issues/2022-06-15/coc_forms_auto_export.2.0.x-dev.rector.patch",
"3259009 - PHP Warnings/Notices on Download Page": "https://git.drupalcode.org/project/coc_forms_auto_export/-/merge_requests/1.diff"
},
"drupal/entity_print": {
"2733781 - Add Export to Word Support": "https://www.drupal.org/files/issues/2019-11-22/2733781-47.patch"
},
"drupal/webform": {
"Unlock possibility of using Entity print module export to Word": "https://www.drupal.org/files/issues/2020-02-29/3096552-6.patch",
"Webform computed element post save alter": "https://www.drupal.org/files/issues/2024-06-25/webform_computed_post_save_field_alter.patch",
"Add custom hook (hook_webform_post_load_data) for audit logging": "https://gist.githubusercontent.com/cableman/d26898fc8f65ee0a31001bf391583b59/raw/6189dc4c2ceaabb19d25cc4b98b0b3028a6b0e1e/gistfile1.txt"

},
"drupal/coc_forms_auto_export": {
"3240592 - Problem with phpseclib requirement in 2.x (https://www.drupal.org/project/coc_forms_auto_export/issues/3240592)": "https://www.drupal.org/files/issues/2021-10-04/requirement-namespace-3240592-1.patch",
"3286562 - Automated Drupal 10 compatibility fixes" : "https://www.drupal.org/files/issues/2022-06-15/coc_forms_auto_export.2.0.x-dev.rector.patch",
"3259009 - PHP Warnings/Notices on Download Page" : "https://git.drupalcode.org/project/coc_forms_auto_export/-/merge_requests/1.diff"
},
"drupal/webform_node_element": {
"3290637 - Automated Drupal 10 compatibility fixes": "https://www.drupal.org/files/issues/2023-05-12/webform_node_element_d10-3290637-11.patch"
},
"drupal/webform_encrypt": {
"Ensure data is base64 encoded (https://www.drupal.org/project/webform_encrypt/issues/3399414)": "https://git.drupalcode.org/project/webform_encrypt/-/merge_requests/4.patch",
"PHP Warning if unserialize fails (https://www.drupal.org/project/webform_encrypt/issues/3292305)": "https://www.drupal.org/files/issues/2022-06-23/unserialize-php-notice.patch"
},
"drupal/webform_node_element": {
"3290637 - Automated Drupal 10 compatibility fixes": "https://www.drupal.org/files/issues/2023-05-12/webform_node_element_d10-3290637-11.patch"
}
},
"drupal-lenient": {
"allowed-list": [
"drupal/coc_forms_auto_export",
"drupal/webform_node_element"
]
}
},
"scripts": {
"code-analysis/phpstan": [
"phpstan analyse"
],
"code-analysis": [
"@code-analysis/phpstan"
],
"coding-standards-check/phpcs": [
"phpcs --standard=phpcs.xml.dist"
"code-analysis/phpstan": [
"phpstan analyse"
],
"coding-standards-check": [
"@coding-standards-check/phpcs"
"coding-standards-apply": [
"@coding-standards-apply/phpcs"
],
"coding-standards-apply/phpcs": [
"phpcbf --standard=phpcs.xml.dist"
],
"coding-standards-apply": [
"@coding-standards-apply/phpcs"
"coding-standards-check": [
"@coding-standards-check/phpcs"
],
"coding-standards-check/phpcs": [
"phpcs --standard=phpcs.xml.dist"
]
},
"config": {
"sort-packages": true,
"allow-plugins": {
"cweagans/composer-patches": true,
"dealerdirect/phpcodesniffer-composer-installer": true,
"phpstan/extension-installer": true,
"simplesamlphp/composer-module-installer": true,
"vaimo/composer-patches": true,
"zaporylie/composer-drupal-optimizations": true,
"mglaman/composer-drupal-lenient": true
}
}
}
14 changes: 8 additions & 6 deletions modules/os2forms_attachment/README.md
Original file line number Diff line number Diff line change
@@ -1,20 +1,22 @@
# OS2Forms Attachment Drupal module

# Module purpose
## Module purpose

The aim of this module is to provide an OS2forms attachment element for adding PDF/HTML attachment.

It also supports creation of reusable headers/footers components which are used when rendering the attachments.

# How does it work
## How does it work

To add custom headers/footer ```admin/structure/webform/config/os2forms_attachment_component```
To add custom headers/footer `admin/structure/webform/config/os2forms_attachment_component`

To specify headers/footers that will override the default ones on a global level (**Third party settings** -> **Entity print** section): ```admin/structure/webform/config```
To specify headers/footers that will override the default ones on a global level (**Third party settings** -> **Entity
print** section): `admin/structure/webform/config`

To specify headers/footers that will override the default ones on a form level (**Third party settings** -> **Entity print** section): ```/admin/structure/webform/manage/[webform]/settings```
To specify headers/footers that will override the default ones on a form level (**Third party settings** -> **Entity
print** section): ```/admin/structure/webform/manage/[webform]/settings```

# Overwriting templates
## Overwriting templates

With some setups it might be necessary to overwrite templates
in order to access stylesheets or images.
Expand Down
Loading
Loading