coopsymbiotic / coop.symbiotic.timetrack

Timetracker for CiviCRM
Other
2 stars 2 forks source link

Accept+document dates as (optional) part of time expression #9

Open totten opened 5 years ago

totten commented 5 years ago

Background: The docs currently point to a notation like this for punching on Mattermost:

!pi -s 17:00+30m wmf/dev This is my description

Use-Case: I find it handy to track time in a text-file. It's useful for offline work (either due to wonky-Internet or travel or tuning-out from the firehose). It also makes it a bit easier to fill-in details (like project id and issues) asynchronously, to copy-edit notes, and to split out things that were multitasked.

The problem is that it might take a day or so to copy it back in. And after midnight... it gets hard to copy info in.

Aside: The offline log is also a little insidious... once I had a backlog that's hard to transfer, then I started feeling some incentive to keep everything together... which meant continuing to use the text file even if I had online access... so I currently have a... long backlog. That's got me feeling a little motivated. (For me, writing a small parser is probably about as easy as doing data-entry for 50 records...) Tried to find the parser for Mattermost comments... but couldn't. The README suggests that a hubot script lives elsewhere. If you can point me at it, then I might be able to write a patch and/or give a better suggestion.

Possible Notations

## Idea 1
!pi [-d YYYY-MM-DD] [-s HH:MM+DDU] [category] [description]
!pi -d 2019-02-01 -s 17:00+30m wmf/dev This is my description

## Idea 2
!pi [-s [YYYY-MM-DD:]HH:MM+DDU] [category] [description]
!pi -s 2019-02-01:17:00+30m wmf/dev This is my description
totten commented 5 years ago

On second thought... instead of pasting the backlog into the Mattermost bot, we could add a page (e.g. civicrm/timetrack/import?reset=1) with a big TEXTAREA. Then paste the backlog of !pi statements in there. Then the patch could be entirely written as part of the extension (without needing access to the bot...). That might also make it easier to test locally (during development)...

mlutfy commented 5 years ago

This kind of ties into a lot of "batch data entry" requirements that we often encounter. I'd like to develop something more generic.

I would like to do this with advimport, which started out mostly as an importer for Excel files, but has a batch data updater that I find is evolving nicely, and could be used for batch data entry.

I'm mostly pondering how to make the UX quick, without having to click through multiple wizard steps to enter data.

Ex:

Advimport is normally a 3 step wizard, which would be annoying for timetracking data entry, but we can use URL presets to make the first step "copy-paste data", second screen is the field mapper, which would be empty, but we can show some stats to confirm what we are importing, ex: "you are about to punch X hours for the period of 2019-02-01 to 2019-02-05", then run the import (runs the queue), to then go to the final import status page (and from there, if there are errors, you can view/fix them).

(In the second wizard step, I would avoid displaying the data, because there can be a lot of data, and it's not directly actionable unless we go to the batch-data-updated screen, which would be another annoying wizard step, although it could be a wizard checkbox at some point, i.e. "Load data, but do not import yet").

totten commented 5 years ago

Ah, I haven't used AdvImporter, but agree that it sounds like a reasonable thing to adapt. Will try to take a look at it the next time I get my head here.

FWIW... I didn't see your last comment until a bit too late. I binged and wrote a PR which defines (1) an API entity Timetrackpunchlist (actions for preview and import) and (2) an AJAX UI which just connects a textarea to the new API. It's not as a general, but I do like the live-editing/fixing experience. Seems worthwhile to see what you think of it...