Implement notification subcommands #389

Merged
6543 merged 20 commits from noerw/tea:notification-subcmds into master 2021-09-05 17:11:17 +00:00
Member
  • enhance notification listing
    • add --states and --type filters
    • toggle per-user or per-repo listing via --mine flag
    • print more fields
  • add subcommands to mark notifications as read, unread, pinned, unpinned. operates on
    • all notifications matching the --state and --mine filter flags, or
    • a notification specified by ID.
  • add a --fields flag for notifications listing. not in this PR
  • interactive mode not in this PR. this would go well together with #324

fixes #243, fixes #155

based on initial work in #283 and #386, but opening a new PR for @6543 to review as I changed quite a lot


⚠️ breaking ⚠️

  • tea notifications --all has moved to tea notifications --mine
  • tea notifications now only works with the context of a remote repo.
    To run this outside of a local git dir, run either tea n --mine or tea n --repo <my/repo>

aside: while developing i discovered a couple of issues with the notifications APIs:

- [x] enhance notification listing - add `--states` and `--type` filters - toggle per-user or per-repo listing via `--mine` flag - print more fields - [x] add subcommands to mark notifications as read, unread, pinned, unpinned. operates on - all notifications matching the `--state` and `--mine` filter flags, or - a notification specified by ID. - [ ] ~~add a `--fields` flag for notifications listing.~~ *not in this PR* - [ ] ~~interactive mode~~ *not in this PR*. this would go well together with #324 fixes #243, fixes #155 based on initial work in #283 and #386, but opening a new PR for @6543 to review as I changed quite a lot --- ### ⚠️ breaking ⚠️ - `tea notifications --all` has moved to `tea notifications --mine` - `tea notifications` now only works with the context of a remote repo. To run this outside of a local git dir, run either `tea n --mine` or `tea n --repo <my/repo>` --- aside: while developing i discovered a couple of issues with the notifications APIs: - https://github.com/go-gitea/gitea/issues/16733 - https://github.com/go-gitea/gitea/issues/16796 - https://github.com/go-gitea/gitea/issues/16797
noerw added this to the v0.8.0 milestone 2021-08-24 02:30:38 +00:00
noerw added the
kind
feature
label 2021-08-24 02:30:38 +00:00
noerw added 18 commits 2021-08-24 02:30:39 +00:00
74047bee0d
add subcomands for notifications
Fix #243

Signed-off-by: Karl Heinz Marbaise <kama@soebes.de>
f978713928
Fixed exported function comments.
Signed-off-by: Karl Heinz Marbaise <kama@soebes.de>
91b5db3e42
Integrated review comments.
Signed-off-by: Karl Heinz Marbaise <kama@soebes.de>
481132ffdb
Moved notifications_list from task into cmd/notifications
Signed-off-by: Karl Heinz Marbaise <kama@soebes.de>
Some checks failed
continuous-integration/drone/pr Build is failing
abd32a7074
WIP - Improved.
All checks were successful
continuous-integration/drone/pr Build is passing
be0e857273
code dedub
All checks were successful
continuous-integration/drone/pr Build is passing
0f12c0a77f
Next dedub
All checks were successful
continuous-integration/drone/pr Build is passing
e52b2678a9
Merge branch 'master' into add-subcomands-for-notifications_rebase283
5ee01374bf
refactor FieldsFlag as CsvFlag for reusability
to be used in --state + --type of notifications listing
4acda8d111
rename --for-user flag to --mine for consistency
with `tea time --mine`. also move the flag to the list subcommand only,
as it's not needed for the other subcmds
Some checks failed
continuous-integration/drone/pr Build is failing
8414c23ed5
print notification id
to be able to mark single notifications
noerw requested review from 6543 2021-08-24 02:30:49 +00:00
noerw added 1 commit 2021-08-24 02:53:34 +00:00
All checks were successful
continuous-integration/drone/pr Build is passing
4b87414787
lint
6543 added 1 commit 2021-09-05 15:24:35 +00:00
All checks were successful
continuous-integration/drone/pr Build is passing
526e665e51
Merge branch 'master' into notification-subcmds
Owner

nice refactor and works great!

one thing: why did you rename --all to --mine ?

nice refactor and works great! one thing: why did you rename `--all` to `--mine` ?
Owner

☝️ noerw: "... for consistency with `tea time --mine` ..."

I can live with that ;)

☝️ ``` noerw: "... for consistency with `tea time --mine` ..." ``` I can live with that ;)
6543 approved these changes 2021-09-05 16:04:09 +00:00
noerw added the
kind/breaking
label 2021-09-05 16:09:01 +00:00
axifive approved these changes 2021-09-05 17:09:09 +00:00
axifive left a comment
Member

looks good

looks good
6543 merged commit 5b28a05eb7 into master 2021-09-05 17:11:17 +00:00
6543 deleted branch notification-subcmds 2021-09-05 17:11:18 +00:00
Sign in to join this conversation.
No description provided.