Skip to content

14.0.0: formio upgrade - #363

Open
Klaas-Ritense wants to merge 19 commits into
next-majorfrom
feat/upgrade-formio
Open

14.0.0: formio upgrade#363
Klaas-Ritense wants to merge 19 commits into
next-majorfrom
feat/upgrade-formio

Conversation

@Klaas-Ritense

@Klaas-Ritense Klaas-Ritense commented Feb 4, 2026

Copy link
Copy Markdown
Member

generiekzaakafhandelcomponent/gzac-issues#611

Note: target branch is next-major

"@formio/angular": "9.0.2",
"@formio/js": "5.3.0"

@Klaas-Ritense
Klaas-Ritense requested review from a team as code owners February 4, 2026 12:46
@Klaas-Ritense Klaas-Ritense added the test env Create a remote test environment for this PR in the Ritense product development cluster label Feb 4, 2026
@valtimo-platform

valtimo-platform Bot commented Feb 4, 2026

Copy link
Copy Markdown
Contributor

Will create a test environment. This comment will be updated once it is available. This usually takes a few minutes.
Closing or merging this PR will automatically delete the test environment. Pushing commits to this PR will update the test environment.
Progress:

  • Created test environment
  • Images tagged testEnv.pr363_commit.c88a06c9d7_contents.27e2256f46_build.1707 (frontend) / testEnv.pr363_commit.c88a06c9d7_contents.7683938871_build.1866 (backend) available
  • Started test environment
  • Test environment is running at https://pr363.product-development.test.k8s.ritense.com

Test environment metadata:

  • URL: https://pr363.product-development.test.k8s.ritense.com
  • Commit: c88a06c
  • Frontend contents: 27e2256f46
  • Backend contents: 7683938871
  • Frontend image: ghcr.io/valtimo-platform/valtimo/gzac-frontend:testEnv.pr363_commit.c88a06c9d7_contents.27e2256f46_build.1707
  • Backend image: ghcr.io/valtimo-platform/valtimo/gzac-backend:testEnv.pr363_commit.c88a06c9d7_contents.7683938871_build.1866

Observability:

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 7

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (3)
frontend/projects/valtimo/zgw/src/lib/modules/documenten-api/formio/documenten-api-uploader/documenten-api-uploader.component.ts (1)

110-134: ⚠️ Potential issue | 🟠 Major

Fix subscription leak in documentType setter — unsubscribe previous subscription and limit to first emission.

The setter creates a new subscription without cleanup, causing memory leaks when the input changes. Additionally, the subscription is not added to the component's _subscriptions property, so it won't be unsubscribed in ngOnDestroy(). Use take(1) to complete after the first caseDefinitionKey emission (only the current key is needed to resolve the document type), and unsubscribe any previous subscription before creating a new one.

Proposed fix
+  private documentTypeSub?: Subscription;
+
   `@Input`() set documentType(defaultValue: string) {
     this.defaultValues['informatieobjecttype'] = defaultValue;
+    this.documentTypeSub?.unsubscribe();
+    this.documentTypeSub = this.stateService.caseDefinitionKey$
       .pipe(
         filter(caseDefinitionKey => !!caseDefinitionKey),
+        take(1),
         switchMap(caseDefinitionKey => this.documentService.getCaseSettings(caseDefinitionKey)),
         switchMap(caseDefinition =>
           this.documentService.getDocumentTypesForCase(
             String(caseDefinition.caseDefinitionKey),
             String(caseDefinition.caseDefinitionVersionTag)
           )
         ),
         catchError(() => {
           this.defaultValues['informatieobjecttype'] = defaultValue;
           return EMPTY;
         })
       )
       .subscribe(documentTypes => {
         const foundDocumentType = documentTypes.find(
           documentType => documentType.name === defaultValue
         );
         foundDocumentType
           ? (this.defaultValues['informatieobjecttype'] = foundDocumentType.url)
           : (this.defaultValues['informatieobjecttype'] = defaultValue);
       });
   }
   public ngOnDestroy(): void {
+    this.documentTypeSub?.unsubscribe();
     this._subscriptions.unsubscribe();
   }
frontend/projects/valtimo/components/src/lib/components/form-io/components/form-io-uploader/form-io-uploader-edit-form.ts (1)

48-59: ⚠️ Potential issue | 🟡 Minor

Placeholder text appears incorrect for the Subtitle field.

The placeholder on line 53 is set to 'Title' but this field is for the Subtitle. This looks like a copy-paste error from the Title field above.

Proposed fix
     {
       type: 'textfield',
       input: true,
       key: 'customOptions.subtitle',
       label: 'Subtitle',
-      placeholder: 'Title',
+      placeholder: 'Subtitle',
       tooltip: 'Leave empty to hide subtitle',
       weight: 12,
       validate: {
         required: false,
       },
     },
frontend/projects/valtimo/zgw/src/lib/modules/documenten-api/formio/documenten-api-uploader/documenten-api-uploader.formio.ts (1)

24-33: ⚠️ Potential issue | 🟡 Minor

Update license header year from 2015-2025 to 2015-2026.

The selector change is clean with no stale references remaining. However, the file's copyright year in the license header is outdated and must be updated to 2015-2026 per coding guidelines.

🧹 Nitpick comments (7)
frontend/projects/valtimo/components/src/lib/components/form-io/components/formio-value-resolver-selector/formio-value-resolver-selector.component.ts (1)

36-39: Keep the observable shape stable (avoid undefined).

Optional chaining makes caseDefinitionKey$ and caseDefinitionVersionTag$ potentially undefined, which can break code that expects an Observable (e.g., template bindings or downstream .pipe(...)). Consider falling back to EMPTY/of(undefined) instead.

♻️ Proposed refactor
-import {BehaviorSubject, map} from 'rxjs';
+import {BehaviorSubject, map, of} from 'rxjs';
 ...
-  public readonly caseDefinitionKey$ = formioParams?.pipe(map(params => params?.caseDefinitionKey));
-  public readonly caseDefinitionVersionTag$ = formioParams?.pipe(
-    map(params => params?.caseDefinitionVersionTag)
-  );
+  public readonly caseDefinitionKey$ =
+    formioParams ? formioParams.pipe(map(params => params?.caseDefinitionKey)) : of(undefined);
+  public readonly caseDefinitionVersionTag$ =
+    formioParams ? formioParams.pipe(map(params => params?.caseDefinitionVersionTag)) : of(undefined);
backend/app/gzac/src/dev/resources/config/case/formio-test/1-0-0/form/container-test.form.json (1)

8-19: Consider moving validation to the inner textfield.

The required validation is placed on the container component (line 16-18), but containers don't hold values directly in Form.io. The validation would be more effective on the inner containerField textfield. If this is intentionally testing container validation behavior, please disregard.

💡 Suggested fix to move validation to the inner field
             "components": [
                 {
                     "label": "Container field",
                     "key": "containerField",
                     "type": "textfield",
+                    "validate": {
+                        "required": true
+                    },
                     "input": true
                 }
             ],
-            "validate": {
-                "required": true
-            },
             "input": true
backend/app/gzac/src/dev/resources/config/case/formio-test/1-0-0/form/documenten-api-uploader-test.form.json (1)

1-27: Use environment variable placeholders for the hardcoded Documenten API URL.

The hardcoded http://localhost:8001 endpoint in informatieobjecttype should use the existing placeholder pattern established in related configurations like formio-test.zgw-document-upload-field.json, which uses ${VALTIMO_CATALOGI_API_URL}informatieobjecttypen/${VALTIMO_INFORMATIEOBJECTTYPE}. Multiple files in the test config directory have similar hardcoded localhost:8001 URLs; adopting the placeholder pattern consistently improves portability across environments.

frontend/projects/valtimo/components/src/lib/components/form-io/components/form-io-uploader/form-io-uploader-edit-form.ts (1)

96-102: Consider adding a warning for unexpected edit form structure.

The null checks prevent runtime errors, but if tabsComponent or displayTab is not found, the custom components are silently not added. This could make debugging difficult if the @formio/js library structure changes in a future upgrade.

Proposed enhancement with console warning
   const tabsComponent = editForm.components.find(component => component.key === 'tabs');
   if (tabsComponent) {
     const displayTab = tabsComponent.components.find(tab => tab.key === 'display');
     if (displayTab) {
       displayTab.components.unshift(...customComponents);
+    } else {
+      console.warn('formIoUploaderEditForm: display tab not found in edit form structure');
     }
+  } else {
+    console.warn('formIoUploaderEditForm: tabs component not found in edit form structure');
   }
frontend/projects/valtimo/task/src/lib/components/task-detail-content/task-detail-content.component.ts (1)

487-494: Consider renaming method for consistency.

The method setDocumentDefinitionNameInService still uses the old naming convention while its implementation now works with caseDefinitionKey. Consider renaming to setCaseDefinitionKeyInService for consistency with the broader refactoring in this PR.

♻️ Suggested refactor
-  private setDocumentDefinitionNameInService(task: Task): void {
+  private setCaseDefinitionKeyInService(task: Task): void {
     this.documentService
       .getProcessDefinitionCaseDefinitionFromProcessInstanceId(task.processInstanceId)
       .subscribe(ProcessDefinitionCaseDefinition => {
         const caseDefinitionKey = ProcessDefinitionCaseDefinition.id.caseDefinitionId.key;
         this.modalService.setCaseDefinitionKey(caseDefinitionKey);
         this.stateService.setCaseDefinitionKey(caseDefinitionKey);
       });
   }

Also update the call site at line 274:

-    this.setDocumentDefinitionNameInService(task);
+    this.setCaseDefinitionKeyInService(task);
frontend/projects/valtimo/components/src/lib/components/form-io/components/form-io-builder/form-io-builder.utils.ts (1)

22-31: Return type mismatch: function declares void but returns a value.

The function signature declares : void but the function returns editForm on line 30. While this was likely pre-existing, the return type should be corrected to match the actual behavior.

🔧 Proposed fix
-const modifyEditFormApiKeyInput = (editForm: any): void => {
+const modifyEditFormApiKeyInput = (editForm: any): any => {
   const keyField = editForm?.components
     ?.find(element => element?.key === 'tabs')
     ?.components?.find(element => element?.key === 'api')
     ?.components?.find(element => element?.key === 'key');
 
   if (keyField) delete keyField.validate;
 
   return editForm;
 };
frontend/projects/valtimo/components/src/lib/components/form-io/components/form-io-current-user/form-io-current-user-edit-form.ts (1)

21-24: Simplify by returning directly.

The intermediate variable editForm serves no purpose and can be eliminated for conciseness.

♻️ Suggested simplification
-export const formIoCurrentUserEditForm = () => {
-  const editForm = TextfieldEditForm();
-  return editForm;
-};
+export const formIoCurrentUserEditForm = () => TextfieldEditForm();

Comment thread documentation/release-notes/13.x.x/13.15.0/README.md
Comment thread documentation/release-notes/13.x.x/13.15.0/README.md Outdated
Comment thread frontend/package.json Outdated
Comment thread frontend/projects/valtimo/resource/src/lib/services/open-zaak.service.ts Outdated

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 4

Comment thread documentation/release-notes/13.x.x/13.15.0/README.md Outdated

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

🧹 Nitpick comments (1)
documentation/release-notes/13.x.x/13.15.0/README.md (1)

23-25: Consider varying the sentence structure (optional style improvement).

All three bug fix entries begin with "Fixed." While this is perfectly acceptable for release notes, you could optionally vary the language for stylistic variety (e.g., "Resolved," "Corrected," "Addressed").

@mbritense mbritense changed the title Upgrade formio WIP: feat: upgrade formio and fix formio issues Feb 9, 2026
@mbritense
mbritense marked this pull request as draft February 9, 2026 08:10
@Klaas-Ritense
Klaas-Ritense changed the base branch from next-minor to next-major February 16, 2026 09:39
@Klaas-Ritense Klaas-Ritense changed the title WIP: feat: upgrade formio and fix formio issues feat: upgrade formio and fix formio issues Feb 16, 2026
…rmio

# Conflicts:
#	documentation/release-notes/13.x.x/13.15.0/README.md
#	frontend/package-lock.json
@Klaas-Ritense
Klaas-Ritense marked this pull request as ready for review February 16, 2026 10:05
@Klaas-Ritense Klaas-Ritense changed the title feat: upgrade formio and fix formio issues 14.0.0: formio upgrade Feb 17, 2026
@mbritense
mbritense marked this pull request as draft February 20, 2026 08:53
…rmio

# Conflicts:
#	frontend/package-lock.json
#	frontend/projects/valtimo/components/src/lib/components/form-io/components/form-io-builder/form-io-builder.component.ts
#	frontend/projects/valtimo/components/src/lib/components/form-io/components/form-io-builder/form-io-builder.utils.ts
#	frontend/projects/valtimo/components/src/lib/components/form-io/components/formio-value-resolver-selector/formio-value-resolver-selector.component.ts
@Klaas-Ritense
Klaas-Ritense marked this pull request as ready for review February 24, 2026 08:39
…rmio

# Conflicts:
#	frontend/package-lock.json
#	frontend/projects/valtimo/components/src/lib/components/form-io/components/form-io-builder/form-io-builder.component.ts
#	frontend/projects/valtimo/components/src/lib/components/form-io/components/formio-value-resolver-selector/formio-value-resolver-selector.component.ts
@valtimo-platform valtimo-platform deleted a comment from coderabbitai Bot Feb 25, 2026
…rmio

# Conflicts:
#	frontend/package-lock.json
@coderabbitai

coderabbitai Bot commented Feb 27, 2026

Copy link
Copy Markdown
Contributor

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: e8a4b537-ec9b-46af-8b63-796bcd3e83c9

📥 Commits

Reviewing files that changed from the base of the PR and between 23fa513 and 6d2665a.

📒 Files selected for processing (1)
  • documentation/SUMMARY.md
✅ Files skipped from review due to trivial changes (1)
  • documentation/SUMMARY.md

📝 Walkthrough

Summary by CodeRabbit

  • New Features

    • Added release notes for 14.0.0 and a Major 14 compatibility matrix.
    • Added a mapping enabling a document-upload process link for document uploads.
  • Enhancements

    • Upgraded Form.io libraries and integrations.
    • Registered Form.io Bootstrap 4 UI theme.
  • Bug Fixes / Changes

    • Made the file upload field optional in forms.

Walkthrough

Replaces package formiojs with @formio/js (v5.3.0) and upgrades @formio/angular from 7.0.0 to 9.0.2; import paths updated across frontend components. Multiple Form.io edit-form implementations were refactored to reuse base Textfield edit forms. FormIoModule now registers the bootstrap4 UI theme. A new public FormioOptions interface was added. Documentation for release 14.0.0 was added (compatibility matrix and migration notes). Backend adds a new case-definition-process-link JSON mapping for document uploads, and a file-uploader form validation rule was changed to make file uploads optional.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/upgrade-formio

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 9

🧹 Nitpick comments (2)
documentation/fundamentals/getting-started/compatibility-matrix.md (1)

13-18: Consider adding a short note for Operaton naming context.

Optional: a one-liner explaining the shift from older Camunda labels in earlier-major rows would reduce reader confusion.

frontend/projects/valtimo/zgw/src/lib/modules/documenten-api/formio/documenten-api-uploader/documenten-api-uploader-edit-form.ts (1)

24-629: Consider extracting shared uploader edit-form construction

Lines 24-629 duplicate a substantial uploader-edit configuration/injection pattern also present in frontend/projects/valtimo/components/src/lib/components/form-io/components/form-io-uploader/form-io-uploader-edit-form.ts (custom options + tabs.display insertion). Centralizing the shared base builder would reduce drift and make future Form.io upgrades safer.


ℹ️ Review info

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between c2719c4 and 23fa513.

📒 Files selected for processing (28)
  • backend/app/gzac/src/dev/resources/config/case/formio-test/1-0-0/case-definition-process-link/formio-test.case-definition-process-link.json
  • backend/app/gzac/src/dev/resources/config/case/formio-test/1-0-0/form/valtimo-file-uploader-test.form.json
  • documentation/SUMMARY.md
  • documentation/fundamentals/getting-started/compatibility-matrix.md
  • documentation/release-notes/14.x.x/14.0.0/README.md
  • documentation/release-notes/14.x.x/14.0.0/back-end-migration.md
  • documentation/release-notes/14.x.x/14.0.0/front-end-migration.md
  • documentation/release-notes/14.x.x/README.md
  • frontend/package.json
  • frontend/projects/valtimo/components/ng-package.json
  • frontend/projects/valtimo/components/package.json
  • frontend/projects/valtimo/components/src/lib/components/form-io/components/form-io-builder/form-io-builder.component.ts
  • frontend/projects/valtimo/components/src/lib/components/form-io/components/form-io-currency/currency-edit-form.ts
  • frontend/projects/valtimo/components/src/lib/components/form-io/components/form-io-current-user/form-io-current-user-edit-form.ts
  • frontend/projects/valtimo/components/src/lib/components/form-io/components/form-io-resource-selector/form-io-resource-selector.formio.ts
  • frontend/projects/valtimo/components/src/lib/components/form-io/components/form-io-uploader/form-io-uploader-edit-form.ts
  • frontend/projects/valtimo/components/src/lib/components/form-io/components/form-io/form-io.component.ts
  • frontend/projects/valtimo/components/src/lib/components/form-io/components/formio-value-resolver-selector/formio-value-resolver-selector-edit-form.ts
  • frontend/projects/valtimo/components/src/lib/components/form-io/components/formio-value-resolver-selector/formio-value-resolver-selector.component.ts
  • frontend/projects/valtimo/components/src/lib/components/form-io/form-io.module.ts
  • frontend/projects/valtimo/components/src/lib/models/form-io.model.ts
  • frontend/projects/valtimo/components/src/lib/modules/custom-formio-component/create-custom-component.ts
  • frontend/projects/valtimo/components/src/lib/modules/custom-formio-component/register-custom-component.ts
  • frontend/projects/valtimo/form-view-model/ng-package.json
  • frontend/projects/valtimo/form-view-model/package.json
  • frontend/projects/valtimo/form-view-model/src/lib/components/form-view-model/form-view-model.component.ts
  • frontend/projects/valtimo/zgw/src/lib/modules/documenten-api/formio/documenten-api-uploader/documenten-api-uploader-edit-form.ts
  • frontend/projects/valtimo/zgw/src/lib/modules/documenten-api/formio/documenten-api-uploader/documenten-api-uploader.formio.ts

Comment thread documentation/release-notes/14.x.x/14.0.0/back-end-migration.md
Comment thread documentation/release-notes/14.x.x/14.0.0/front-end-migration.md
Comment thread documentation/release-notes/14.x.x/14.0.0/README.md
Comment thread documentation/release-notes/14.x.x/README.md
@Klaas-Ritense
Klaas-Ritense requested a review from mbritense March 26, 2026 12:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

test env Create a remote test environment for this PR in the Ritense product development cluster

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants