Commit 29bff59d authored by Enrique Alcántara's avatar Enrique Alcántara Committed by Mike Greiling

Display inline validation error messages

In the new cluster forms, display form error messages
below form fields instead of a summary banner on top
of the form.

Include client side validation in order to display
user friendly error messages.

Also remove unnecessary placeholders.
parent cd9c5e72
...@@ -15,7 +15,7 @@ export default class GlFieldErrors { ...@@ -15,7 +15,7 @@ export default class GlFieldErrors {
initValidators() { initValidators() {
// register selectors here as needed // register selectors here as needed
const validateSelectors = [':text', ':password', '[type=email]'] const validateSelectors = [':text', ':password', '[type=email]', '[type=url]', '[type=number]']
.map(selector => `input${selector}`) .map(selector => `input${selector}`)
.join(','); .join(',');
......
...@@ -204,8 +204,10 @@ label { ...@@ -204,8 +204,10 @@ label {
margin-top: #{$grid-size / 2}; margin-top: #{$grid-size / 2};
} }
.gl-field-error { .gl-field-error,
.invalid-feedback {
color: $red-500; color: $red-500;
font-size: $gl-font-size;
} }
.gl-show-field-errors { .gl-show-field-errors {
......
...@@ -7,25 +7,27 @@ ...@@ -7,25 +7,27 @@
- help_link_end = ' %{external_link_icon}</a>'.html_safe % { external_link_icon: external_link_icon } - help_link_end = ' %{external_link_icon}</a>'.html_safe % { external_link_icon: external_link_icon }
%p %p
- link_to_help_page = link_to(s_('ClusterIntegration|help page'), help_page_path('user/project/clusters/index'), target: '_blank', rel: 'noopener noreferrer') - link_to_help_page = link_to(s_('ClusterIntegration|help page'),
= s_('ClusterIntegration|Read our %{link_to_help_page} on Kubernetes cluster integration.').html_safe % { link_to_help_page: link_to_help_page} help_page_path('user/project/clusters/index'), target: '_blank', rel: 'noopener noreferrer')
= s_('ClusterIntegration|Read our %{link_to_help_page} on Kubernetes cluster integration.').html_safe % { link_to_help_page: link_to_help_page }
%p= link_to('Select a different Google account', @authorize_url) %p= link_to('Select a different Google account', @authorize_url)
= form_for @gcp_cluster, html: { class: 'js-gke-cluster-creation prepend-top-20', data: { token: token_in_session } }, url: clusterable.create_gcp_clusters_path, as: :cluster do |field| = bootstrap_form_for @gcp_cluster, html: { class: 'gl-show-field-errors js-gke-cluster-creation prepend-top-20',
= form_errors(@gcp_cluster) data: { token: token_in_session } }, url: clusterable.create_gcp_clusters_path, as: :cluster do |field|
.form-group = field.text_field :name, required: true, title: s_('ClusterIntegration|Cluster name is required.'),
= field.label :name, s_('ClusterIntegration|Kubernetes cluster name'), class: 'label-bold' label: s_('ClusterIntegration|Kubernetes cluster name'), label_class: 'label-bold'
= field.text_field :name, class: 'form-control', placeholder: s_('ClusterIntegration|Kubernetes cluster name')
- if has_multiple_clusters? - if has_multiple_clusters?
.form-group = field.form_group :environment_scope, label: { text: s_('ClusterIntegration|Environment scope'),
= field.label :environment_scope, s_('ClusterIntegration|Environment scope'), class: 'label-bold' class: 'label-bold' } do
= field.text_field :environment_scope, class: 'form-control', placeholder: s_('ClusterIntegration|Environment scope') = field.text_field :environment_scope, required: true, class: 'form-control',
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
= provider_gcp_field.label :gcp_project_id, s_('ClusterIntegration|Google Cloud Platform project'), class: 'label-bold' = provider_gcp_field.label :gcp_project_id, s_('ClusterIntegration|Google Cloud Platform project'),
class: 'label-bold'
.js-gcp-project-id-dropdown-entry-point{ data: { docsUrl: 'https://console.cloud.google.com/home/dashboard' } } .js-gcp-project-id-dropdown-entry-point{ data: { docsUrl: 'https://console.cloud.google.com/home/dashboard' } }
= provider_gcp_field.hidden_field :gcp_project_id = provider_gcp_field.hidden_field :gcp_project_id
.dropdown .dropdown
...@@ -47,9 +49,9 @@ ...@@ -47,9 +49,9 @@
%p.form-text.text-muted %p.form-text.text-muted
= s_('ClusterIntegration|Learn more about %{help_link_start}zones%{help_link_end}.').html_safe % { help_link_start: help_link_start % { url: zones_link_url }, help_link_end: help_link_end } = s_('ClusterIntegration|Learn more about %{help_link_start}zones%{help_link_end}.').html_safe % { help_link_start: help_link_start % { url: zones_link_url }, help_link_end: help_link_end }
.form-group = provider_gcp_field.number_field :num_nodes, required: true, placeholder: '3',
= provider_gcp_field.label :num_nodes, s_('ClusterIntegration|Number of nodes'), class: 'label-bold' title: s_('ClusterIntegration|Number of nodes must be a numerical value.'),
= provider_gcp_field.text_field :num_nodes, class: 'form-control', placeholder: '3' label: s_('ClusterIntegration|Number of nodes'), label_class: 'label-bold'
.form-group .form-group
= provider_gcp_field.label :machine_type, s_('ClusterIntegration|Machine type'), class: 'label-bold' = provider_gcp_field.label :machine_type, s_('ClusterIntegration|Machine type'), class: 'label-bold'
...@@ -64,13 +66,14 @@ ...@@ -64,13 +66,14 @@
= s_('ClusterIntegration|Learn more about %{help_link_start_machine_type}machine types%{help_link_end} and %{help_link_start_pricing}pricing%{help_link_end}.').html_safe % { help_link_start_machine_type: help_link_start % { url: machine_type_link_url }, help_link_start_pricing: help_link_start % { url: pricing_link_url }, help_link_end: help_link_end } = s_('ClusterIntegration|Learn more about %{help_link_start_machine_type}machine types%{help_link_end} and %{help_link_start_pricing}pricing%{help_link_end}.').html_safe % { help_link_start_machine_type: help_link_start % { url: machine_type_link_url }, help_link_start_pricing: help_link_start % { url: pricing_link_url }, help_link_end: help_link_end }
.form-group .form-group
.form-check = provider_gcp_field.check_box :legacy_abac, { label: s_('ClusterIntegration|RBAC-enabled cluster'),
= provider_gcp_field.check_box :legacy_abac, { class: 'form-check-input' }, false, true label_class: 'label-bold' }, false, true
= provider_gcp_field.label :legacy_abac, s_('ClusterIntegration|RBAC-enabled cluster'), class: 'form-check-label label-bold' .form-text.text-muted
.form-text.text-muted = s_('ClusterIntegration|Enable this setting if using role-based access control (RBAC).')
= s_('ClusterIntegration|Enable this setting if using role-based access control (RBAC).') = s_('ClusterIntegration|This option will allow you to install applications on RBAC clusters.')
= s_('ClusterIntegration|This option will allow you to install applications on RBAC clusters.') = link_to _('More information'), help_page_path('user/project/clusters/index.md',
= link_to _('More information'), help_page_path('user/project/clusters/index.md', anchor: 'role-based-access-control-rbac-core-only'), target: '_blank' anchor: 'role-based-access-control-rbac-core-only'), target: '_blank'
.form-group .form-group
= field.submit s_('ClusterIntegration|Create Kubernetes cluster'), class: 'js-gke-cluster-creation-submit btn btn-success', disabled: true = field.submit s_('ClusterIntegration|Create Kubernetes cluster'),
class: 'js-gke-cluster-creation-submit btn btn-success', disabled: true
= form_for @user_cluster, url: clusterable.create_user_clusters_path, as: :cluster do |field| = bootstrap_form_for @user_cluster, html: { class: 'gl-show-field-errors' },
= form_errors(@user_cluster) url: clusterable.create_user_clusters_path, as: :cluster do |field|
.form-group = field.text_field :name, required: true, title: s_('ClusterIntegration|Cluster name is required.'),
= field.label :name, s_('ClusterIntegration|Kubernetes cluster name'), class: 'label-bold' label: s_('ClusterIntegration|Kubernetes cluster name'), label_class: 'label-bold'
= field.text_field :name, class: 'form-control', placeholder: s_('ClusterIntegration|Kubernetes cluster name')
- if has_multiple_clusters? - if has_multiple_clusters?
.form-group = field.form_group :environment_scope, label: { text: s_('ClusterIntegration|Environment scope'),
= field.label :environment_scope, s_('ClusterIntegration|Environment scope'), class: 'label-bold' class: 'label-bold' } do
= field.text_field :environment_scope, class: 'form-control', placeholder: s_('ClusterIntegration|Environment scope') = field.text_field :environment_scope, required: true,
.form-text.text-muted= s_("ClusterIntegration|Choose which of your environments will use this cluster.") title: 'Environment scope is required.', wrapper: false
.form-text.text-muted
= 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|
.form-group = platform_kubernetes_field.url_field :api_url, required: true,
= platform_kubernetes_field.label :api_url, s_('ClusterIntegration|API URL'), class: 'label-bold' title: s_('ClusterIntegration|API URL should be a valid http/https url.'),
= platform_kubernetes_field.text_field :api_url, class: 'form-control', placeholder: s_('ClusterIntegration|API URL') label: s_('ClusterIntegration|API URL'), label_class: 'label-bold'
= platform_kubernetes_field.text_area :ca_cert,
.form-group placeholder: s_('ClusterIntegration|Certificate Authority bundle (PEM format)'),
= platform_kubernetes_field.label :ca_cert, s_('ClusterIntegration|CA Certificate'), class: 'label-bold' label: s_('ClusterIntegration|CA Certificate'), label_class: 'label-bold'
= platform_kubernetes_field.text_area :ca_cert, class: 'form-control', placeholder: s_('ClusterIntegration|Certificate Authority bundle (PEM format)') = platform_kubernetes_field.text_field :token, required: true,
title: s_('ClusterIntegration|Service token is required.'), label: s_('ClusterIntegration|Service Token'),
.form-group autocomplete: 'off', label_class: 'label-bold'
= platform_kubernetes_field.label :token, s_('ClusterIntegration|Token'), class: 'label-bold'
= platform_kubernetes_field.text_field :token, class: 'form-control', placeholder: s_('ClusterIntegration|Service token'), autocomplete: 'off'
- if @user_cluster.allow_user_defined_namespace? - if @user_cluster.allow_user_defined_namespace?
.form-group = platform_kubernetes_field.text_field :namespace,
= platform_kubernetes_field.label :namespace, s_('ClusterIntegration|Project namespace (optional, unique)'), class: 'label-bold' label: s_('ClusterIntegration|Project namespace (optional, unique)'), label_class: 'label-bold'
= platform_kubernetes_field.text_field :namespace, class: 'form-control', placeholder: s_('ClusterIntegration|Project namespace')
.form-group = platform_kubernetes_field.form_group :authorization_type do
.form-check = platform_kubernetes_field.check_box :authorization_type,
= platform_kubernetes_field.check_box :authorization_type, { class: 'form-check-input qa-rbac-checkbox' }, 'rbac', 'abac' { class: 'qa-rbac-checkbox', label: s_('ClusterIntegration|RBAC-enabled cluster'),
= platform_kubernetes_field.label :authorization_type, s_('ClusterIntegration|RBAC-enabled cluster'), class: 'form-check-label label-bold' label_class: 'label-bold', inline: true }, 'rbac', 'abac'
.form-text.text-muted .form-text.text-muted
= s_('ClusterIntegration|Enable this setting if using role-based access control (RBAC).') = s_('ClusterIntegration|Enable this setting if using role-based access control (RBAC).')
= s_('ClusterIntegration|This option will allow you to install applications on RBAC clusters.') = s_('ClusterIntegration|This option will allow you to install applications on RBAC clusters.')
= link_to _('More information'), help_page_path('user/project/clusters/index.md', anchor: 'role-based-access-control-rbac-core-only'), target: '_blank' = link_to _('More information'), help_page_path('user/project/clusters/index.md',
anchor: 'role-based-access-control-rbac-core-only'), target: '_blank'
.form-group .form-group
= field.submit s_('ClusterIntegration|Add Kubernetes cluster'), class: 'btn btn-success' = field.submit s_('ClusterIntegration|Add Kubernetes cluster'), class: 'btn btn-success'
= form_for cluster, url: update_cluster_url_path, as: :cluster do |field| = bootstrap_form_for cluster, url: update_cluster_url_path, html: { class: 'gl-show-field-errors' },
= form_errors(cluster) as: :cluster do |field|
- copy_name_btn = clipboard_button(text: cluster.name, title: s_('ClusterIntegration|Copy Kubernetes cluster name'),
.form-group class: 'input-group-text btn-default') unless !cluster.read_only_kubernetes_platform_fields?
- if cluster.read_only_kubernetes_platform_fields? = field.text_field :name, class: 'js-select-on-focus cluster-name', required: true,
%label.append-bottom-10{ for: 'cluster-name' } title: s_('ClusterIntegration|Cluster name is required.'),
= s_('ClusterIntegration|Kubernetes cluster name') readonly: cluster.read_only_kubernetes_platform_fields?,
.input-group label: s_('ClusterIntegration|Kubernetes cluster name'), label_class: 'label-bold',
%input.form-control.cluster-name.js-select-on-focus{ value: cluster.name, readonly: true } input_group_class: 'gl-field-error-anchor', append: copy_name_btn
%span.input-group-append
= clipboard_button(text: cluster.name, title: s_('ClusterIntegration|Copy Kubernetes cluster name'), class: 'input-group-text btn-default')
- else
= field.label :name, s_('ClusterIntegration|Kubernetes cluster name'), class: 'label-bold'
.input-group
= field.text_field :name, class: 'form-control', placeholder: s_('ClusterIntegration|Kubernetes cluster name')
= field.fields_for :platform_kubernetes, platform do |platform_field| = field.fields_for :platform_kubernetes, platform do |platform_field|
.form-group - copy_api_url = clipboard_button(text: platform.api_url, title: s_('ClusterIntegration|Copy API URL'),
= platform_field.label :api_url, s_('ClusterIntegration|API URL') class: 'input-group-text btn-default') unless !cluster.read_only_kubernetes_platform_fields?
.input-group = platform_field.text_field :api_url, class: 'js-select-on-focus', required: true,
= platform_field.text_field :api_url, class: 'form-control js-select-on-focus', placeholder: s_('ClusterIntegration|API URL'), readonly: cluster.read_only_kubernetes_platform_fields? title: s_('ClusterIntegration|API URL should be a valid http/https url.'),
- if cluster.read_only_kubernetes_platform_fields? readonly: cluster.read_only_kubernetes_platform_fields?,
%span.input-group-append label: s_('ClusterIntegration|API URL'), label_class: 'label-bold',
= clipboard_button(text: platform.api_url, title: s_('ClusterIntegration|Copy API URL'), class: 'input-group-text btn-default') input_group_class: 'gl-field-error-anchor', append: copy_api_url
- copy_ca_cert_btn = clipboard_button(text: platform.ca_cert, title: s_('ClusterIntegration|Copy CA Certificate'),
class: 'input-group-text btn-default') unless !cluster.read_only_kubernetes_platform_fields?
= platform_field.text_area :ca_cert, class: 'js-select-on-focus', rows: '5',
readonly: cluster.read_only_kubernetes_platform_fields?,
placeholder: s_('ClusterIntegration|Certificate Authority bundle (PEM format)'),
label: s_('ClusterIntegration|CA Certificate'), label_class: 'label-bold',
input_group_class: 'gl-field-error-anchor', append: copy_ca_cert_btn
.form-group - show_token_btn = (platform_field.button s_('ClusterIntegration|Show'),
= platform_field.label :ca_cert, s_('ClusterIntegration|CA Certificate') type: 'button', class: 'js-show-cluster-token btn btn-default')
.input-group - copy_token_btn = clipboard_button(text: platform.token, title: s_('ClusterIntegration|Copy Service Token'),
= platform_field.text_area :ca_cert, class: 'form-control js-select-on-focus', placeholder: s_('ClusterIntegration|Certificate Authority bundle (PEM format)'), readonly: cluster.read_only_kubernetes_platform_fields? class: 'input-group-text btn-default') unless !cluster.read_only_kubernetes_platform_fields?
- if cluster.read_only_kubernetes_platform_fields?
%span.input-group-append.clipboard-addon
= clipboard_button(text: platform.ca_cert, title: s_('ClusterIntegration|Copy CA Certificate'), class: 'input-group-text btn-blank')
.form-group = platform_field.text_field :token, type: 'password', class: 'js-select-on-focus js-cluster-token',
= platform_field.label :token, s_('ClusterIntegration|Token') required: true, title: s_('ClusterIntegration|Service token is required.'),
.input-group readonly: cluster.read_only_kubernetes_platform_fields?,
= platform_field.text_field :token, class: 'form-control js-cluster-token js-select-on-focus', type: 'password', placeholder: s_('ClusterIntegration|Token'), readonly: cluster.read_only_kubernetes_platform_fields? label: s_('ClusterIntegration|Service Token'), label_class: 'label-bold',
%span.input-group-append input_group_class: 'gl-field-error-anchor', append: show_token_btn + copy_token_btn
%button.btn.btn-default.input-group-text.js-show-cluster-token{ type: 'button' }
= s_('ClusterIntegration|Show')
- if cluster.read_only_kubernetes_platform_fields?
= clipboard_button(text: platform.token, title: s_('ClusterIntegration|Copy Token'), class: 'btn-default')
- if cluster.allow_user_defined_namespace? - if cluster.allow_user_defined_namespace?
.form-group = platform_field.text_field :namespace, label: s_('ClusterIntegration|Project namespace (optional, unique)'),
= platform_field.label :namespace, s_('ClusterIntegration|Project namespace (optional, unique)') label_class: 'label-bold'
= platform_field.text_field :namespace, class: 'form-control', placeholder: s_('ClusterIntegration|Project namespace')
.form-group = platform_field.form_group :authorization_type do
.form-check = platform_field.check_box :authorization_type, { disabled: true, label: s_('ClusterIntegration|RBAC-enabled cluster'),
= platform_field.check_box :authorization_type, { class: 'form-check-input', disabled: true }, 'rbac', 'abac' label_class: 'label-bold', inline: true }, 'rbac', 'abac'
= platform_field.label :authorization_type, s_('ClusterIntegration|RBAC-enabled cluster'), class: 'form-check-label label-bold' .form-text.text-muted
.form-text.text-muted = s_('ClusterIntegration|Enable this setting if using role-based access control (RBAC).')
= s_('ClusterIntegration|Enable this setting if using role-based access control (RBAC).') = s_('ClusterIntegration|This option will allow you to install applications on RBAC clusters.')
= s_('ClusterIntegration|This option will allow you to install applications on RBAC clusters.')
.form-group .form-group
= field.submit s_('ClusterIntegration|Save changes'), class: 'btn btn-success' = field.submit s_('ClusterIntegration|Save changes'), class: 'btn btn-success'
---
title: Display cluster form validation error messages inline
merge_request: 26502
author:
type: changed
...@@ -13,12 +13,12 @@ module EE ...@@ -13,12 +13,12 @@ module EE
def unique_environment_scope def unique_environment_scope
if project && project.clusters.where(environment_scope: environment_scope).where.not(id: id).exists? if project && project.clusters.where(environment_scope: environment_scope).where.not(id: id).exists?
errors.add(:base, "cannot add duplicated environment scope") errors.add(:environment_scope, "cannot add duplicated environment scope")
return false return false
end end
if group && group.clusters.where(environment_scope: environment_scope).where.not(id: id).exists? if group && group.clusters.where(environment_scope: environment_scope).where.not(id: id).exists?
errors.add(:base, 'cannot add duplicated environment scope') errors.add(:environment_scope, 'cannot add duplicated environment scope')
return false return false
end end
......
...@@ -64,6 +64,9 @@ describe 'EE Clusters', :js do ...@@ -64,6 +64,9 @@ describe 'EE Clusters', :js do
click_link 'Add existing cluster' click_link 'Add existing cluster'
fill_in 'cluster_name', with: 'staging-cluster' fill_in 'cluster_name', with: 'staging-cluster'
fill_in 'cluster_environment_scope', with: '*' fill_in 'cluster_environment_scope', with: '*'
fill_in 'cluster_platform_kubernetes_attributes_api_url', with: 'https://0.0.0.0'
fill_in 'cluster_platform_kubernetes_attributes_token', with: 'token'
click_button 'Add Kubernetes cluster' click_button 'Add Kubernetes cluster'
end end
......
...@@ -2256,6 +2256,9 @@ msgstr "" ...@@ -2256,6 +2256,9 @@ msgstr ""
msgid "ClusterIntegration|API URL" msgid "ClusterIntegration|API URL"
msgstr "" msgstr ""
msgid "ClusterIntegration|API URL should be a valid http/https url."
msgstr ""
msgid "ClusterIntegration|Add Kubernetes cluster" msgid "ClusterIntegration|Add Kubernetes cluster"
msgstr "" msgstr ""
...@@ -2319,6 +2322,9 @@ msgstr "" ...@@ -2319,6 +2322,9 @@ msgstr ""
msgid "ClusterIntegration|Cluster health" msgid "ClusterIntegration|Cluster health"
msgstr "" msgstr ""
msgid "ClusterIntegration|Cluster name is required."
msgstr ""
msgid "ClusterIntegration|Clusters are utilized by selecting the nearest ancestor with a matching environment scope. For example, project clusters will override group clusters." msgid "ClusterIntegration|Clusters are utilized by selecting the nearest ancestor with a matching environment scope. For example, project clusters will override group clusters."
msgstr "" msgstr ""
...@@ -2340,7 +2346,7 @@ msgstr "" ...@@ -2340,7 +2346,7 @@ msgstr ""
msgid "ClusterIntegration|Copy Kubernetes cluster name" msgid "ClusterIntegration|Copy Kubernetes cluster name"
msgstr "" msgstr ""
msgid "ClusterIntegration|Copy Token" msgid "ClusterIntegration|Copy Service Token"
msgstr "" msgstr ""
msgid "ClusterIntegration|Create Kubernetes cluster" msgid "ClusterIntegration|Create Kubernetes cluster"
...@@ -2538,6 +2544,9 @@ msgstr "" ...@@ -2538,6 +2544,9 @@ msgstr ""
msgid "ClusterIntegration|Number of nodes" msgid "ClusterIntegration|Number of nodes"
msgstr "" msgstr ""
msgid "ClusterIntegration|Number of nodes must be a numerical value."
msgstr ""
msgid "ClusterIntegration|Please enter access information for your Kubernetes cluster. If you need help, you can read our %{link_to_help_page} on Kubernetes" msgid "ClusterIntegration|Please enter access information for your Kubernetes cluster. If you need help, you can read our %{link_to_help_page} on Kubernetes"
msgstr "" msgstr ""
...@@ -2550,9 +2559,6 @@ msgstr "" ...@@ -2550,9 +2559,6 @@ msgstr ""
msgid "ClusterIntegration|Project cluster" msgid "ClusterIntegration|Project cluster"
msgstr "" msgstr ""
msgid "ClusterIntegration|Project namespace"
msgstr ""
msgid "ClusterIntegration|Project namespace (optional, unique)" msgid "ClusterIntegration|Project namespace (optional, unique)"
msgstr "" msgstr ""
...@@ -2619,7 +2625,10 @@ msgstr "" ...@@ -2619,7 +2625,10 @@ msgstr ""
msgid "ClusterIntegration|Select zone to choose machine type" msgid "ClusterIntegration|Select zone to choose machine type"
msgstr "" msgstr ""
msgid "ClusterIntegration|Service token" msgid "ClusterIntegration|Service Token"
msgstr ""
msgid "ClusterIntegration|Service token is required."
msgstr "" msgstr ""
msgid "ClusterIntegration|Show" msgid "ClusterIntegration|Show"
...@@ -2652,9 +2661,6 @@ msgstr "" ...@@ -2652,9 +2661,6 @@ msgstr ""
msgid "ClusterIntegration|Toggle Kubernetes cluster" msgid "ClusterIntegration|Toggle Kubernetes cluster"
msgstr "" msgstr ""
msgid "ClusterIntegration|Token"
msgstr ""
msgid "ClusterIntegration|Update failed. Please check the logs and try again." msgid "ClusterIntegration|Update failed. Please check the logs and try again."
msgstr "" msgstr ""
......
...@@ -6,7 +6,7 @@ module QA ...@@ -6,7 +6,7 @@ module QA
class AddExisting < Page::Base class AddExisting < Page::Base
view 'app/views/clusters/clusters/user/_form.html.haml' do view 'app/views/clusters/clusters/user/_form.html.haml' do
element :cluster_name, 'text_field :name' # rubocop:disable QA/ElementWithPattern element :cluster_name, 'text_field :name' # rubocop:disable QA/ElementWithPattern
element :api_url, 'text_field :api_url' # rubocop:disable QA/ElementWithPattern element :api_url, 'url_field :api_url' # rubocop:disable QA/ElementWithPattern
element :ca_certificate, 'text_area :ca_cert' # rubocop:disable QA/ElementWithPattern element :ca_certificate, 'text_area :ca_cert' # rubocop:disable QA/ElementWithPattern
element :token, 'text_field :token' # rubocop:disable QA/ElementWithPattern element :token, 'text_field :token' # rubocop:disable QA/ElementWithPattern
element :add_cluster_button, "submit s_('ClusterIntegration|Add Kubernetes cluster')" # rubocop:disable QA/ElementWithPattern element :add_cluster_button, "submit s_('ClusterIntegration|Add Kubernetes cluster')" # rubocop:disable QA/ElementWithPattern
......
...@@ -69,7 +69,7 @@ describe 'User Cluster', :js do ...@@ -69,7 +69,7 @@ describe 'User Cluster', :js do
end end
it 'user sees a validation error' do it 'user sees a validation error' do
expect(page).to have_css('#error_explanation') expect(page).to have_css('.gl-field-error')
end end
end end
end end
......
...@@ -92,7 +92,7 @@ describe 'Gcp Cluster', :js do ...@@ -92,7 +92,7 @@ describe 'Gcp Cluster', :js do
end end
it 'user sees a validation error' do it 'user sees a validation error' do
expect(page).to have_css('#error_explanation') expect(page).to have_css('.gl-field-error')
end end
end end
end end
......
...@@ -53,7 +53,7 @@ describe 'User Cluster', :js do ...@@ -53,7 +53,7 @@ describe 'User Cluster', :js do
end end
it 'user sees a validation error' do it 'user sees a validation error' do
expect(page).to have_css('#error_explanation') expect(page).to have_css('.gl-field-error')
end end
end end
end end
......
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