Skip to content

fix: type the contributor components and details page (CM-1527) - #4983

Merged
gaspergrom merged 5 commits into
mainfrom
fix/CM-1527-contributor-components-types
Oct 16, 2026
Merged

gaspergrom merged 5 commits into
mainfrom
fix/CM-1527-contributor-components-types

Conversation

@gaspergrom

Copy link
Copy Markdown
Contributor

Summary

Types the contributor components and the contributor details page: the header, identities, work experience and affiliations, and the page that hosts them. Type errors on main drop from 187 to 146.

  • timeline?.fetchActivities() now no-ops when the timeline ref is missing instead of throwing.
  • Casts that hide null values are marked with shortcut: comments and keep the existing behaviour.
  • One error in contributor-details-header.vue clears once CM-1526 is in.

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

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
Mostly compile-time typing and formatting; optional chaining on activities load-more is a minor safety improvement. Work-history edit drops client-side org list patching but still persists via the same API.

Overview
Tightens TypeScript across contributor details UI (header, identities, projects/affiliations, activities tab) and related edit/create flows, and lowers the frontend typecheck baseline from 160 to 121 errors.

Adds CreateContributorPayload (and uses CreateContributorIdentity in add-person) so ContributorApiService.create and the add-person modal send typed payloads instead of Partial<Contributor>. Props, emits, route query (subProjectId), scroll handlers, and affiliation grouping get explicit types; several Platform casts and shortcut: comments preserve today’s runtime behavior where types are still loose (e.g. nullable organizationId, array query values).

Small runtime hardening: activity load more uses optional chaining on the timeline ref; identity profile links use url ?? undefined for href. Work-history save no longer mutates a local copy of organizations before the API call—it only uses the store create/update paths.

Reviewed by Cursor Bugbot for commit 65a6ea3. 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

The changes are narrowly scoped typing improvements and a defensive timeline guard, with no identified blocking issues.

0 open findings

What changed in this PR

Improves TypeScript coverage across contributor creation and details views while largely preserving existing behavior.

Changes:

  • Refines contributor payload, component, and event types.
  • Guards activity loading when the timeline reference is missing.
  • Removes unused work-history calculations and lowers the typecheck baseline from 187 to 146.
File Description
frontend/​typecheck-baseline.json Lowers the error baseline to 146.
frontend/​src/​modules/​contributor/​types/​Contributor.ts Adds creation payload typing and optional segment ID.
frontend/​src/​modules/​contributor/​services/​contributor.api.service.ts Uses the creation payload type.
frontend/​src/​modules/​contributor/​pages/​contributor-details.page.vue Types the scroll event.
frontend/​src/​modules/​contributor/​components/​edit/​work-history/​contributor-work-history-edit.vue Types organization labels and removes unused calculations.
frontend/​src/​modules/​contributor/​components/​edit/​contributor-add.vue Corrects identity, payload, and validation types.
frontend/​src/​modules/​contributor/​components/​details/​overview/​project/​contributor-details-projects-sorting.vue Types the sorting event return value.
frontend/​src/​modules/​contributor/​components/​details/​overview/​project/​contributor-details-projects-affiliation.vue Defines the project affiliation prop shape.
frontend/​src/​modules/​contributor/​components/​details/​overview/​contributor-details-projects.vue Types affiliation grouping keys.
frontend/​src/​modules/​contributor/​components/​details/​header/​contributor-details-header-profiles.vue Types profile grouping and handles nullable URLs.
frontend/​src/​modules/​contributor/​components/​details/​contributor-details-identities.vue Requires complete identities for editing.
frontend/​src/​modules/​contributor/​components/​details/​contributor-details-header.vue Aligns platform membership checks with platform types.
frontend/​src/​modules/​contributor/​components/​details/​contributor-details-activities.vue Types query values and guards timeline access.

🧠 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 03:57

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 found no blocking issues in the narrowly scoped typing changes, unused-code removal, or timeline guard; automated checks were not run.

0 open findings

🧠 Review effort: Balanced

@gaspergrom
gaspergrom merged commit 84549bd into main Oct 16, 2026
14 checks passed
@gaspergrom
gaspergrom deleted the fix/CM-1527-contributor-components-types branch October 16, 2026 03:59
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