Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Boxiang Sun
gitlab-ce
Commits
771dec84
Commit
771dec84
authored
Jul 25, 2018
by
Stan Hu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Clean up implementation
parent
ae7574f9
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
20 additions
and
7 deletions
+20
-7
lib/bitbucket_server/representation/activity.rb
lib/bitbucket_server/representation/activity.rb
+1
-1
lib/bitbucket_server/representation/comment.rb
lib/bitbucket_server/representation/comment.rb
+19
-6
No files found.
lib/bitbucket_server/representation/activity.rb
View file @
771dec84
...
...
@@ -56,7 +56,7 @@ module BitbucketServer
end
def
created_date
raw
.
dig
(
'createdDate'
)
raw
[
'createdDate'
]
end
end
end
...
...
lib/bitbucket_server/representation/comment.rb
View file @
771dec84
...
...
@@ -28,11 +28,11 @@ module BitbucketServer
end
def
author_username
author
[
'
usern
ame'
]
author
[
'
displayN
ame'
]
end
def
author_email
author
[
'
displayName
'
]
author
[
'
emailAddress
'
]
end
def
note
...
...
@@ -44,9 +44,22 @@ module BitbucketServer
end
def
updated_at
Time
.
at
(
updated_date
/
1000
)
if
cre
ated_date
.
is_a?
(
Integer
)
Time
.
at
(
updated_date
/
1000
)
if
upd
ated_date
.
is_a?
(
Integer
)
end
# Bitbucket Server supports the ability to reply to any comment
# and created multiple threads. It represents these as a linked list
# of comments within comments. For example:
#
# "comments": [
# {
# "author" : ...
# "comments": [
# {
# "author": ...
#
# Since GitLab only supports a single thread, we flatten all these
# comments into a single discussion.
def
comments
workset
=
[
raw_comment
[
'comments'
]].
compact
all_comments
=
[]
...
...
@@ -71,15 +84,15 @@ module BitbucketServer
end
def
author
raw
_comment
.
fetch
(
'author'
,
{}
)
raw
.
dig
(
'comment'
,
'author'
)
end
def
created_date
raw
_comment
[
'createdDate'
]
raw
.
dig
(
'comment'
,
'createdDate'
)
end
def
updated_date
raw
_comment
[
'updatedDate'
]
raw
.
dig
(
'comment'
,
'updatedDate'
)
end
end
end
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment