-
Notifications
You must be signed in to change notification settings - Fork 526
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Removes experimental features flag from Case Cost and adds Case Costs…
… to the Dashboard (#5719) * Removes experimental features flag from Case Cost and adds Case Costs to the Dashboard * Add Case Cost bar chart module * Remove debugging statements. * chore(deps): bump sass-embedded in /src/dispatch/static/dispatch (#5696) Bumps [sass-embedded](https://github.com/sass/embedded-host-node) from 1.83.1 to 1.83.4. - [Changelog](https://github.com/sass/embedded-host-node/blob/main/CHANGELOG.md) - [Commits](sass/embedded-host-node@1.83.1...1.83.4) --- updated-dependencies: - dependency-name: sass-embedded dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Avery <[email protected]> --------- Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
- Loading branch information
1 parent
ce57eef
commit e76bdac
Showing
6 changed files
with
139 additions
and
21 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
108 changes: 108 additions & 0 deletions
108
src/dispatch/static/dispatch/src/dashboard/case/CaseCostBarChartCard.vue
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,108 @@ | ||
<template> | ||
<dashboard-card | ||
:loading="loading" | ||
type="bar" | ||
:options="chartOptions" | ||
:series="series" | ||
title="Cost" | ||
/> | ||
</template> | ||
|
||
<script> | ||
import { forEach, sumBy } from "lodash" | ||
import DashboardCard from "@/dashboard/DashboardCard.vue" | ||
export default { | ||
name: "CaseCostBarChartCard", | ||
props: { | ||
modelValue: { | ||
type: Object, | ||
default: function () { | ||
return {} | ||
}, | ||
}, | ||
loading: { | ||
type: [String, Boolean], | ||
default: function () { | ||
return false | ||
}, | ||
}, | ||
}, | ||
components: { | ||
DashboardCard, | ||
}, | ||
computed: { | ||
chartOptions() { | ||
return { | ||
chart: { | ||
type: "bar", | ||
height: 350, | ||
animations: { | ||
enabled: false, | ||
}, | ||
}, | ||
responsive: [ | ||
{ | ||
options: { | ||
legend: { | ||
position: "top", | ||
}, | ||
}, | ||
}, | ||
], | ||
xaxis: { | ||
categories: this.categoryData || [], | ||
title: { | ||
text: "Month", | ||
}, | ||
}, | ||
yaxis: { | ||
labels: { | ||
show: false, | ||
formatter: function (val) { | ||
var formatter = new Intl.NumberFormat("en-US", { | ||
style: "currency", | ||
currency: "USD", | ||
maximumSignificantDigits: 6, | ||
}) | ||
return formatter.format(val) /* $2,500.00 */ | ||
}, | ||
}, | ||
}, | ||
fill: { | ||
opacity: 1, | ||
}, | ||
legend: { | ||
position: "top", | ||
}, | ||
dataLabels: { | ||
enabled: true, | ||
formatter: function (val) { | ||
var formatter = new Intl.NumberFormat("en-US", { | ||
style: "currency", | ||
currency: "USD", | ||
maximumSignificantDigits: 6, | ||
}) | ||
return formatter.format(val) /* $2,500.00 */ | ||
}, | ||
}, | ||
} | ||
}, | ||
series() { | ||
let series = { name: "cost", data: [] } | ||
forEach(this.modelValue, function (value) { | ||
series.data.push(sumBy(value, "total_cost")) | ||
}) | ||
return [series] | ||
}, | ||
categoryData() { | ||
return Object.keys(this.modelValue) | ||
}, | ||
}, | ||
} | ||
</script> |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -190,6 +190,7 @@ export default { | |
"tags", | ||
"title", | ||
"triage_at", | ||
"total_cost", | ||
], | ||
} | ||
|
This file contains 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