Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Do not support name values for user/assignee flags #8

Merged
merged 1 commit into from
Feb 19, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion cmd/list/work_packages_flags.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ func initWorkPackagesFlags() {
"assignee",
"a",
"",
"Assignee of the work package (can be name, ID or 'me')",
"Assignee of the work package (can be ID or 'me')",
)

workPackagesCmd.Flags().Uint64VarP(
Expand Down
5 changes: 2 additions & 3 deletions components/resources/time_entries/filters/user.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,9 @@ import (
)

// validates the value is one or more of the following - separated by commas
// - a valid login (see https://github.com/opf/openproject/blob/dev/app/models/user.rb#L135)
// - a numeric id
// - me
const validValueRegexp = `^([\pL0-9_\-@.+ ]+|[0-9]+|me)(,([\pL0-9_\-@.+ ]+|[0-9]+|me))*$`
const validValueRegexp = `^([0-9]+|me)(,([0-9]+|me))*$`

type UserFilter struct {
value string
Expand All @@ -37,7 +36,7 @@ func (f *UserFilter) ShortHand() string {
}

func (f *UserFilter) Usage() string {
return `User the time entry tracks expenditures for (can be name, ID or 'me')`
return `User the time entry tracks expenditures for (can be ID or 'me')`
}

func (f *UserFilter) ValidateInput() error {
Expand Down