Modify the Size of Product Editor Text Boxes - Hazard Services
Modify the Size of Product Editor Text Boxes
Background: By default, the text boxes that appear in the Product Editor only go to a maximum of 6 lines. For some boxes, such as the What bullet text, that can lead to difficulties viewing and editing the output for a complex event like a mixed precip winter storm. Setting the default numLines provides a larger text box that can more easily accommodate editing.
For example, before making any changes, if a forecaster needs to add information to the What bullet in the Product Editor, it can easily go beyond what the box shows, and even with a scroll on the edge of the box, the result is unwieldy at best. The box only shows 2 lines while the text has 7 lines.
Making the Change
- In the Localization Perspective, navigate to the Utilities sub-directory under the Hazard Services folder.
- Double click on ProductEditorFields.py to show the available versions
- Create a user override version if none exists (user override is best practice for testing changes):
- If there is only a BASE version: right click on BASE and select Create Override File, then select User
- If there is another version (e.g. SITE) you wish to use: right click on that file and select Copy To, then select User (this lets you work on an updated SITE version to replace the original when you're finished)
- Double click on the USER version of ProductEditorFields.py to open it for editing
- Open a reference copy of the existing ProductEditorFields.py file, which will be used to copy in the desired fields to be overridden
- It's typically best to open the BASE version because most methods have not already been overridden in a higher-level override
- In the User version, add the following import statement and framing to the file
ProductEditorFields = { }
-
In the BASE reference file you opened, scroll or search to find the product part you wish to expand and copy it
-
Paste the desired field information into your User override inside the the brackets, as shown:
ProductEditorFields = { "impactsBullet": { "displayable": True, "editable": True, "label": "Impacts Bullet", "required": True }, "whatBullet": { "displayable": True, "editable": True, "label": "What", "required": True }, "whereBullet": { "allowPreviousText": False, "displayable": True, "editable": True, "label": "Where", "required": True }, }
- Add a line to each section called numLines and set a value for the minimum number of lines the editor box will be for that section. A good starting point is 4.
ProductEditorFields = { "impactsBullet": { "displayable": True, "editable": True, "label": "Impacts Bullet", "numLines" : 4, "required": True }, "whatBullet": { "displayable": True, "editable": True, "label": "What", "numLines" : 4, "required": True }, "whereBullet": { "allowPreviousText": False, "displayable": True, "editable": True, "label": "Where", "numLines" : 4, "required": True } }
-
If no other changes are being made to the lists, remove everything other than the numLines entries.
ProductEditorFields = { "impactsBullet": { "numLines" : 4, }, "whatBullet": { "numLines" : 4, }, "whereBullet": { "numLines" : 4, } }
-
Now the same text as before looks like this. Even with the text exceeding the box size, the scroll bar is far easier to manipulate.
-
-
Promote User file to Site in the Localization Perspective, if desired.