Skip to content

grower and mentor sorting and filtering#163

Open
markdav-is wants to merge 2 commits into
mainfrom
feature/157-mentor-list-mobile-cards
Open

grower and mentor sorting and filtering#163
markdav-is wants to merge 2 commits into
mainfrom
feature/157-mentor-list-mobile-cards

Conversation

@markdav-is

Copy link
Copy Markdown
Member

PR Classification

Documentation and UX improvement for navigation and state preservation in Oqtane module Edit pages.

PR Summary

This PR introduces a new skill guide for safe return navigation in Oqtane modules and refactors Grower and Mentor modules to preserve filter and sort state across navigation. It also modernizes the filter/sort UI and enhances sorting/filtering capabilities.

  • oqtane-navigation-returnurl/SKILL.md: Added documentation for correct Back/Cancel navigation and state handling.
  • Edit.razor (Grower & Mentor): Updated Back/Cancel navigation to preserve filter/sort state using the recommended pattern.
  • Index.razor (Grower & Mentor): Refactored filter/sort UI to a flexbox layout, added new filter/sort fields, and improved query string/state management.
  • Index.razor (Grower & Mentor): Enhanced sorting logic and ensured state is passed when navigating to Edit pages.
  • ModuleInfo.cs (Grower & Mentor): Bumped module versions to 2.4.0 and updated release history.

- Add SKILL.md for returnurl navigation best practices in Oqtane modules
- Refactor Edit.razor Back/Cancel to preserve filter/sort state and avoid Blazor 404s
- Redesign Grower and Mentor Index filter/sort bars with flex layout
- Add client-side sorting (fields, direction) for growers and mentors
- Pass filter/sort state in Edit links and restore from URL
- Use Open Iconic icons for navigation buttons throughout
- Update Mentor and Grower modules to v2.4.0
- Refactor Mentor Index.razor: filters, sort, and navigation now use query strings for state persistence; Edit links preserve filter context; improved responsive layout
- Update Mentor Edit.razor: Back/Cancel links and post-save navigation retain filter/sort state
- Add name filter to Grower Index.razor; remove ClearFilters/ApplyFilters; all filter state managed via query strings for consistency
Copilot AI review requested due to automatic review settings June 2, 2026 02:22

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 documents a safe Oqtane navigation pattern for Edit→Index return flows and refactors the Grower and Mentor modules to preserve filter/sort state via query-string round-tripping, while modernizing the filter/sort UI.

Changes:

  • Added a new skill guide describing the recommended Back/Cancel + filter state preservation pattern for Oqtane modules.
  • Updated Grower and Mentor Index pages to use a unified filter/sort bar, additional filter/sort options, and query-string-based state.
  • Updated Grower and Mentor Edit pages to navigate Back/Cancel using NavigateUrl(PageState.Page.Path, PageState.QueryString) and bumped module versions to 2.4.0.

Reviewed changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated 8 comments.

Show a summary per file
File Description
.github/skills/oqtane-navigation-returnurl/SKILL.md New documentation for safe return navigation + state preservation.
Client/Modules/Grower/Index.razor Filter/sort UI + query-string state management + sort logic + Edit link param propagation.
Client/Modules/Grower/Edit.razor Back navigation updated to preserve query-string state.
Client/Modules/Grower/ModuleInfo.cs Version bump + release history update.
Client/Modules/Mentor/Index.razor Filter/sort UI + query-string state management + sort logic + Edit link state propagation.
Client/Modules/Mentor/Edit.razor Back/Cancel navigation updated to preserve query-string state.
Client/Modules/Mentor/ModuleInfo.cs Version bump + release history update.

</div>
<div>
<label for="cohortFilter" class="form-label">Cohort</label>
<select id="cohortFilter" class="form-select" @bind="_cohortFilter" @bind:after="LoadGrowersAsync">
Comment on lines 208 to +212
_statusFilter = PageState.QueryString.GetValueOrDefault("status", "");
_villageFilter = PageState.QueryString.GetValueOrDefault("villageId", "");
_nameFilter = PageState.QueryString.GetValueOrDefault("name", "");
_sortBy = PageState.QueryString.GetValueOrDefault("sortBy", "lastname");
_sortAsc = !PageState.QueryString.ContainsKey("sortDesc");
Comment on lines 351 to +355
var parts = new List<string>();
if (!string.IsNullOrEmpty(_statusFilter)) parts.Add($"status={Uri.EscapeDataString(_statusFilter)}");
if (!string.IsNullOrEmpty(_villageFilter)) parts.Add($"villageId={Uri.EscapeDataString(_villageFilter)}");
if (!string.IsNullOrEmpty(_nameFilter)) parts.Add($"name={Uri.EscapeDataString(_nameFilter)}");
if (_sortBy != "lastname") parts.Add($"sortBy={Uri.EscapeDataString(_sortBy)}");
</div>
<div>
<label for="nameFilter" class="form-label">Name</label>
<input id="nameFilter" type="text" class="form-control" @bind="_nameFilter" @bind:event="oninput" @bind:after="NavigateWithFilters" placeholder="Search…" />
Comment on lines 362 to 364
var queryString = BuildFilterQueryString();
NavigationManager.NavigateTo(NavigateUrl(PageState.Page.Path, queryString));
}
</div>
<div>
<label class="form-label" for="filterName">Name / Username</label>
<input id="filterName" type="text" class="form-control" @bind="_nameFilter" @bind:event="oninput" @bind:after="NavigateWithFilters" placeholder="Search…" />
Comment on lines +222 to +226
private void NavigateWithFilters()
{
_page = 1;
NavigationManager.NavigateTo(NavigateUrl(PageState.Page.Path, BuildFilterQueryString()));
}
Comment on lines +230 to +232
if (PageState.QueryString.TryGetValue("villageId", out var vid) && int.TryParse(vid, out var villageId))
_villageFilter = villageId;
_nameFilter = PageState.QueryString.GetValueOrDefault("name", "");
@markdav-is markdav-is force-pushed the feature/157-mentor-list-mobile-cards branch from bee0790 to e65a9f7 Compare July 7, 2026 17:58
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