This repository has been archived by the owner on May 17, 2021. It is now read-only.
fix(jobs): change job command input field to textarea #241
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.
What
This PR changes the edit job view to make use of a textarea tag instead of an input tag for the job command field.
Why
The command doesn't have any HTML escaping and therefore might cut short the value displayed in the input tag. For example, if the command of a job was
command "some text"
, the displayed HTML command would becommand
as thevalue
property of the input tag was closed by the double quote in the command value, causing the rest of the command to be added as attributes to the input field. I considered escaping the HTML and displaying the entire command in an input field but that meant that when saving the command all HTML entities would now be stored as escaped HTML rather than their characters. A textarea seemed better suited for the job and provided the additional benefit of the command input being re-sizeable.Overall this change has two benefits: 1) the cron job command is now fully displayed and is able to be edited by the user without having to re-enter the entire command and 2) users can make use of the resize textbox feature built-in by browsers to increase the textarea size if the command doesn't fit in the default textarea size.
Screenshots