Skip to content
Merged
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
3 changes: 3 additions & 0 deletions .github/workflows/module.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,9 @@ jobs:

- uses: go-task/setup-task@v2

- name: Install Drupal site
run: task drupal:site:install

- name: Extract translations
run: task translations:extract

Expand Down
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [1.0.0] - 2026-09-28

* [PR-11](https://github.com/itk-dev/os2forms_f2/pull/11)
* Cleaned up identification of cases and matters
* Set default matter type ("Internal")
* Updated user manual
* [PR-10](https://github.com/itk-dev/os2forms_f2/pull/10)
Updated user manual
* [PR-8](https://github.com/itk-dev/os2forms_f2/pull/8)
Expand Down
21 changes: 17 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ changes).
## Testing

``` shell
task drupal:os2forms:install
task drupal:site:install
```

## User manual
Expand Down Expand Up @@ -154,7 +154,7 @@ F2_MATTER_IDENTIFIER='903'
With these in place, we can now generate images:

``` shell
task drupal:os2forms:install --yes
task drupal:site:install --yes
task playwright:install --yes
task user-manual:images:generate
```
Expand All @@ -177,12 +177,25 @@ task user-manual:images:generate
to quickly check that everything works as expected, but before committing anything you must run

``` shell
task drupal:os2forms:install --yes
task drupal:site:reset --yes
task user-manual:images:generate
```

reset Drupal before generating the images.
to reset Drupal before generating the images.

> [!TIP]
> See [Run a Playwright command](https://addons.ddev.com/addons/julienloizelet/ddev-playwright#run-a-playwright-command)
> for other cool tricks supported by DDEV and the Playwright add-on.

We use [php-vcr](https://github.com/php-vcr/php-vcr) to record and replay interactions with the F2 API during testing
and store cassettes in `tests/vcr-cassettes`.

> [!NOTE]
> php-vcr has some redaction issues (cf. <https://github.com/php-vcr/php-vcr/issues/503>) so we're not yet ready to
> publish cassettes and Git ignore the cassettes for now.

---

``` shell
ddev dotenv set .env.local --os2forms-f2-test=value
```
64 changes: 48 additions & 16 deletions Taskfile.yml
Original file line number Diff line number Diff line change
Expand Up @@ -141,13 +141,9 @@ tasks:

translations:extract:
desc: Extract module translations
deps:
- drupal:site:is-installed
cmds:
# Patch https://github.com/OS2Forms/os2forms/blob/develop/config/optional/pathauto.pattern.os2forms_wf_webforms.yml
- |
ddev exec sed --in-place 's/id: node_type$/id: entity_bundle:node/' */modules/contrib/os2forms/config/optional/pathauto.pattern.os2forms_wf_webforms.yml
- ddev drush --yes site:install minimal
- ddev drush --yes pm:install drupal_translation_extractor
- ddev drush --yes pm:install os2forms_f2
- for:
- da
cmd: >-
Expand All @@ -156,6 +152,11 @@ tasks:
--require-context=os2forms_f2 module:os2forms_f2
--sort=asc --clean --debug
--finder-do-not-ignore-vcs-ignored
# Show any changes
- task: translations:git:diff
ignore_error: true
# Restore if only some metadata is changed
- task: translations:git:restore

translations:git:diff:
desc: "`git diff` all translation files ignoring timestamp changes"
Expand All @@ -180,19 +181,35 @@ tasks:
to check.
cmd: git restore '*.po'

drupal:os2forms:install:
desc: Install OS2Forms F2 module and configure Drupal for testing
prompt: Really reset Drupal site?
drupal:site:is-installed:
internal: true
preconditions:
# https://drupal.stackexchange.com/a/318384
- sh: '[ $(ddev drush status --field=bootstrap) = "Successful" ]'
msg: |
It seems that Drupal has not been installed. Run

task drupal:site:install

before running this task.

drupal:site:install:
desc: Installs Drupal site, enables OS2Forms F2 module and configures Drupal for development and testing
prompt: Really install (and reset) Drupal site?
cmds:
- ddev drush --yes site:install
- ddev drush --yes user:password admin password
- ddev drush --yes pm:uninstall update
- ddev drush --yes pm:uninstall update announcements_feed

# Patch https://github.com/OS2Forms/os2forms/blob/develop/config/optional/pathauto.pattern.os2forms_wf_webforms.yml
- |
ddev exec sed --in-place 's/id: node_type$/id: entity_bundle:node/' */modules/contrib/os2forms/config/optional/pathauto.pattern.os2forms_wf_webforms.yml

- ddev drush --yes pm:install os2forms_f2 os2forms_f2_examples os2forms_test_playwright
- ddev drush --yes pm:install os2forms_f2 os2forms_f2_examples os2forms_f2_test drupal_translation_extractor

# Some defaults
- ddev drush --yes config:set os2forms_f2.settings f2_api.log_level debug
- ddev drush --yes config:set os2forms_f2.settings general.queue os2forms_f2

# Gin theme
- ddev drush --yes theme:install gin
Expand All @@ -213,21 +230,34 @@ tasks:
# Import our module translations
- ddev drush --yes locale:import da modules/custom/os2forms_f2/translations/os2forms_f2.da.po

- task: drupal:os2forms:configure
- task: drupal:site:reset

drupal:os2forms:configure:
drupal:site:reset:
decs: Create settings for os2forms_f2 module
prompt: Really reset Drupal site?
cmds:
# Some defaults
- ddev drush --yes config:set os2forms_f2.settings f2_api.log_level debug
- ddev drush --yes config:set os2forms_f2.settings general.queue os2forms_f2
- ddev drush --yes config:import --partial --source modules/custom/os2forms_f2/modules/os2forms_f2_examples/config/install
- ddev drush --yes config:import --partial --source modules/custom/os2forms_f2/modules/os2forms_f2_test/config/install
- >-
ddev drush --yes sql:query "
TRUNCATE advancedqueue;
TRUNCATE webform_submission_log;
TRUNCATE webform_submission_data;
TRUNCATE webform_submission;
TRUNCATE os2forms_f2_f2_item;
ALTER TABLE webform_submission AUTO_INCREMENT = 1;
UPDATE webform SET next_serial = 1;
"

playwright:install:
desc: Install Playwright stuff
cmd: ddev playwright-install --pm npm

user-manual:images:generate:
desc: Generate user manual images
deps:
- drupal:site:is-installed
- playwright:install
cmds:
- cmd: ddev playwright test user-manual-images.spec.ts {{.CLI_ARGS}}
# We want to postprocess any updated images even if something fails
Expand All @@ -237,6 +267,7 @@ tasks:

user-manual:images:trim:
desc: "Trim docs images"
silent: true
vars:
BORDER_WIDTH: 4
# Trim and add border
Expand All @@ -256,6 +287,7 @@ tasks:

user-manual:images:restore:
desc: "Restore docs images that are not visually modified"
silent: true
cmd:
cmd: |
# https://stackoverflow.com/a/949391
Expand Down
6 changes: 6 additions & 0 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
"mglaman/composer-drupal-lenient": "^1.0",
"mglaman/phpstan-drupal": "^2.2",
"palantirnet/drupal-rector": "^1.1",
"php-vcr/php-vcr": "^1.12",
"phpstan/extension-installer": "^1.4",
"phpstan/phpstan": "2.3.3",
"phpstan/phpstan-deprecation-rules": "^2.0"
Expand Down Expand Up @@ -67,6 +68,11 @@
"drupal/events_logging",
"drupal/switch_page_theme"
]
},
"patches": {
"php-vcr/php-vcr": {
"Undefined array key 2097198": "patches/php-vcr/php-vcr/curl-helper.patch"
}
}
}
}
18 changes: 16 additions & 2 deletions docs/user-manual/da/form-builder.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,12 @@ på yderligere muligheder i behandlerindstillingerne.

Som bekendt ligger dokumenter i F2 på en akt, og for at arkivere på en sag opretter behandleren derfor indledningsvist
en akt som dokumentet kan knyttes til. For at arkivere på en sag skal man angive et id der entydigt udpeger en sag i F2.
Det vil være oplagt at bruge et sags-nummer
Det vil være oplagt at bruge et sagsnummer.

![Arkivér på sag](./images/generated/form-builder/webform-handler-add-archive-on-case.png)

Akttypen er som standard “Intern" og det vil formentlig aldrig blive aktuelt at ændre den til noget andet.

![Udfyldt "Arkivér på sag"](./images/generated/form-builder/webform-handler-add-archive-on-case-filled.png)

Når man gemmer tjekker systemet at sags-id'et entydigt identificerer en sag i F2:
Expand All @@ -44,12 +46,24 @@ Hvis man, som antydet, redigerer en F2-behandler kan man se detaljer om hvilken

![Detaljer om sag](./images/generated/form-builder/webform-handler-archive-on-case-case-details.png)

### Indsendelse af formular

Når en bruger indsender en besvarelse af en formular med en F2-behandler, så oprettes et job i F2-job i køen:

![Resultatloggen efter indsendelse](./images/generated/webform-submission/submission-log.png)

Når jobbet i køen er blevet behandlet kan man se hvad der faktisk er sket:

![Resultatloggen efter behandling af kø](./images/generated/webform-submission/submission-log-after-queue-processed.png)

## Arkivering på akt

Når man vil arkivere på en (eksisterende) akt skal man angive et id, fx akt-nummer, der entydigt udpeger akten i F2.
Når man vil arkivere på en (eksisterende) akt skal man angive et id, fx aktnummer, der entydigt udpeger akten i F2.

![Arkivér på akt](./images/generated/form-builder/webform-handler-add-archive-on-matter.png)

![Udfyldt "Arkivér på akt"](./images/generated/form-builder/webform-handler-add-archive-on-matter-filled.png)

Når man gemmer tjekker systemet at akt-id'et entydigt identificerer en akt i F2:

![Ugyldigt sags-id](./images/generated/form-builder/webform-handler-add-archive-on-matter-filled-invalid-matter-identifier.png)
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
7 changes: 7 additions & 0 deletions docs/user-manual/da/webform-submission.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# Formularbesvarelse

![En tom formular](./images/generated/webform-submission/form-empty.png)
![En udfyldt formular](./images/generated/webform-submission/form-filled.png)
![Besvarelse indsendt](./images/generated/webform-submission/form-submitted.png)
![Resultatloggen efter indsendelse](./images/generated/webform-submission/submission-log.png)
![Resultatloggen efter behandling af kø](./images/generated/webform-submission/submission-log-after-queue-processed.png)
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ uid: 0
template: false
archive: false
id: os2forms_f2_ex_000
title: F2
title: F2 (archive on case)
description: null
categories: { }
elements: |-
Expand Down Expand Up @@ -212,5 +212,25 @@ access:
roles: { }
users: { }
permissions: { }
handlers: { }
handlers:
f2_archive_on_case:
id: os2forms_f2_f2
handler_id: f2_archive_on_case
label: 'F2 (arkivér på sag)'
notes: ''
status: true
conditions: { }
weight: 1
settings:
archive:
attachment_element: attachment
document_title: '[webform_submission:label] ([site:url]) – [current-date:html_datetime]'
archive_target: case
archive_target_case:
case_identifier: '2026 - 1234567890'
matter_title: 'Matter: [webform_submission:label] ([site:url]) – [current-date:html_datetime]'
matter_type: Internal
additional:
states:
- completed
variants: { }
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ uid: 0
template: false
archive: false
id: os2forms_f2_ex_001
title: F2
title: F2 (archive on matter)
description: null
categories: { }
elements: |-
Expand Down Expand Up @@ -231,24 +231,4 @@ handlers:
additional:
states:
- completed
f2_archive_on_case:
id: os2forms_f2_f2
handler_id: f2_archive_on_case
label: 'F2 (arkivér på sag)'
notes: ''
status: true
conditions: { }
weight: 1
settings:
archive:
attachment_element: attachment
document_title: '[webform_submission:label] ([site:url]) – [current-date:html_datetime]'
archive_target: case
archive_target_case:
case_identifier: '2026 - 1234567890'
matter_title: 'Matter: [webform_submission:label] ([site:url]) – [current-date:html_datetime]'
matter_type: Internal
additional:
states:
- completed
variants: { }
Loading
Loading