Skip to content

Commit

Permalink
Merge pull request #257 from qld-gov-au/develop
Browse files Browse the repository at this point in the history
Update docs to v2
  • Loading branch information
duttonw authored Nov 16, 2023
2 parents cab1e2a + ff7cfce commit 6ffc5df
Show file tree
Hide file tree
Showing 11 changed files with 29 additions and 29 deletions.
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -106,13 +106,13 @@ You can consume this library either in Form.io Builder or Form.io Renderer.
To use custom components in the Form.io platform builder, please go to the [Project stage settings](https://help.form.io/userguide/projects#custom-js-and-css) and update the `Custom javascript` URL with the CDN URL of this library:

```
https://static.qgov.net.au/formio-qld/v1/v1.x.x-latest/formio-qld.min.js
https://static.qgov.net.au/formio-qld/v2/v2.x.x-latest/formio-qld.min.js
```

and update the `Custom CSS` property with

```
https://static.qgov.net.au/formio-qld/v1/v1.x.x-latest/formio-qld.min.css
https://static.qgov.net.au/formio-qld/v2/v2.x.x-latest/formio-qld.min.css
```

<img src="https://qld-gov-au.github.io/formio/static/media/storybook-formioSettings.fbfb01cf.png" alt="share diagram" width="640" />
Expand All @@ -123,12 +123,12 @@ To use custom components in the Form.io JS renderer, please include the script *
Pleaser refer to [Form.io doc](https://help.form.io/developers/form-renderer#getting-started) for how to initiate your form application in a HTML page.

```html
<script src="https://static.qgov.net.au/formio-qld/v1/v1.x.x-latest/formio.full.min.js"></script>
<script src="https://static.qgov.net.au/formio-qld/v2/v2.x.x-latest/formio.full.min.js"></script>
...
<script src="https://static.qgov.net.au/formio-qld/v1/v1.x.x-latest/formio-qld.min.js"></script>
<script src="https://static.qgov.net.au/formio-qld/v2/v2.x.x-latest/formio-qld.min.js"></script>
<link
rel="stylesheet"
href="https://static.qgov.net.au/formio-qld/v1/v1.x.x-latest/formio-qld.min.css"
href="https://static.qgov.net.au/formio-qld/v2/v2.x.x-latest/formio-qld.min.css"
/>
```

Expand Down
2 changes: 1 addition & 1 deletion src/examples/DownloadPdf/DownloadPdf.code.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { DownloadPdfRender } from "!!./DownloadPdf";

export const downloadPdfCode = `
<head>
<script src="https://static.qgov.net.au/formio-qld/v1/v1.x.x-latest/formio-script.min.js"></script>
<script src="https://static.qgov.net.au/formio-qld/v2/v2.x.x-latest/formio-script.min.js"></script>
</head>
<body>
<script>
Expand Down
2 changes: 1 addition & 1 deletion src/examples/DownloadPdf/DownloadPdfWizard.code.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { DownloadPdfWizardRender } from "!!./DownloadPdfWizard";

export const downloadPdfWizardCode = `
<head>
<script src="https://static.qgov.net.au/formio-qld/v1/v1.x.x-latest/formio-script.min.js"></script>
<script src="https://static.qgov.net.au/formio-qld/v2/v2.x.x-latest/formio-script.min.js"></script>
</head>
<body>
<script>
Expand Down
2 changes: 1 addition & 1 deletion src/examples/SimpleWizard/SimpleWizard.code.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { SimpleWizardRender } from "!!./SimpleWizard";

export const simpleWizardCode = `
<head>
<script src="https://static.qgov.net.au/formio-qld/v1/v1.x.x-latest/formio-script.min.js"></script>
<script src="https://static.qgov.net.au/formio-qld/v2/v2.x.x-latest/formio-script.min.js"></script>
</head>
<body>
<script>
Expand Down
2 changes: 1 addition & 1 deletion src/examples/SingleSignOn/stories/SSOUnauth.code.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { SSOUnauth } from "!!./SSOUnauth";

export const SSOUnauthCode = `
<head>
<script src="https://static.qgov.net.au/formio-qld/v1/v1.x.x-latest/formio-script.min.js"></script>
<script src="https://static.qgov.net.au/formio-qld/v2/v2.x.x-latest/formio-script.min.js"></script>
</head>
<body>
<script>
Expand Down
2 changes: 1 addition & 1 deletion src/examples/SingleSignOn/stories/SingleSignOn.code.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { SingleSignOn } from "!!./SingleSignOn";

export const singleSignOnCode = `
<head>
<script src="https://static.qgov.net.au/formio-qld/v1/v1.x.x-latest/formio-script.min.js"></script>
<script src="https://static.qgov.net.au/formio-qld/v2/v2.x.x-latest/formio-script.min.js"></script>
</head>
<body>
<script>
Expand Down
2 changes: 1 addition & 1 deletion src/helpers/FormioLoader/FormioLoader.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ FormioLoader provide function for you to initiate Formio instance.
To use it, simply include the script and run `FormioLoader.initFormio()` in your webpage, it will initiate Formio instance with the div that contains `data-formio` attribute.

```html
<script src="https://static.qgov.net.au/formio-qld/v1/v1.x.x-latest/formio-loader.min.js"></script>
<script src="https://static.qgov.net.au/formio-qld/v2/v2.x.x-latest/formio-loader.min.js"></script>
<script>
FormioLoader.initFormio();
</script>
Expand Down
2 changes: 1 addition & 1 deletion src/helpers/FormioScript/FormioScript.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
export const defaultVersion = window.formioQldCdnVersion || "v1/v1.x.x-latest";
export const defaultVersion = window.formioQldCdnVersion || "v2/v2.x.x-latest";

export const createScripts = (scripts, i, mainResolve) => {
if (i > scripts.length - 1) {
Expand Down
24 changes: 12 additions & 12 deletions src/helpers/FormioScript/FormioScript.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,12 @@ Simply include it in your application and it will search through the page with F
**Before using FormioScript:**

```html
<script async="false" src="https://static.qgov.net.au/formio-qld/v1/v1.x.x-latest/formio.full.js"></script>
<script async="false" src="https://static.qgov.net.au/formio-qld/v1/v1.x.x-latest/premium.min.js" ></script>
<script async="false" src="https://static.qgov.net.au/formio-qld/v1/v1.x.x-latest/formio-qld.js"></script>
<link href="https://static.qgov.net.au/formio-qld/v1/v1.x.x-latest/formio.full.min.css" rel="stylesheet"></link>
<link href="https://static.qgov.net.au/formio-qld/v1/v1.x.x-latest/premium.css" rel="stylesheet"></link>
<link href="https://static.qgov.net.au/formio-qld/v1/v1.x.x-latest/formio-qld.min.css" rel="stylesheet"></link>
<script async="false" src="https://static.qgov.net.au/formio-qld/v2/v2.x.x-latest/formio.full.js"></script>
<script async="false" src="https://static.qgov.net.au/formio-qld/v2/v2.x.x-latest/premium.min.js" ></script>
<script async="false" src="https://static.qgov.net.au/formio-qld/v2/v2.x.x-latest/formio-qld.js"></script>
<link href="https://static.qgov.net.au/formio-qld/v2/v2.x.x-latest/formio.full.min.css" rel="stylesheet"></link>
<link href="https://static.qgov.net.au/formio-qld/v2/v2.x.x-latest/premium.css" rel="stylesheet"></link>
<link href="https://static.qgov.net.au/formio-qld/v2/v2.x.x-latest/formio-qld.min.css" rel="stylesheet"></link>
<div id="formio1" class="qg-forms-v2"></div>
<div id="formio2" class="qg-forms-v2"></div>
<script>
Expand Down Expand Up @@ -74,7 +74,7 @@ Formio.createForm(
};
window.customFn3 = () => {};
</script>
<script src="https://static.qgov.net.au/formio-qld/v1/v1.x.x-latest/formio-script.min.js"></script>
<script src="https://static.qgov.net.au/formio-qld/v2/v2.x.x-latest/formio-script.min.js"></script>
<script>
FormioScript.init().then(() => {
// all formio scripts/css has been loaded.
Expand Down Expand Up @@ -108,7 +108,7 @@ Please refer to Squiz Matrix asset #249261.
You could create form dynamically after all the scripts are loaded.

```html
<script src="https://static.qgov.net.au/formio-qld/v1/v1.x.x-latest/formio-script.min.js"></script>
<script src="https://static.qgov.net.au/formio-qld/v2/v2.x.x-latest/formio-script.min.js"></script>
<script>
FormioScript.init().then(() => {
const div = document.createElement("div");
Expand All @@ -124,7 +124,7 @@ You could create form dynamically after all the scripts are loaded.
or using `FormioLoader.initFormio()` instead:

```html
<script src="https://static.qgov.net.au/formio-qld/v1/v1.x.x-latest/formio-script.min.js"></script>
<script src="https://static.qgov.net.au/formio-qld/v2/v2.x.x-latest/formio-script.min.js"></script>
<script>
FormioScript.init().then(() => {
const div = document.createElement("div");
Expand All @@ -145,7 +145,7 @@ or using `FormioLoader.initFormio()` instead:
or using out of the box `Formio.createForm()` function instead:

```html
<script src="https://static.qgov.net.au/formio-qld/v1/v1.x.x-latest/formio-script.min.js"></script>
<script src="https://static.qgov.net.au/formio-qld/v2/v2.x.x-latest/formio-script.min.js"></script>
<script>
FormioScript.init().then(() => {
const div = document.createElement("div");
Expand Down Expand Up @@ -173,7 +173,7 @@ You can add `data-formio-createForm-options` in the div's data attribute with th
data-formio-env-url="api.forms.platforms.qld.gov.au"
data-formio-createForm-options="customFn1"
></div>
<script src="https://static.qgov.net.au/formio-qld/v1/v1.x.x-latest/formio-script.min.js"></script>
<script src="https://static.qgov.net.au/formio-qld/v2/v2.x.x-latest/formio-script.min.js"></script>
<script>
window.customFn1 = ({
envUrl,
Expand Down Expand Up @@ -203,7 +203,7 @@ You can add `data-formio-createForm-controller` in the div's data attribute with
data-formio-env-url="api.forms.platforms.qld.gov.au"
data-formio-createForm-controller="customFn2"
></div>
<script src="https://static.qgov.net.au/formio-qld/v1/v1.x.x-latest/formio-script.min.js"></script>
<script src="https://static.qgov.net.au/formio-qld/v2/v2.x.x-latest/formio-script.min.js"></script>
<script>
window.customFn2 = ({ envUrl, projectName, formName, form, elem }) => {
form.on("change", (e) => {
Expand Down
10 changes: 5 additions & 5 deletions src/stories/How.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,13 @@ import FormioSettings from "./assets/formioSettings.png";
To use custom components in the Form.io platform builder, please go to the [Project stage settings](https://help.form.io/userguide/projects#custom-js-and-css) and update the `Custom javascript` URL with the CDN URL of this library:

```
https://static.qgov.net.au/formio-qld/v1/v1.x.x-latest/formio-qld.min.js
https://static.qgov.net.au/formio-qld/v2/v2.x.x-latest/formio-qld.min.js
```

and update the `Custom CSS` property with

```
https://static.qgov.net.au/formio-qld/v1/v1.x.x-latest/formio-qld.min.css
https://static.qgov.net.au/formio-qld/v2/v2.x.x-latest/formio-qld.min.css
```

<img src={FormioSettings} alt="share diagram" width="640" />
Expand All @@ -29,12 +29,12 @@ To use custom components in the Form.io JS renderer, please include the script *
Pleaser refer to [Form.io doc](https://help.form.io/developers/form-renderer#getting-started) for how to initiate your form application in a HTML page.

```html
<script src="https://static.qgov.net.au/formio-qld/v1/v1.x.x-latest/formio.full.js"></script>
<script src="https://static.qgov.net.au/formio-qld/v2/v2.x.x-latest/formio.full.js"></script>
...
<script src="https://static.qgov.net.au/formio-qld/v1/v1.x.x-latest/formio-qld.min.js"></script>
<script src="https://static.qgov.net.au/formio-qld/v2/v2.x.x-latest/formio-qld.min.js"></script>
<link
rel="stylesheet"
href="https://static.qgov.net.au/formio-qld/v1/v1.x.x-latest/formio-qld.min.css"
href="https://static.qgov.net.au/formio-qld/v2/v2.x.x-latest/formio-qld.min.css"
/>
```

Expand Down
Binary file modified src/stories/assets/formioSettings.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 6ffc5df

Please sign in to comment.