#895 Fix DrawTool bugs, template field naming, not null adv filters by tariqksoliman · Pull Request #896 · NASA-AMMOS/MMGIS · GitHub
Skip to content

#895 Fix DrawTool bugs, template field naming, not null adv filters#896

Merged
tariqksoliman merged 2 commits into
developmentfrom
ts-895
Mar 11, 2026
Merged

#895 Fix DrawTool bugs, template field naming, not null adv filters#896
tariqksoliman merged 2 commits into
developmentfrom
ts-895

Conversation

@tariqksoliman

Copy link
Copy Markdown
Member

Closes #895

With Claude

Fix DrawTool bugs, template field naming, and null advanced filters

This PR addresses several critical bugs in the DrawTool feature and adds support for null/not-null
filtering operations.

🐛 Bug Fixes

Backend (API/Backend/Draw/)

  • aggregations.js: Fixed promise chain issue where response was sent but the promise continued
    executing, causing potential errors when history is empty
  • filesutils.js:
    • Fixed field name validation to allow spaces, dashes, dots in addition to alphanumeric and
      underscores (previously was too restrictive)
    • Added SQL injection protection by escaping single quotes in property keys
    • Improved error handling for malformed filter formats with proper 400 status responses

Frontend (src/essence/Tools/Draw/)

  • DrawTool_Files.js: Fixed DynamicExtent state not resetting properly when toggling files off, which
    prevented proper reload on next toggle. Now clears:
    • Truncation state
    • Last requested location
    • Last requested extent
  • DrawTool_Shapes.js: Fixed blur event handler to properly read input value from DOM element
  • DrawTool_Templater.js: Added null safety checks using optional chaining (?.) to prevent errors when
    templateObj is undefined

✨ New Features

Advanced Filtering

  • Added "Is Null" and "Is Not Null" operators to the Draw Tool advanced filter system
  • Automatically hides value input field when null operators are selected (they don't require a value)
  • Includes appropriate icons and tooltips for the new operators
  • Backend support for isnull and isnotnull SQL operations

Template Field Validation

  • Added validation for template field names to ensure they only contain safe characters: [a-zA-Z0-9
    _-.]
  • Displays clear error message when invalid characters are used
  • Prevents potential issues with field name handling in filters and queries

🎨 UI Improvements

  • dropy.css: Increased dropdown max-height from 20em to 24em for better visibility of filter options

📝 Files Changed

  • API/Backend/Draw/routes/aggregations.js
  • API/Backend/Draw/routes/filesutils.js
  • src/essence/Tools/Draw/DrawTool_Files.js
  • src/essence/Tools/Draw/DrawTool_Shapes.js
  • src/essence/Tools/Draw/DrawTool_Templater.js
  • src/external/Dropy/dropy.css

@tariqksoliman tariqksoliman self-assigned this Mar 11, 2026
@tariqksoliman tariqksoliman added the bug Something isn't working label Mar 11, 2026
@github-actions

Copy link
Copy Markdown
Contributor

@tariqksoliman tariqksoliman merged commit 48dc75e into development Mar 11, 2026
@github-project-automation github-project-automation Bot moved this to Done in MMGIS Mar 11, 2026
@tariqksoliman tariqksoliman deleted the ts-895 branch March 11, 2026 19:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

[Bug]: DrawTool Advanced Filter on Booleans not working.

1 participant