From bea4303840308e10e073134cab294181c744c770 Mon Sep 17 00:00:00 2001 From: Kamil Trzcinski Date: Fri, 1 Dec 2017 12:56:31 +0100 Subject: Fix clusters active/inactive toggling --- app/assets/javascripts/clusters/clusters_index.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/app/assets/javascripts/clusters/clusters_index.js b/app/assets/javascripts/clusters/clusters_index.js index 3fd188a8770..82ac8d93035 100644 --- a/app/assets/javascripts/clusters/clusters_index.js +++ b/app/assets/javascripts/clusters/clusters_index.js @@ -28,7 +28,7 @@ const toggleValue = (button) => { * * When the user clicks the toggle button for each cluster, it: * - toggles the button - * - shows a loding and disabled state + * - shows a loading and disabled state * - Makes a put request to the given endpoint * Once we receive the response, either: * 1) Show updated status in case of successfull response @@ -38,12 +38,13 @@ export default function setClusterTableToggles() { document.querySelectorAll('.js-toggle-cluster-list') .forEach(button => button.addEventListener('click', (e) => { const toggleButton = e.currentTarget; - const value = toggleButton.classList.contains('checked').toString(); const endpoint = toggleButton.getAttribute('data-endpoint'); toggleValue(toggleButton); toggleLoadingButton(toggleButton); + const value = toggleButton.classList.contains('is-checked'); + ClustersService.updateCluster(endpoint, { cluster: { enabled: value } }) .then(() => { toggleLoadingButton(toggleButton); -- cgit v1.2.1 From d7ebb823bf788bbfc05c368ab9c134a7fc84650d Mon Sep 17 00:00:00 2001 From: Kamil Trzcinski Date: Sun, 3 Dec 2017 23:01:18 +0100 Subject: Use actual namespace --- app/views/projects/clusters/_cluster.html.haml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/projects/clusters/_cluster.html.haml b/app/views/projects/clusters/_cluster.html.haml index ba36828d407..d292d68386c 100644 --- a/app/views/projects/clusters/_cluster.html.haml +++ b/app/views/projects/clusters/_cluster.html.haml @@ -8,7 +8,7 @@ .table-mobile-content= cluster.environment_scope .table-section.section-30 .table-mobile-header{ role: "rowheader" }= s_("ClusterIntegration|Project namespace") - .table-mobile-content= cluster.platform_kubernetes&.namespace + .table-mobile-content= cluster.platform_kubernetes&.actual_namespace .table-section.section-10 .table-mobile-header{ role: "rowheader" } .table-mobile-content -- cgit v1.2.1