You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The HTML comment is not closed, which will break the document head and potentially ignore subsequent tags. Close the comment properly to avoid malformed HTML and stylesheet loading issues.
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/formiojs@4.13.1/dist/formio.full.min.css">
-<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap-icons@1.13.1/font/bootstrap-icons.min.css"> <!--TODO need to figure out why @aot-technologies/formiojs doesn't package this properly+<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap-icons@1.13.1/font/bootstrap-icons.min.css"> <!-- TODO: need to figure out why @aot-technologies/formiojs doesn't package this properly -->
Suggestion importance[1-10]: 9
__
Why: The HTML comment after the bootstrap-icons link is indeed unclosed in the PR, which can break parsing of the head. Closing it is a small but critical correctness fix.
High
Avoid unintended fetches in preview
When rendering a static read-only preview, using src can trigger network fetching or schema resolution side effects. Pass the schema via form instead of src to avoid unintended requests and ensure consistent offline rendering.
Why: Switching from form to src in a read-only preview can trigger remote fetch or resolver behavior; recommending form improves determinism and avoids side effects. It directly matches the changed lines and is context-appropriate.
Medium
Ensure builder reflects live form
Using initialForm with a stable key can prevent the builder from updating when form changes, causing edits not to reflect. Re-key the builder when the working form changes and pass the live form to ensure the builder reflects current edits.
Why: The PR intentionally switches to a memoized initialForm and stable key, likely to prevent unnecessary remounts; reverting to form may reintroduce churn. The concern about updates not reflecting is plausible but speculative without evidence, so impact is moderate.
Guard against formData being null during initial render to avoid a runtime error when accessing _id. Include formData in dependencies and safely return a clone only when defined.
Why: Accessing formData._id in the dependency array can throw if formData is null; guarding against null and broadening dependencies prevents a runtime error and ensures correct memoization.
Medium
Fix duplicate CSS and comment
Remove the duplicate Formio CSS include to avoid conflicting styles and larger payloads. Also close the HTML comment after the Bootstrap Icons line to prevent malformed markup breaking subsequent tags.
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/formiojs@4.13.1/dist/formio.full.min.css">
-...-<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/formiojs@4.13.1/dist/formio.full.min.css">-<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap-icons@1.13.1/font/bootstrap-icons.min.css"> <!--TODO need to figure out why @aot-technologies/formiojs doesn't package this properly+<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap-icons@1.13.1/font/bootstrap-icons.min.css"> <!-- TODO: figure out why @aot-technologies/formiojs doesn't package this properly -->
Suggestion importance[1-10]: 7
__
Why: The PR adds Formio CSS twice (lines 23 and 29) and leaves an unclosed HTML comment on the Bootstrap Icons link (line 30), which can cause style duplication and malformed markup; removing the duplicate and closing the comment is correct and improves robustness.
Medium
General
Coerce hidden fields flag
Ensure showHiddenFields is explicitly boolean to prevent unexpected rendering if it’s undefined or non-boolean. Coerce the value when passing into options to avoid leaking hidden fields in read-only previews.
Why: Coercing showHiddenFields to boolean (!!showHiddenFields) is a reasonable safeguard to avoid unintended truthy values affecting rendering, though the impact is moderate and context-dependent.
There is a duplicated Formio CSS include and a malformed HTML comment missing a closing -->, which can break HTML parsing and stylesheet loading. Remove the duplicate CSS and close the comment to avoid rendering issues.
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/formiojs@4.13.1/dist/formio.full.min.css">
<link rel="stylesheet" href="https://cdn.form.io/flatpickr-formio/4.6.13-formio.3/flatpickr.min.css">
-<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/formiojs@4.13.1/dist/formio.full.min.css">-<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap-icons@1.13.1/font/bootstrap-icons.min.css"> <!--TODO need to figure out why @aot-technologies/formiojs doesn't package this properly+<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap-icons@1.13.1/font/bootstrap-icons.min.css"> <!-- TODO: need to figure out why @aot-technologies/formiojs doesn't package this properly -->
Suggestion importance[1-10]: 8
__
Why: It correctly identifies a duplicated Formio CSS include and an unclosed HTML comment that could cause parsing issues. Fixing both is important for correctness and rendering stability.
Medium
Ensure boolean option consistency
The options object is missing a default for showHiddenFields, which can be undefined and cause hidden fields to unexpectedly render. Explicitly coerce it to a boolean to avoid inconsistent behavior across renders.
Why: Coercing showHiddenFields to a boolean is a reasonable minor robustness improvement and matches the new props (options.showHiddenFields). Impact is moderate and the change is accurate to the diff context.
Low
General
Fix stale FormBuilder re-renders
Using initialForm for the key may prevent re-renders when other critical props change, leaving a stale builder. Use a stable key that updates whenever the source form changes to ensure the builder resets predictably.
Why: Using a more robust key helps ensure the builder resets when the underlying form changes; the proposed key logic is sensible though speculative about modified presence. It addresses potential staleness without contradicting the PR.
Catch issues before they fail your Quality Gate with our IDE extension SonarQube for IDE
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
User description
Issue Tracking
JIRA: https://aottech.atlassian.net/browse/FWF-4762
Issue Type: FEATURE
DEPENDENCY PR: AOT-Technologies/forms-flow-ai-micro-front-ends#823
Changes
Checklist
🔗 Dependency PR Status
PR Type
Enhancement, Bug fix
Description
Switch Form prop from form to src
Restore onFormReady prop usage
Centralize FormBuilder options via ref
Update formio imports and dependencies
Diagram Walkthrough
File Walkthrough
9 files
Use src prop for Form renderingUpdate formio utils import pathMigrate utils import to new pathRefactor builder to initialForm and options refSwitch Form to src propReplace form with src in FormPass form via src to FormUse src prop for resubmission formReplace form prop with src2 files
Update Form props and readiness handlerUse src and onFormReady for Form2 files
Add bootstrap icons stylesheet CDNPoint to new formio packages and bump bpmn-js