diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml index 42565ef..ca98f73 100644 --- a/.github/workflows/pr.yml +++ b/.github/workflows/pr.yml @@ -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 @@ -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' diff --git a/.gitignore b/.gitignore index 1cc8643..1a6c252 100644 --- a/.gitignore +++ b/.gitignore @@ -4,5 +4,3 @@ composer.lock vendor -node_modules/ -yarn.lock diff --git a/.markdownlint.jsonc b/.markdownlint.jsonc new file mode 100644 index 0000000..a28c580 --- /dev/null +++ b/.markdownlint.jsonc @@ -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 + } +} diff --git a/.markdownlintrc b/.markdownlintrc deleted file mode 100644 index 7563715..0000000 --- a/.markdownlintrc +++ /dev/null @@ -1,18 +0,0 @@ -{ - // @see https://github.com/DavidAnson/markdownlint/blob/main/schema/.markdownlint.jsonc - // https://github.com/DavidAnson/markdownlint/blob/main/doc/md013.md - "MD013": { - // Exclude code blocks - "code_blocks": false - }, - - // Prevent complaining on duplicated headings in CHANGELOG.md - // https://github.com/DavidAnson/markdownlint/blob/main/doc/md024.md - "MD024": { - "siblings_only": true - } -} - -// Local Variables: -// mode: json -// End: diff --git a/README.md b/README.md index c2f0962..90245a2 100644 --- a/README.md +++ b/README.md @@ -130,20 +130,19 @@ docker run --rm --volume ${PWD}:/app --workdir /app itkdev/php8.1-fpm composer c ### 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)). diff --git a/composer.json b/composer.json index 28f6f77..e43c19b 100644 --- a/composer.json +++ b/composer.json @@ -1,24 +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": { - "os2web/os2web_key": { - "type": "vcs", - "url": "https://github.com/rimi-itk/os2web_key" - }, - "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": "*", @@ -51,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", @@ -79,12 +63,12 @@ "itk-dev/beskedfordeler-drupal": "^1.0", "itk-dev/serviceplatformen": "dev-feature/guzzle6-adapter as 1.5", "os2web/os2web_datalookup": "^1.5", - "os2web/os2web_nemlogin": "^1.0", "os2web/os2web_key": "dev-os2web_key", + "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" @@ -93,62 +77,80 @@ "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_key": { + "type": "vcs", + "url": "https://github.com/itk-dev/os2web_key" + }, + "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/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" + }, + "drupal/dynamic_entity_reference": { + "entityQuery reference JOINs should specify target_type (https://www.drupal.org/project/dynamic_entity_reference/issues/3120952#comment-14141038)": "https://www.drupal.org/files/issues/2021-06-22/entityquery-reference-joins-should-specify-target_type-3120952-24.patch" + }, "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" - }, - "drupal/dynamic_entity_reference": { - "entityQuery reference JOINs should specify target_type (https://www.drupal.org/project/dynamic_entity_reference/issues/3120952#comment-14141038)": "https://www.drupal.org/files/issues/2021-06-22/entityquery-reference-joins-should-specify-target_type-3120952-24.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" } } }, "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 - } } } diff --git a/modules/os2forms_attachment/README.md b/modules/os2forms_attachment/README.md index 09ff6cf..1a88099 100644 --- a/modules/os2forms_attachment/README.md +++ b/modules/os2forms_attachment/README.md @@ -1,15 +1,17 @@ # 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` diff --git a/modules/os2forms_autocomplete/README.md b/modules/os2forms_autocomplete/README.md index d590238..2294d45 100644 --- a/modules/os2forms_autocomplete/README.md +++ b/modules/os2forms_autocomplete/README.md @@ -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] ``` diff --git a/modules/os2forms_consent/README.md b/modules/os2forms_consent/README.md index 45c89fc..4fa2331 100644 --- a/modules/os2forms_consent/README.md +++ b/modules/os2forms_consent/README.md @@ -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 - - diff --git a/modules/os2forms_dawa/README.md b/modules/os2forms_dawa/README.md index 53876ba..ae242ad 100644 --- a/modules/os2forms_dawa/README.md +++ b/modules/os2forms_dawa/README.md @@ -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 ) 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. diff --git a/modules/os2forms_digital_post/src/Form/SettingsForm.php b/modules/os2forms_digital_post/src/Form/SettingsForm.php index 9f4b93d..44febc7 100644 --- a/modules/os2forms_digital_post/src/Form/SettingsForm.php +++ b/modules/os2forms_digital_post/src/Form/SettingsForm.php @@ -19,11 +19,6 @@ final class SettingsForm extends FormBase { use StringTranslationTrait; - public const TEST_MODE = 'test_mode'; - public const SENDER = 'sender'; - public const CERTIFICATE = 'certificate'; - public const PROCESSING = 'processing'; - /** * The queue storage. * @@ -69,14 +64,14 @@ public function getFormId() { * @phpstan-return array */ public function buildForm(array $form, FormStateInterface $form_state): array { - $form[self::TEST_MODE] = [ + $form[Settings::TEST_MODE] = [ '#type' => 'checkbox', '#title' => $this->t('Test mode'), '#default_value' => $this->settings->getTestMode(), ]; $sender = $this->settings->getSender(); - $form[self::SENDER] = [ + $form[Settings::SENDER] = [ '#type' => 'fieldset', '#title' => $this->t('Sender'), '#tree' => TRUE, @@ -107,7 +102,7 @@ public function buildForm(array $form, FormStateInterface $form_state): array { ]; $certificate = $this->settings->getCertificate(); - $form[self::CERTIFICATE] = [ + $form[Settings::CERTIFICATE] = [ '#type' => 'fieldset', '#title' => $this->t('Certificate'), '#tree' => TRUE, @@ -124,7 +119,7 @@ public function buildForm(array $form, FormStateInterface $form_state): array { ], ]; - $form[self::CERTIFICATE][CertificateLocatorHelper::LOCATOR_TYPE_KEY] = [ + $form[Settings::CERTIFICATE][CertificateLocatorHelper::LOCATOR_TYPE_KEY] = [ '#type' => 'container', '#states' => [ 'visible' => [':input[name="certificate[locator_type]"]' => ['value' => CertificateLocatorHelper::LOCATOR_TYPE_KEY]], @@ -143,7 +138,7 @@ public function buildForm(array $form, FormStateInterface $form_state): array { ], ]; - $form[self::CERTIFICATE][CertificateLocatorHelper::LOCATOR_TYPE_AZURE_KEY_VAULT] = [ + $form[Settings::CERTIFICATE][CertificateLocatorHelper::LOCATOR_TYPE_AZURE_KEY_VAULT] = [ '#type' => 'fieldset', '#title' => $this->t('Azure key vault'), '#states' => [ @@ -161,7 +156,7 @@ public function buildForm(array $form, FormStateInterface $form_state): array { ]; foreach ($settings as $key => $info) { - $form[self::CERTIFICATE][CertificateLocatorHelper::LOCATOR_TYPE_AZURE_KEY_VAULT][$key] = [ + $form[Settings::CERTIFICATE][CertificateLocatorHelper::LOCATOR_TYPE_AZURE_KEY_VAULT][$key] = [ '#type' => 'textfield', '#title' => $info['title'], '#default_value' => $certificate[CertificateLocatorHelper::LOCATOR_TYPE_AZURE_KEY_VAULT][$key] ?? NULL, @@ -171,7 +166,7 @@ public function buildForm(array $form, FormStateInterface $form_state): array { ]; } - $form[self::CERTIFICATE][CertificateLocatorHelper::LOCATOR_TYPE_FILE_SYSTEM] = [ + $form[Settings::CERTIFICATE][CertificateLocatorHelper::LOCATOR_TYPE_FILE_SYSTEM] = [ '#type' => 'fieldset', '#title' => $this->t('File system'), '#states' => [ @@ -188,7 +183,7 @@ public function buildForm(array $form, FormStateInterface $form_state): array { ], ]; - $form[self::CERTIFICATE][CertificateLocatorHelper::LOCATOR_PASSPHRASE] = [ + $form[Settings::CERTIFICATE][CertificateLocatorHelper::LOCATOR_PASSPHRASE] = [ '#type' => 'textfield', '#title' => $this->t('Passphrase'), '#default_value' => $certificate[CertificateLocatorHelper::LOCATOR_PASSPHRASE] ?? NULL, @@ -203,14 +198,14 @@ public function buildForm(array $form, FormStateInterface $form_state): array { ]; $processing = $this->settings->getProcessing(); - $form[self::PROCESSING] = [ + $form[Settings::PROCESSING] = [ '#type' => 'fieldset', '#title' => $this->t('Processing'), '#tree' => TRUE, ]; $defaultValue = $processing['queue'] ?? 'os2forms_digital_post'; - $form[self::PROCESSING]['queue'] = [ + $form[Settings::PROCESSING]['queue'] = [ '#type' => 'select', '#title' => $this->t('Queue'), '#options' => array_map( @@ -252,8 +247,8 @@ public function validateForm(array &$form, FormStateInterface $formState): void } $values = $formState->getValues(); - if (CertificateLocatorHelper::LOCATOR_TYPE_FILE_SYSTEM === $values[self::CERTIFICATE][CertificateLocatorHelper::LOCATOR_TYPE]) { - $path = $values[self::CERTIFICATE][CertificateLocatorHelper::LOCATOR_TYPE_FILE_SYSTEM]['path'] ?? NULL; + if (CertificateLocatorHelper::LOCATOR_TYPE_FILE_SYSTEM === $values[Settings::CERTIFICATE][CertificateLocatorHelper::LOCATOR_TYPE]) { + $path = $values[Settings::CERTIFICATE][CertificateLocatorHelper::LOCATOR_TYPE_FILE_SYSTEM]['path'] ?? NULL; if (!file_exists($path)) { $formState->setErrorByName('certificate][file_system][path', $this->t('Invalid certificate path: %path', ['%path' => $path])); } @@ -273,10 +268,10 @@ public function submitForm(array &$form, FormStateInterface $formState): void { } try { - $settings[self::TEST_MODE] = (bool) $formState->getValue(self::TEST_MODE); - $settings[self::SENDER] = $formState->getValue(self::SENDER); - $settings[self::CERTIFICATE] = $formState->getValue(self::CERTIFICATE); - $settings[self::PROCESSING] = $formState->getValue(self::PROCESSING); + $settings[Settings::TEST_MODE] = (bool) $formState->getValue(Settings::TEST_MODE); + $settings[Settings::SENDER] = $formState->getValue(Settings::SENDER); + $settings[Settings::CERTIFICATE] = $formState->getValue(Settings::CERTIFICATE); + $settings[Settings::PROCESSING] = $formState->getValue(Settings::PROCESSING); $this->settings->setSettings($settings); $this->messenger()->addStatus($this->t('Settings saved')); diff --git a/modules/os2forms_digital_post/src/Helper/Settings.php b/modules/os2forms_digital_post/src/Helper/Settings.php index 33e6040..238d4ba 100644 --- a/modules/os2forms_digital_post/src/Helper/Settings.php +++ b/modules/os2forms_digital_post/src/Helper/Settings.php @@ -5,17 +5,23 @@ use Drupal\Core\KeyValueStore\KeyValueFactoryInterface; use Drupal\Core\KeyValueStore\KeyValueStoreInterface; use Drupal\os2forms_digital_post\Exception\InvalidSettingException; -use Drupal\os2forms_digital_post\Form\SettingsForm; use Symfony\Component\OptionsResolver\OptionsResolver; /** * General settings for os2forms_digital_post. */ final class Settings { + public const TEST_MODE = 'test_mode'; + + public const SENDER = 'sender'; public const SENDER_IDENTIFIER_TYPE = 'sender_identifier_type'; public const SENDER_IDENTIFIER = 'sender_identifier'; public const FORSENDELSES_TYPE_IDENTIFIKATOR = 'forsendelses_type_identifikator'; + public const CERTIFICATE = 'certificate'; + + public const PROCESSING = 'processing'; + /** * The store. * @@ -41,7 +47,7 @@ public function __construct(KeyValueFactoryInterface $keyValueFactory) { * Get test mode. */ public function getTestMode(): bool { - return (bool) $this->get(SettingsForm::TEST_MODE, TRUE); + return (bool) $this->get(self::TEST_MODE, TRUE); } /** @@ -50,7 +56,7 @@ public function getTestMode(): bool { * @phpstan-return array */ public function getSender(): array { - $value = $this->get(SettingsForm::SENDER); + $value = $this->get(self::SENDER); return is_array($value) ? $value : []; } @@ -60,7 +66,7 @@ public function getSender(): array { * @phpstan-return array */ public function getCertificate(): array { - $value = $this->get(SettingsForm::CERTIFICATE); + $value = $this->get(self::CERTIFICATE); return is_array($value) ? $value : []; } @@ -70,7 +76,7 @@ public function getCertificate(): array { * @phpstan-return array */ public function getProcessing(): array { - $value = $this->get(SettingsForm::PROCESSING); + $value = $this->get(self::PROCESSING); return is_array($value) ? $value : []; } @@ -116,10 +122,10 @@ public function setSettings(array $settings): self { private function getSettingsResolver(): OptionsResolver { return (new OptionsResolver()) ->setDefaults([ - SettingsForm::TEST_MODE => TRUE, - SettingsForm::SENDER => [], - SettingsForm::CERTIFICATE => [], - SettingsForm::PROCESSING => [], + self::TEST_MODE => TRUE, + self::SENDER => [], + self::CERTIFICATE => [], + self::PROCESSING => [], ]); } diff --git a/modules/os2forms_forloeb/CHANGELOG.md b/modules/os2forms_forloeb/CHANGELOG.md index 0ab070a..197d24b 100644 --- a/modules/os2forms_forloeb/CHANGELOG.md +++ b/modules/os2forms_forloeb/CHANGELOG.md @@ -1,4 +1,5 @@ # OS2Forms Forløb Change Log + All notable changes to this project should be documented in this file. The format is based on [Keep a Changelog](http://keepachangelog.com/) @@ -16,9 +17,11 @@ before starting to add changes. ## 2.5.2 - 27.03.2023 ### Updated + - Bumped drupal/ultimate_cron version fixing [Deprecated function: Implicit conversion from float-string](https://www.drupal.org/project/ultimate_cron/issues/3256142). ## 2.5.1 - 10.03.2023 + - Added github action for checking changelog changes when creating pull requests - Added os2forms/os2forms dependency - Changed composer patching configuration @@ -29,18 +32,20 @@ before starting to add changes. ## 2.5.0 - 11.10.2022 ### Added + - retry task controller action - Added support for inheriting values without creating a submission ## 2.4.0 ### Added + - Github CI action for checking Drupal Coding standards with PHP Code Sniffer - Fixed coding standards issues - ## Example of change log record -``` + +```markdown ## [x.x.x] Release name ### Added - Description on added functionality. diff --git a/modules/os2forms_forloeb/README.md b/modules/os2forms_forloeb/README.md index 5d00e94..ff65413 100644 --- a/modules/os2forms_forloeb/README.md +++ b/modules/os2forms_forloeb/README.md @@ -4,11 +4,13 @@ Adds a Maestro workflow engine and advanced workflow functionality to OS2forms. ## Installing OS2forms 2.1 med Forløb -This module requires the codebase from the [OS2forms core project](https://github.com/OS2Forms/os2forms8) installed per the documentation and by selecting the os2forms_forloeb_profile at installation. After succesful installation you should have the OS2forms med Forløb Module available for install via gui. +This module requires the codebase from the [OS2forms core project](https://github.com/OS2Forms/os2forms8) installed per +the documentation and by selecting the os2forms_forloeb_profile at installation. After succesful installation you should +have the OS2forms med Forløb Module available for install via gui. You can also install the module by using Drush: -``` +```shell ./vendor/bin/drush pm:enable os2forms_forloeb ``` @@ -16,12 +18,10 @@ You can also install the module by using Drush: ## Maestro notifications -Maestro 3.1 adds a `hook_webform_submission_form_alter` hook which we utilize to -send assignment, reminder and escalation notifications by adding a *Maestro -notification* handler to a form that spawns a Maestro workflow or assigns a -task. If the notification recipient is identified by an an email address, the -notification is sent as an email, and if the identifier is a Danish CPR number, -the notifications is sent as digital post. +Maestro 3.1 adds a `hook_webform_submission_form_alter` hook which we utilize to send assignment, reminder and +escalation notifications by adding a *Maestro notification* handler to a form that spawns a Maestro workflow or assigns +a task. If the notification recipient is identified by an an email address, the notification is sent as an email, and if +the identifier is a Danish CPR number, the notifications is sent as digital post. See [Opret flow-notifikationer](https://os2forms.os2.eu/node/457) (in Danish) for details. @@ -32,14 +32,13 @@ Settings for OS2Forms forløb are defined on `/admin/config/system/os2forms_forl #### Known anonymous roles -In order to make the notifications work, Maestro workflow tasks must be assigned -to a *known anonymous role* and these roles are defined under *Known anonymous -roles*. +In order to make the notifications work, Maestro workflow tasks must be assigned to a *known anonymous role* and these +roles are defined under *Known anonymous roles*. #### Processing -A notification is not sent to a user immediately, but added to a queue which -must be processed asynchronously. Specify the queue handling notification jobs. +A notification is not sent to a user immediately, but added to a queue which must be processed asynchronously. Specify +the queue handling notification jobs. #### Templates diff --git a/modules/os2forms_nemid/README.md b/modules/os2forms_nemid/README.md index 6f67a0e..83abeb3 100644 --- a/modules/os2forms_nemid/README.md +++ b/modules/os2forms_nemid/README.md @@ -1,10 +1,10 @@ # OS2Forms Nemid Drupal module -# Module purpose +## Module purpose The aim of this module is to provide custom NemId field and integration with OS2Web Nemlogin module. -# How does it work +## How does it work Module exposes dozen of new NemID components that are available in the webform build process. @@ -16,4 +16,3 @@ Besides this module adds a special settings to the Third Party Webform settings: - Redirect to nemlogin automatically Settings: admin/structure/webform/manage/[webform]/settings - diff --git a/modules/os2forms_permissions_by_term/README.md b/modules/os2forms_permissions_by_term/README.md index 2c57293..33ac936 100644 --- a/modules/os2forms_permissions_by_term/README.md +++ b/modules/os2forms_permissions_by_term/README.md @@ -1,10 +1,13 @@ # OS2Forms permission by term module + This module implements permission by term access restrictions on several lists and entity displays related to webform and maestro. ## Setup configuration + Add to your settings.php or local.settings.php -``` + +```php $config['permissions_by_term.settings'] = [ 'permissions_mode' => FALSE, 'require_all_terms_granted' => FALSE, @@ -12,6 +15,7 @@ $config['permissions_by_term.settings'] = [ 'target_bundles' => ['user_affiliation'] ] ``` + Alternative change your site configuration on admin/permissions-by-term/settings to match the above. !note This is the recommended configuration of the permissions_by_term module. Using different values for @@ -19,6 +23,7 @@ Alternative change your site configuration on admin/permissions-by-term/settings be thoroughly tested. ## Usage + - The user affiliation taxonomy is added to webform config form and Maestro workflow forms. - The Permissions by Term module adds a form element to the user form. - When a user visits an entity of the above mentioned this module checks for match between the entity and the users diff --git a/modules/os2forms_sbsys/README.md b/modules/os2forms_sbsys/README.md index b554eeb..8e1129f 100644 --- a/modules/os2forms_sbsys/README.md +++ b/modules/os2forms_sbsys/README.md @@ -1,6 +1,7 @@ # OS2forms SBSYS integration Drupal module ## Module purpose + The aim of this module is to provide integration with SBSYS ESDH provider. ## How does it work diff --git a/modules/os2forms_webform_maps/README.md b/modules/os2forms_webform_maps/README.md index e6d0874..c36b901 100644 --- a/modules/os2forms_webform_maps/README.md +++ b/modules/os2forms_webform_maps/README.md @@ -1,13 +1,16 @@ # OS2Forms Webform Maps module for Drupal 9 ## Module description + Provides integration with Leaflet maps and provides map element for webform. ## How does it work + The module provides a new element type for webform. The element type is called "OS2Forms Kort". The element type is based on the Leaflet library. The element type provides a map with a marker that can be moved around on the map. The element type also provides ways of changing layers on the map. The data can be exported to PDF. ## Installation + The module can be installed using the standard Drupal installation procedure. diff --git a/modules/webform_embed/README.md b/modules/webform_embed/README.md index cfb4240..65b9855 100644 --- a/modules/webform_embed/README.md +++ b/modules/webform_embed/README.md @@ -1,6 +1,6 @@ -Webform Embed +# Webform Embed -This is a copy of the abandoned project https://www.drupal.org/project/webform_embed. +This is a copy of the abandoned project . Since there is no drupal 9 version available and there probably never will be, future maintenance of this module must be handled by the os2forms development team. diff --git a/package.json b/package.json deleted file mode 100644 index 52fcd34..0000000 --- a/package.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "license": "UNLICENSED", - "private": true, - "devDependencies": { - "markdownlint-cli": "^0.32.2" - }, - "scripts": { - "coding-standards-check/markdownlint": "yarn markdownlint --ignore LICENSE.md --ignore vendor --ignore node_modules '*.md' 'modules/os2forms_digital_post/**/*.md'", - "coding-standards-check": "yarn coding-standards-check/markdownlint", - "coding-standards-apply/markdownlint": "yarn markdownlint --ignore LICENSE.md --ignore vendor --ignore node_modules '*.md' 'modules/os2forms_digital_post/**/*.md' --fix", - "coding-standards-apply": "yarn coding-standards-apply/markdownlint" - } -} diff --git a/scripts/code-analysis b/scripts/code-analysis index f8ace6c..5a3c1e2 100755 --- a/scripts/code-analysis +++ b/scripts/code-analysis @@ -16,9 +16,21 @@ if [ ! -f "$drupal_dir/composer.json" ]; then composer --no-interaction create-project drupal/recommended-project:^9 "$drupal_dir" fi # Copy our code into the modules folder -mkdir -p "$drupal_dir/$module_path" + +# Clean up +rm -fr "${drupal_dir:?}/$module_path" + # https://stackoverflow.com/a/15373763 -rsync --archive --compress . --filter=':- .gitignore' --exclude "$drupal_dir" --exclude .git "$drupal_dir/$module_path" +# rsync --archive --compress . --filter=':- .gitignore' --exclude "$drupal_dir" --exclude .git "$drupal_dir/$module_path" + +# The rsync command in not available in itkdev/php8.1-fpm + +git config --global --add safe.directory /app +# Copy module files into module path +for f in $(git ls-files); do + mkdir -p "$drupal_dir/$module_path/$(dirname "$f")" + cp "$f" "$drupal_dir/$module_path/$f" +done drupal_composer config minimum-stability dev @@ -32,4 +44,4 @@ drupal_composer config extra.merge-plugin.include "$module_path/composer.json" drupal_composer require --dev symfony/phpunit-bridge # Run PHPStan -(cd "$drupal_dir" && vendor/bin/phpstan --configuration="$module_path/phpstan.neon") +(cd "$drupal_dir/$module_path" && ../../../../vendor/bin/phpstan)