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
6a385b60
Commit
6a385b60
authored
Aug 22, 2019
by
Igor
Committed by
Rémy Coutable
Aug 22, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove mergeTrain from FE since it's used only in EE
parent
842b4d4a
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
3 additions
and
46 deletions
+3
-46
app/assets/javascripts/vue_merge_request_widget/stores/mr_widget_store.js
...cripts/vue_merge_request_widget/stores/mr_widget_store.js
+0
-3
app/serializers/merge_request_widget_entity.rb
app/serializers/merge_request_widget_entity.rb
+3
-1
spec/javascripts/vue_mr_widget/stores/mr_widget_store_spec.js
.../javascripts/vue_mr_widget/stores/mr_widget_store_spec.js
+0
-42
No files found.
app/assets/javascripts/vue_merge_request_widget/stores/mr_widget_store.js
View file @
6a385b60
...
@@ -87,9 +87,6 @@ export default class MergeRequestStore {
...
@@ -87,9 +87,6 @@ export default class MergeRequestStore {
this
.
allowCollaboration
=
data
.
allow_collaboration
;
this
.
allowCollaboration
=
data
.
allow_collaboration
;
this
.
sourceProjectId
=
data
.
source_project_id
;
this
.
sourceProjectId
=
data
.
source_project_id
;
this
.
targetProjectId
=
data
.
target_project_id
;
this
.
targetProjectId
=
data
.
target_project_id
;
this
.
mergePipelinesEnabled
=
Boolean
(
data
.
merge_pipelines_enabled
);
this
.
mergeTrainsCount
=
data
.
merge_trains_count
||
0
;
this
.
mergeTrainIndex
=
data
.
merge_train_index
;
// CI related
// CI related
this
.
hasCI
=
data
.
has_ci
;
this
.
hasCI
=
data
.
has_ci
;
...
...
app/serializers/merge_request_widget_entity.rb
View file @
6a385b60
...
@@ -84,8 +84,10 @@ class MergeRequestWidgetEntity < Grape::Entity
...
@@ -84,8 +84,10 @@ class MergeRequestWidgetEntity < Grape::Entity
private
private
delegate
:current_user
,
to: :request
def
presenter
(
merge_request
)
def
presenter
(
merge_request
)
@presenters
||=
{}
@presenters
||=
{}
@presenters
[
merge_request
]
||=
MergeRequestPresenter
.
new
(
merge_request
,
current_user:
request
.
current_user
)
# rubocop: disable CodeReuse/Presenter
@presenters
[
merge_request
]
||=
MergeRequestPresenter
.
new
(
merge_request
,
current_user:
current_user
)
# rubocop: disable CodeReuse/Presenter
end
end
end
end
spec/javascripts/vue_mr_widget/stores/mr_widget_store_spec.js
View file @
6a385b60
...
@@ -82,47 +82,5 @@ describe('MergeRequestStore', () => {
...
@@ -82,47 +82,5 @@ describe('MergeRequestStore', () => {
expect
(
store
.
isNothingToMergeState
).
toEqual
(
false
);
expect
(
store
.
isNothingToMergeState
).
toEqual
(
false
);
});
});
});
});
describe
(
'
mergePipelinesEnabled
'
,
()
=>
{
it
(
'
should set mergePipelinesEnabled = true when merge_pipelines_enabled is true
'
,
()
=>
{
store
.
setData
({
...
mockData
,
merge_pipelines_enabled
:
true
});
expect
(
store
.
mergePipelinesEnabled
).
toBe
(
true
);
});
it
(
'
should set mergePipelinesEnabled = false when merge_pipelines_enabled is not provided
'
,
()
=>
{
store
.
setData
({
...
mockData
,
merge_pipelines_enabled
:
undefined
});
expect
(
store
.
mergePipelinesEnabled
).
toBe
(
false
);
});
});
describe
(
'
mergeTrainsCount
'
,
()
=>
{
it
(
'
should set mergeTrainsCount when merge_trains_count is provided
'
,
()
=>
{
store
.
setData
({
...
mockData
,
merge_trains_count
:
3
});
expect
(
store
.
mergeTrainsCount
).
toBe
(
3
);
});
it
(
'
should set mergeTrainsCount = 0 when merge_trains_count is not provided
'
,
()
=>
{
store
.
setData
({
...
mockData
,
merge_trains_count
:
undefined
});
expect
(
store
.
mergeTrainsCount
).
toBe
(
0
);
});
});
describe
(
'
mergeTrainIndex
'
,
()
=>
{
it
(
'
should set mergeTrainIndex when merge_train_index is provided
'
,
()
=>
{
store
.
setData
({
...
mockData
,
merge_train_index
:
3
});
expect
(
store
.
mergeTrainIndex
).
toBe
(
3
);
});
it
(
'
should not set mergeTrainIndex when merge_train_index is not provided
'
,
()
=>
{
store
.
setData
({
...
mockData
,
merge_train_index
:
undefined
});
expect
(
store
.
mergeTrainIndex
).
toBeUndefined
();
});
});
});
});
});
});
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