Focal Point Winter Weather Jobsheets

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 

  1. In the Localization Perspective, navigate to the Utilities sub-directory under the Hazard Services folder.
  2. Double click on ProductEditorFields.py to show the available versions
  3. Create a user override version if none exists (user override is best practice for testing changes):
    1. If there is only a BASE version: right click on BASE and select Create Override File, then select User
    2. 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)
  4. Double click on the USER version of ProductEditorFields.py to open it for editing
  5. Open a reference copy of the existing ProductEditorFields.py file, which will be used to copy in the desired fields to be overridden  
    1. It's typically best to open the BASE version because most methods have not already been overridden in a higher-level override
  6. In the User version, add the following import statement and framing to the file 
    
    ProductEditorFields = {
    
    }

     

  7. In the BASE reference file you opened, scroll or search to find the product part you wish to expand and copy it

  8. 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
        },
        }
  9. 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
        }
        }

     

  10. 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,
        }
        }
    1.  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.

  11. Promote User file to Site in the Localization Perspective, if desired.