Skip to content

fix: type the shared filter, identity and saved-view modules (CM-1532) - #4984

Merged
gaspergrom merged 6 commits into
mainfrom
fix/CM-1532-shared-modules-types
Oct 16, 2026
Merged

gaspergrom merged 6 commits into
mainfrom
fix/CM-1532-shared-modules-types

Conversation

@gaspergrom

Copy link
Copy Markdown
Contributor

Summary

Types the shared filter, identity and saved-view modules. Type errors on main drop from 187 to 154, and shared/modules is at zero.

  • FilterInput and the other shared filter components take typed models; casts that hide null or undefined are marked with shortcut: comments.
  • No runtime change.

Closes linuxfoundation/lfx-cdp-insights-ops#232

Copilot AI balanced review requested due to automatic review settings October 16, 2026 03:52
@cursor

cursor Bot commented Oct 16, 2026 •

Copy link
Copy Markdown

PR Summary

Low Risk
Compile-time and annotation changes only; remaining shortcut: casts document unchanged assumptions rather than new logic.

Overview
Tightens TypeScript across shared filters, identities, saved views, and a few adjacent modules, with no intended runtime behavior change. The typecheck baseline drops from 121 to 88 errors.

Filters: Vue defineEmits signatures now include : void return types. FilterItem treats filter chip values as Record<string, unknown> instead of string. Date/number API renderers and label helpers use stricter operator types, optional parse on number rendering, and explicit casts where values are still loosely typed—each marked with shortcut: comments for follow-up. apiFilterRendererByType’s record type reflects the optional parse argument.

Identities & platform: Identity shapes now allow link: string | null and include verified, aligned with useOrganizationIdentities and list/platform components.

Saved views: The form’s view prop is Partial<SavedView> | null; edit flow uses non-null assertions on name and config where behavior was already assumed.

Other: PermissionGuard gets vue-router guard parameter types; merge error handlers and the report-issue modal use error.response! / entity.value! with shortcut notes; project-affiliation description typing uses ContributorAffiliation[]. Contributor API service changes are formatting only.

Reviewed by Cursor Bugbot for commit 853a78e. Bugbot is set up for automated code reviews on this repo. Configure here.

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.

🟢 Approval recommended

Static review identified no blocking regressions in these focused typing changes; typechecking was not executed.

0 open findings

What changed in this PR

Improves typing across shared frontend modules and lowers the typecheck error baseline from 187 to 154.

Changes:

  • Refines filter models, event signatures, and renderer types.
  • Aligns identity and saved-view types with existing usage.
  • Documents legacy nullability assumptions without changing those behaviors.
File Description
frontend/​typecheck-baseline.json Lowers error baseline to 154.
frontend/​src/​shared/​modules/​saved-views/​components/​forms/​SavedViewForm.vue Adjusts view typing and removes redundant fallbacks.
frontend/​src/​shared/​modules/​report-issue/​config/​type/​project-affiliation/​project-affiliation.ts Types affiliation collections.
frontend/​src/​shared/​modules/​report-issue/​component/​report-data-issue-modal.vue Marks the existing entity assumption.
frontend/​src/​shared/​modules/​platform/​components/​platform.vue Allows nullable identity links.
frontend/​src/​shared/​modules/​permissions/​router/​PermissionGuard.ts Types navigation guard parameters.
frontend/​src/​shared/​modules/​merge/​config/​organization/​apiErrorMessage.ts Marks the existing response assumption.
frontend/​src/​shared/​modules/​merge/​config/​member/​apiErrorMessage.ts Marks the existing response assumption.
frontend/​src/​shared/​modules/​identities/​config/​useOrganizationIdentities.ts Aligns identity keys and nullable links.
frontend/​src/​shared/​modules/​identities/​components/​identities-horizontal-list.vue Types verification status and nullable links.
frontend/​src/​shared/​modules/​filters/​config/​itemLabelRenderer/​date.label.renderer.ts Types the partial operator-label map.
frontend/​src/​shared/​modules/​filters/​config/​apiFilterRendererByType.ts Types the optional numeric parser.
frontend/​src/​shared/​modules/​filters/​config/​apiFilterRenderer/​number.filter.renderer.ts Makes numeric coercion explicit.
frontend/​src/​shared/​modules/​filters/​config/​apiFilterRenderer/​date.filter.renderer.ts Adds casts documenting legacy value assumptions.
frontend/​src/​shared/​modules/​filters/​components/​filterTypes/​DateFilter.vue Types date-operator checks.
frontend/​src/​shared/​modules/​filters/​components/​FilterSearch.vue Adds the event return type.
frontend/​src/​shared/​modules/​filters/​components/​FilterItem.vue Types the model and narrows custom configuration.
frontend/​src/​shared/​modules/​filters/​components/​FilterDropdown.vue Adds event return types.
frontend/​src/​shared/​modules/​filters/​components/​Filter.vue Adds event return types.

🧠 Review effort: Balanced


💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Signed-off-by: Gašper Grom <gasper.grom@gmail.com>

# Conflicts:
#	frontend/typecheck-baseline.json
Copilot AI balanced review requested due to automatic review settings October 16, 2026 04:00
@gaspergrom
gaspergrom merged commit a3400ba into main Oct 16, 2026
14 checks passed
@gaspergrom
gaspergrom deleted the fix/CM-1532-shared-modules-types branch October 16, 2026 04:02

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.

🟢 Approval recommended

Static review identified no blocking regressions in these focused typing changes; automated checks were not run.

0 open findings

🧠 Review effort: Balanced

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