Commit 1dae4367 authored by Bryce Johnson's avatar Bryce Johnson

Move camelCased props to computed, to fix mutation propagation.

parent 2fd57321
//= require lib/utils/pretty_time //= require lib/utils/pretty_time
(() => { (() => {
const PrettyTime = gl.PrettyTime;
Vue.component('time-tracking-collapsed-state', { Vue.component('time-tracking-collapsed-state', {
name: 'time-tracking-collapsed-state', name: 'time-tracking-collapsed-state',
props: [ props: [
...@@ -16,7 +14,7 @@ ...@@ -16,7 +14,7 @@
], ],
methods: { methods: {
abbreviateTime(timeStr) { abbreviateTime(timeStr) {
return PrettyTime.abbreviateTime(timeStr); return gl.PrettyTime.abbreviateTime(timeStr);
}, },
}, },
template: ` template: `
......
...@@ -19,13 +19,21 @@ ...@@ -19,13 +19,21 @@
data() { data() {
return { return {
showHelp: false, showHelp: false,
timeSpent: this.time_spent,
timeEstimate: this.time_estimate,
timeEstimateHuman: this.human_time_estimate,
timeSpentHuman: this.human_time_spent,
}; };
}, },
computed: { computed: {
timeSpent() {
return this.time_spent;
},
timeEstimate() {
return this.time_estimate;
},
timeEstimateHuman() {
return this.human_time_estimate;
},
timeSpentHuman() {
return this.human_time_spent;
},
hasTimeSpent() { hasTimeSpent() {
return !!this.timeSpent; return !!this.timeSpent;
}, },
...@@ -56,12 +64,12 @@ ...@@ -56,12 +64,12 @@
template: ` template: `
<div class='time_tracker time-tracking-component-wrap' v-cloak> <div class='time_tracker time-tracking-component-wrap' v-cloak>
<time-tracking-collapsed-state <time-tracking-collapsed-state
:showComparisonState='showComparisonState' :show-comparison-state='showComparisonState'
:showHelpState='showHelpState' :show-help-state='showHelpState'
:showSpentOnlyState='showSpentOnlyState' :show-spent-only-state='showSpentOnlyState'
:showEstimateOnlyState='showEstimateOnlyState' :show-estimate-only-state='showEstimateOnlyState'
:timeSpentHuman='timeSpentHuman' :time-spent-human='timeSpentHuman'
:timeEstimateHuman='timeEstimateHuman' :time-estimate-human='timeEstimateHuman'
:stopwatch-svg='stopwatchSvg'> :stopwatch-svg='stopwatchSvg'>
</time-tracking-collapsed-state> </time-tracking-collapsed-state>
<div class='title hide-collapsed'> <div class='title hide-collapsed'>
...@@ -80,21 +88,21 @@ ...@@ -80,21 +88,21 @@
<div class='time-tracking-content hide-collapsed'> <div class='time-tracking-content hide-collapsed'>
<time-tracking-estimate-only-pane <time-tracking-estimate-only-pane
v-if='showEstimateOnlyState' v-if='showEstimateOnlyState'
:timeEstimateHuman='timeEstimateHuman'> :time-estimate-human='timeEstimateHuman'>
</time-tracking-estimate-only-pane> </time-tracking-estimate-only-pane>
<time-tracking-spent-only-pane <time-tracking-spent-only-pane
v-if='showSpentOnlyState' v-if='showSpentOnlyState'
:timeSpentHuman='timeSpentHuman'> :time-spent-human='timeSpentHuman'>
</time-tracking-spent-only-pane> </time-tracking-spent-only-pane>
<time-tracking-no-tracking-pane <time-tracking-no-tracking-pane
v-if='showNoTimeTrackingState'> v-if='showNoTimeTrackingState'>
</time-tracking-no-tracking-pane> </time-tracking-no-tracking-pane>
<time-tracking-comparison-pane <time-tracking-comparison-pane
v-if='showComparisonState' v-if='showComparisonState'
:timeEstimate='timeEstimate' :time-estimate='timeEstimate'
:timeSpent='timeSpent' :time-spent='timeSpent'
:timeSpentHuman='timeSpentHuman' :time-spent-human='timeSpentHuman'
:timeEstimateHuman='timeEstimateHuman'> :time-estimate-human='timeEstimateHuman'>
</time-tracking-comparison-pane> </time-tracking-comparison-pane>
<transition name='help-state-toggle'> <transition name='help-state-toggle'>
<time-tracking-help-state <time-tracking-help-state
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment