adfinis / timedctl

GNU Affero General Public License v3.0
5 stars 0 forks source link

Feature Request: activity show should give out more info #39

Closed eyenx closed 1 year ago

eyenx commented 1 year ago

Right now timedctl ac s prints out just the comment of the activity. it would be nice to also see which customer project the activity is running on.

Right now:

$ timedctl ac s
Current activity: Testing timedctl (Since 13:33:03) 

Propsal:

$ timedctl ac s
Current activity: Adfinis > OSS Contribution > Development contributions > Testing timedctl (Since 13:33:03)

Possibly we could also use a shorter argument like --short for just getting back the customer project the activity is running on:

$ timedctl ac s --short
Current activity: Adfinis > OSS Contribution > Development contributions (Since 13:33:03)
gianklug commented 1 year ago

Hey! Thanks for reporting this.

The main issue why this wasn't implemented in the first place was because no caching was in place, thus resulting this query in taking 4 times as long:

Right now:
GET /activities

In the future:
GET /activities -> Returns task IDs
GET /tasks?id=xyz -> Returns task name + project ID
GET /projects?id=xyz -> Returns project name + customer ID
GET /customers?id=xyz -> Returns customer name

I'll see what impacts this actually has and implement this if it's not too time-hungry.

gianklug commented 1 year ago

Implemented in 20d07fe5d9deef38d6a63b1724067115c1ff4591, it's actually much quicker than expected.