Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

Version 1 Next »

This page is intended for technical users looking to make changes to how CHEFS uses form.io. The initialization of CHEFS works as follows:

  1. Register form.io modules

  2. Load keycloak

  3. Initialize Vue

In this configuration, modules are registered prior to starting Vue and are not registered post initialization.

Modules

Form.io can be customized by creating and registering custom modules. These custom modules alter the behaviour of the form.io builder and renderer. You need a minimum version of formio.js v4.5.0 and is documented here. Form.io allows you to customize the following modules: components, templates, providers, displays, builders, options, fetch, framework. CHEFS is currently customizing components and providers.

Components

In the stable release of CHEFS v1.3.0, custom components are created and built prior to deployment. Once deployed, the components are registered in the initialization process of the application.

Solutions

We can create our custom components and host them internally in CHEFS or externally, and register the modules post deployment. This would require a comparison check between what the user has on their computer and what exists on the server. Any changes would need to be downloaded to the users computer. This comparison would need to occur every time they are going to use http://form.io in any way. A means of reducing the bandwidth between checks could be a simple hash of the components on the user’s end compared against the hash of the components on the server end. A deeper comparison can be made if there is a difference in the hash.

This method works and can be seen in this repository: https://github.com/jasonchung1871/common-hosted-form-service/tree/post-init-modules

It is important that you include the Formio.use(yourModuleName) inside of your custom component, as CHEFS will not be able to use your module without knowing it’s variable name.

  • No labels