Commit df6eb9b1 authored by Bryce Johnson's avatar Bryce Johnson

Switch {prop}Human to {prop}HumanReadable.

parent 5b90c4ca
...@@ -9,20 +9,20 @@ ...@@ -9,20 +9,20 @@
props: [ props: [
'timeSpent', 'timeSpent',
'timeEstimate', 'timeEstimate',
'timeSpentHuman', 'timeSpentHumanReadable',
'timeEstimateHuman', 'timeEstimateHumanReadable',
], ],
computed: { computed: {
parsedRemaining() { parsedRemaining() {
const diffSeconds = this.timeEstimate - this.timeSpent; const diffSeconds = this.timeEstimate - this.timeSpent;
return PrettyTime.parseSeconds(diffSeconds); return PrettyTime.parseSeconds(diffSeconds);
}, },
timeRemainingHuman() { timeRemainingHumanReadable() {
return PrettyTime.stringifyTime(this.parsedRemaining); return PrettyTime.stringifyTime(this.parsedRemaining);
}, },
timeRemainingTooltip() { timeRemainingTooltip() {
const prefix = this.timeRemainingMinutes < 0 ? 'Over by' : 'Time remaining:'; const prefix = this.timeRemainingMinutes < 0 ? 'Over by' : 'Time remaining:';
return `${prefix} ${this.timeRemainingHuman}`; return `${prefix} ${this.timeRemainingHumanReadable}`;
}, },
/* Diff values for comparison meter */ /* Diff values for comparison meter */
...@@ -56,11 +56,11 @@ ...@@ -56,11 +56,11 @@
<div class='compare-display-container'> <div class='compare-display-container'>
<div class='compare-display pull-left'> <div class='compare-display pull-left'>
<span class='compare-label'>Spent</span> <span class='compare-label'>Spent</span>
<span class='compare-value spent'>{{ timeSpentHuman }}</span> <span class='compare-value spent'>{{ timeSpentHumanReadable }}</span>
</div> </div>
<div class='compare-display estimated pull-right'> <div class='compare-display estimated pull-right'>
<span class='compare-label'>Est</span> <span class='compare-label'>Est</span>
<span class='compare-value'>{{ timeEstimateHuman }}</span> <span class='compare-value'>{{ timeEstimateHumanReadable }}</span>
</div> </div>
</div> </div>
</div> </div>
......
...@@ -13,8 +13,8 @@ function initTimeTrackingComponent(opts) { ...@@ -13,8 +13,8 @@ function initTimeTrackingComponent(opts) {
this.initialData = { this.initialData = {
time_estimate: opts.timeEstimate, time_estimate: opts.timeEstimate,
time_spent: opts.timeSpent, time_spent: opts.timeSpent,
human_time_estimate: opts.timeEstimateHuman, human_time_estimate: opts.timeEstimateHumanReadable,
human_time_spent: opts.timeSpentHuman, human_time_spent: opts.timeSpentHumanReadable,
docsUrl: '/help/workflow/time_tracking.md', docsUrl: '/help/workflow/time_tracking.md',
}; };
...@@ -29,7 +29,7 @@ function initTimeTrackingComponent(opts) { ...@@ -29,7 +29,7 @@ function initTimeTrackingComponent(opts) {
describe('Issuable Time Tracker', function() { describe('Issuable Time Tracker', function() {
describe('Initialization', function() { describe('Initialization', function() {
beforeEach(function() { beforeEach(function() {
initTimeTrackingComponent.call(this, { timeEstimate: 100000, timeSpent: 5000, timeEstimateHuman: '2h 46m', timeSpentHuman: '1h 23m' }); initTimeTrackingComponent.call(this, { timeEstimate: 100000, timeSpent: 5000, timeEstimateHumanReadable: '2h 46m', timeSpentHumanReadable: '1h 23m' });
}); });
it('should return something defined', function() { it('should return something defined', function() {
...@@ -54,7 +54,7 @@ function initTimeTrackingComponent(opts) { ...@@ -54,7 +54,7 @@ function initTimeTrackingComponent(opts) {
describe('Panes', function() { describe('Panes', function() {
describe('Comparison pane', function() { describe('Comparison pane', function() {
beforeEach(function() { beforeEach(function() {
initTimeTrackingComponent.call(this, { timeEstimate: 100000, timeSpent: 5000, timeEstimateHuman: '', timeSpentHuman: '' }); initTimeTrackingComponent.call(this, { timeEstimate: 100000, timeSpent: 5000, timeEstimateHumanReadable: '', timeSpentHumanReadable: '' });
}); });
it('should show the "Comparison" pane when timeEstimate and time_spent are truthy', function(done) { it('should show the "Comparison" pane when timeEstimate and time_spent are truthy', function(done) {
...@@ -96,7 +96,7 @@ function initTimeTrackingComponent(opts) { ...@@ -96,7 +96,7 @@ function initTimeTrackingComponent(opts) {
describe("Estimate only pane", function() { describe("Estimate only pane", function() {
beforeEach(function() { beforeEach(function() {
initTimeTrackingComponent.call(this, { timeEstimate: 100000, timeSpent: 0, timeEstimateHuman: '2h 46m', timeSpentHuman: '' }); initTimeTrackingComponent.call(this, { timeEstimate: 100000, timeSpent: 0, timeEstimateHumanReadable: '2h 46m', timeSpentHumanReadable: '' });
}); });
it('should display the human readable version of time estimated', function(done) { it('should display the human readable version of time estimated', function(done) {
...@@ -113,7 +113,7 @@ function initTimeTrackingComponent(opts) { ...@@ -113,7 +113,7 @@ function initTimeTrackingComponent(opts) {
describe('Spent only pane', function() { describe('Spent only pane', function() {
beforeEach(function() { beforeEach(function() {
initTimeTrackingComponent.call(this, { timeEstimate: 0, timeSpent: 5000, timeEstimateHuman: '2h 46m', timeSpentHuman: '1h 23m' }); initTimeTrackingComponent.call(this, { timeEstimate: 0, timeSpent: 5000, timeEstimateHumanReadable: '2h 46m', timeSpentHumanReadable: '1h 23m' });
}); });
it('should display the human readable version of time spent', function(done) { it('should display the human readable version of time spent', function(done) {
...@@ -129,7 +129,7 @@ function initTimeTrackingComponent(opts) { ...@@ -129,7 +129,7 @@ function initTimeTrackingComponent(opts) {
describe('No time tracking pane', function() { describe('No time tracking pane', function() {
beforeEach(function() { beforeEach(function() {
initTimeTrackingComponent.call(this, { timeEstimate: 0, timeSpent: 0, timeEstimateHuman: 0, timeSpentHuman: 0 }); initTimeTrackingComponent.call(this, { timeEstimate: 0, timeSpent: 0, timeEstimateHumanReadable: 0, timeSpentHumanReadable: 0 });
}); });
it('should only show the "No time tracking" pane when both timeEstimate and time_spent are falsey', function(done) { it('should only show the "No time tracking" pane when both timeEstimate and time_spent are falsey', function(done) {
......
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