Skip to content

Added text area multiline to runtime values on bot config#315

Open
mateodurante wants to merge 1 commit intocerttools:developfrom
mateodurante:feature/multiline-input-bot-config
Open

Added text area multiline to runtime values on bot config#315
mateodurante wants to merge 1 commit intocerttools:developfrom
mateodurante:feature/multiline-input-bot-config

Conversation

@mateodurante
Copy link

This pull request improves the usability and flexibility of the configuration editing UI in intelmq_manager/static/js/configs.js. The main enhancements include supporting multiline values for runtime configuration sections, improving the handling and display of JSON values, and refining keyboard accessibility in popups.

Makes all runtime values as text area to improve the bot configuration parameters:
image

As future improvement it could be selective based on some bot definition or documentation.

UI and Input Improvements:

  • The insertKeyValue function now uses a <textarea> for runtime section values, enabling users to enter multiline text. For all other sections, a standard <input type="text"> is used. This makes editing complex or multiline configuration values more user-friendly.
  • JSON object values are now pretty-printed in the UI for better readability, and both <input> and <textarea> elements are handled uniformly when setting their values.

Accessibility and Form Handling:

  • The Enter key behavior in popups has been improved: pressing Enter in a <textarea> now inserts a newline instead of submitting the form, while pressing Enter in other fields still triggers the OK button.
  • The saveFormData function is updated to correctly retrieve values from both <input> and <textarea> elements, ensuring that all user input is saved regardless of the input type.

Other UI Details:

  • Additional Bootstrap styling (form-control and full width) is applied to input elements for a more consistent look.
  • The logic for disabling keys is clarified and extended to both the 'id' and 'GENERIC' sections.

Copilot AI review requested due to automatic review settings February 19, 2026 19:52
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR enhances the bot configuration UI by introducing multiline text area support for runtime values and improving JSON handling. The changes make it easier to edit complex configuration parameters by providing a more spacious input field with vertical resizing capability.

Changes:

  • Runtime section values now use <textarea> elements instead of <input> fields to support multiline entries
  • JSON object values are pretty-printed with 2-space indentation for better readability
  • Enter key behavior in popups is refined to allow newlines in textareas while preserving form submission for other inputs
Comments suppressed due to low confidence (2)

intelmq_manager/static/js/configs.js:519

  • The return statement should explicitly return true or call event.preventDefault() for clarity. An empty return in an event handler can be ambiguous about intent. Consider return true; to clearly indicate the default behavior should proceed.
            return; 

intelmq_manager/static/js/configs.js:542

  • The change from valueInput === undefined to !valueInput is less precise. The original check was specifically looking for undefined, while !valueInput will also match null, empty string, 0, etc. Since querySelector returns null (not undefined) when no element is found, this works correctly but consider using if (valueInput === null) for clarity and precision.
        if (!valueInput) continue;

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants