Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
T
todoistms
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
tgms
todoistms
Commits
19102a67
Commit
19102a67
authored
6 years ago
by
Vladymyr Riabov
Browse files
Options
Downloads
Plain Diff
Merge branch 'dev' into 'stageMappingSupport'
# Conflicts: # entities/entities.go
parents
ea471fb0
46c23e76
Branches
Branches containing commit
Tags
Tags containing commit
2 merge requests
!32
Dev
,
!31
+ Status field >> Issue struct
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
api/rpcsvc/api.go
+1
-0
1 addition, 0 deletions
api/rpcsvc/api.go
api/rpcsvc/svc.go
+31
-0
31 additions, 0 deletions
api/rpcsvc/svc.go
entities/entities.go
+1
-0
1 addition, 0 deletions
entities/entities.go
tracker/entities.go
+1
-0
1 addition, 0 deletions
tracker/entities.go
with
34 additions
and
0 deletions
api/rpcsvc/api.go
+
1
−
0
View file @
19102a67
...
...
@@ -46,6 +46,7 @@ type ProjectIssuesReq struct {
Tracker
entities
.
Tracker
ProjectID
entities
.
ProjectID
IssueStatuses
[]
entities
.
TypeID
AssignedOnly
bool
entities
.
Pagination
}
...
...
This diff is collapsed.
Click to expand it.
api/rpcsvc/svc.go
+
31
−
0
View file @
19102a67
...
...
@@ -16,6 +16,7 @@ import (
"github.com/powerman/rpc-codec/jsonrpc2"
"gitlab.qarea.org/tgms/tgmserr"
"strconv"
)
var
log
=
narada
.
NewLog
(
"rpcsvc: "
)
...
...
@@ -131,6 +132,7 @@ func (r *API) GetProjectIssues(req *ProjectIssuesReq, resp *ProjectIssuesResp) e
Tracker
:
req
.
Tracker
,
}
is
,
amount
,
err
:=
r
.
tracker
.
ProjectIssues
(
ctx
,
params
)
is
=
r
.
isAssignedTo
(
is
,
req
.
AssignedOnly
,
req
)
*
resp
=
ProjectIssuesResp
{
Issues
:
is
,
...
...
@@ -386,3 +388,32 @@ func reducePath(path string, f func(string) (string, error)) (url string) {
return
}
func
(
r
*
API
)
isAssignedTo
(
issues
[]
entities
.
Issue
,
isAssignedTo
bool
,
req
*
ProjectIssuesReq
)
[]
entities
.
Issue
{
var
el
int
log
.
DEBUG
(
"ASSIGNEDONLY: %+b"
,
req
.
AssignedOnly
)
if
req
.
AssignedOnly
{
userReq
:=
CurrentUserReq
{
Context
:
req
.
Context
,
Tracker
:
req
.
Tracker
,
}
userResp
:=
CurrentUserResp
{}
err
:=
r
.
GetCurrentUser
(
&
userReq
,
&
userResp
)
if
err
!=
nil
{
log
.
DEBUG
(
"Can not get user id: %+v"
,
err
)
return
issues
}
for
_
,
issue
:=
range
issues
{
uid
,
err
:=
strconv
.
Atoi
(
userResp
.
User
.
ID
)
if
err
!=
nil
{
log
.
DEBUG
(
"Can not convert user id: %+v"
,
err
)
return
issues
}
if
issue
.
Assignee
==
int64
(
uid
)
{
issues
[
el
]
=
issue
el
++
}
}
}
return
issues
}
This diff is collapsed.
Click to expand it.
entities/entities.go
+
1
−
0
View file @
19102a67
...
...
@@ -59,6 +59,7 @@ type Issue struct {
Spent
int64
URL
string
Status
TypeID
Assignee
int64
}
type
NewIssue
struct
{
...
...
This diff is collapsed.
Click to expand it.
tracker/entities.go
+
1
−
0
View file @
19102a67
...
...
@@ -17,6 +17,7 @@ type taskItem struct {
Title
string
`json:"content"`
Complete
bool
`json:"completed"`
URL
string
`json:"url"`
Assignee
int64
`json:"user_id"`
}
type
projectItem
struct
{
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment