Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Implements the inventory detail “Timeline” view and includes a handful of inventory list/create fixes to stabilize behavior and align request/response shapes with the backend.
Changes:
- Align inventory create payload fields to
*_idand normalize create responses to a consistentview_id. - Improve inventory list grid UX by pinning selection/shortcut/access-level columns and add error-swallowing in the list fetch pipeline.
- Build out the inventory detail timeline UI (cycle-grouped event accordion) and add new i18n entries.
Reviewed changes
Copilot reviewed 11 out of 11 changed files in this pull request and generated 10 comments.
Show a summary per file
| File | Description |
|---|---|
| src/app/modules/inventory/inventory.types.ts | Renames inventory create config fields to access_level_instance_id / cycle_id. |
| src/app/modules/inventory/create/inventory-create.component.ts | Updates create payload to use the renamed *_id fields. |
| src/app/modules/inventory-list/list/inventory.component.ts | Adds catchError(() => of(null)) so inventory loads don’t break the stream on error. |
| src/app/modules/inventory-list/list/grid/grid.component.ts | Pins selection + shortcut + access-level columns to keep user-pinned columns positioned consistently. |
| src/app/modules/inventory-detail/timeline/timeline.types.ts | Introduces timeline event/cycle response types. |
| src/app/modules/inventory-detail/timeline/timeline.component.ts | Implements timeline data loading + grouping + sorting logic. |
| src/app/modules/inventory-detail/timeline/timeline.component.html | Adds timeline UI with Material expansion panels and event detail rendering. |
| src/@seed/api/inventory/inventory.service.ts | Switches inventory create POST URL and normalizes returned view_id across property/taxlot responses. |
| public/i18n/fr_CA.json | Adds new translation keys/values. |
| public/i18n/es.json | Adds new translation keys/values. |
| public/i18n/en_US.json | Adds new translation keys/values. |
Suppressed comments (1)
src/app/modules/inventory-detail/timeline/timeline.component.html:64
- Hard-coded gray background utilities don't follow the app's semantic theme tokens, and can look inconsistent across light/dark themes. Prefer theme-aware tokens like bg-card / text-secondary, etc.
<div class="rounded bg-gray-50 p-3 text-sm dark:bg-gray-800">
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Comment on lines
+54
to
+57
| this._organizationService.currentOrganization$.pipe().subscribe((org) => { | ||
| this.orgId = org.org_id | ||
| this.loadData() | ||
| }) |
Comment on lines
+67
to
+71
| const inventoryObj = this.type === 'taxlots' ? view.taxlot : view.property | ||
| this.propertyId = inventoryObj?.id | ||
| this.cycles = cycles | ||
| this.cycleNameById = cycles.reduce<Record<number, string>>((acc, c) => ({ ...acc, [c.id]: c.name }), {}) | ||
| this.orgUsers = users |
Comment on lines
+73
to
+80
| this._httpClient | ||
| .get<TimelineEventsResponse>(`/api/v3/${this.type}/${this.propertyId}/events/`, { | ||
| params: { organization_id: this.orgId }, | ||
| }) | ||
| .subscribe((response) => { | ||
| this.buildTimeline(response.data ?? []) | ||
| this.loading = false | ||
| }) |
Comment on lines
+12
to
+16
| <div class="text-secondary text-sm">{{ timeline.length }} cycle(s)</div> | ||
| <div class="flex items-center gap-3"> | ||
| <span class="text-secondary text-sm">Sort:</span> | ||
| <button class="text-sm" (click)="toggleSort()" mat-stroked-button> | ||
| {{ sortDesc ? 'Oldest to Newest' : 'Newest to Oldest' }} |
|
|
||
| <!-- NoteEvent detail --> | ||
| @if (event.event_type === 'NoteEvent' && event.note) { | ||
| <div class="rounded bg-gray-50 p-3 text-sm dark:bg-gray-800"> |
| "Create new data set": "Create new data set", | ||
| "Create new label": "Create new label", | ||
| "Create new sub-organization": "Create new sub-organization", | ||
| "Create new {{type}}": "Create New {{type}}", |
| "Cycle Name Benchmark Field": "Nom du cycle Champ de référence", | ||
| "Cycle Selection": "Sélection des cycles", | ||
| "Cycle Start": "Démarrage du cycle", | ||
| "Cycle is required": "Le vélo est nécessaire", |
| "Create new label": "Crear nueva etiqueta", | ||
| "Create new sub-organization": "Crear una nueva suborganización", | ||
| "Create new {{type}}": "Crear Nuevo {{type}}", | ||
| "Create {{ali}} {{type}} in Cycle {{cycle}}?": "Crear {{ali}} {{type}} en ciclo {{cycle}}¿", |
| this.buildTimeline(response.data ?? []) | ||
| this.loading = false | ||
| }) | ||
| }) |
Comment on lines
+125
to
+128
| if (d) return `${d} days` | ||
| if (h) return `${h} hours` | ||
| if (m) return `${m} minutes` | ||
| return `${s} seconds` |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.