Commit 9a206ff1 authored by Fatih Acet's avatar Fatih Acet

Merge branch '1428-fix-lingering-technical-debt-issues-from-timetracking-v1-1' into 'master'

For all timetracking props, include annotations

Closes #1428

See merge request !1405
parents 584ad125 cff7e958
...@@ -6,14 +6,32 @@ require('../../../lib/utils/pretty_time'); ...@@ -6,14 +6,32 @@ require('../../../lib/utils/pretty_time');
(() => { (() => {
Vue.component('time-tracking-collapsed-state', { Vue.component('time-tracking-collapsed-state', {
name: 'time-tracking-collapsed-state', name: 'time-tracking-collapsed-state',
props: [ props: {
'showComparisonState', showComparisonState: {
'showSpentOnlyState', type: Boolean,
'showEstimateOnlyState', required: true,
'showNoTimeTrackingState', },
'timeSpentHumanReadable', showSpentOnlyState: {
'timeEstimateHumanReadable', type: Boolean,
], required: true,
},
showEstimateOnlyState: {
type: Boolean,
required: true,
},
showNoTimeTrackingState: {
type: Boolean,
required: true,
},
timeSpentHumanReadable: {
type: String,
required: false,
},
timeEstimateHumanReadable: {
type: String,
required: false,
},
},
methods: { methods: {
abbreviateTime(timeStr) { abbreviateTime(timeStr) {
return gl.utils.prettyTime.abbreviateTime(timeStr); return gl.utils.prettyTime.abbreviateTime(timeStr);
......
...@@ -6,12 +6,24 @@ require('../../../lib/utils/pretty_time'); ...@@ -6,12 +6,24 @@ require('../../../lib/utils/pretty_time');
Vue.component('time-tracking-comparison-pane', { Vue.component('time-tracking-comparison-pane', {
name: 'time-tracking-comparison-pane', name: 'time-tracking-comparison-pane',
props: [ props: {
'timeSpent', timeSpent: {
'timeEstimate', type: Number,
'timeSpentHumanReadable', required: true,
'timeEstimateHumanReadable', },
], timeEstimate: {
type: Number,
required: true,
},
timeSpentHumanReadable: {
type: String,
required: true,
},
timeEstimateHumanReadable: {
type: String,
required: true,
},
},
computed: { computed: {
parsedRemaining() { parsedRemaining() {
const diffSeconds = this.timeEstimate - this.timeSpent; const diffSeconds = this.timeEstimate - this.timeSpent;
......
...@@ -2,7 +2,12 @@ ...@@ -2,7 +2,12 @@
(() => { (() => {
Vue.component('time-tracking-estimate-only-pane', { Vue.component('time-tracking-estimate-only-pane', {
name: 'time-tracking-estimate-only-pane', name: 'time-tracking-estimate-only-pane',
props: ['timeEstimateHumanReadable'], props: {
timeEstimateHumanReadable: {
type: String,
required: true,
},
},
template: ` template: `
<div class='time-tracking-estimate-only-pane'> <div class='time-tracking-estimate-only-pane'>
<span class='bold'>Estimated:</span> <span class='bold'>Estimated:</span>
......
...@@ -2,7 +2,12 @@ ...@@ -2,7 +2,12 @@
(() => { (() => {
Vue.component('time-tracking-help-state', { Vue.component('time-tracking-help-state', {
name: 'time-tracking-help-state', name: 'time-tracking-help-state',
props: ['docsUrl'], props: {
docsUrl: {
type: String,
required: true,
},
},
template: ` template: `
<div class='time-tracking-help-state'> <div class='time-tracking-help-state'>
<div class='time-tracking-info'> <div class='time-tracking-info'>
......
...@@ -2,7 +2,12 @@ ...@@ -2,7 +2,12 @@
(() => { (() => {
Vue.component('time-tracking-spent-only-pane', { Vue.component('time-tracking-spent-only-pane', {
name: 'time-tracking-spent-only-pane', name: 'time-tracking-spent-only-pane',
props: ['timeSpentHumanReadable'], props: {
timeSpentHumanReadable: {
type: String,
required: true,
},
},
template: ` template: `
<div class='time-tracking-spend-only-pane'> <div class='time-tracking-spend-only-pane'>
<span class='bold'>Spent:</span> <span class='bold'>Spent:</span>
......
...@@ -10,13 +10,30 @@ require('./comparison_pane'); ...@@ -10,13 +10,30 @@ require('./comparison_pane');
(() => { (() => {
Vue.component('issuable-time-tracker', { Vue.component('issuable-time-tracker', {
name: 'issuable-time-tracker', name: 'issuable-time-tracker',
props: [ props: {
'time_estimate', time_estimate: {
'time_spent', type: Number,
'human_time_estimate', required: true,
'human_time_spent', default: 0,
'docsUrl', },
], time_spent: {
type: Number,
required: true,
default: 0,
},
human_time_estimate: {
type: String,
required: false,
},
human_time_spent: {
type: String,
required: false,
},
docsUrl: {
type: String,
required: true,
},
},
data() { data() {
return { return {
showHelp: false, showHelp: false,
...@@ -66,6 +83,7 @@ require('./comparison_pane'); ...@@ -66,6 +83,7 @@ require('./comparison_pane');
<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
:show-comparison-state='showComparisonState' :show-comparison-state='showComparisonState'
:show-no-time-tracking-state='showNoTimeTrackingState'
:show-help-state='showHelpState' :show-help-state='showHelpState'
:show-spent-only-state='showSpentOnlyState' :show-spent-only-state='showSpentOnlyState'
:show-estimate-only-state='showEstimateOnlyState' :show-estimate-only-state='showEstimateOnlyState'
......
---
title: Fix type declarations for spend/estimate values.
merge_request:
author:
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