Skip to content

Commit

Permalink
fix(list): adds missing user column
Browse files Browse the repository at this point in the history
  • Loading branch information
Ephigenia committed Nov 5, 2018
1 parent 39fad5a commit bae35b5
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 25 deletions.
32 changes: 16 additions & 16 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -97,22 +97,22 @@ When an entry is currently active and tracked it will be yellow and indicated wi

mite list

┌──────────┬────────────┬────────────┬──────────┬─────────┬───────────────────┬──────────────────────────────────────────────────┐
│ id │ date │ project │ duration │ revenue │ service │ note │
├──────────┼────────────┼────────────┼──────────┼─────────┼───────────────────┼──────────────────────────────────────────────────┤
│ 73628791 │ 2017-09-13 │ carservice │ ▶ 01:36 │ - │ Programming │ open in browser │
├──────────┼────────────┼────────────┼──────────┼─────────┼───────────────────┼──────────────────────────────────────────────────┤
│ 73628761 │ 2017-09-13 │ ABC │ 00:07 │ 9.33 │ Communication │ lorem ipsum dolor │
├──────────┼────────────┼────────────┼──────────┼─────────┼───────────────────┼──────────────────────────────────────────────────┤
│ 73627950 │ 2017-09-13 │ sp support │ 00:04 │ 4.84 │ Programming │ JIRA-123 Lorem ipsum dolor sit amet, consetetur │
│ │ │ │ │ │ │ sadipscing. │
├──────────┼────────────┼────────────┼──────────┼─────────┼───────────────────┼──────────────────────────────────────────────────┤
│ 73627919 │ 2017-09-13 │ XYZ │ 00:10 │ 13.33 │ Communication │ Lorem ipsum dolor sit amet, consetetur │
│ │ │ │ │ │ │ sadipscing elitr, sed diam nonumy eirmod │
│ │ │ │ │ │ │ tempor invidunt ut labore et dolore │
├──────────┼────────────┼────────────┼──────────┼─────────┼───────────────────┴──────────────────────────────────────────────────┤
│ │ │ │ 00:21 │ 27.50 │ │
└──────────┴────────────┴────────────┴──────────┴─────────┴──────────────────────────────────────────────────────────────────────┘
┌──────────┬────────────┬─────────────────┬────────────┬──────────┬─────────┬───────────────────┬──────────────────────────────────────────────────┐
│ id │ date │ user │ project │ duration │ revenue │ service │ note │
├──────────┼────────────┼─────────────────┼────────────┼──────────┼─────────┼───────────────────┼──────────────────────────────────────────────────┤
│ 73628791 │ 2017-09-13 │ Marcel Eichner │ carservice │ ▶ 01:36 │ - │ Programming │ open in browser │
├──────────┼────────────┼─────────────────┼────────────┼──────────┼─────────┼───────────────────┼──────────────────────────────────────────────────┤
│ 73628761 │ 2017-09-13 │ Marcel Eichner │ ABC │ 00:07 │ 9.33 │ Communication │ lorem ipsum dolor │
├──────────┼────────────┼─────────────────┼────────────┼──────────┼─────────┼───────────────────┼──────────────────────────────────────────────────┤
│ 73627950 │ 2017-09-13 │ Marcel Eichner │ sp support │ 00:04 │ 4.84 │ Programming │ JIRA-123 Lorem ipsum dolor sit amet, consetetur │
│ │ │ │ │ │ │ sadipscing. │
├──────────┼────────────┼─────────────────┼────────────┼──────────┼─────────┼───────────────────┼──────────────────────────────────────────────────┤
│ 73627919 │ 2017-09-13 │ Marcel Eichner │ XYZ │ 00:10 │ 13.33 │ Communication │ Lorem ipsum dolor sit amet, consetetur │
│ │ │ │ │ │ │ sadipscing elitr, sed diam nonumy eirmod │
│ │ │ │ │ │ │ tempor invidunt ut labore et dolore │
├──────────┼────────────┼─────────────────┼────────────┼──────────┼─────────┼───────────────────┴──────────────────────────────────────────────────┤
│ │ │ │ 00:21 │ 27.50 │ │
└──────────┴────────────┴─────────────────┴────────────┴──────────┴─────────┴──────────────────────────────────────────────────────────────────────┘

You also can request longer time frames by using the first argument which is bascially the [`at` parameter](https://mite.yo.lk/en/api/time-entries.html#list-all) of the time entries api:

Expand Down
22 changes: 13 additions & 9 deletions source/mite-list.js
Original file line number Diff line number Diff line change
Expand Up @@ -246,6 +246,7 @@ program
let row = [
timeEntry.id,
timeEntry.date_at,
timeEntry.user_name,
timeEntry.project_name || '-',
duration,
revenue,
Expand All @@ -269,13 +270,14 @@ program
}, 0)

tableData.unshift([
'id', 'date', 'project', 'duration', 'revenue', 'service', 'note'
'id', 'date', 'user', 'project', 'duration', 'revenue', 'service', 'note'
].map(function(v) { return chalk.bold(v); }))
// sum up everything as last row
tableData.push([
null,
null,
null,
null,
chalk.bold(formater.minutesToDuration(minutesTotal)),
chalk.bold(formater.budget(BUDGET_TYPE.CENTS, revenueTotal)),
null,
Expand All @@ -285,34 +287,36 @@ program
const tableConfig = {
border: tableLib.getBorderCharacters('norc'),
columns: {
0: {
0: { // id
width: 10,
alignment: 'right',
},
1: {
1: { // date
width: 10,
alignment: 'right',
},
2: { // project
// user
// no-definition
3: { // project
width: 20,
alignment: 'right',
wrapWord: true,
},
3: { // duration
4: { // duration
width: 10,
alignment: 'right',
},
4: { // revenue
5: { // revenue
width: 10,
alignment: 'right',
},
5: { // service
6: { // service
width: 20,
wrapWord: true,
alignment: 'right',
},
6: { // note
width: 80,
7: { // note
width: 70,
wrapWord: true,
alignment: 'left',
}
Expand Down

0 comments on commit bae35b5

Please sign in to comment.