Skip to content

Comments

Potential code refactoring and improvements#15

Open
elaouniyassine wants to merge 73 commits intoCIAT:stagingfrom
APPLITICS:refactor/code-improvements
Open

Potential code refactoring and improvements#15
elaouniyassine wants to merge 73 commits intoCIAT:stagingfrom
APPLITICS:refactor/code-improvements

Conversation

@elaouniyassine
Copy link
Collaborator

To be tested once the cleaned package is working perfectly

elaouniyassine and others added 30 commits October 24, 2025 16:09
…able

- Add validation warnings for crop areas and residue management table
- Update livestock warnings IDs names for consistency
- Use CSS custom properties to clamp dropdown height per modal
- auto-compute modal-specific max height on show, refresh, resize so menus stay within the modal and viewport
Allow text to wrap cleanly without ellipses
- Add validation module ensuring all Area tab fields (Soil N, Soil C, Soil clay, Bulk density, Soil depth, ET₀, and land conversions) are non-negative (≥ 0) with real-time error messaging.

- Correct ET₀ label formatting from ETO to proper subscript.
Validates Waste input fields (milk and meat waste percentages along production, distribution, processing, and consumption) are between 0-100 with real-time error messaging.

Extends validation module with percentage validator and adds `waste_inputs` configuration to validation registry.
Displays validation errors in config order instead of random order for better readability and predictable error presentation.
Validates that all 4 manure/fertilizer purchase fields are non-negative (≥ 0) with real-time error messaging.
Changes `textInput` to `numericInput` for proper numeric validation of manure/fertilizer purchase inputs.
Enhanced module header, renamed validation_server() to farm_validation_server() and organized validation systems by target tab scalability purpse.
Added `livestock_feeding_validation_server()` to validate allocation tables in real-time. Ensures each livestock column sums to exactly 100% per season.
Prevent users from editing fertilizer columns in the Crop Inputs table that were not enabled in the Farm tab. Implement a whitelist approach to dynamically block inactive columns using specific column indices.
elaouniyassine and others added 30 commits December 28, 2025 15:21
- Remove `cp_lactation` from the livestock dataframe in the app.
- Remove `milk_production` and `live_weight_gain` from the livestock dataframe in the parameters database.
- Remove `n_content` from the feedtype initialization table,
- Update all lkp_feeditem.csv files with feed_item_code as first column
Addressed Issues
✅ Improve Livetype table experience in the parameters database #14
✅ Move the Edit Parameters button above the scenario creation #20
✅ Update the form link in the help button #21
Merge branch 'staging' into feature/tables-ux-improvements

# Conflicts:
#	R/40_mod_params_db_server.R
- Remove `grazing_displacement_energy`
- Remove `energy_eggcontent`
- Remove `cp_grazing`
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.

1 participant