/frontend-validation-tool

Tool for validating/monitoring new publications

Primary LanguageTypeScript

project-logo

FRONTEND-VALIDATION-TOOL

last-commit repo-top-language repo-language-count


Table of Contents

Overview

A publication can have several requirements in order to make structural sense. These are the type of requirements that can be checked by this tool:

Features

Document Type Validation

Publications must meet structural requirements to ensure consistency and readability. The frontend supports validation for the following document types:

- Besluitenlijst
- Notule
- Agenda

In addition to specific document types, each publication is required to have a title, validated as a string to ensure it is present and correctly formatted. For "Notule" documents, there is an additional requirement to validate the maturity level, ensuring that these documents not only meet structural standards but also adhere to designated maturity criteria, adding a layer of depth to the validation process.

Validation Glue

In order to properly validate an agenda item exists in a publication, we need to know the following:

- Agenda item
  - title
  - resolution
  - vote
  - decision
- Session
  - time
  - governing body

Installation

From source

  1. Clone the frontend-validation-tool repository:
$ git clone git@github.com:lblod/frontend-validation-tool.git
  1. Change to the project directory:
$ cd frontend-validation-tool
  1. Install the dependencies:
$ > npm install
  1. Build the frontend:
$ > npm run build

Note that you can define the environment by creating a .ENV file in the root and set ENVIRONMENT=development for development.

Usage

Run the application using the command below:

npm run dev

CORS

Due to issues with CORS for publications published by vendors other than Gelinkt Notuleren changes needed to be made to the way the app proxies. Either we host a CORS-anywhere service alongside the app or we resort to using a third party. We currently chose the latter and are using CORS proxy. In the future we might want to host our own CORS-anywhere service to avoid the need for a third party.

To change the default proxy, configure the CORS_PROXY_URL environment variable in the .ENV file. For example, to not use a proxy leave the variable empty:

ENVIRONMENT=development
CORS_PROXY_URL=

Don't forget to rebuild by running npm run dev.

Testing

Run the test suite using the command below:

npm run test

Documentation

Link to the full documentation here.

Return