diff --git a/app/assets/javascripts/clusters.js b/app/assets/javascripts/clusters.js index 64bf22f48e23056ac7601f7467b9f30b28620793..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 100644 --- a/app/assets/javascripts/clusters.js +++ b/app/assets/javascripts/clusters.js @@ -1,11 +0,0 @@ -document.addEventListener('DOMContentLoaded', () => { - - const toggleButton = document.querySelector('.js-toggle-cluster'); - // disable in case of no permissions - toggleButton.addEventListener(() => { - - // update text - }); - - // poll the status -}); diff --git a/app/views/projects/clusters/_form.html.haml b/app/views/projects/clusters/_form.html.haml index 1951f1ab9ebfe9412806e4ad32877183d9ba1e80..ebe4d9380eb9dc86ef924b0b4e1368040cabe4f0 100644 --- a/app/views/projects/clusters/_form.html.haml +++ b/app/views/projects/clusters/_form.html.haml @@ -12,10 +12,12 @@ .form-group = field.label :gcp_project_id + = link_to(s_('ClusterIntegration|See your projects'), 'https://console.cloud.google.com/home/dashboard', target: '_blank', rel: 'noopener noreferrer') = field.text_field :gcp_project_id, class: 'form-control' .form-group = field.label :cluster_zone + = link_to(s_('ClusterIntegration|See zones'), 'https://cloud.google.com/compute/docs/regions-zones/regions-zones', target: '_blank', rel: 'noopener noreferrer') = field.text_field :cluster_zone, class: 'form-control' .form-group @@ -28,6 +30,7 @@ .form-group = field.label :machine_type + = link_to(s_('ClusterIntegration|Machine type'), 'https://cloud.google.com/compute/docs/machine-types', target: '_blank', rel: 'noopener noreferrer') = field.text_field :machine_type, class: 'form-control' .form-group diff --git a/app/views/projects/clusters/_header.html.haml b/app/views/projects/clusters/_header.html.haml index 795299b0625bed0a54ba969478fa0bbfc85b5cc4..c7c5272089a5ff34bb8a661d083a36e40f2a38d4 100644 --- a/app/views/projects/clusters/_header.html.haml +++ b/app/views/projects/clusters/_header.html.haml @@ -5,11 +5,11 @@ = s_('ClusterIntegration|To create a new cluster on Google Container Engine, please sign in with your Google account:') %ul %li - - link_to_container_engine = link_to(s_('ClusterIntegration|access to Google Container Engine')) + - link_to_container_engine = link_to(s_('ClusterIntegration|access to Google Container Engine'), 'https://console.cloud.google.com', target: '_blank', rel: 'noopener noreferrer') = s_('ClusterIntegration|Your account must have %{link_to_container_engine}').html_safe % { link_to_container_engine: link_to_container_engine } %li - - link_to_requirements = link_to(s_('ClusterIntegration|meets the requirements')) + - link_to_requirements = link_to(s_('ClusterIntegration|meets the requirements'), 'https://cloud.google.com/container-engine/docs/quickstart', target: '_blank', rel: 'noopener noreferrer') = s_('ClusterIntegration|Make sure your account %{link_to_requirements} to create clusters').html_safe % { link_to_requirements: link_to_requirements } %li - - link_to_container_project = link_to(s_('ClusterIntegration|Google Container Engine project')) + - link_to_container_project = link_to(s_('ClusterIntegration|Google Container Engine project'), target: '_blank', rel: 'noopener noreferrer') = s_('ClusterIntegration|A %{link_to_container_project} must have been created under this account').html_safe % { link_to_container_project: link_to_container_project } diff --git a/app/views/projects/clusters/_sidebar.html.haml b/app/views/projects/clusters/_sidebar.html.haml index 4d19fa460c83acefc71d23fc64e430be10bbc2bf..739c38e073ac626ac9a4c17706438b12776f2281 100644 --- a/app/views/projects/clusters/_sidebar.html.haml +++ b/app/views/projects/clusters/_sidebar.html.haml @@ -2,7 +2,7 @@ %h4.prepend-top-0 = s_('ClusterIntegration|Cluster integration') %p - = s_('ClusterIntegration|With cluster integration you can take advantage of Kubernetes auto deployment.') + = s_('ClusterIntegration|With a cluster associated to this project, you can use review apps, deploy your applications, run your pipelines, and much more in an easy way.') %p - - 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 } + - link = link_to(s_('ClusterIntegration|cluster'), help_page_path('TODO'), target: '_blank', rel: 'noopener noreferrer') + = s_('ClusterIntegration|Learn more about %{link_to_documentation}').html_safe % { link_to_documentation: link } diff --git a/app/views/projects/clusters/edit.html.haml b/app/views/projects/clusters/edit.html.haml index feea40cee0da6197c4cf0be22879be6951666823..16d864423f557e5d49193ac73a246becfa952b27 100644 --- a/app/views/projects/clusters/edit.html.haml +++ b/app/views/projects/clusters/edit.html.haml @@ -1,4 +1,4 @@ -.row.prepend-top-default.edit-cluster-form +.row.prepend-top-default.edit-cluster-form.js-edit-cluster-form{ data: { check_status: status_namespace_project_cluster_path(@cluster.project.namespace, @cluster.project, @cluster.id), edit_path: namespace_project_cluster_path(@project.namespace, @project, @cluster.id)}} = render 'sidebar' .col-lg-8 %h4.prepend-top-0 @@ -15,9 +15,11 @@ -# else = s_('ClusterIntegration|Cluster integration is disabled for this project.') - %label.toggle-wrapper + %label.toggle-wrapper %button{ type: 'button', class: 'js-toggle-cluster project-feature-toggle', aria: { label: 'Toggle' }, data: { 'enabled-text': 'Enable', 'disabled-text': 'disabled' } } + .form-group + -# render errors TODO #= form_errors(@cluster) @@ -27,7 +29,7 @@ %label = s_('ClusterIntegration|Google container engine') %p - - link_gke = link_to(s_('ClusterIntegration|Manage your cluster on GKE'), path: '', target: '_blank', rel: 'noopener noreferrer') + - link_gke = link_to(s_('ClusterIntegration|Manage your cluster on GKE'), '', 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 } .form_group @@ -49,7 +51,7 @@ %br -= link_to "Enable", namespace_project_cluster_path(@project.namespace, @project, @cluster.id, cluster: {enabled: 'true'}), method: :put += link_to "Enable", namespace_project_cluster_path(@project.namespace, @project, @cluster.id), method: :put %br = link_to "Disable", namespace_project_cluster_path(@project.namespace, @project, @cluster.id, cluster: {enabled: 'false'}), method: :put diff --git a/app/views/projects/clusters/login.html.haml b/app/views/projects/clusters/login.html.haml index ef6efc84cebfde1b5606ef08f2675328c0d4e376..3c68d4dbabcc25cbe11b5e2ee0da14bf1680e165 100644 --- a/app/views/projects/clusters/login.html.haml +++ b/app/views/projects/clusters/login.html.haml @@ -6,5 +6,6 @@ - if @authorize_url %a{ href: @authorize_url } = image_tag('auth_buttons/signin_with_google.png') - -# - else - -# You have not configrued GitLab properly. So we can not proceed authentication. Please check if you have set up omniauth->providers->google_oauth2 in gitlab.yml + - else + - link = link_to(s_('ClusterIntegration|properly configured'), help_page_path("integration/google"), target: '_blank', rel: 'noopener noreferrer') + = s_('Google authentication is not %{link_to_documentation}. Ask your GitLab administrator if you want to use this service.').html_safe % { link_to_documentation: link }