diff --git a/packages/govus/public/case2.html b/packages/govus/public/case2.html index ead08b3..9910ad7 100644 --- a/packages/govus/public/case2.html +++ b/packages/govus/public/case2.html @@ -228,7 +228,7 @@ elem.appendChild(mytag); } var id = new URLSearchParams(window.location.search).get("case"); - startcase("OPGO8L-CARINSUR-WORK " + id); + startcase("SSA-ICLAIMS-WORK " + id); diff --git a/packages/govus/src/layout.js b/packages/govus/src/layout.js index 204e604..72a1f6e 100644 --- a/packages/govus/src/layout.js +++ b/packages/govus/src/layout.js @@ -1,8 +1,18 @@ /* global i18n */ import { html } from 'lit'; +import { unsafeHTML } from 'lit/directives/unsafe-html'; + import { Field } from './fields'; import { SimpleTable, DisplayList } from './lists'; +const Instructions = (paragraph, webcomp) => { + if (!paragraph) return null; + const paragraphObj = webcomp.data.uiResources.resources.paragraphs[paragraph.replace('@PARAGRAPH ', '')]; + if (typeof paragraphObj === 'object' && paragraphObj.length === 1 && paragraphObj[0].content) { + return html`${unsafeHTML(paragraphObj[0].content)}`; + } + return null; +}; export const Layout = (data, path, isReadOnly, webcomp, context) => { if (typeof data === 'undefined') return null; if (Array.isArray(data) && data.length === 1 && data[0].type === 'View') { @@ -33,6 +43,7 @@ export const Layout = (data, path, isReadOnly, webcomp, context) => { case 'DefaultForm': return html`
+ ${Instructions(data.config.instructions, webcomp)} ${Layout(data.children[0].children, `${path}-0`, isReadOnly, webcomp, context)}
`;