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
e5b8809e
Commit
e5b8809e
authored
Feb 27, 2019
by
GitLab Bot
Browse files
Options
Browse Files
Download
Plain Diff
Automatic merge of gitlab-org/gitlab-ce master
parents
7ee4fb00
d6696f81
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
34 additions
and
5 deletions
+34
-5
app/assets/javascripts/environments/mixins/environments_mixin.js
...ets/javascripts/environments/mixins/environments_mixin.js
+12
-5
changelogs/unreleased/sh-wip-fix-duplicate-env-xhr.yml
changelogs/unreleased/sh-wip-fix-duplicate-env-xhr.yml
+5
-0
spec/features/projects/environments/environments_spec.rb
spec/features/projects/environments/environments_spec.rb
+17
-0
No files found.
app/assets/javascripts/environments/mixins/environments_mixin.js
View file @
e5b8809e
...
...
@@ -43,7 +43,11 @@ export default {
saveData
(
resp
)
{
this
.
isLoading
=
false
;
if
(
_
.
isEqual
(
resp
.
config
.
params
,
this
.
requestData
))
{
// Prevent the absence of the nested flag from causing mismatches
const
response
=
this
.
filterNilValues
(
resp
.
config
.
params
);
const
request
=
this
.
filterNilValues
(
this
.
requestData
);
if
(
_
.
isEqual
(
response
,
request
))
{
this
.
store
.
storeAvailableCount
(
resp
.
data
.
available_count
);
this
.
store
.
storeStoppedCount
(
resp
.
data
.
stopped_count
);
this
.
store
.
storeEnvironments
(
resp
.
data
.
environments
);
...
...
@@ -51,6 +55,10 @@ export default {
}
},
filterNilValues
(
obj
)
{
return
_
.
omit
(
obj
,
value
=>
_
.
isUndefined
(
value
)
||
_
.
isNull
(
value
));
},
/**
* Handles URL and query parameter changes.
* When the user uses the pagination or the tabs,
...
...
@@ -64,10 +72,9 @@ export default {
// fetch new data
return
this
.
service
.
fetchEnvironments
(
this
.
requestData
)
.
then
(
response
=>
this
.
successCallback
(
response
))
.
then
(()
=>
{
// restart polling
this
.
poll
.
restart
({
data
:
this
.
requestData
});
.
then
(
response
=>
{
this
.
successCallback
(
response
);
this
.
poll
.
enable
({
data
:
this
.
requestData
,
response
});
})
.
catch
(()
=>
{
this
.
errorCallback
();
...
...
changelogs/unreleased/sh-wip-fix-duplicate-env-xhr.yml
0 → 100644
View file @
e5b8809e
---
title
:
Fix pagination and duplicate requests in environments page
merge_request
:
25582
author
:
type
:
fixed
spec/features/projects/environments/environments_spec.rb
View file @
e5b8809e
...
...
@@ -38,6 +38,23 @@ describe 'Environments page', :js do
end
end
describe
'with environments spanning multiple pages'
,
:js
do
before
do
allow
(
Kaminari
.
config
).
to
receive
(
:default_per_page
).
and_return
(
3
)
create_list
(
:environment
,
4
,
project:
project
,
state: :available
)
end
it
'should render second page of pipelines'
do
visit_environments
(
project
,
scope:
'available'
)
find
(
'.js-next-button'
).
click
wait_for_requests
expect
(
page
).
to
have_selector
(
'.gl-pagination .page'
,
count:
2
)
expect
(
find
(
'.gl-pagination .page-item.active .page-link'
).
text
).
to
eq
(
"2"
)
end
end
describe
'in stopped tab page'
do
it
'should show no environments'
do
visit_environments
(
project
,
scope:
'stopped'
)
...
...
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