Skip to content

lblod/manage-submission-form-tooling

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

warning-forms

Usage

The buildForms script can be used to bundle all form configurations and generate a folder structure for each supported project.

npm install # Make sure you run this before running the script
npm run buildForms

This will create a folder for each supported project in the ./dist folder. You can then copy this folder to each respective project.

Using a specific date

By default a new timestamp will be generated when running the script, which will be used to prefix all file and folder names. If you want to use a different date for this you can pass it in as an argument to the script:

npm run buildForms -- --date 2022-02-03T11:00:00

The date should be a valid ISO 8601 date and parsable by date-fns' parseISO function.

Using Docker to run the script

To run in a docker container clone this repo then run:

docker run -it --rm -v "$PWD":/app -w /app node:16 sh build-forms.sh

Testing changes

Make sure to test extensively your updates.

Checklists

⚠️ ⚠️ ⚠️ An update to the form, means it needs to be manually propageted to ALL apps. ⚠️ ⚠️ ⚠️

Loket

  • Create a new submission
  • Save the empty submission to check validations
  • Fill the submission
  • Ensure fields and subfields behave property, especially with
  • Save the submission, close it, reopen it
  • Send the submission, close it, reopen it
  • Open a submission in Concept state created with the previous forms version
  • Open a submission in Sent state created with the previous forms version

Meldingsplichtige

  • Create a new submission
  • Save the empty submission to check validations
  • Fill the submission
  • Ensure fields and subfields behave property, especially with
  • Save the submission, close it, reopen it
  • Send the submission, close it, reopen it
  • Open a submission in Concept state created with the previous forms version
  • Open a submission in Sent state created with the previous forms version

Toezicht

Full flow

  • Create a submission with the new forms version in Loket, send it, make sure it appears in Toezicht and can be opened
  • Same with a submission created with the old forms version but sent with the new forms version in application (env variable)

app-public-decisions-database

app-worship-decisions-database

  • connect the app to a source loket (with delta's), assuming the new forms have been deployed at the source
  • create e.g. notulen from an eredienstberstuur, and check it correctly syncs through, i.e. login as the same eredienstbestuur on worship-decisions-database

Debugging hints

This list is meant to evolve and get filled by developpers encountering issues.

  • Forms not opening in Toezicht ABB --> double check there is a migration defining the form file as a resource
  • For app-public-decisions-database, there is another default graph where the forms-files are stored, so you will need to update the migration accordingly.
  • For app-public-decisions-database, if a new form, very likely the business rules to decided whether it should be published or not, should be updated too.

Guide to create new fields

This is a little guide of files and services that need to be updated when creating new form fields.

Create fields

  1. Create your new field in formSkeleton/inputFields/input-fields.ttl with the appropriated constraints and a displayType.
  2. If the displayType is a new one (it's the case if you need a custom behaviour or if it doesn't exist yet), you will need to create the matching component in ember-submission-form-fields and add the correct mappings in the following files :
  1. Use the new field where it's needed in the forms

If your field is using new concept schemes they must be added in lib/enricher.js of enrich-submission-service

If your field is using new relationships that are not added in the enrichment yet, they must be added in lib/enricher.js of enrich-submission-service as well as in lib/submission-enricher.js of import-submission-service

Furthermore, most likely, you want this field in the database if new relation: this toezicht-flattened-form-data-generator should be updated with a new extractor

Export configuration to the apps

Generate the project specific files using the npm run buildForms script and paste the output in the app's root folder.

If you create a new configuration file, a few things need to be done :

  1. The ACTIVE_FORM_FILE environment variable of the enrich-submission-service needs to be updated to the new file name
  2. Add migrations to the app defining the configuration file as a resource in the database (migration)

When adding new Dossier Types (BesluitDocumentType/BesluitType)

If you introduce new Dossier Types (i.e., Concepts), they have to be published in several places. Additionally, there are business rules that should be published so vendors know how to handle these new dossier types.

Publishing the business rules to app-centrale-vindplaats

This should only happen on app-centrale-vindplaats. It's a simple TTL file that needs to be updated and ingested. Here is a reference. Take the latest migration you find and update the file.

This involves:

  • Adding a new skos:Concept as shown here.
  • Adding a notification rule, as demonstrated here.

Data model for the rules can be found here.

Publishing the Dossier Types (BesluitDocumentType/BesluitType) to data.vlaanderen

Since these skos:Concepts fall under data.vlaanderen.be, they should be published here as well so they resolve correctly.

Example PR: Publishing to data.vlaanderen

About

Tooling to generate forms for Toezicht

Resources

Stars

Watchers

Forks

Packages

No packages published