Skip to content
This repository was archived by the owner on May 22, 2025. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
56d54f5
Typo : total_estimate instead of estimation
benchti Oct 2, 2017
ff86366
Merge pull request #28 from benchti/patch-1
kriskbx Oct 3, 2017
9540c03
Add recursive subgroup querying
kriskbx Oct 3, 2017
565ffc6
Release 1.6.11
kriskbx Oct 3, 2017
7855f6b
Add timeformat for different report parts
kriskbx Oct 3, 2017
0833099
Add shorthands for gtt-start command. #23
kriskbx Oct 3, 2017
8c835d7
Add description parsing #27
kriskbx Oct 3, 2017
7e26755
Remove FAQ part from readme
kriskbx Oct 3, 2017
b956d32
open config file in local EDITOR, if user is connected via SSH
zealot128 Oct 6, 2017
e7d8c01
Implemented resume command
zealot128 Oct 6, 2017
acade2b
made gtt-resume.js executable
zealot128 Oct 6, 2017
4d2dc51
Merge branch 'gtt-resume' of https://github.com/zealot128-os/gitlab-t…
kriskbx Oct 6, 2017
3f49200
Add project argument to resume command. Refactor resume method to be …
kriskbx Oct 6, 2017
9a55e39
Add promise rejection to resume method if there's no project set
kriskbx Oct 6, 2017
02d1502
Merge branch 'zealot128-os-gtt-resume'
kriskbx Oct 6, 2017
66fd3c1
Fix issues with description parsing
kriskbx Oct 10, 2017
ee35f64
Merge branch 'ssh-login-editor' of https://github.com/zealot128-os/gi…
kriskbx Oct 10, 2017
3b8a381
Add VISUAL and EDITOR env check to open command
kriskbx Oct 10, 2017
06de05b
Fix group searching by using the full path
kriskbx Oct 10, 2017
15a3d25
Add time format ceiling
kriskbx Oct 12, 2017
17bec44
Add rounded conditionals to time format
kriskbx Oct 14, 2017
3617da5
Fix missing time when there's no conditional in the ceiling function
kriskbx Oct 19, 2017
6cf60b8
Release 1.7.0
kriskbx Oct 19, 2017
4ed1d1c
Fix missing time_stats
kriskbx Oct 23, 2017
d525463
Fix missing time_stats
kriskbx Oct 23, 2017
c9fd848
Fix 'total_time_spent' undefined error
kriskbx Nov 12, 2017
1670b89
Release 1.7.1
kriskbx Nov 12, 2017
9c78e89
Fix configuration directory permissions
bobvandevijver Dec 12, 2017
16ee9cf
Merge pull request #37 from bobvandevijver/patch-1
kriskbx Dec 15, 2017
e5527de
Release 1.7.2
kriskbx Dec 15, 2017
ba2feef
Added line on default editor
bobvandevijver Dec 31, 2017
e68fb7a
Merge pull request #40 from bobvandevijver/patch-2
kriskbx Jan 11, 2018
2d64d5b
Add support for self-signed ssl certificates
kriskbx Jan 11, 2018
fce944a
Javascript parseInt also returns true if only the first character of …
spamsch Jan 12, 2018
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Add description parsing #27
  • Loading branch information
kriskbx committed Oct 3, 2017
commit 8c835d7f5dcdeb4e2b26d2ac12372d536e98edf1
19 changes: 14 additions & 5 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -603,6 +603,12 @@ includeLabels:
- pending
- approved

# Only works if using a local configuration file!
# Extend the global configuration if set to true, pass a string to extend
# the configuration file stored at the given path
# defaults to true
extend: true

# Change number of concurrent connections/http queries
# Note: Handle with care, we don't want to spam GitLabs API too much
# defaults to 10
Expand All @@ -612,11 +618,14 @@ _parallel: 20
# defaults to 100
_perPage: 100

# Only works if using a local configuration file!
# Extend the global configuration if set to true, pass a string to extend
# the configuration file stored at the given path
# defaults to true
extend: true
# Verbose output
_verbose: false

# Check access token validity up front
_checkToken: false

# Skip parsing the issue/merge_request description for time records
_skipDescriptionParsing: false
```
### Time format
Expand Down
3 changes: 2 additions & 1 deletion src/include/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,8 @@ const defaults = {
_perPage: 100,
_parallel: 10,
_verbose: false,
_checkToken: false
_checkToken: false,
_skipDescriptionParsing: false
};

/**
Expand Down
14 changes: 12 additions & 2 deletions src/models/hasTimes.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ class hasTimes extends Base {
constructor(config) {
super(config);
this.times = [];
this.name = '';
}

/**
Expand Down Expand Up @@ -59,7 +58,7 @@ class hasTimes extends Base {
let times = [],
timeSpent = 0,
timeUsers = {},
timeFormat = this.config.get('timeFormat', this.name);
timeFormat = this.config.get('timeFormat', this._type);

// sort by created at
this.notes.sort((a, b) => {
Expand Down Expand Up @@ -95,6 +94,17 @@ class hasTimes extends Base {
done();
});

promise = promise.then(() => new Promise(resolve => {
if (this.config('_skipDescriptionParsing') || timeSpent === this.data.time_stats.total_time_spent) return resolve();

let difference = this.data.time_stats.total_time_spent - timeSpent,
note = Object.assign({noteable_type: this._typeSingular}, this.data);

times.unshift(new Time(Time.toHumanReadable(difference, this.config.get('hoursPerDay')), note, this, this.config));

resolve();
}));

promise.then(() => {
_.each(timeUsers, (time, name) => this[`time_${name}`] = Time.toHumanReadable(time, this.config.get('hoursPerDay'), timeFormat));
this.timeSpent = timeSpent;
Expand Down
11 changes: 7 additions & 4 deletions src/models/issue.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ class issue extends hasTimes {
constructor(config, data = {}) {
super(config);
this.data = data;
this.name= 'issues';
}

make(project, id, create = false) {
Expand Down Expand Up @@ -88,20 +87,24 @@ class issue extends hasTimes {
}

get spent() {
return this.config.toHumanReadable(this.timeSpent, this.name);
return this.config.toHumanReadable(this.timeSpent, this._type);
}

get total_spent() {
return this.stats ? this.config.toHumanReadable(this.stats.total_time_spent, this.name) : null;
return this.stats ? this.config.toHumanReadable(this.stats.total_time_spent, this._type) : null;
}

get total_estimate() {
return this.stats ? this.config.toHumanReadable(this.stats.time_estimate, this.name) : null;
return this.stats ? this.config.toHumanReadable(this.stats.time_estimate, this._type) : null;
}

get _type() {
return 'issues';
}

get _typeSingular() {
return 'Issue';
}
}

module.exports = issue;
11 changes: 7 additions & 4 deletions src/models/mergeRequest.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ class mergeRequest extends hasTimes {
constructor(config, data = {}) {
super(config);
this.data = data;
this.name = 'merge_requests';
}

make(project, id, create = false) {
Expand Down Expand Up @@ -81,20 +80,24 @@ class mergeRequest extends hasTimes {
}

get spent() {
return this.config.toHumanReadable(this.timeSpent, this.name);
return this.config.toHumanReadable(this.timeSpent, this._type);
}

get total_spent() {
return this.stats ? this.config.toHumanReadable(this.stats.total_time_spent, this.name) : null;
return this.stats ? this.config.toHumanReadable(this.stats.total_time_spent, this._type) : null;
}

get total_estimate() {
return this.stats ? this.config.toHumanReadable(this.stats.time_estimate, this.name) : null;
return this.stats ? this.config.toHumanReadable(this.stats.time_estimate, this._type) : null;
}

get _type() {
return 'merge_requests';
}

get _typeSingular() {
return 'Merge Request';
}
}

module.exports = mergeRequest;