Skip to content

Finish Cross Cycles migration (properties + tax lots) - #78

Open
nllong wants to merge 3 commits into
mainfrom
feature/finish-cross-cycles
Open

Finish Cross Cycles migration (properties + tax lots)#78
nllong wants to merge 3 commits into
mainfrom
feature/finish-cross-cycles

Conversation

@nllong

@nllong nllong commented Aug 3, 2026

Copy link
Copy Markdown
Member

Summary

Finishes the Cross Cycles migration for both Properties and Tax Lots (list + detail routes).
Previously setGrid() returned EMPTY, the grid markup was commented out, and the detail tab
just showed "Cross Cycles in development."

Changes

  • New shared seed-cross-cycles-grid component (src/@seed/components/cross-cycles-grid/) used
    by both the list and detail pages (mirrors the existing ColumnProfilesComponent list/detail
    reuse pattern):
    • Cycle-partitioned fetch via InventoryService.filterByCycle() (existing v3
      filter_by_cycle endpoint, unchanged payload)
    • Flattens the per-cycle response into rows sorted/grouped by linking id (ag-grid Community in
      this app has no row-grouping module — that's an Enterprise-only feature — so grouping is
      done via sort + a row-boundary style instead of a tree)
    • Matching-criteria columns pinned left with an asterisk, Cycle / Cycle Start columns,
      data-type-aware filters (date/number/text), decimal formatting from the org's
      display_decimal_places
    • Configured List View Profile columns, or all non-extra-data columns when no profile exists
    • Detail link column, Clear Filters, loading/empty/error states, translations
  • List page (inventory-list/cross-cycles): persisted cycle multi-select +
    column-list-profile selection (currentUser.settings.crossCycles / .profile.list), guarded
    against users who've never saved these settings before (a bare JSON field with no backend
    default)
  • Detail page (inventory-detail/cross-cycles): scopes the shared grid to the current record's
    linking id across all of the org's cycles; fixed a hardcoded 'properties' type and reactive
    route-param handling
  • Bug fix: inventory.routes.ts's top-level /properties|taxlots/cross-cycles route was
    wired to the inventory-detail CrossCyclesComponent instead of the inventory-list one —
    both files export a class with the same name, and only the detail one was ever imported, so
    the list page was completely unreachable (it 500'd trying to parse "cross-cycles" as a numeric
    view id). Exported the list component from the inventory-list barrel and aliased the import.
  • New Cycle Start, Linking ID, and related translation keys added to public/i18n/en_US.json
  • MIGRATION.md updated now that the grid is verified functional

Preserves the existing v3 filter_by_cycle endpoint and payload semantics — no backend changes
required for this app.

Testing

  • pnpm lint and pnpm build pass
  • Live-tested against a throwaway backend with seeded multi-cycle data via Playwright: a property
    linked across all 3 seeded cycles, one existing in only 1 of 3 cycles, and one in 2 of 3 —
    covering multi-cycle grouping, configured vs. missing column-list profile, empty/no-data
    cycles, filters, tab switching, and detail links (from both the list grid and the detail-scoped
    grid)

Screenshots

List, no profile selected (fallback to all columns)
List, configured Column List Profile applied
Multiple cycles selected — rows flattened/grouped by linking id
Detail-page Cross Cycles tab scoped to one record
Tax Lots tab, no profile exists yet
Empty state for a cycle with no data

- Add shared seed-cross-cycles-grid component (cycle-partitioned fetch
  via filterByCycle, flattened rows sorted/grouped by linking id,
  matching-criteria pinning, Cycle/Cycle Start columns, data-type-aware
  filters, clear filters, loading/empty/error states)
- List page: persisted cycle multi-select + column-list-profile
  selection, properties/taxlots tabs
- Detail page: scopes the shared grid to the current record's linking
  id across all cycles
- Fix inventory.routes.ts: top-level /properties|taxlots/cross-cycles
  route was wired to the inventory-detail CrossCyclesComponent instead
  of the inventory-list one (both classes share a name), making the
  list page unreachable; export cross-cycles from the inventory-list
  barrel and alias the import
- Guard against org users with no persisted crossCycles/profile
  settings (a JSONField with no backend default)
- Add Cycle Start, Linking ID, and related translation keys
- Update MIGRATION.md now that the grid is verified functional

Preserves existing v3 filter_by_cycle endpoint/payload semantics; no
backend changes required for this app.

Tested against a live backend with seeded multi-cycle data (single
linked record across 3 cycles, a single-cycle-only record, a
2-of-3-cycle record) covering multi-cycle grouping, configured vs
missing profile, empty/no-data cycles, filters, and detail links via
Playwright.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

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.

🟡 Not ready to approve

The new shared grid component has confirmed lifecycle/accessibility issues (subscription duplication on input changes and a non-accessible/untranslated detail link implementation) that should be addressed before approval.

Once you've addressed the issues Copilot identified, you can request another Copilot review.

This review doesn't count toward merge requirements. Sign up for the private preview to control whether Copilot approvals count.

Pull request overview

Completes the Cross Cycles migration in the Angular inventory experience by introducing a shared, reusable cross-cycle ag-grid component and wiring it into both inventory list and detail routes for Properties and Tax Lots.

Changes:

  • Added a shared seed-cross-cycles-grid component that fetches cross-cycle data via the existing v3 filter_by_cycle endpoint and renders flattened, cycle-aware rows with profile-driven columns, filters, and states.
  • Updated inventory list and detail Cross Cycles pages to use the shared grid (including route-param reactivity fixes on the detail side).
  • Fixed inventory routing so /cross-cycles correctly loads the list Cross Cycles page; added translation keys and updated MIGRATION.md.
File summaries
File Description
src/app/modules/inventory/inventory.routes.ts Fixes the /cross-cycles route to load the list Cross Cycles component (avoids misrouting to the detail tab component).
src/app/modules/inventory-list/index.ts Exports the list Cross Cycles component so routing can import it unambiguously.
src/app/modules/inventory-list/cross-cycles/cross-cycles.component.ts Simplifies the list wrapper to delegate all grid behavior to the shared grid component.
src/app/modules/inventory-list/cross-cycles/cross-cycles.component.html Uses Transloco for the page title and renders the shared grid in list mode.
src/app/modules/inventory-detail/cross-cycles/cross-cycles.component.ts Loads the current view’s linking id across route changes and passes it into the shared grid.
src/app/modules/inventory-detail/cross-cycles/cross-cycles.component.html Replaces the placeholder “in development” state with the shared grid scoped by linking id.
src/@seed/components/cross-cycles-grid/cross-cycles-grid.component.ts New shared ag-grid implementation: dependencies, profile/cycle selection, flattening, grouping-by-sort, formatting, and detail navigation.
src/@seed/components/cross-cycles-grid/cross-cycles-grid.component.html New shared grid UI: cycle/profile selectors, clear filters, loading/error/empty states, and ag-grid host markup.
public/i18n/en_US.json Adds/extends translation keys used by the new grid UI.
MIGRATION.md Updates migration status and documents Cross Cycles parity and verification evidence.
Review details
  • Files reviewed: 10/10 changed files
  • Comments generated: 5
  • Review effort level: Lite

We're testing this review assessment. Please use 👍 or 👎 to tell us if it's correct.

Comment thread src/@seed/components/cross-cycles-grid/cross-cycles-grid.component.ts Outdated
nllong and others added 2 commits August 4, 2026 07:34
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants