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
16990e1e
Commit
16990e1e
authored
Apr 06, 2017
by
Jacob Schatz
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch '1589-deploy-boards-2nd-iteration' into 'master'
Deploy board - second iteration See merge request !1327
parents
eff10bbb
33e2ecdb
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
60 additions
and
36 deletions
+60
-36
app/assets/javascripts/environments/components/deploy_board_component.js
...scripts/environments/components/deploy_board_component.js
+57
-36
app/controllers/projects/environments_controller.rb
app/controllers/projects/environments_controller.rb
+2
-0
spec/controllers/projects/environments_controller_spec.rb
spec/controllers/projects/environments_controller_spec.rb
+1
-0
No files found.
app/assets/javascripts/environments/components/deploy_board_component.js
View file @
16990e1e
/* eslint-disable no-new */
/* eslint-disable no-new
, no-undef
*/
/* global Flash */
/* global Flash */
/**
/**
* Renders a deploy board.
* Renders a deploy board.
...
@@ -67,6 +67,26 @@ export default {
...
@@ -67,6 +67,26 @@ export default {
},
},
created
()
{
created
()
{
this
.
getDeployBoard
();
},
updated
()
{
// While board is not complete we need to request new data from the server.
// Let's make sure we are not making any request at the moment
// and that we only make this request if the latest response was not 204.
if
(
!
this
.
isLoading
&&
!
this
.
hasError
&&
this
.
deployBoardData
.
completion
&&
this
.
deployBoardData
.
completion
<
100
)
{
// let's wait 1s and make the request again
setTimeout
(()
=>
{
this
.
getDeployBoard
();
},
3000
);
}
},
methods
:
{
getDeployBoard
()
{
this
.
isLoading
=
true
;
this
.
isLoading
=
true
;
const
maxNumberOfRequests
=
3
;
const
maxNumberOfRequests
=
3
;
...
@@ -109,6 +129,7 @@ export default {
...
@@ -109,6 +129,7 @@ export default {
new
Flash
(
'
An error occurred while fetching the deploy board.
'
,
'
alert
'
);
new
Flash
(
'
An error occurred while fetching the deploy board.
'
,
'
alert
'
);
});
});
},
},
},
computed
:
{
computed
:
{
canRenderDeployBoard
()
{
canRenderDeployBoard
()
{
...
...
app/controllers/projects/environments_controller.rb
View file @
16990e1e
...
@@ -132,6 +132,8 @@ class Projects::EnvironmentsController < Projects::ApplicationController
...
@@ -132,6 +132,8 @@ class Projects::EnvironmentsController < Projects::ApplicationController
rollout_status
=
@environment
.
rollout_status
rollout_status
=
@environment
.
rollout_status
Gitlab
::
PollingInterval
.
set_header
(
response
,
interval:
3000
)
unless
rollout_status
.
try
(
:complete?
)
if
rollout_status
.
nil?
if
rollout_status
.
nil?
render
body:
nil
,
status:
204
# no result yet
render
body:
nil
,
status:
204
# no result yet
else
else
...
...
spec/controllers/projects/environments_controller_spec.rb
View file @
16990e1e
...
@@ -266,6 +266,7 @@ describe Projects::EnvironmentsController do
...
@@ -266,6 +266,7 @@ describe Projects::EnvironmentsController do
get
:status
,
environment_params
get
:status
,
environment_params
expect
(
response
.
status
).
to
eq
(
204
)
expect
(
response
.
status
).
to
eq
(
204
)
expect
(
response
.
headers
[
'Poll-Interval'
]).
to
eq
(
3000
)
end
end
it
'returns the rollout status when present'
do
it
'returns the rollout status when present'
do
...
...
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