Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added support for os2web_key #101

Open
wants to merge 5 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
31 changes: 10 additions & 21 deletions .github/workflows/pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,9 @@ 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
Expand Down Expand Up @@ -111,27 +114,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.

3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@ 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

## [3.15.1] 2024-05-14

- Added missing return type.
Expand Down
20 changes: 9 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -122,29 +122,27 @@ 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 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)).
94 changes: 46 additions & 48 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 @@ -47,7 +35,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/queue_ui": "^2.1",
"drupal/r4032login": "^2.1",
Expand Down Expand Up @@ -75,13 +63,14 @@
"drupal/workflow_participants": "^2.4",
"http-interop/http-factory-guzzle": "^1.0.0",
"itk-dev/beskedfordeler-drupal": "^1.0",
"itk-dev/serviceplatformen": "dev-feature/guzzle6-adapter as 1.5",
"os2web/os2web_datalookup": "^1.5",
"itk-dev/serviceplatformen": "dev-feature/guzzle6-adapter as 1.5.0",
"os2web/os2web_datalookup": "dev-feature/os2web_key as 1.12.0",
"os2web/os2web_key": "^1.0",
"os2web/os2web_nemlogin": "^1.0",
"php-http/guzzle6-adapter": "^2.0",
"phpoffice/phpword": "^0.18.2",
"symfony/options-resolver": "^5.4 || ^6.0",
"tecnickcom/tcpdf": "~6",
"tecnickcom/tcpdf": "^6",
"webmozart/path-util": "^2.3",
"wsdltophp/packagebase": "^5.0",
"zaporylie/composer-drupal-optimizations": "^1.2"
Expand All @@ -90,25 +79,45 @@
"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,
"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,
"enable-patching": true,
"patches": {
"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"
},
"drupal/user_default_page": {
"Warning: in_array() expects parameter 2 to be array, null given in user_default_page_user_logout() (https://www.drupal.org/node/3246986)": "https://www.drupal.org/files/issues/2021-11-01/user_default_page-3246986-2.patch"
},
"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"
},
Expand All @@ -121,34 +130,23 @@
}
},
"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
}
}
}
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
9 changes: 5 additions & 4 deletions modules/os2forms_autocomplete/README.md
Original file line number Diff line number Diff line change
@@ -1,15 +1,16 @@
# OS2Forms Autocomplete Drupal module

# Module purpose
## Module purpose

The aim of this module is to provide a genetic OS2Forms Autocomplete element which can return options from an external webservice.
The aim of this module is to provide a genetic OS2Forms Autocomplete element which can return options from an external
webservice.

# How does it work
## How does it work

Module exposes OS2Forms Autocomplete component that are available in the webform build process.

Build page:

```
```url
admin/structure/webform/manage/[webform]
```
3 changes: 1 addition & 2 deletions modules/os2forms_consent/README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
# OS2forms Consent Drupal module

## Module purpose

The aim of this module is to provide integration consent provider.

## How does it work


7 changes: 4 additions & 3 deletions modules/os2forms_dawa/README.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
# OS2Forms DAWA Drupal module

# Module purpose
## Module purpose

The aim of this module is to provide integration with Danish Addresses Web API (DAWA https://dawa.aws.dk) and provider address autocomplete fields.
The aim of this module is to provide integration with Danish Addresses Web API (DAWA <https://dawa.aws.dk>) and provider
address autocomplete fields.

# How does it work
## How does it work

Module exposes couple of new Autocomplete components that are available in the webform build process.

Expand Down
5 changes: 5 additions & 0 deletions modules/os2forms_digital_post/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,11 @@ examples](modules/os2forms_digital_post_examples/README.md).
Go to `/admin/os2forms_digital_post/settings` to set up global settings for
digital post.

### Key

We use [os2web_key](https://github.com/OS2web/os2web_key) to provide the certificate for sending digital post, and the
key must be of type "[Certificate](https://github.com/os2web/os2web_key?tab=readme-ov-file#certificate)".

### Queue

The actual sending of digital post is handled by jobs in an [Advanced
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ dependencies:
- 'beskedfordeler:beskedfordeler'
- 'drupal:advancedqueue'
- 'os2web_datalookup:os2web_datalookup'
- 'os2web_key:os2web_key'
- 'webform:webform'
- 'webform:webform_submission_log'

Expand Down
9 changes: 9 additions & 0 deletions modules/os2forms_digital_post/os2forms_digital_post.install
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,12 @@ use Drupal\os2forms_digital_post\Helper\BeskedfordelerHelper;
function os2forms_digital_post_schema() {
return Drupal::service(BeskedfordelerHelper::class)->schema();
}

/**
* Implements hook_update_N().
*/
function os2forms_digital_post_update_9001(): void {
\Drupal::service('module_installer')->install([
'os2web_key',
], TRUE);
}
Loading
Loading