Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
totten opened this issue Feb 9, 2019 · 3 comments
Open

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

totten opened this issue Feb 9, 2019 · 3 comments

Comments

@totten
Copy link
Contributor

totten commented Feb 9, 2019

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
Copy link
Contributor Author

totten commented Feb 20, 2019

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
Copy link
Contributor

mlutfy commented Feb 24, 2019

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:

  • User copy-pastes data into a text field
  • Advimport timetrack helper parses the data, directly imports it
  • If there are errors, the user can go to the screen for reviewing errors and fix/update values as necessary.

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 added a commit to totten/coop.symbiotic.timetrack that referenced this issue Feb 27, 2019
This addresses the import scenario for coopsymbiotic#9.  It includes live-update, so that
you can fix syntax errors and data-errors while watching the preview of the
proposed import.
@totten
Copy link
Contributor Author

totten commented Feb 27, 2019

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...

mlutfy pushed a commit that referenced this issue Apr 8, 2019
This addresses the import scenario for #9.  It includes live-update, so that
you can fix syntax errors and data-errors while watching the preview of the
proposed import.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants