Skip to content

Commit

Permalink
feat(incident): Show the last update time of response costs in the UI (
Browse files Browse the repository at this point in the history
…#5408)

* Show the last update time of response costs.

* Remove unused import.
  • Loading branch information
metroid-samus authored Nov 4, 2024
1 parent 24a36fe commit d5e63a5
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
3 changes: 3 additions & 0 deletions src/dispatch/incident_cost/models.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
from datetime import datetime

from sqlalchemy import Column, ForeignKey, Integer, Numeric
from sqlalchemy.ext.associationproxy import association_proxy
from sqlalchemy.orm import relationship
Expand Down Expand Up @@ -40,6 +42,7 @@ class IncidentCostUpdate(IncidentCostBase):
class IncidentCostRead(IncidentCostBase):
id: PrimaryKey
incident_cost_type: IncidentCostTypeRead
updated_at: Optional[datetime] = None


class IncidentCostPagination(Pagination):
Expand Down
6 changes: 5 additions & 1 deletion src/dispatch/static/dispatch/src/incident/CostsTab.vue
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,9 @@
{{ cost.incident_cost_type.name }}
</v-list-item-title>
<v-list-item-subtitle>{{ cost.incident_cost_type.description }}</v-list-item-subtitle>
<v-list-item-subtitle>
Updated At: {{ formatRelativeDate(cost.updated_at) }}
</v-list-item-subtitle>

<template #append>
{{ toUSD(cost.amount) }}
Expand All @@ -46,6 +49,7 @@
import { mapMutations } from "vuex"
import { mapMultiRowFields } from "vuex-map-fields"
import { toUSD } from "@/filters"
import { formatRelativeDate } from "@/filters"
import IncidentCostInput from "@/incident_cost/IncidentCostInput.vue"
Expand All @@ -57,7 +61,7 @@ export default {
},
setup() {
return { toUSD }
return { toUSD, formatRelativeDate }
},
computed: {
Expand Down

0 comments on commit d5e63a5

Please sign in to comment.