add subcomands for notifications #283
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
3 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: gitea/tea#283
Loading…
Reference in New Issue
Block a user
No description provided.
Delete Branch "khmarbaise/tea:issue-243-add_subcomands_for_notifications"
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
Signed-off-by: Karl Heinz Marbaise kama@soebes.de
@ -0,0 +1,49 @@
// Copyright 2020 The Gitea Authors. All rights reserved.
// Use of this source code is governed by a MIT-style
// license that can be found in the LICENSE file.
Is this the way to go with common code from cmd/... ? Or should that put into cmd/notifications/ ?
@ -0,0 +16,4 @@
Name: "ls",
Aliases: []string{"list"},
Usage: "List notifications....",
Description: `List notification....`,
@ -0,0 +19,4 @@
Description: `List notification....`,
Action: RunNotificationsList,
Flags: append([]cli.Flag{
&cli.BoolFlag{
Please move these common flags into
cmd/flags/flags.go
asNotificationFlags
Good idea not even realized that. Thanks.
@ -0,0 +22,4 @@
&cli.BoolFlag{
Name: "all",
Aliases: []string{"a"},
Usage: "show all notifications of related gitea instance",
@ -0,0 +26,4 @@
},
&cli.StringFlag{
Name: "state",
Usage: "Filter by milestone state (all|open|closed)",
Yes of course.
@ -0,0 +14,4 @@
// CmdNotificationsPinned represents a sub command of notifications to list pinned notifications
var CmdNotificationsPinned = cli.Command{
Name: "pinned",
Aliases: []string{"pin"},
"pin" makes it sound like a verb, not a read list-command.
I'd drop this alias
What about with an alias
pd
instead?@ -0,0 +21,4 @@
listOpts := flags.GetListOptions(ctx)
if listOpts.Page == 0 {
listOpts.Page = 1
}
@6453 ?
If you take a look into
flags.GetListOptions(ctx)
After I've played a little bit with it which means removed the lines from notification_list.go I've not seen a difference. May I have missed a thing... Can someone enlighten me ?
I don't understand why, but these lines are needed still, without I get no results for
tea notif read
in short: it enforces paggination
@ -0,0 +23,4 @@
Name: "all",
Aliases: []string{"a"},
Usage: "show all notifications of related gitea instance",
},
@khmarbaise can you move task.ListNotifications back to cmd/notification module
I dont see a reason to add cli & flag dependency into task module
So making a file
notifications_list.go
which contains that. I will do and change it accordingly.Done as suggested.
d350600d81
to85c3001e49
@ -79,2 +43,3 @@
print.NotificationsList(news, flags.GlobalOutputValue, ctx.Bool("all"))
func runNotificationsDetails(ctx *cli.Context) error {
log.Fatal("Not yet implemented.")
I would print
use --help to see all options
I dont get the usage of pin, unpin, read subcommand
they only list stuff as
list
does?I expect pin to actualy pin a notification ...
same vor unpin & read
the list should print out the notif id to this actions specific or with or,
--all
flag for read/pin mark all unread as read--all
flag for unpin mark all pined as readunread should only be used to mark a specific one as "unread"
@khmarbaise can you resolve conflicts?
If you need help just shout out on discord to me
85c3001e49
toabd32a7074
-> #386
Pull request closed