Commit b6df705e authored by Bryce Johnson's avatar Bryce Johnson

Simplify dependency management for timetracking components.

parent bfb5ebd6
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
(() => { (() => {
const PrettyTime = gl.PrettyTime; const PrettyTime = gl.PrettyTime;
gl.IssuableTimeTrackingApp.collapsedState = { Vue.component('time-tracking-collapsed-state', {
name: 'time-tracking-collapsed-state', name: 'time-tracking-collapsed-state',
props: [ props: [
'showComparisonState', 'showComparisonState',
...@@ -38,6 +38,6 @@ ...@@ -38,6 +38,6 @@
</div> </div>
</div> </div>
`, `,
}; });
})(gl.IssuableTimeTrackingApp || (gl.IssuableTimeTrackingApp = {})); })();
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
(() => { (() => {
const PrettyTime = gl.PrettyTime; const PrettyTime = gl.PrettyTime;
gl.IssuableTimeTrackingApp.comparisonPane = { Vue.component('time-tracking-comparison-pane', {
name: 'time-tracking-comparison-pane', name: 'time-tracking-comparison-pane',
props: [ props: [
'timeSpent', 'timeSpent',
...@@ -65,5 +65,5 @@ ...@@ -65,5 +65,5 @@
</div> </div>
</div> </div>
`, `,
}; });
})(gl.IssuableTimeTrackingApp || (gl.IssuableTimeTrackingApp = {})); })();
(() => { (() => {
gl.IssuableTimeTrackingApp.estimateOnlyPane = { Vue.component('time-tracking-estimate-only-pane', {
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>
`, `,
}; });
})(gl.IssuableTimeTrackingApp || (gl.IssuableTimeTrackingApp = {})); })();
(() => { (() => {
gl.IssuableTimeTrackingApp.helpState = { Vue.component('time-tracking-help-state', {
name: 'time-tracking-help-state', name: 'time-tracking-help-state',
props: ['docsUrl'], props: ['docsUrl'],
template: ` template: `
...@@ -19,5 +19,5 @@ ...@@ -19,5 +19,5 @@
</div> </div>
</div> </div>
`, `,
}; });
})(gl.IssuableTimeTrackingApp || (gl.IssuableTimeTrackingApp = {})); })();
(() => { (() => {
gl.IssuableTimeTrackingApp.noTrackingPane = { Vue.component('time-tracking-no-tracking-pane', {
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>
`, `,
}; });
})(gl.IssuableTimeTrackingApp || (gl.IssuableTimeTrackingApp = {})); })();
(() => { (() => {
gl.IssuableTimeTrackingApp.spentOnlyPane = { Vue.component('time-tracking-spent-only-pane', {
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>
`, `,
}; });
})(gl.IssuableTimeTrackingApp || (gl.IssuableTimeTrackingApp = {})); })();
//= require ./help_state
//= require ./collapsed_state
//= require ./spent_only_pane
//= require ./no_tracking_pane
//= require ./estimate_only_pane
//= require ./comparison_pane
(() => { (() => {
const app = gl.IssuableTimeTrackingApp; Vue.component('issuable-time-tracker', {
gl.IssuableTimeTracker = Vue.component('issuable-time-tracker', {
name: 'issuable-time-tracker', name: 'issuable-time-tracker',
props: [ props: [
'time_estimate', 'time_estimate',
...@@ -19,14 +25,6 @@ ...@@ -19,14 +25,6 @@
timeSpentHuman: this.human_time_spent, timeSpentHuman: this.human_time_spent,
}; };
}, },
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: {
hasTimeSpent() { hasTimeSpent() {
return !!this.timeSpent; return !!this.timeSpent;
...@@ -108,4 +106,4 @@ ...@@ -108,4 +106,4 @@
</div> </div>
`, `,
}); });
})(gl.IssuableTimeTrackingApp || (gl.IssuableTimeTrackingApp = {})); })();
/* eslint-disable */
//= require vue //= require vue
//= require_directory ./components //= require ./components/time_tracker
//= require smart_interval //= require smart_interval
//= require subbable_resource //= require subbable_resource
(() => { (() => {
/* This Vue instance represents what will become the parent instance for the /* This Vue instance represents what will become the parent instance for the
* sidebar. It will be responsible for managing `issuable` state and propagating * sidebar. It will be responsible for managing `issuable` state and propagating
* changes to sidebar components. * changes to sidebar components. We will want to create a separate service to
* interface with the server at that point.
*/ */
class IssuableTimeTracking { class IssuableTimeTracking {
......
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