Commit 0b5e227d authored by Bryce Johnson's avatar Bryce Johnson

Register timetracking components locally.

parent dec5b363
//= require lib/utils/pretty_time //= require lib/utils/pretty_time
((gl) => { ((app) => {
const PrettyTime = gl.PrettyTime; const PrettyTime = gl.PrettyTime;
Vue.component('time-tracking-collapsed-state', { app.collapsedState = {
name: 'time-tracking-collapsed-state', name: 'time-tracking-collapsed-state',
props: ['showComparisonState', 'showSpentOnlyState', 'showEstimateOnlyState', 'showNoTimeTrackingState', 'timeSpentHuman', 'timeEstimateHuman', 'stopwatchSvg'], props: ['showComparisonState', 'showSpentOnlyState', 'showEstimateOnlyState', 'showNoTimeTrackingState', 'timeSpentHuman', 'timeEstimateHuman', 'stopwatchSvg'],
methods: { methods: {
...@@ -30,6 +30,6 @@ ...@@ -30,6 +30,6 @@
</div> </div>
</div> </div>
`, `,
}); };
})(window.gl || (window.gl = {})); })(gl.IssuableTimeTrackingApp || (gl.IssuableTimeTrackingApp = {}));
//= require lib/utils/pretty_time //= require lib/utils/pretty_time
((gl) => { ((app) => {
const PrettyTime = gl.PrettyTime; const PrettyTime = gl.PrettyTime;
Vue.component('time-tracking-comparison-pane', { app.comparisonPane = {
name: 'time-tracking-comparison-pane', name: 'time-tracking-comparison-pane',
props: ['timeSpent', 'timeEstimate', 'timeSpentHuman', 'timeEstimateHuman'], props: ['timeSpent', 'timeEstimate', 'timeSpentHuman', 'timeEstimateHuman'],
computed: { computed: {
...@@ -60,5 +60,5 @@ ...@@ -60,5 +60,5 @@
</div> </div>
</div> </div>
`, `,
}); };
})(window.gl || (window.gl = {})); })(gl.IssuableTimeTrackingApp || (gl.IssuableTimeTrackingApp = {}));
((gl) => { ((app) => {
Vue.component('time-tracking-estimate-only-pane', { app.estimateOnlyPane = {
name: 'time-tracking-estimate-only-pane', name: 'time-tracking-estimate-only-pane',
props: ['timeEstimateHuman'], props: ['timeEstimateHuman'],
template: ` template: `
...@@ -8,5 +8,5 @@ ...@@ -8,5 +8,5 @@
{{ timeEstimateHuman }} {{ timeEstimateHuman }}
</div> </div>
`, `,
}); };
})(window.gl || (window.gl = {})); })(gl.IssuableTimeTrackingApp || (gl.IssuableTimeTrackingApp = {}));
(() => { ((app) => {
Vue.component('time-tracking-help-state', { app.helpState = {
name: 'time-tracking-help-state', name: 'time-tracking-help-state',
data() { data() {
return { return {
...@@ -23,5 +23,5 @@ ...@@ -23,5 +23,5 @@
</div> </div>
</div> </div>
`, `,
}); };
})(); })(gl.IssuableTimeTrackingApp || (gl.IssuableTimeTrackingApp = {}));
((gl) => { ((app) => {
Vue.component('time-tracking-no-tracking-pane', { app.noTrackingPane = {
name: 'time-tracking-no-tracking-pane', name: 'time-tracking-no-tracking-pane',
template: ` template: `
<div class='time-tracking-no-tracking-pane'> <div class='time-tracking-no-tracking-pane'>
<span class='no-value'>No estimate or time spent</span> <span class='no-value'>No estimate or time spent</span>
</div> </div>
`, `,
}); };
})(window.gl || (window.gl = {})); })(gl.IssuableTimeTrackingApp || (gl.IssuableTimeTrackingApp = {}));
((gl) => { ((app) => {
Vue.component('time-tracking-spent-only-pane', { app.spentOnlyPane = {
name: 'time-tracking-spent-only-pane', name: 'time-tracking-spent-only-pane',
props: ['timeSpentHuman'], props: ['timeSpentHuman'],
template: ` template: `
...@@ -8,5 +8,5 @@ ...@@ -8,5 +8,5 @@
{{ timeSpentHuman }} {{ timeSpentHuman }}
</div> </div>
`, `,
}); };
})(window.gl || (window.gl = {})); })(gl.IssuableTimeTrackingApp || (gl.IssuableTimeTrackingApp = {}));
(() => { ((app) => {
gl.IssuableTimeTracker = Vue.component('issuable-time-tracker', { gl.IssuableTimeTracker = Vue.component('issuable-time-tracker', {
name: 'issuable-time-tracker', name: 'issuable-time-tracker',
props: ['time_estimate', 'time_spent', 'human_time_estimate', 'human_time_spent', 'stopwatchSvg'], props: ['time_estimate', 'time_spent', 'human_time_estimate', 'human_time_spent', 'stopwatchSvg'],
...@@ -7,6 +7,14 @@ ...@@ -7,6 +7,14 @@
showHelp: false, showHelp: false,
}; };
}, },
components: {
'time-tracking-spent-only-pane': app.spentOnlyPane,
'time-tracking-estimate-only-pane': app.estimateOnlyPane,
'time-tracking-comparison-pane': app.comparisonPane,
'time-tracking-no-tracking-pane': app.noTrackingPane,
'time-tracking-help-state': app.helpState,
'time-tracking-collapsed-state': app.collapsedState,
},
computed: { computed: {
timeSpent() { timeSpent() {
return this.time_spent; return this.time_spent;
...@@ -99,4 +107,4 @@ ...@@ -99,4 +107,4 @@
</div> </div>
`, `,
}); });
})(); })(gl.IssuableTimeTrackingApp || (gl.IssuableTimeTrackingApp = {}));
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