Skip to content

integrate validators 3-tier warning style#213

Open
nautilus69 wants to merge 1 commit into
mainfrom
use-new-validators
Open

integrate validators 3-tier warning style#213
nautilus69 wants to merge 1 commit into
mainfrom
use-new-validators

Conversation

@nautilus69

Copy link
Copy Markdown
Contributor

Call esqlabsR::validateAllConfigurations() on import, reload, and export
to check xlsx configuration files. Results are mapped into an extended
WarningHandler that now supports both critical errors and warnings.

  • Extend WarningHandler with critical_messages, add_critical_error(),
    has_critical_errors(), clear(), and populate_from_validation()
  • Update warning modal to show 3 tiers: clean (black bell),
    warnings only (yellow triangle), critical errors (red circle)
  • Block export when critical errors exist (button disabled + re-validation
    before writing files)
  • Show blocking modal on import when critical errors are found

Closes #193

@nautilus69

Copy link
Copy Markdown
Contributor Author

Should be merged after esqLABS/esqlabsR#983 to esqlabs main.

Instructions for Code Review:

Test Case 1: Clean import (no errors)
Test Case 2: Import with critical errors

  • Create a ProjectConfiguration.xlsx that points to a Scenarios file missing required columns (e.g., remove IndividualId column)
  • Import it
  • Expected:
    • Red circle-exclamation icon appears in navbar
    • Blocking modal appears: "X critical error(s) found"
    • Export button is disabled
    • Click the red icon → modal shows critical errors in red, grouped by file

Test Case 3: Import with warnings only

  • Create a config where optional sheets (e.g., plotGrids) are missing
  • Expected:
    • Yellow triangle icon appears
    • Toast notification about warnings
    • Export button stays enabled
    • Click icon → modal shows warnings in yellow

Test Case 4: Export blocked

  • Import a config with critical errors
  • Try clicking Export (if somehow enabled)
  • Expected: "Export Blocked" modal appears, no files written

Test Case 5: Reload clears and re-validates

  • Import a valid config → no critical errors
  • Manually break one of the xlsx files (e.g., delete a required column)
  • Click "Reload Project" → confirm
  • Expected: Warnings/errors from the broken file appear, export disabled if critical

Test Case 6: Reload fixes issues

  • Import a broken config → critical errors shown, export disabled
  • Fix the xlsx file
  • Click "Reload Project" → confirm
  • Expected: Previous errors cleared, bell icon resets, export re-enabled

@nautilus69 nautilus69 requested review from AKostiv8 and PavelBal March 17, 2026 13:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Use Validators in esqlabsR inside ESQapp

1 participant