Skip to content

assessment data entry improvements - #181

Merged
markdav-is merged 2 commits into
mainfrom
feature/issue-180-assessment-date-proximity-warning
Jul 23, 2026
Merged

assessment data entry improvements#181
markdav-is merged 2 commits into
mainfrom
feature/issue-180-assessment-date-proximity-warning

Conversation

@markdav-is

Copy link
Copy Markdown
Member

PR Classification

New feature and code cleanup to support per-cohort assessment frequency configuration and improve assessment date validation UX.

PR Summary

Introduces a configurable Assessment Frequency field for cohorts, moves frequency validation to a client-side warning, and refactors service interfaces for clarity.

  • Cohort model, database, and UI: Added required AssessmentFrequencyDays field with validation and migration script.
  • Assessment Edit UI: Replaced server-side frequency block with live client-side warnings and improved dropdown behaviors.
  • Service interfaces: Split Cohort, TreeType, and Village interfaces into separate files and clarified method names.
  • Resource files: Updated English and Xitsonga .resx for new labels and warnings.
  • DI startup and project files: Improved DI registration and removed redundant SQL table files.

markdav-is and others added 2 commits July 22, 2026 11:37
Assessments were hard-blocked based on DateTime.UtcNow and a hardcoded
14/30-day cohort-year rule, which broke bulk/historical data entry.
Replace with a non-blocking inline warning comparing the entered
Assessment Date against the grower's existing assessments, using a new
per-cohort AssessmentFrequencyDays setting instead of the hardcoded split.

Fixes #180

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Introduce non-blocking, per-cohort assessment frequency warning:
- Add AssessmentFrequencyDays to Cohort model, DB, and migration
- Update Cohort Edit form with validated frequency field
- Show live warning on Assessment Edit for date proximity/duplicates
- Server blocks only exited/inactive growers, not frequency
- Preserve filter state via query string on assessment add
- Move service interfaces to separate files; refactor for Blazor
- Improve localization (en, ts) and accessibility for new UI
- Remove Oqtane/system tables from SQL project file
- Update test plan for migration, UI, and accessibility scenarios
Copilot AI review requested due to automatic review settings July 23, 2026 02:23

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

This PR adds per-cohort assessment-frequency configuration and shifts “too-soon” assessment checks from a server-side submission block to a non-blocking, live client-side proximity warning, while also refactoring shared service interfaces and cleaning up SQL project artifacts.

Changes:

  • Added AssessmentFrequencyDays (default 30) to Cohort model/schema plus an idempotent migration script.
  • Replaced server-side assessment-frequency hard stop with a client-side proximity warning on Assessment Edit (keeping the exited/inactive grower hard stop).
  • Split Cohort/Village/TreeType service interfaces into Shared/Services and updated controllers/DI/client services accordingly, plus related UX and localization updates.

Reviewed changes

Copilot reviewed 73 out of 73 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
Sql/Sql.sqlproj Remove many table script includes from the SQL project (project cleanup).
Sql/Scripts/Migration_AddAssessmentFrequencyDaysToCohort.sql Add idempotent migration to introduce AssessmentFrequencyDays.
Sql/dbo/Tables/Visitor.sql Remove redundant table DDL from repo.
Sql/dbo/Tables/UserRole.sql Remove redundant table DDL from repo.
Sql/dbo/Tables/User.sql Remove redundant table DDL from repo.
Sql/dbo/Tables/UrlMapping.sql Remove redundant table DDL from repo.
Sql/dbo/Tables/Theme.sql Remove redundant table DDL from repo.
Sql/dbo/Tables/Tenant.sql Remove redundant table DDL from repo.
Sql/dbo/Tables/SiteTask.sql Remove redundant table DDL from repo.
Sql/dbo/Tables/SiteGroupMember.sql Remove redundant table DDL from repo.
Sql/dbo/Tables/SiteGroup.sql Remove redundant table DDL from repo.
Sql/dbo/Tables/Site.sql Remove redundant table DDL from repo.
Sql/dbo/Tables/Setting.sql Remove redundant table DDL from repo.
Sql/dbo/Tables/SearchWord.sql Remove redundant table DDL from repo.
Sql/dbo/Tables/SearchContentWord.sql Remove redundant table DDL from repo.
Sql/dbo/Tables/SearchContentProperty.sql Remove redundant table DDL from repo.
Sql/dbo/Tables/SearchContent.sql Remove redundant table DDL from repo.
Sql/dbo/Tables/Role.sql Remove redundant table DDL from repo.
Sql/dbo/Tables/Profile.sql Remove redundant table DDL from repo.
Sql/dbo/Tables/Permission.sql Remove redundant table DDL from repo.
Sql/dbo/Tables/PageModule.sql Remove redundant table DDL from repo.
Sql/dbo/Tables/Page.sql Remove redundant table DDL from repo.
Sql/dbo/Tables/Notification.sql Remove redundant table DDL from repo.
Sql/dbo/Tables/ModuleDefinition.sql Remove redundant table DDL from repo.
Sql/dbo/Tables/Module.sql Remove redundant table DDL from repo.
Sql/dbo/Tables/Log.sql Remove redundant table DDL from repo.
Sql/dbo/Tables/Language.sql Remove redundant table DDL from repo.
Sql/dbo/Tables/JobLog.sql Remove redundant table DDL from repo.
Sql/dbo/Tables/Job.sql Remove redundant table DDL from repo.
Sql/dbo/Tables/HtmlText.sql Remove redundant table DDL from repo.
Sql/dbo/Tables/Folder.sql Remove redundant table DDL from repo.
Sql/dbo/Tables/File.sql Remove redundant table DDL from repo.
Sql/dbo/Tables/Cohort.sql Add AssessmentFrequencyDays column (default 30).
Sql/dbo/Tables/AspNetUserTokens.sql Remove redundant table DDL from repo.
Sql/dbo/Tables/AspNetUsers.sql Remove redundant table DDL from repo.
Sql/dbo/Tables/AspNetUserPasskeys.sql Remove redundant table DDL from repo.
Sql/dbo/Tables/AspNetUserLogins.sql Remove redundant table DDL from repo.
Sql/dbo/Tables/AspNetUserClaims.sql Remove redundant table DDL from repo.
Sql/dbo/Tables/Alias.sql Remove redundant table DDL from repo.
Sql/dbo/Tables/__EFMigrationsHistory.sql Remove redundant table DDL from repo.
Specs/Plans/test-plan-issue-180-assessment-date-proximity-warning.md Add manual browser test plan for Issue #180 behavior.
Specs/Features/GardenAssessment.feature Update Gherkin documentation from hard stop to proximity warning scenarios.
Shared/Services/IVillageService.cs Introduce shared Village service interface.
Shared/Services/ITreeTypeService.cs Introduce shared TreeType service interface.
Shared/Services/ICohortService.cs Introduce shared Cohort service interface + clearer method naming.
Shared/Models/Cohort.cs Add AssessmentFrequencyDays property (default 30).
Server/Services/VillageService.cs Remove embedded interface; rely on shared interface.
Server/Services/TreeTypeService.cs Remove embedded interface; rely on shared interface.
Server/Services/CohortService.cs Remove embedded interface; rename methods to match new shared interface.
Server/Services/AssessmentService.cs Remove frequency hard-stop logic from CanSubmitAssessmentAsync.
Server/Controllers/VillageController.cs Add hasassociateddata endpoint with controller-boundary error handling.
Server/Controllers/CohortController.cs Update to new Cohort service method names/signatures.
Client/Startup/VillageClientStartup.cs Guard DI against double-registration in Blazor Server hosting.
Client/Startup/TreeTypeClientStartup.cs Guard DI against double-registration in Blazor Server hosting.
Client/Startup/TrainingClientStartup.cs Guard DI against double-registration in Blazor Server hosting.
Client/Startup/OrchardClientStartup.cs Guard DI against double-registration in Blazor Server hosting.
Client/Startup/MentorClientStartup.cs Guard DI against double-registration in Blazor Server hosting.
Client/Startup/EnrollmentClientStartup.cs Guard DI against double-registration (multiple services).
Client/Startup/CohortClientStartup.cs Guard DI against double-registration in Blazor Server hosting.
Client/Startup/AssessmentClientStartup.cs Guard DI against double-registration in Blazor Server hosting.
Client/Services/VillageService.cs Remove embedded interface; add HasAssociatedDataAsync API call.
Client/Services/TreeTypeService.cs Remove embedded interface; rely on shared interface.
Client/Services/CohortService.cs Remove embedded interface; rely on shared interface.
Client/Resources/OpenEug.TenTrees.Module.Cohort/Edit.ts-ZA.resx Add localization for new Cohort frequency field + ActivatedOn hint.
Client/Resources/OpenEug.TenTrees.Module.Cohort/Edit.resx Add localization for new Cohort frequency field + ActivatedOn hint.
Client/Resources/OpenEug.TenTrees.Module.Assessment/Edit.ts-ZA.resx Add new warning/error message keys and dropdown labels in ts-ZA.
Client/Resources/OpenEug.TenTrees.Module.Assessment/Edit.resx Add new warning/error message keys and dropdown labels in English.
Client/Modules/Enrollment/Index.razor Refactor row class and village loading logic for clarity.
Client/Modules/Cohort/ModuleInfo.cs Bump Cohort module version and release list.
Client/Modules/Cohort/Edit.razor Add required AssessmentFrequencyDays input and editable ActivatedOn with hint text.
Client/Modules/Assessment/ModuleInfo.cs Bump Assessment module version and release list.
Client/Modules/Assessment/Index.razor Preserve/add filters to Add flow via returnurl parameters.
Client/Modules/Assessment/Edit.razor Add village/cohort selectors (Add), implement live proximity warning, keep hard-stop only for ineligible growers.

Comment thread Shared/Models/Cohort.cs
Comment on lines 22 to +24
public DateTime? ActivatedOn { get; set; }

public int AssessmentFrequencyDays { get; set; } = 30;
@markdav-is
markdav-is merged commit f642e76 into main Jul 23, 2026
1 check passed
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.

2 participants