Watson icon indicating copy to clipboard operation
Watson copied to clipboard

Add day and week editing options

Open Link- opened this issue 5 years ago • 10 comments

A useful feature for daily Watson users (like myself) is having the ability to edit all the entries of a given day or week (generally towards the end of the day | week). This PR provides 5 new optional flags to the edit command:

`-d, --day` | Edit all frames for today.
`-w, --week` | Edit all frames for the past week.
`-m, --month` | Edit all frames for the past month.
`-f, --from` | The date from when the log should start.
`-t, --to` | The date at which the log should stop (inclusive).

If day, week or month are passed, all the frames for that day, week or month will be available for editing. If an id is also passed it will be ignored.

If from and/or to are specified the frames within this range will be available for editing.

Notes:

  • [x] Unit tests have been included for the newly added utility functions
  • [x] Documentation has been updated to reflect the new flags
  • [x] API was maintained and is consistent with what's released right now

Link- avatar Jul 11 '20 17:07 Link-

Thx for this clean implementation! We'll look in more details quickly. :pray:

jmaupetit avatar Jul 16 '20 08:07 jmaupetit

Just to be consitent - what about other time slicing options: --month, --year, --from, and --to?

loonies avatar Jul 16 '20 11:07 loonies

Just to be consitent - what about other time slicing options: --month, --year, --from, and --to?

Definitely feasible and simple to implement. I was thinking of adding them to this PR but the branch name becomes inconsistent with implementation then. Shall we merge this and follow it up with another PR to implement the rest of the options?

Edit:

I've implemented the -m | --month parameter in this PR. I will create a new one to implement --from | --to as they're a bit more complex than I expected (with edge cases).

Link- avatar Jul 16 '20 19:07 Link-

I was thinking of adding them to this PR but the branch name becomes inconsistent with implementation then.

We don't really care about your branch name, you can pursue your work in here. It will be squashed before merging. Thx again!

jmaupetit avatar Jul 17 '20 07:07 jmaupetit

Apologies for the delay in finalising this implementation but I couldn't find the free time during the past couple of weeks. This implementation is now complete with from and to options implemented. I've also made some updates to the response after successful editing: instead of returning the whole list of frames in the specified range now it only returns the frames that were actually edited only.

Link- avatar Aug 01 '20 21:08 Link-

Please don't apologies for having better things to do. We are all volunteers here :wink:

jmaupetit avatar Aug 03 '20 13:08 jmaupetit

Small bump to this PR; anything else is required before merging this?

Link- avatar Aug 30 '20 11:08 Link-

I should take time to test it locally...

jmaupetit avatar Aug 31 '20 12:08 jmaupetit

@jmaupetit I'll just repeat what you told me: "Please don't apologies for having better things to do. We are all volunteers here" :D I was just curious as to the next steps that's all, no pressure!

Link- avatar Aug 31 '20 14:08 Link-

This PR is now broken

Link- avatar Mar 20 '21 12:03 Link-