Conversation
There was a problem hiding this comment.
Copilot review overview
🔵 Needs a closer look
Its broad set of unchecked boundary casts across dynamic APIs and UI modules warrants final human validation.
Review effort: Balanced
Findings: None
What changed in this PR
This PR completes the remaining frontend typing cleanup across shared services, UI components, boards, grids, graphs, BCF, and HTTP infrastructure without intended runtime changes.
Changes:
- Replaces broad
anyusage with concrete, generic, orunknowntypes. - Types HTTP maps, graph datasets, BCF resources, modal locals, and grid references.
- Removes obsolete lint suppressions and unused callback parameters.
| File | Description |
|---|---|
drop-modal-teleportation.service.ts |
Types teleported templates. |
wp-embedded-graph.component.ts |
Types graph datasets and aggregation. |
wp-graph-configuration.ts |
Types graph query properties. |
wp-graph-configuration.service.ts |
Removes obsolete lint suppression. |
wp-graph-configuration.modal.ts |
Types injected modal components. |
trigger-actions-entry.component.ts |
Types HTTP errors. |
remote-field-updater.component.ts |
Types response entries. |
principal-types.ts |
Types custom field values as unknown. |
option-list.component.ts |
Types control callbacks. |
wp-button-macro.modal.ts |
Types modal locals and text. |
wiki-include-page-macro.modal.ts |
Types modal page data. |
code-block-macro.modal.ts |
Infers translation text type. |
child-pages-macro.modal.ts |
Types modal page settings. |
modal.types.ts |
Changes arbitrary modal locals to unknown. |
wp-graph.component.ts |
Removes unused output argument. |
wp-graph.component.html |
Updates graph callback invocation. |
custom-text.component.ts |
Types changed widget resources. |
grid.component.ts |
Types widget constructors and references. |
drag-and-drop.service.ts |
Types dragged DOM lookup. |
area.service.ts |
Types nonstandard scrolling API. |
editable-toolbar-title.component.ts |
Types changed title values. |
wp-date-picker.modal.ts |
Types date-picker resources and formatting. |
op-date-time.component.ts |
Types date and time values. |
version-autocompleter.component.ts |
Uses an inferred version payload. |
create-autocompleter.component.ts |
Types arbitrary models as unknown. |
user-preferences.service.ts |
Types HTTP errors. |
http.interfaces.ts |
Defines accepted HTTP map value types. |
highlighting-tab.component.ts |
Types modal board data. |
board.service.ts |
Types translated board attributes. |
board-partitioned-page.component.ts |
Types parsed board filters. |
board-list-container.component.ts |
Types list creation results and errors. |
board-list.component.ts |
Types column request parameters. |
add-list-modal.component.ts |
Types modal data and version payloads. |
bcf-export-button.component.ts |
Types export events. |
bcf-wp-attribute-group.component.ts |
Types gallery images and actions. |
bcf-viewpoint-collection.paths.ts |
Types BCF creation payloads. |
bcf-topic.resource.ts |
Types date deserializers. |
bcf-api.service.ts |
Types dynamic BCF path traversal. |
bcf-api-request.service.ts |
Types request payloads and responses. |
editable-query-props.component.ts |
Safely stringifies parsing errors. |
states.service.ts |
Types dynamic state lookup. |
capabilities.service.ts |
Types capability request errors. |
schema-cache.service.ts |
Tightens bulk-loading return type. |
model-auth.service.ts |
Types authorization links and teardown streams. |
apiv3-query-paths.ts |
Types query request parameters. |
apiv3-queries-paths.ts |
Types collection query parameters. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
0b25b60 to
59cef96
Compare
|
Warning Flaky specs
🤖 Ask Copilot to investigateCopy the prompt below into a new comment on this PR to delegate the investigation to GitHub Copilot. It will look into the flakiness and open a separate pull request with you as reviewer. |
Types HTTPClientParamMap with the value shapes HttpParams accepts and HTTPClientHeaders with the shapes HttpHeaders accepts, instead of Record<string, any>. Both maps feed Angular's HttpClient unchanged, so the narrower types only document what already worked. The BCF request service now takes its request payload as unknown, as the HAL resource service does, and casts it to a param map only on the GET branch. The query path helpers that forward loosely typed query params cast them at that boundary. https://community.openproject.org/wp/OP-20348
Types the BCF API path parser walk, the TypedJSON deserializer inputs and the viewpoint gallery images and actions with the types the libraries declare, instead of any. The parser still returns the resource it reaches and the deserializers still receive the raw date strings, so runtime behaviour is unchanged. https://community.openproject.org/wp/OP-20348
Declares the OpModalLocalsMap index signature as unknown instead of any, so every modal states the type of each local it reads. The modals that read locals now cast them at that boundary to the type their callers already pass. The date picker modal reads its resource through a small interface instead of eleven lint suppressions. Its formatter now stringifies the non-working-days flag itself; URLSearchParams did the same before, so the URL is unchanged. The macro and add-list modals infer their text maps instead of declaring them as any. https://community.openproject.org/wp/OP-20348
Types the board list query params as an HTTP param map, the add-list handler's return value, the parsed board filter URL param and the board type label translation, instead of letting them fall back to any. The version payloads in the add-list modal and the version autocompleter are built as object literals instead of being assembled on an any-typed object, so their shape is inferred. The payload keys and values are unchanged. https://community.openproject.org/wp/OP-20348
Types the graph dataset query props, the graph query params props and the embedded graph's label and count maps instead of using any. The graph configuration drops an interface that merged with its own class of the same name; the class already declares every member. The graph widget's configured handler drops the event argument it never read, and the graph modal's prepend token takes an unknown component type like its work package table counterpart. https://community.openproject.org/wp/OP-20348
Types the placeholder's non-standard scrollIntoViewIfNeeded method, the dragged area element lookup, the widget component registrations and the custom text widget's changed resource instead of reaching them through any. The lookups keep asserting that the elements exist, as the any casts did. https://community.openproject.org/wp/OP-20348
Types the model auth links, the dynamic state lookup, the date-time component inputs, the option list form callbacks, the principal custom fields, the remote field response, the create autocompleter model and the teleport template ref instead of using any. Error callbacks that hand HTTP errors to the toast service now declare them as HttpErrorResponse, which the service already accepts. The state lookup falls back with ?? instead of ||; the looked-up members are state objects or undefined, so the result is unchanged. https://community.openproject.org/wp/OP-20348
59cef96 to
6689447
Compare
|
Warning Flaky specs
🤖 Ask Copilot to investigateCopy the prompt below into a new comment on this PR to delegate the investigation to GitHub Copilot. It will look into the flakiness and open a separate pull request with you as reviewer. |
Ticket
https://community.openproject.org/wp/OP-20348
What are you trying to accomplish?
Part of OP-20341, the last batch: removes ESLint typing violations from the remaining modules (BCF, boards, grids, graphs, modals, autocompleters, states and the HTTP client maps), without changing behaviour.
HttpParamsandHttpHeadersaccept.unknowninstead ofany.The scoped files go from 115 typing violations to 2; the remaining two clear once #25664 types grouped values. Application-code typing violations drop from 531 to 417 on this branch.
With all OP-20341 pull requests merged together (#25657, #25659–#25666), application-code typing violations are at zero, and
tsc,ngcand the frontend unit tests pass on the combined tree.What approach did you choose and why?
Changes are annotations and boundary casts; no runtime narrowing was added. Small equivalent rewrites: a date formatter returns
String(value)whereURLSearchParamsstringified the same value, the states lookup falls back with??on an object-or-undefined value, the version payloads are object literals with the same keys, and the graph update handler drops an event argument it never read.BcfApiRequestService#_requestbecomessendRequest, and the embedded graph keeps nullable group labels separate from the display labels.Typing modal locals as
unknownmeans new reads ofthis.locals.xneed a cast or a typed locals interface; the date picker modal loses eleven inline disables as a result. The BCF request payload isunknownand cast only on the GET path, as the HAL resource service already does.Stacked on #25661, which makes the
HalResourceindex signatureunknown. It merges cleanly with the sibling pull requests.AI involvement
Directed – I specified the requirements and AI implemented most of it; I validated via testing rather than a full line-by-line review.
Merge checklist
Browser JavaScript diff (12 files, type-only changes omitted)
Each changed browser file (TypeScript and templates, excluding specs, test helpers and declaration files) is transpiled on its own with
frontend/tsconfig.json, before and after; this is the emitted JavaScript that differs.