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

Ability to Restrict Available Form Elements in Form-js #1195

Open
alosultan opened this issue Jun 2, 2024 · 0 comments
Open

Ability to Restrict Available Form Elements in Form-js #1195

alosultan opened this issue Jun 2, 2024 · 0 comments
Assignees
Labels
backlog Queued in backlog enhancement New feature or request

Comments

@alosultan
Copy link

alosultan commented Jun 2, 2024

Feature Request: Ability to Restrict Available Form Elements in Form-js

Description

We are using the BPMN-IO Form-js editor in a Django project to allow users to create and edit forms. However, we need to restrict the available form elements to only a few basic types (e.g., text field, text area, number, date, select). Currently, the editor displays all available form elements, and we have not found a way to limit this.

Use Case

We need to provide a streamlined form creation experience where users are only allowed to add specific types of fields. This is important for maintaining consistency and simplicity in the forms created by users.

What We Tried

We attempted to use the palette configuration option to restrict the available elements, but it does not appear to work. We also tried hiding elements via CSS after the editor is initialized, but this is not an ideal solution.

Example

Ideally, we would like to configure the editor like this:

const formEditor = new FormEditor({
    container: element,
    schema: schema,
    palette: {
        'entries': {
            'form-field': {
                'group': 'tools',
                'items': [
                    { 'type': 'textfield', 'id': 'textfield', 'label': 'Text Field' },
                    { 'type': 'textarea', 'id': 'textarea', 'label': 'Text Area' },
                    { 'type': 'number', 'id': 'number', 'label': 'Number' },
                    { 'type': 'date', 'id': 'date', 'label': 'Date' },
                    { 'type': 'select', 'id': 'select', 'label': 'Select' }
                ]
            }
        }
    }
});

Request

Could you provide guidance on how to restrict the available form elements in Form-js? If this functionality is not currently supported, would it be possible to add it in a future release?

Thank you for your assistance!

@alosultan alosultan added the enhancement New feature or request label Jun 2, 2024
@nikku nikku added the backlog Queued in backlog label Jul 23, 2024 — with bpmn-io-tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backlog Queued in backlog enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants