Commit a7e06bca authored by Kushal Pandya's avatar Kushal Pandya

Merge branch '225837-removing-remaining-instances-of-multiple_clusters' into 'master'

Removing remaining instances of multiple_clusters

Closes #225837

See merge request gitlab-org/gitlab!35927
parents 58ee6ba9 0a40bebb
# frozen_string_literal: true # frozen_string_literal: true
module ClustersHelper module ClustersHelper
def has_multiple_clusters?
true
end
def create_new_cluster_label(provider: nil) def create_new_cluster_label(provider: nil)
case provider case provider
when 'aws' when 'aws'
......
...@@ -10,17 +10,10 @@ ...@@ -10,17 +10,10 @@
.form-group .form-group
%h5= s_('ClusterIntegration|Environment scope') %h5= s_('ClusterIntegration|Environment scope')
- if has_multiple_clusters? = field.text_field :environment_scope, class: 'col-md-6 form-control js-select-on-focus', placeholder: s_('ClusterIntegration|Environment scope')
= field.text_field :environment_scope, class: 'col-md-6 form-control js-select-on-focus', placeholder: s_('ClusterIntegration|Environment scope') - environment_scope_url = help_page_path('user/project/clusters/index', anchor: 'base-domain')
.form-text.text-muted= s_("ClusterIntegration|Choose which of your environments will use this cluster.") - environment_scope_start = '<a href="%{url}" target="_blank" rel="noopener noreferrer">'.html_safe % { url: environment_scope_url }
- else .form-text.text-muted= s_("ClusterIntegration|Choose which of your environments will use this cluster. %{environment_scope_start}More information%{environment_scope_end}").html_safe % { environment_scope_start: environment_scope_start, environment_scope_end: '</a>'.html_safe }
= text_field_tag :environment_scope, '*', class: 'col-md-6 form-control disabled', placeholder: s_('ClusterIntegration|Environment scope'), disabled: true
- environment_scope_url = help_page_path('user/project/clusters/index', anchor: 'base-domain')
- environment_scope_start = '<a href="%{url}" target="_blank" rel="noopener noreferrer">'.html_safe % { url: environment_scope_url }
.form-text.text-muted
%code
= _('*')
= s_("ClusterIntegration| is the default environment scope for this cluster. This means that all jobs, regardless of their environment, will use this cluster. %{environment_scope_start}More information%{environment_scope_end}").html_safe % { environment_scope_start: environment_scope_start, environment_scope_end: '</a>'.html_safe }
.form-group .form-group
%h5= s_('ClusterIntegration|Base domain') %h5= s_('ClusterIntegration|Base domain')
......
...@@ -16,12 +16,11 @@ ...@@ -16,12 +16,11 @@
data: { token: token_in_session } }, url: clusterable.create_gcp_clusters_path, as: :cluster do |field| data: { token: token_in_session } }, url: clusterable.create_gcp_clusters_path, as: :cluster do |field|
= field.text_field :name, required: true, title: s_('ClusterIntegration|Cluster name is required.'), = field.text_field :name, required: true, title: s_('ClusterIntegration|Cluster name is required.'),
label: s_('ClusterIntegration|Kubernetes cluster name'), label_class: 'label-bold' label: s_('ClusterIntegration|Kubernetes cluster name'), label_class: 'label-bold'
- if has_multiple_clusters? = field.form_group :environment_scope, label: { text: s_('ClusterIntegration|Environment scope'),
= field.form_group :environment_scope, label: { text: s_('ClusterIntegration|Environment scope'), class: 'label-bold' } do
class: 'label-bold' } do = field.text_field :environment_scope, required: true, class: 'form-control',
= field.text_field :environment_scope, required: true, class: 'form-control', title: 'Environment scope is required.', wrapper: false
title: 'Environment scope is required.', wrapper: false .form-text.text-muted= s_("ClusterIntegration|Choose which of your environments will use this cluster.")
.form-text.text-muted= s_("ClusterIntegration|Choose which of your environments will use this cluster.")
= field.fields_for :provider_gcp, @gcp_cluster.provider_gcp do |provider_gcp_field| = field.fields_for :provider_gcp, @gcp_cluster.provider_gcp do |provider_gcp_field|
.form-group .form-group
......
...@@ -13,10 +13,10 @@ ...@@ -13,10 +13,10 @@
url: clusterable.create_user_clusters_path, as: :cluster do |field| url: clusterable.create_user_clusters_path, as: :cluster do |field|
= field.text_field :name, required: true, title: s_('ClusterIntegration|Cluster name is required.'), = field.text_field :name, required: true, title: s_('ClusterIntegration|Cluster name is required.'),
label: s_('ClusterIntegration|Kubernetes cluster name'), label_class: 'label-bold' label: s_('ClusterIntegration|Kubernetes cluster name'), label_class: 'label-bold'
- if has_multiple_clusters?
= field.text_field :environment_scope, required: true, title: 'Environment scope is required.', = field.text_field :environment_scope, required: true, title: s_('ClusterIntegration|Environment scope is required.'),
label: s_('ClusterIntegration|Environment scope'), label_class: 'label-bold', label: s_('ClusterIntegration|Environment scope'), label_class: 'label-bold',
help: s_("ClusterIntegration|Choose which of your environments will use this cluster.") help: s_('ClusterIntegration|Choose which of your environments will use this cluster.')
= field.fields_for :platform_kubernetes, @user_cluster.platform_kubernetes do |platform_kubernetes_field| = field.fields_for :platform_kubernetes, @user_cluster.platform_kubernetes do |platform_kubernetes_field|
= platform_kubernetes_field.url_field :api_url, required: true, = platform_kubernetes_field.url_field :api_url, required: true,
......
...@@ -791,9 +791,6 @@ msgstr "" ...@@ -791,9 +791,6 @@ msgstr ""
msgid "(revoked)" msgid "(revoked)"
msgstr "" msgstr ""
msgid "*"
msgstr ""
msgid "+ %{amount} more" msgid "+ %{amount} more"
msgstr "" msgstr ""
...@@ -4959,9 +4956,6 @@ msgstr "" ...@@ -4959,9 +4956,6 @@ msgstr ""
msgid "ClusterIntegration| can be used instead of a custom domain." msgid "ClusterIntegration| can be used instead of a custom domain."
msgstr "" msgstr ""
msgid "ClusterIntegration| is the default environment scope for this cluster. This means that all jobs, regardless of their environment, will use this cluster. %{environment_scope_start}More information%{environment_scope_end}"
msgstr ""
msgid "ClusterIntegration|%{appList} was successfully installed on your Kubernetes cluster" msgid "ClusterIntegration|%{appList} was successfully installed on your Kubernetes cluster"
msgstr "" msgstr ""
...@@ -5082,6 +5076,9 @@ msgstr "" ...@@ -5082,6 +5076,9 @@ msgstr ""
msgid "ClusterIntegration|Choose which of your environments will use this cluster." msgid "ClusterIntegration|Choose which of your environments will use this cluster."
msgstr "" msgstr ""
msgid "ClusterIntegration|Choose which of your environments will use this cluster. %{environment_scope_start}More information%{environment_scope_end}"
msgstr ""
msgid "ClusterIntegration|Clear cluster cache" msgid "ClusterIntegration|Clear cluster cache"
msgstr "" msgstr ""
...@@ -5214,6 +5211,9 @@ msgstr "" ...@@ -5214,6 +5211,9 @@ msgstr ""
msgid "ClusterIntegration|Environment scope" msgid "ClusterIntegration|Environment scope"
msgstr "" msgstr ""
msgid "ClusterIntegration|Environment scope is required."
msgstr ""
msgid "ClusterIntegration|Every new Google Cloud Platform (GCP) account receives $300 in credit upon %{sign_up_link}. In partnership with Google, GitLab is able to offer an additional $200 for both new and existing GCP accounts to get started with GitLab's Google Kubernetes Engine Integration." msgid "ClusterIntegration|Every new Google Cloud Platform (GCP) account receives $300 in credit upon %{sign_up_link}. In partnership with Google, GitLab is able to offer an additional $200 for both new and existing GCP accounts to get started with GitLab's Google Kubernetes Engine Integration."
msgstr "" msgstr ""
......
...@@ -107,12 +107,6 @@ RSpec.describe ClustersHelper do ...@@ -107,12 +107,6 @@ RSpec.describe ClustersHelper do
end end
end end
describe '#has_multiple_clusters?' do
subject { helper.has_multiple_clusters? }
it { is_expected.to be_truthy }
end
describe '#cluster_type_label' do describe '#cluster_type_label' do
subject { helper.cluster_type_label(cluster_type) } subject { helper.cluster_type_label(cluster_type) }
......
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