Added text area multiline to runtime values on bot config#315
Open
mateodurante wants to merge 1 commit intocerttools:developfrom
Open
Added text area multiline to runtime values on bot config#315mateodurante wants to merge 1 commit intocerttools:developfrom
mateodurante wants to merge 1 commit intocerttools:developfrom
Conversation
There was a problem hiding this comment.
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
trueor callevent.preventDefault()for clarity. An empty return in an event handler can be ambiguous about intent. Considerreturn true;to clearly indicate the default behavior should proceed.
return;
intelmq_manager/static/js/configs.js:542
- The change from
valueInput === undefinedto!valueInputis less precise. The original check was specifically looking for undefined, while!valueInputwill also match null, empty string, 0, etc. SincequerySelectorreturns null (not undefined) when no element is found, this works correctly but consider usingif (valueInput === null)for clarity and precision.
if (!valueInput) continue;
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
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:

As future improvement it could be selective based on some bot definition or documentation.
UI and Input Improvements:
insertKeyValuefunction 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.<input>and<textarea>elements are handled uniformly when setting their values.Accessibility and Form Handling:
<textarea>now inserts a newline instead of submitting the form, while pressing Enter in other fields still triggers the OK button.saveFormDatafunction 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:
form-controland full width) is applied to input elements for a more consistent look.