Add subcomands for notifications #386
No reviewers
Labels
No Label
kind/breaking
kind/bug
kind/build
kind/dependency
kind/deployment
kind/docs
kind
enhancement
kind
feature
kind/proposal
kind
question
kind
refactor
kind/security
kind/testing
kind/translation
priority/critical
priority/high
priority/low
priority/medium
reviewed/duplicate
reviewed/invalid
reviewed/wontfix
skip-changelog
status/blocked
status/has-backport
status/has-pull
status/needs-backport
status/needs-feedback
status/needs-reviews
status/wip
upstream/gitea
upstream/sdk
No Milestone
No Assignees
2 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: gitea/tea#386
Loading…
Reference in New Issue
Block a user
No description provided.
Delete Branch "6543:add-subcomands-for-notifications_rebase283"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Fix #243
use #283 and resolved conflicts + some code dedub
Initial review, still quite some work to do (I might pick it up this or next week, no promises though)
@ -104,0 +104,4 @@
// NotificationFlags defines flags that should be available on notifications.
var NotificationFlags = append([]cli.Flag{
&cli.BoolFlag{
Name: "all",
can we rename this to
user
,account
orany-scope
?all
is ambiguous as it could also mean--state=all
#usability@ -26,3 +20,1 @@
Name: "all",
Aliases: []string{"a"},
Usage: "show all notifications of related gitea instance",
Description: "Show notifications, by default based of the current repo",
Description: "Show notifications, by default based on the current repo if available",
@ -29,0 +28,4 @@
Flags: append(flags.NotificationFlags,
&cli.StringFlag{
Name: "state",
Usage: "set notification state (default is all), pinned,read,unread",
@ -0,0 +30,4 @@
// notif ls --state all
// notif ls --state pinned
// notif ls --state read
// notif ls --state unread
?
@ -0,0 +21,4 @@
ctx := context.InitCommand(cmd)
client := ctx.Login.Client()
all := ctx.Bool("all")
see above
@ -0,0 +26,4 @@
//This enforces pagination.
listOpts := ctx.GetListOptions()
if listOpts.Page == 0 {
listOpts.Page = 1
do we really want this here? a reusable helper would be better. or even move this logic into the sdk?
@ -0,0 +35,4 @@
Status: status,
})
} else {
ctx.Ensure(context.CtxRequirement{RemoteRepo: true})
this is a breaking change, previously
tea n
ran fine without a remote repo, and just listed the user notifications.I think the new behaviour is better, so we just need to make sure to note that breaking change in the PR description/labels
@ -0,0 +12,4 @@
// CmdNotificationsPinned represents a sub command of notifications to list pinned notifications
var CmdNotificationsPinned = cli.Command{
Name: "pinned",
These subcommands are unneeded/wrong (was a misunderstanding with the original author i think):
We want subcommands that pin/unpin + mark as read/unread.
superseded by #389
Pull request closed