summaryrefslogtreecommitdiff
path: root/app/assets/javascripts/clusters/clusters_bundle.js
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2019-09-13 13:26:31 +0000
committerGitLab Bot <gitlab-bot@gitlab.com>2019-09-13 13:26:31 +0000
commitb7dfe2ae4054aa40e15182fd3c6cb7dd39f131db (patch)
tree5ab080ca9cadeb6cd9578bf301e4e9e8810bed9e /app/assets/javascripts/clusters/clusters_bundle.js
parent25cb337cf12438169f1b14bc5dace8a06a7356e3 (diff)
downloadgitlab-ce-b7dfe2ae4054aa40e15182fd3c6cb7dd39f131db.tar.gz
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/assets/javascripts/clusters/clusters_bundle.js')
-rw-r--r--app/assets/javascripts/clusters/clusters_bundle.js19
1 files changed, 19 insertions, 0 deletions
diff --git a/app/assets/javascripts/clusters/clusters_bundle.js b/app/assets/javascripts/clusters/clusters_bundle.js
index 1f213d5aaf2..28850710f80 100644
--- a/app/assets/javascripts/clusters/clusters_bundle.js
+++ b/app/assets/javascripts/clusters/clusters_bundle.js
@@ -39,6 +39,7 @@ export default class Clusters {
updateKnativePath,
installPrometheusPath,
managePrometheusPath,
+ clusterEnvironmentsPath,
hasRbac,
clusterType,
clusterStatus,
@@ -79,6 +80,7 @@ export default class Clusters {
installJupyterEndpoint: installJupyterPath,
installKnativeEndpoint: installKnativePath,
updateKnativeEndpoint: updateKnativePath,
+ clusterEnvironmentsEndpoint: clusterEnvironmentsPath,
});
this.installApplication = this.installApplication.bind(this);
@@ -109,6 +111,10 @@ export default class Clusters {
this.initApplications(clusterType);
this.initEnvironments();
+ if (clusterEnvironmentsPath) {
+ this.fetchEnvironments();
+ }
+
this.updateContainer(null, this.store.state.status, this.store.state.statusReason);
this.addListeners();
@@ -162,6 +168,7 @@ export default class Clusters {
render(createElement) {
return createElement(Environments, {
props: {
+ isFetching: this.state.fetchingEnvironments,
environments: this.state.environments,
environmentsHelpPath: this.state.environmentsHelpPath,
clustersHelpPath: this.state.clustersHelpPath,
@@ -172,6 +179,18 @@ export default class Clusters {
});
}
+ fetchEnvironments() {
+ this.store.toggleFetchEnvironments(true);
+
+ this.service
+ .fetchClusterEnvironments()
+ .then(data => {
+ this.store.toggleFetchEnvironments(false);
+ this.store.updateEnvironments(data.data);
+ })
+ .catch(() => Clusters.handleError());
+ }
+
static initDismissableCallout() {
const callout = document.querySelector('.js-cluster-security-warning');
PersistentUserCallout.factory(callout);