Skip to content

Implement comprehensive three-tier validation system for Excel imports#194

Open
nautilus69 wants to merge 7 commits into
mainfrom
ValidateImportFiles
Open

Implement comprehensive three-tier validation system for Excel imports#194
nautilus69 wants to merge 7 commits into
mainfrom
ValidateImportFiles

Conversation

@nautilus69

Copy link
Copy Markdown
Contributor
  • Add ValidationResult R6 class for structured validation results

    • Store data, critical errors, and warnings separately
    • Provide methods for categorizing and formatting messages
    • Include validation summary and status checking
  • Create validation utilities with esqlabsR integration

    • Wrap esqlabsR validation functions to capture errors/warnings
    • Implement validators for project config, scenarios, and plots files
    • Add smart error categorization (Missing Fields, Uniqueness, References, etc.)
    • Parse error messages to extract details (sheet names, row numbers)
  • Enhance WarningHandler to support ValidationResult objects

    • Add validation_results and critical_errors tracking
    • Maintain backward compatibility with legacy warnings
    • Provide summary method for all validation results
  • Update import module with validation workflow

    • Validate project configuration before import
    • Show modal for critical errors that block import
    • Validate individual Excel files (scenarios, plots)
    • Skip files with critical errors, import files with warnings
  • Redesign warning modal for three-tier display

    • Add tabbed interface (Summary, Critical Errors, Warnings)
    • Color-code messages (red for critical, yellow for warnings)
    • Dynamic icon changes based on severity
    • Include validation summary table with clear status

  - Add ValidationResult R6 class for structured validation results
    - Store data, critical errors, and warnings separately
    - Provide methods for categorizing and formatting messages
    - Include validation summary and status checking

  - Create validation utilities with esqlabsR integration
    - Wrap esqlabsR validation functions to capture errors/warnings
    - Implement validators for project config, scenarios, and plots files
    - Add smart error categorization (Missing Fields, Uniqueness, References, etc.)
    - Parse error messages to extract details (sheet names, row numbers)

  - Enhance WarningHandler to support ValidationResult objects
    - Add validation_results and critical_errors tracking
    - Maintain backward compatibility with legacy warnings
    - Provide summary method for all validation results

  - Update import module with validation workflow
    - Validate project configuration before import
    - Show modal for critical errors that block import
    - Validate individual Excel files (scenarios, plots)
    - Skip files with critical errors, import files with warnings

  - Redesign warning modal for three-tier display
    - Add tabbed interface (Summary, Critical Errors, Warnings)
    - Color-code messages (red for critical, yellow for warnings)
    - Dynamic icon changes based on severity
    - Include validation summary table with clear status
@nautilus69 nautilus69 requested review from AKostiv8 and PavelBal and removed request for PavelBal November 17, 2025 10:41

@AKostiv8 AKostiv8 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

esqlabsR should:

  • Perform ALL validation logic
  • Return structured ValidationResult objects (or similar)
  • Include critical errors, warnings, and validated data
  • Handle all business rules (required fields, uniqueness, references, etc.)

ESQapp should:

  • Call esqlabsR validation functions
  • Display validation results to users
  • Make UI decisions based on validation status
  • Have ONLY ESQapp-specific validation (UI-related checks, if any)

AKostiv8 and others added 3 commits November 18, 2025 20:54
- Remove validation logic from ESQapp (prepare for esqlabsR migration)
- Simplify mod_import.R with clear TODOs for esqlabsR integration
- Add HTML support to modal system for rich error formatting
- Implement configuration-driven dropdown population
  - Add format_validation_errors() to show specific errors by file
  - Display exact error category, message, and affected Excel file
  - Replace generic summary with actionable error details
  - Add validation integration tests (non-reactive checks)
@nautilus69

nautilus69 commented Dec 8, 2025

Copy link
Copy Markdown
Contributor Author

This should be Tested After [Extending validation #912: https://github.com/esqLABS/esqlabsR/pull/912] on esqlabsR merged to main. This is dependent on the Validation Object which is developed inside esqlabsR package.

@nautilus69

Copy link
Copy Markdown
Contributor Author

esqlabsR 912 ValidationObject is merged now this can be tested. :) @PavelBal @AKostiv8

Comment thread NEWS.md Outdated
#### **Main Changes:**
- **Dropdown Validation with Visual Feedback:** Updated `esqlabs.handsontable` components to include dropdown validation across multiple table components (DataCombined, PlotConfiguration, ExportConfiguration, Demographics, IndividualBiometrics). Invalid dropdown values now display with red background and warning tooltips on hover. Resolved an issue in (#191).
- **Column Description Tooltips:** Added informative tooltips to all table column headers across the application. Hovering over any column header now displays a description extracted from official esqlabsR documentation, helping users understand the purpose and expected values for each field. Resolved an issue in (#191).
- **Validate Imported Excel file:** Use the R6 Validation Object from EsqlabsR and show the user where should be edited to resolve the critical error.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please rephrase to "validate loaded project" - as we plan to move away from the excel structure.

@AKostiv8

Copy link
Copy Markdown
Collaborator

When importing a project configuration, the validation does not detect cases where some or all of the required XLSX configuration files are missing.

Here is the list of XLSX file names:

  • Scenarios.xlsx
  • Populations.xlsx
  • Plots.xlsx
  • ModelParameters.xlsx
  • Individuals.xlsx
  • Applications.xlsx

@nautilus69

Copy link
Copy Markdown
Contributor Author

This will be resolved by esqLABS/esqlabsR#919 merge to esqlabsR main.

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.

3 participants