Implement notification subcommands #389

Merged
6543 merged 20 commits from noerw/tea:notification-subcmds into master 2 months ago
noerw commented 2 months ago
  • 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 2 months ago
noerw added the
kind/feature
label 2 months ago
noerw added 18 commits 2 months ago
74047bee0d
add subcomands for notifications
f978713928
Fixed exported function comments.
91b5db3e42
Integrated review comments.
481132ffdb
Moved notifications_list from task into cmd/notifications
abd32a7074
WIP - Improved.
be0e857273
code dedub
0f12c0a77f
Next dedub
5ee01374bf
refactor FieldsFlag as CsvFlag for reusability
4acda8d111
rename --for-user flag to --mine for consistency
8414c23ed5
print notification id
noerw requested review from 6543 2 months ago
noerw added 1 commit 2 months ago
4b87414787
lint
6543 added 1 commit 2 months ago
526e665e51 Merge branch 'master' into notification-subcmds
Collaborator

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` ?
Collaborator

☝️ 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 2 months ago
noerw added the
kind/breaking
label 2 months ago
axifive approved these changes 2 months ago
axifive left a comment

looks good

6543 merged commit 5b28a05eb7 into master 2 months ago
6543 referenced this issue from a commit 2 months ago
6543 deleted branch notification-subcmds 2 months ago

Reviewers

6543 approved these changes 2 months ago
axifive approved these changes 2 months ago
continuous-integration/drone/pr Build is passing
The pull request has been merged as 5b28a05eb7.
Sign in to join this conversation.
Loading…
There is no content yet.