BigW Consortium Gitlab
Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gitlab-ce
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Forest Godfrey
gitlab-ce
Commits
f1b9a9cb
Unverified
Commit
f1b9a9cb
authored
Jan 16, 2018
by
Filipa Lacerda
Committed by
Luke Bennett
Jan 17, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Merge branch 'mr-status-box-update' into 'master'
Fixed merge request status badge not updating after merging See merge request gitlab-org/gitlab-ce!16470
parent
6fefbf2e
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
19 additions
and
10 deletions
+19
-10
merge_request.js
app/assets/javascripts/merge_request.js
+4
-4
mr_widget_ready_to_merge.js
...uest_widget/components/states/mr_widget_ready_to_merge.js
+2
-1
mr-status-box-update.yml
changelogs/unreleased/mr-status-box-update.yml
+5
-0
merge_request_spec.js
spec/javascripts/merge_request_spec.js
+3
-4
mr_widget_ready_to_merge_spec.js
...widget/components/states/mr_widget_ready_to_merge_spec.js
+5
-1
No files found.
app/assets/javascripts/merge_request.js
View file @
f1b9a9cb
...
...
@@ -111,7 +111,7 @@ MergeRequest.prototype.initCommitMessageListeners = function() {
});
};
MergeRequest
.
setStatusBoxToMerged
=
function
(
)
{
MergeRequest
.
updateStatusText
=
function
(
classToRemove
,
classToAdd
,
newStatusText
)
{
$
(
'.detail-page-header .status-box'
)
.
removeClass
(
'status-box-open'
)
.
addClass
(
'status-box-mr-merged'
)
...
...
@@ -119,14 +119,14 @@ MergeRequest.setStatusBoxToMerged = function() {
.
text
(
__
(
'Merged'
));
};
MergeRequest
.
prototype
.
decreaseCounter
=
function
(
by
=
1
)
{
const
$el
=
$
(
'.
nav-links .
js-merge-counter'
);
MergeRequest
.
decreaseCounter
=
function
(
by
=
1
)
{
const
$el
=
$
(
'.js-merge-counter'
);
const
count
=
Math
.
max
((
parseInt
(
$el
.
text
().
replace
(
/
[^\d]
/
,
''
),
10
)
-
by
),
0
);
$el
.
text
(
addDelimiter
(
count
));
};
MergeRequest
.
prototype
.
hideCloseButton
=
function
()
{
MergeRequest
.
hideCloseButton
=
function
()
{
const
el
=
document
.
querySelector
(
'.merge-request .js-issuable-actions'
);
const
closeDropdownItem
=
el
.
querySelector
(
'li.close-item'
);
if
(
closeDropdownItem
)
{
...
...
app/assets/javascripts/vue_merge_request_widget/components/states/mr_widget_ready_to_merge.js
View file @
f1b9a9cb
import
successSvg
from
'icons/_icon_status_success.svg'
;
import
warningSvg
from
'icons/_icon_status_warning.svg'
;
import
simplePoll
from
'~/lib/utils/simple_poll'
;
import
MergeRequest
from
'../../../merge_request'
;
import
Flash
from
'../../../flash'
;
import
statusIcon
from
'../mr_widget_status_icon'
;
import
eventHub
from
'../../event_hub'
;
...
...
@@ -165,7 +166,7 @@ export default {
// If state is merged we should update the widget and stop the polling
eventHub
.
$emit
(
'MRWidgetUpdateRequested'
);
eventHub
.
$emit
(
'FetchActionsContent'
);
MergeRequest
.
setStatusBoxToMerged
(
);
MergeRequest
.
updateStatusText
(
'status-box-open'
,
'status-box-merged'
,
'Merged'
);
MergeRequest
.
hideCloseButton
();
MergeRequest
.
decreaseCounter
();
stopPolling
();
...
...
changelogs/unreleased/mr-status-box-update.yml
0 → 100644
View file @
f1b9a9cb
---
title
:
Fixed merge request status badge not updating after merging
merge_request
:
author
:
type
:
fixed
spec/javascripts/merge_request_spec.js
View file @
f1b9a9cb
...
...
@@ -63,8 +63,8 @@ import IssuablesHelper from '~/helpers/issuables_helper';
beforeEach
(()
=>
{
loadFixtures
(
'merge_requests/merge_request_with_task_list.html.raw'
);
this
.
el
=
document
.
querySelector
(
'.js-issuable-actions'
);
const
merge
=
new
MergeRequest
();
merge
.
hideCloseButton
();
new
MergeRequest
();
// eslint-disable-line no-new
MergeRequest
.
hideCloseButton
();
});
it
(
'hides the dropdown close item and selects the next item'
,
()
=>
{
...
...
@@ -83,8 +83,7 @@ import IssuablesHelper from '~/helpers/issuables_helper';
beforeEach
(()
=>
{
loadFixtures
(
'merge_requests/merge_request_of_current_user.html.raw'
);
this
.
el
=
document
.
querySelector
(
'.js-issuable-actions'
);
const
merge
=
new
MergeRequest
();
merge
.
hideCloseButton
();
MergeRequest
.
hideCloseButton
();
});
it
(
'hides the close button'
,
()
=>
{
...
...
spec/javascripts/vue_mr_widget/components/states/mr_widget_ready_to_merge_spec.js
View file @
f1b9a9cb
...
...
@@ -371,6 +371,10 @@ describe('MRWidgetReadyToMerge', () => {
});
});
beforeEach
(()
=>
{
loadFixtures
(
'merge_requests/merge_request_of_current_user.html.raw'
);
});
it
(
'should call start and stop polling when MR merged'
,
(
done
)
=>
{
spyOn
(
eventHub
,
'$emit'
);
spyOn
(
vm
.
service
,
'poll'
).
and
.
returnValue
(
returnPromise
(
'merged'
));
...
...
@@ -400,7 +404,7 @@ describe('MRWidgetReadyToMerge', () => {
setTimeout
(()
=>
{
const
statusBox
=
document
.
querySelector
(
'.status-box'
);
expect
(
statusBox
.
classList
.
contains
(
'status-box-m
r-m
erged'
)).
toBeTruthy
();
expect
(
statusBox
.
classList
.
contains
(
'status-box-merged'
)).
toBeTruthy
();
expect
(
statusBox
.
textContent
).
toContain
(
'Merged'
);
done
();
...
...
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