Skip to content

Commit

Permalink
Update general readmes and md formatting
Browse files Browse the repository at this point in the history
Signed-off-by: Jeremy Ho <jujaga@gmail.com>
  • Loading branch information
jujaga committed Oct 28, 2020
1 parent d69d6bb commit 75e216b
Show file tree
Hide file tree
Showing 3 changed files with 48 additions and 40 deletions.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ Create, edit and publish forms.
│ ├── docs/ - OpenAPI 3.0 Specification
│ └── forms/ - Models, Controllers, Routes for the forms
└── tests/ - Node.js backend web application tests
components/ - Form.io Custom Components Library
load-test/ - Standalone CHEFS load testing utility
openshift/ - OpenShift-deployment and shared pipeline files
CODE-OF-CONDUCT.md - Code of Conduct
COMPLIANCE.yaml - BCGov PIA/STRA compliance status
Expand Down
14 changes: 8 additions & 6 deletions components/README.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
# Form.io contrib components library

This module contains contributed components for use with Form.io. It also serves as a good example on how you can
create your very own custom components library that can be used with Form.io platform.
This module contains contributed components for use with Form.io. It also serves as a good example on how you can create your very own custom components library that can be used with Form.io platform.

## Installation

To install this library, do the following.

```
```sh
npm install --save @formio/contrib
```

Expand Down Expand Up @@ -40,15 +40,17 @@ Or you can use the **formio-contrib.use.min.js** file which automatically adds t
```

### Using within the Form.io Developer Portal
It is also possible to inject custom components within the Form.io Developer Portal. This allows you to use the Developer Portal to create forms that include your custom components. Note: This currently only works with the Next portal @ https://next.form.io

It is also possible to inject custom components within the Form.io Developer Portal. This allows you to use the Developer Portal to create forms that include your custom components. Note: This currently only works with the Next portal @ <https://next.form.io>

To make this work, navigate to your project settings, and then click on **Custom JS and CSS**. Within the **Custom JavaScript** box, you will then place the hosted URL to the **dist/formio-contrib.use.min.js** file within this library, like so.

![](https://api.monosnap.com/file/download?id=dQmYlhPWLa7mDDDJMN1VpkJwXy7iHG)
![Custom CSS and Javascript](https://api.monosnap.com/file/download?id=dQmYlhPWLa7mDDDJMN1VpkJwXy7iHG)

You can also use the unpkg url to this repo to test this out. [https://unpkg.com/@formio/contrib@latest/dist/formio-contrib.use.min.js](https://unpkg.com/@formio/contrib@latest/dist/formio-contrib.use.min.js)

### Using within the Form Manager application

You can also use this method to introduce custom components into the Form Manager application. To get this to work, you just need to Enable Public configurations within your project settings, and then provide the **js** setting to contain the URL of the **dist/formio-contrib.use.min.js** file within this repository like so.

![](https://api.monosnap.com/file/download?id=lvK2kW9eOuAEVDMNW96hP5qLOCaQEY)
![Public Configurations](https://api.monosnap.com/file/download?id=lvK2kW9eOuAEVDMNW96hP5qLOCaQEY)
72 changes: 38 additions & 34 deletions load-test/README.md
Original file line number Diff line number Diff line change
@@ -1,44 +1,48 @@
# CHEFS Load Test Utility
This utility is intended to be run by a developer against any fully running instance of CHEFS. The developer will need to ensure the configured client and user are valid and have the appropriate permissions to create a form, submit data to that form, and read/export the submissions.

The default configuration is against CHEFS Dev Master, using a Keycloak client (chefs-load-test) and user (chefs-load-test). It is important that the Keycloak client allows for username/password login.
This utility is intended to be run by a developer against any fully running instance of CHEFS. The developer will need to ensure the configured client and user are valid and have the appropriate permissions to create a form, submit data to that form, and read/export the submissions.

### Configuration
The utility leverages the [config](https://www.npmjs.com/package/config) library, which can read environment variables or files (see [/config](./config)). The default configuration does not contain a password, so the developer can set it via a local.json or environment variable `AUTH_PASSWORD`.
The default configuration is against CHEFS Dev Master, using a Keycloak client (chefs-load-test) and user (chefs-load-test). It is important that the Keycloak client allows for username/password login.

There is currently a single valid schema/submission: `kitchen_sink_advanced`. To add another, follow the naming and folder location layout (`./schema/<new_type>_schema.json` and `./submissions/<new_type>_submission.json`). Set via the submissions.schema configuration variable.
## Configuration

### Running
Ensure that the configuration is set correctly, and start with small batches...
The utility leverages the [config](https://www.npmjs.com/package/config) library, which can read environment variables or files (see [/config](./config)). The default configuration does not contain a password, so the developer can set it via a local.json or environment variable `AUTH_PASSWORD`.

```cmd
There is currently a single valid schema/submission: `kitchen_sink_advanced`. To add another, follow the naming and folder location layout (`./schema/<new_type>_schema.json` and `./submissions/<new_type>_submission.json`). Set via the submissions.schema configuration variable.

## Running

Ensure that the configuration is set correctly, and start with small batches...

```sh
npm run load-test
```

### Results
Expect the following layout for results:

```shell script
info
info ==============================================================================
info API: https://chefs-dev.pathfinder.gov.bc.ca/app/api/v1
info User: chefs-load-test
info Form: CHEFS Load Test - 2020-10-23T21:20:09.043Z - (5)
info Submission Count: 5
info ==============================================================================
info
info Create Form ElapsedMS : 553
info
info Create Submissions (Avg) ElapsedMS: 294
info Create Submissions (Min) ElapsedMS: 199
info Create Submissions (Max) ElapsedMS: 439
info
info Get Submissions ElapsedMS : 157
info Export Submissions ElapsedMS : 243
info
info Get Submissions Size : 1.76kb
info Export Submissions Size : 42.7kb
info
info ==============================================================================
info
## Results

Expect the following layout for results:

```sh
info
info ==============================================================================
info API: https://chefs-dev.pathfinder.gov.bc.ca/app/api/v1
info User: chefs-load-test
info Form: CHEFS Load Test - 2020-10-23T21:20:09.043Z - (5)
info Submission Count: 5
info ==============================================================================
info
info Create Form ElapsedMS : 553
info
info Create Submissions (Avg) ElapsedMS: 294
info Create Submissions (Min) ElapsedMS: 199
info Create Submissions (Max) ElapsedMS: 439
info
info Get Submissions ElapsedMS : 157
info Export Submissions ElapsedMS : 243
info
info Get Submissions Size : 1.76kb
info Export Submissions Size : 42.7kb
info
info ==============================================================================
info
```

0 comments on commit 75e216b

Please sign in to comment.