feat(org-lens): all-time range for project detail influence trend + sparklines (LFXV2-2867) - #1305
feat(org-lens): all-time range for project detail influence trend + sparklines (LFXV2-2867)#1305ahmedomosanya wants to merge 1 commit into
Conversation
…nd + sparklines (LFXV2-2867) Wire the BFF + frontend to the new lifetime-bucketed dbt read models so the Project Detail influence-trend chart and card sparklines support a true "All time" range. getTrendBlock / getInfluenceBlock branch on range: `all` reads the adaptive lifetime-bucketed trend / sparkline / bucket-spine tables and emits a variable periods[] axis (the project's shared bucket calendar), while 1y/2y keep the trailing-monthly source and the client-derived month axis. Range is threaded through the controller and folded into the trend/influence cache keys so an all-time request is never served a 1y/2y series. The Angular component consumes periods[] for the chart axis labels. Depends on lf-dbt #2711 (the lifetime read models) reaching prod first. Signed-off-by: ahmedomosanya <aopeyemi@contractor.linuxfoundation.org>
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
Comment |
There was a problem hiding this comment.
Pull request overview
Adds adaptive all-time Org Lens Project Detail trends and sparklines backed by lifetime Snowflake models.
Changes:
- Adds lifetime-bucketed BFF queries and range-aware caching.
- Extends shared contracts with adaptive period labels.
- Updates charts and sparklines to consume server-provided axes.
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
packages/shared/src/interfaces/org-lens-project-detail.interface.ts |
Adds optional adaptive period labels. |
packages/shared/src/constants/org-lens-project-detail.constants.ts |
Defines all-time as variable-length. |
apps/lfx-one/src/server/services/org-lens-project-detail.service.ts |
Queries and maps lifetime models. |
apps/lfx-one/src/server/controllers/org-lens-project-detail.controller.ts |
Passes range to trend retrieval. |
apps/lfx-one/src/app/shared/services/org-lens-project-detail.service.ts |
Sends range with trend requests. |
apps/lfx-one/src/app/modules/dashboards/org/org-project-detail/org-project-detail.component.ts |
Renders adaptive chart axes. |
| // Only the viewing org's own row is needed here (for the section-title band chips), so fetch | ||
| // that single row rather than the whole board — the board itself is now paged separately. | ||
| this.fetchViewingLeaderboardRow(orgUid, slug, timeRangeType).catch(() => null), | ||
| range === 'all' ? this.fetchLifetimeSparklineData(orgUid, slug) : this.fetchMonthlySparklineData(orgUid, slug), |
| // "All time" (periods present): the payload already carries the adaptive-bucket axis, so render | ||
| // the series as-is against the server-emitted labels. 1y/2y: slice the trailing months and derive | ||
| // the fixed month labels client-side (unchanged). | ||
| const useBuckets = periods !== null && periods.length > 0; | ||
| const sparkline = useBuckets ? card.sparkline : card.sparkline.slice(-months); | ||
| const projectSparkline = useBuckets ? card.projectSparkline : card.projectSparkline.slice(-months); | ||
| const labels = useBuckets ? periods.slice(-sparkline.length) : this.monthLabels.slice(-sparkline.length); |
Summary
Adds a true "All time" range to the Org Lens Project Detail influence-trend chart and card sparklines (LFXV2-2867). The BFF now serves the new adaptive lifetime-bucketed warehouse read models for
?range=all, alongside the existing trailing-monthly source for1y/2y.Dependency (draft until this clears)
Reads three new Snowflake models shipped in lf-dbt #2711:
ORG_LENS_PROJECT_DETAIL_TREND_LIFETIME,ORG_LENS_PROJECT_DETAIL_SPARKLINES_LIFETIME,ORG_LENS_PROJECT_INFLUENCE_LIFETIME_BUCKET_SPINE. Kept as a draft until lf-dbt #2711 merges and the tables land in prod — until then theallpath 500s in prod.Changes
org-lens-project-detail.service.ts):getTrendBlock/getInfluenceBlockbranch onrange.allreads the lifetime-bucketed trend/sparkline tables + the bucket spine and emits a variableperiods[]axis (the project's shared adaptive bucket calendar, ≤ 12 points);1y/2ykeep the trailing-monthly source + client-derived month axis. New parameterized fetches (fetchTrendLifetime,fetchSparklinesLifetime,fetchLifetimeAxis) and bucket-label formatting (MMM YYYY/Q# YYYY/YYYY/YYYY–YYYY).range, so an all-time request is never served a1y/2yseries.rangeintogetTrendBlock.periods?: string[]onOrgLensTrendBlock/OrgLensInfluenceBlock(present only forall);PD_TIME_RANGE_MONTHS.alldocumented as variable-length.periods[]for the chart axis labels.Test plan
yarn check-types,yarn lint:check,yarn build— all pass locally.