Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor Camunda registration options + drop RJSF #4807

Merged
merged 3 commits into from
Nov 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
243 changes: 15 additions & 228 deletions package-lock.json

Large diffs are not rendered by default.

1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@
"@open-formulieren/formio-builder": "^0.32.0",
"@open-formulieren/leaflet-tools": "^1.0.0",
"@open-formulieren/monaco-json-editor": "^0.2.0",
"@rjsf/core": "^4.2.1",
"@tinymce/tinymce-react": "^4.3.2",
"@trivago/prettier-plugin-sort-imports": "^4.0.0",
"babel-jest": "^29.3.1",
Expand Down
68 changes: 0 additions & 68 deletions src/openforms/js/components/admin/RJSFWrapper.js

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import {expect, fn, screen, userEvent, waitFor, within} from '@storybook/test';
import selectEvent from 'react-select-event';

import {mockProcessDefinitionsGet} from 'components/admin/form_design/registrations/camunda/mocks';
import {
mockDocumentTypesGet,
mockCataloguesGet as mockObjectsApiCataloguesGet,
Expand Down Expand Up @@ -261,10 +262,81 @@ export default {
{
id: 'camunda',
label: 'Camunda',
// real schema is defined, but irrelevant because of our react components
schema: {
type: 'object',
properties: {},
properties: {
processDefinition: {
type: 'string',
minLength: 1,
title: 'Process definition',
description: 'The process definition for which to start a process instance.',
},
processDefinitionVersion: {
type: ['integer', 'null'],
title: 'Process definition version',
description:
'Which version of the process definition to start. The latest version is used if not specified.',
},
processVariables: {
type: 'array',
items: {
type: 'object',
properties: {
enabled: {
type: 'boolean',
title: 'enable',
description: 'Only enabled variables are passed into the process',
},
componentKey: {
type: 'string',
minLength: 1,
title: 'Component key',
description: 'Key of the Formio.js component to take the value from.',
},
alias: {
type: 'string',
title: 'Alias',
description:
'If provided, the Camunda process variable will have this alias as name instead of the component key. Use this to map a component onto a different process variable name.',
},
},
required: ['enabled', 'componentKey'],
title: 'Mapped process variables',
},
title: 'Mapped process variables',
},
complexProcessVariables: {
type: 'array',
items: {
type: 'object',
properties: {
enabled: {
type: 'boolean',
title: 'enable',
description: 'Only enabled variables are passed into the process',
},
alias: {
type: 'string',
minLength: 1,
title: 'Alias',
description:
'Name of the variable in the Camunda process instance. For complex variables, the name must be supplied.',
},
type: {
type: 'string',
enum: ['object', 'array'],
enumNames: ['Object', 'Array'],
title: 'Type',
description: 'The type determines how to interpret the variable definition.',
},
},
required: ['enabled', 'alias', 'type'],
title: 'Complex process variables',
},
title: 'Complex process variables',
},
},
required: ['processDefinition', 'processVariables', 'complexProcessVariables'],
},
},
{
Expand Down Expand Up @@ -435,6 +507,7 @@ export default {
mockDocumentTypesGet(),
],
zgwMocks: [mockZGWApisCataloguesGet(), mockCaseTypesGet()],
camundaMocks: [mockProcessDefinitionsGet()],
},
},
},
Expand Down Expand Up @@ -563,6 +636,37 @@ export const ConfiguredBackends = {
driveId: 'myDrive',
},
},
{
key: 'backend10',
name: 'Camunda',
backend: 'camunda',
options: {
processDefinition: '',
processDefinitionVersion: null,
processVariables: [
{
enabled: true,
componentKey: 'textField1',
alias: '',
},
],
complexProcessVariables: [
{
enabled: true,
alias: 'sampleVariable',
type: 'object',
definition: {
foo: {
source: 'component',
definition: {
var: 'textField2',
},
},
},
},
],
},
},
],
validationErrors: [
['form.registrationBackends.1.options.zgwApiGroup', 'You sure about this?'],
Expand Down
Loading
Loading