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
ca01ee51
Commit
ca01ee51
authored
Oct 31, 2017
by
Filipa Lacerda
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Adds callback function to inital cluster request
parent
7e78db6e
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
19 additions
and
8 deletions
+19
-8
app/assets/javascripts/clusters.js
app/assets/javascripts/clusters.js
+14
-8
changelogs/unreleased/39639-clusters-poll.yml
changelogs/unreleased/39639-clusters-poll.yml
+5
-0
No files found.
app/assets/javascripts/clusters.js
View file @
ca01ee51
...
...
@@ -64,19 +64,16 @@ export default class Clusters {
this
.
poll
=
new
Poll
({
resource
:
this
.
service
,
method
:
'
fetchData
'
,
successCallback
:
(
data
)
=>
{
const
{
status
,
status_reason
}
=
data
.
data
;
this
.
updateContainer
(
status
,
status_reason
);
},
errorCallback
:
()
=>
{
Flash
(
s__
(
'
ClusterIntegration|Something went wrong on our end.
'
));
},
successCallback
:
data
=>
this
.
handleSuccess
(
data
),
errorCallback
:
()
=>
Clusters
.
handleError
(),
});
if
(
!
Visibility
.
hidden
())
{
this
.
poll
.
makeRequest
();
}
else
{
this
.
service
.
fetchData
();
this
.
service
.
fetchData
()
.
then
(
data
=>
this
.
handleSuccess
(
data
))
.
catch
(()
=>
Clusters
.
handleError
());
}
Visibility
.
change
(()
=>
{
...
...
@@ -88,6 +85,15 @@ export default class Clusters {
});
}
static
handleError
()
{
Flash
(
s__
(
'
ClusterIntegration|Something went wrong on our end.
'
));
}
handleSuccess
(
data
)
{
const
{
status
,
status_reason
}
=
data
.
data
;
this
.
updateContainer
(
status
,
status_reason
);
}
hideAll
()
{
this
.
errorContainer
.
classList
.
add
(
'
hidden
'
);
this
.
successContainer
.
classList
.
add
(
'
hidden
'
);
...
...
changelogs/unreleased/39639-clusters-poll.yml
0 → 100644
View file @
ca01ee51
---
title
:
Adds callback functions for initial request in clusters page
merge_request
:
author
:
type
:
fixed
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