feat(opgaver): multi-tavle filter on ListOpgaver + StreamOpgaveChanges#799
Merged
Conversation
…iple tavle_ids Replaces string tavle_id with repeated string tavle_ids on ListOpgaverRequest and StreamOpgaveChangesRequest. The C# handlers parse the repeated field directly into the existing BoardIds list that BackendConfigurationCalendarService.ShouldIncludeTask already filters on, so no business logic changes — only proto + glue. Hard cutover (same field number, type change). The flutter consumer is the only client of this proto; plugin and flutter PRs merge in lockstep. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Simplifier polish on TryParseBoardIds: file already imports System.Collections.Generic; bare List<int>/HashSet<int>/IEnumerable<string> match the rest of OpgaverGrpcService. XML doc trimmed to the load-bearing facts (per-entry skip semantics, dedup, empty=show-all contract). Behavior unchanged. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
There was a problem hiding this comment.
Pull request overview
This PR updates the Opgaver gRPC contract and server adapter to support filtering tasks by multiple boards (“tavler”) by widening the request field from a single tavle_id to repeated tavle_ids, and plumbing that through to the existing CalendarTaskRequestModel.BoardIds filtering.
Changes:
- Updated
ListOpgaverRequestandStreamOpgaveChangesRequestinopgaver.prototo userepeated string tavle_ids = 2. - Updated
OpgaverGrpcServiceto readrequest.TavleIdsin bothListOpgaverandStreamOpgaveChanges. - Refactored
TryParseBoardIdsto acceptIEnumerable<string>, skip blank/non-numeric entries per element, and deduplicate while preserving first-seen order.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| eFormAPI/Plugins/BackendConfiguration.Pn/BackendConfiguration.Pn/Services/GrpcServices/OpgaverGrpcService.cs | Switches request consumption to TavleIds and updates board-id parsing to handle multi-select input. |
| eFormAPI/Plugins/BackendConfiguration.Pn/BackendConfiguration.Pn/Protos/opgaver.proto | Updates gRPC request messages to accept multiple board IDs via repeated string tavle_ids. |
Comment on lines
+2934
to
+2941
| /// <summary> | ||
| /// Parse the repeated <c>tavle_ids</c> wire field into a deduplicated list | ||
| /// of numeric SDK board ids for <c>CalendarTaskRequestModel.BoardIds</c>. | ||
| /// Blank and non-numeric entries are skipped per-entry (not all-or-nothing); | ||
| /// an empty result means "no board filter, show all" downstream in | ||
| /// <c>BackendConfigurationCalendarService.ShouldIncludeTask</c>. | ||
| /// </summary> | ||
| private static List<int> TryParseBoardIds(IEnumerable<string> raws) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
string tavle_id = 2;withrepeated string tavle_ids = 2;onListOpgaverRequestandStreamOpgaveChangesRequestinopgaver.proto. Same field number, type change. Hard cutover — flutter is the only consumer.OpgaverGrpcService.TryParseBoardIds(string)refactored toTryParseBoardIds(IEnumerable<string>)with per-entry skip-on-blank-or-non-numeric semantics + insertion-order-preserving HashSet dedup. Empty result still means "show all".ListOpgaverline 202,StreamOpgaveChangesline 780) feed the parsed list into the existingCalendarTaskRequestModel.BoardIdswhichBackendConfigurationCalendarService.ShouldIncludeTaskalready filters on (1809-1813) — no business-logic changes, only proto + glue.HasAccessAsync); EF schema untouched.Why
Today the mobile home-page filter renders
Checkboxwidgets for tavler that visually read as multi-select, but the data model is single-select — checking a second board silently overwrites the first. This PR is the wire side of widening the model toSet<String>end-to-end. The flutter side is in a follow-up PR (linked below) that must merge in lockstep with this one (a flutter client carrying the new repeated field cannot talk to atavle_id-only server, and vice versa).Verification
dotnet clean && dotnet buildagainst the embedded copy (/home/rene/Documents/workspace/microting/eform-angular-frontend/eFormAPI/Plugins/BackendConfiguration.Pn/): 0 errors, only pre-existing CS8632/NU1510 warnings.Known follow-ups (not in this PR)
TryParseBoardIdsor the two RPCs. Worth a backlog item: table test coveringnull,[],[""],[" "],["abc"],["1","1","2"],["1","abc","2"].Lockstep
stable) FIRST, then deploy the new backend, then merge the flutter-eform consumer PR.🤖 Generated with Claude Code