Show annual spend calculated from monthly spend

This commit is contained in:
Patrick Smith 2018-08-10 11:23:22 -04:00
parent 855857217f
commit 8859ca238e
2 changed files with 12 additions and 2 deletions

View File

@ -17,8 +17,14 @@ export default {
}, },
data: function () { data: function () {
const {
estimated_monthly_spend = 0,
jedi_migration = ''
} = this.initialData
return { return {
jedi_migration: this.initialData.jedi_migration estimated_monthly_spend,
jedi_migration
} }
}, },
@ -27,6 +33,10 @@ export default {
}, },
computed: { computed: {
annualSpend: function () {
const monthlySpend = this.estimated_monthly_spend || 0
return monthlySpend * 12
},
isJediMigration: function () { isJediMigration: function () {
return this.jedi_migration === 'yes' return this.jedi_migration === 'yes'
} }

View File

@ -42,7 +42,7 @@
<h2>Financial Usage</h2> <h2>Financial Usage</h2>
{{ TextInput(f.estimated_monthly_spend, validation='dollars') }} {{ TextInput(f.estimated_monthly_spend, validation='dollars') }}
<p>So this means you are spending approximately <b>$X</b> annually</p> <p>So this means you are spending approximately <b>$!{ annualSpend }</b> annually</p>
{{ TextInput(f.dollar_value, validation='dollars') }} {{ TextInput(f.dollar_value, validation='dollars') }}
{{ TextInput(f.number_user_sessions, validation='integer') }} {{ TextInput(f.number_user_sessions, validation='integer') }}
{{ TextInput(f.average_daily_traffic, placeholder='Gigabytes per day', validation='gigabytes') }} {{ TextInput(f.average_daily_traffic, placeholder='Gigabytes per day', validation='gigabytes') }}