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
1
Merge Requests
1
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
nexedi
gitlab-ce
Commits
453d7867
Commit
453d7867
authored
Aug 19, 2019
by
Igor Drozdov
Committed by
Paul Slaughter
Aug 20, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix comments related to BE part
- Edit commit messge body to fix "danger-review"
parent
6aa6456a
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
6 additions
and
39 deletions
+6
-39
app/serializers/merge_request_sidebar_basic_entity.rb
app/serializers/merge_request_sidebar_basic_entity.rb
+5
-2
ee/app/serializers/ee/merge_request_sidebar_basic_entity.rb
ee/app/serializers/ee/merge_request_sidebar_basic_entity.rb
+0
-15
ee/spec/serializers/ee/merge_request_sidebar_basic_entity_spec.rb
...serializers/ee/merge_request_sidebar_basic_entity_spec.rb
+0
-22
spec/fixtures/api/schemas/entities/merge_request_sidebar.json
.../fixtures/api/schemas/entities/merge_request_sidebar.json
+1
-0
No files found.
app/serializers/merge_request_sidebar_basic_entity.rb
View file @
453d7867
# frozen_string_literal: true
class
MergeRequestSidebarBasicEntity
<
IssuableSidebarBasicEntity
expose
:current_user
,
if:
lambda
{
|
_issuable
|
current_user
}
do
expose
:can_merge
do
|
merge_request
|
merge_request
.
can_be_merged_by?
(
current_user
)
end
end
end
MergeRequestSidebarBasicEntity
.
prepend_if_ee
(
'EE::MergeRequestSidebarBasicEntity'
)
ee/app/serializers/ee/merge_request_sidebar_basic_entity.rb
deleted
100644 → 0
View file @
6aa6456a
# frozen_string_literal: true
module
EE
module
MergeRequestSidebarBasicEntity
extend
ActiveSupport
::
Concern
prepended
do
expose
:current_user
,
if:
lambda
{
|
_issuable
|
current_user
}
do
expose
:can_merge
do
|
merge_request
|
merge_request
.
can_be_merged_by?
(
current_user
)
end
end
end
end
end
ee/spec/serializers/ee/merge_request_sidebar_basic_entity_spec.rb
deleted
100644 → 0
View file @
6aa6456a
# frozen_string_literal: true
require
'spec_helper'
describe
MergeRequestSidebarBasicEntity
do
let
(
:project
)
{
create
:project
,
:repository
}
let
(
:merge_request
)
{
create
(
:merge_request
,
source_project:
project
,
target_project:
project
)
}
let
(
:user
)
{
create
(
:user
)
}
let
(
:request
)
{
double
(
'request'
,
current_user:
user
,
project:
project
)
}
let
(
:entity
)
{
described_class
.
new
(
merge_request
,
request:
request
).
as_json
}
describe
'#current_user'
do
it
'contains attributes related to the current user'
do
expect
(
entity
[
:current_user
].
keys
).
to
contain_exactly
(
:id
,
:name
,
:username
,
:state
,
:avatar_url
,
:web_url
,
:todo
,
:can_edit
,
:can_move
,
:can_admin_label
,
:can_merge
)
end
end
end
spec/fixtures/api/schemas/entities/merge_request_sidebar.json
View file @
453d7867
...
...
@@ -2,6 +2,7 @@
"type"
:
"object"
,
"properties"
:
{
"id"
:
{
"type"
:
"integer"
},
"iid"
:
{
"type"
:
"integer"
},
"type"
:
{
"type"
:
"string"
},
"author_id"
:
{
"type"
:
"integer"
},
"project_id"
:
{
"type"
:
"integer"
},
...
...
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