Remove integration toggle from cluster index page
This commit is contained in:
parent
c72cf87918
commit
236a0cb438
|
@ -1,24 +0,0 @@
|
|||
import createFlash from '~/flash';
|
||||
import { __ } from '~/locale';
|
||||
import setupToggleButtons from '~/toggle_buttons';
|
||||
import initDismissableCallout from '~/dismissable_callout';
|
||||
|
||||
import ClustersService from './services/clusters_service';
|
||||
|
||||
export default () => {
|
||||
const clusterList = document.querySelector('.js-clusters-list');
|
||||
|
||||
initDismissableCallout('.gcp-signup-offer');
|
||||
|
||||
// The empty state won't have a clusterList
|
||||
if (clusterList) {
|
||||
setupToggleButtons(document.querySelector('.js-clusters-list'), (value, toggle) =>
|
||||
ClustersService.updateCluster(toggle.dataset.endpoint, { cluster: { enabled: value } }).catch(
|
||||
err => {
|
||||
createFlash(__('Something went wrong on our end.'));
|
||||
throw err;
|
||||
},
|
||||
),
|
||||
);
|
||||
}
|
||||
};
|
|
@ -1,5 +1,5 @@
|
|||
import ClustersIndex from '~/clusters/clusters_index';
|
||||
import initDismissableCallout from '~/dismissable_callout';
|
||||
|
||||
document.addEventListener('DOMContentLoaded', () => {
|
||||
new ClustersIndex(); // eslint-disable-line no-new
|
||||
initDismissableCallout('.gcp-signup-offer');
|
||||
});
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
import ClustersIndex from '~/clusters/clusters_index';
|
||||
import initDismissableCallout from '~/dismissable_callout';
|
||||
|
||||
document.addEventListener('DOMContentLoaded', () => {
|
||||
new ClustersIndex(); // eslint-disable-line no-new
|
||||
initDismissableCallout('.gcp-signup-offer');
|
||||
});
|
||||
|
|
|
@ -3,19 +3,11 @@
|
|||
.table-mobile-header{ role: "rowheader" }= s_("ClusterIntegration|Kubernetes cluster")
|
||||
.table-mobile-content
|
||||
= link_to cluster.name, cluster.show_path
|
||||
.table-section.section-30
|
||||
.table-section.section-25
|
||||
.table-mobile-header{ role: "rowheader" }= s_("ClusterIntegration|Environment scope")
|
||||
.table-mobile-content= cluster.environment_scope
|
||||
.table-section.section-10
|
||||
.table-section.section-15.text-right
|
||||
.table-mobile-header{ role: "rowheader" }
|
||||
.table-mobile-content
|
||||
%button.js-project-feature-toggle.project-feature-toggle{ type: "button",
|
||||
class: "#{'is-checked' if cluster.enabled?} #{'is-disabled' if !cluster.can_toggle_cluster?}",
|
||||
"aria-label": s_("ClusterIntegration|Toggle Kubernetes Cluster"),
|
||||
disabled: !cluster.can_toggle_cluster?,
|
||||
data: { endpoint: clusterable.cluster_path(cluster, format: :json) } }
|
||||
%input.js-project-feature-toggle-input{ type: "hidden", value: cluster.enabled? }
|
||||
= icon("spinner spin", class: "loading-icon")
|
||||
%span.toggle-icon
|
||||
= sprite_icon('status_success_borderless', size: 16, css_class: 'toggle-icon-svg toggle-status-checked')
|
||||
= sprite_icon('status_failed_borderless', size: 16, css_class: 'toggle-icon-svg toggle-status-unchecked')
|
||||
%span.badge.badge-light
|
||||
= cluster.project_type? ? s_("ClusterIntegration|Project cluster") : s_("ClusterIntegration|Group cluster")
|
||||
|
|
Loading…
Reference in New Issue