Commit cddab09b authored by Filipa Lacerda's avatar Filipa Lacerda

Starts edit form

parent 25d1c786
document.addEventListener('DOMContentLoaded', () => {
const toggleButton = document.querySelector('.js-toggle-cluster');
// disable in case of no permissions
toggleButton.addEventListener(() => {
// update text
// poll the status
.edit-cluster-form {
.clipboard-addon {
background-color: $white-light;
\ No newline at end of file
......@@ -5,4 +5,4 @@
= s_('ClusterIntegration|With cluster integration you can take advantage of Kubernetes auto deployment.')
- link = link_to(s_('ClusterIntegration|auto deployment'), help_page_path('TODO'), target: '_blank', rel: 'noopener noreferrer')
= s_('ClusterIntegration|Learn more about %{link_to_documentation} in GitLab').html_safe % { link_to_documentation: link }
= s_('ClusterIntegration|Learn more about %{link_to_documentation} in GitLab.').html_safe % { link_to_documentation: link }
edit/show cluster
= @cluster.inspect
= @cluster.service.inspect
= form_errors(@cluster)
= render 'sidebar'
= s_('ClusterIntegration|Enable cluster integration')
-#TODO: if can?(current_user, :update_cluster, @cluster)
-# if :enabled
= s_('ClusterIntegration|Disabling cluster integration will not affect your cluster. It will only temporarily turn off GitLab\'s conection to it.')
-# else
= s_('ClusterIntegration|Missing test/state in mockups.')
-# else !can?(current_user, :update_cluster, @cluster)
-# if :enabled
= s_('ClusterIntegration|Cluster integration is enabled for this project.')
-# else
= s_('ClusterIntegration|Cluster integration is disabled for this project.')
%button{ type: 'button', class: 'js-toggle-cluster project-feature-toggle', aria: { label: 'Toggle' }, data: { 'enabled-text': 'Enable', 'disabled-text': 'disabled' } }
-# render errors TODO
#= form_errors(@cluster)
-# if can?(current_user, :update_cluster, @cluster)
= s_('ClusterIntegration|Google container engine')
- link_gke = link_to(s_('ClusterIntegration|Manage your cluster on GKE'), path: '', target: '_blank', rel: 'noopener noreferrer')
= s_('ClusterIntegration|This cluster was not set up on Google Container Engine. %{link_gke}').html_safe % { link_gke: link_gke }
= s_('ClusterIntegration|Cluster name')
%input.form-control{ value: @cluster.cluster_name, disabled: true}
= clipboard_button(text: @cluster.cluster_name, title: s_('ClusterIntegration|Copy cluster name'))
-# - if can?(current_user, :admin_cluster, @cluster)
= s_('ClusterIntegration|Remove cluster integration')
= s_('ClusterIntegration|Removing cluster integration will remove the cluster configuration you have added to this project. It will not delete your project.')
= link_to(s_('ClusterIntegration|Remove integration'), namespace_project_cluster_path(@project.namespace, @project,, method: :delete, class: 'btn btn-danger')
= link_to "Enable", namespace_project_cluster_path(@project.namespace, @project,, cluster: {enabled: 'true'}), method: :put
= link_to "Disable", namespace_project_cluster_path(@project.namespace, @project,, cluster: {enabled: 'false'}), method: :put
= link_to "Soft-delete the cluster", namespace_project_cluster_path(@project.namespace, @project,, method: :delete
-# status GET
-# status: The current status of the operation.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment