Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2023-01-20 00:07:28 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2023-01-20 00:07:28 +0300
commit9bc3ee9ad4c857570b7a029345cc6fff3ed46b5f (patch)
tree4de11c170947a73056c72b47f1036c048e7c082e /app/views/clusters
parentdc539af30068062bd6fc2f9c6b478d4a1feb8c23 (diff)
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/views/clusters')
-rw-r--r--app/views/clusters/clusters/_namespace.html.haml15
-rw-r--r--app/views/clusters/clusters/_provider_details_form.html.haml82
-rw-r--r--app/views/clusters/clusters/user/_form.html.haml77
3 files changed, 100 insertions, 74 deletions
diff --git a/app/views/clusters/clusters/_namespace.html.haml b/app/views/clusters/clusters/_namespace.html.haml
index 572f2d6d9a2..34576b6e5af 100644
--- a/app/views/clusters/clusters/_namespace.html.haml
+++ b/app/views/clusters/clusters/_namespace.html.haml
@@ -3,11 +3,12 @@
- managed_namespace_help_link = link_to _('More information'), help_page_path('user/project/clusters/gitlab_managed_clusters.md'), target: '_blank', rel: 'noopener noreferrer'
.js-namespace-prefixed
- = platform_field.text_field :namespace,
- label: s_('ClusterIntegration|Project namespace prefix (optional, unique)'), label_class: 'label-bold',
- help: '%{help_text} %{help_link}'.html_safe % { help_text: managed_namespace_help_text, help_link: managed_namespace_help_link }
+ .form-group
+ = platform_field.label :namespace, s_('ClusterIntegration|Project namespace prefix (optional, unique)'), class: 'label-bold'
+ = platform_field.text_field :namespace, class: 'form-control'
+ %small.form-text.text-muted= '%{help_text} %{help_link}'.html_safe % { help_text: managed_namespace_help_text, help_link: managed_namespace_help_link }
.js-namespace.hidden
- = platform_field.text_field :namespace,
- label: s_('ClusterIntegration|Project namespace (optional, unique)'), label_class: 'label-bold',
- help: '%{help_text}'.html_safe % { help_text: non_managed_namespace_help_text },
- disabled: true
+ .form-group
+ = platform_field.label :namespace, s_('ClusterIntegration|Project namespace (optional, unique)'), class: 'label-bold'
+ = platform_field.text_field :namespace, class: 'form-control', disabled: true
+ %small.form-text.text-muted= '%{help_text}'.html_safe % { help_text: non_managed_namespace_help_text }
diff --git a/app/views/clusters/clusters/_provider_details_form.html.haml b/app/views/clusters/clusters/_provider_details_form.html.haml
index 11277a83e3a..59706b6d8c4 100644
--- a/app/views/clusters/clusters/_provider_details_form.html.haml
+++ b/app/views/clusters/clusters/_provider_details_form.html.haml
@@ -1,52 +1,62 @@
-= bootstrap_form_for cluster, url: update_cluster_url_path, html: { class: 'js-provider-details gl-show-field-errors' },
+= gitlab_ui_form_for cluster, url: update_cluster_url_path, html: { class: 'js-provider-details gl-show-field-errors', role: 'form' },
as: :cluster do |field|
- - copy_name_btn = clipboard_button(text: cluster.name, title: s_('ClusterIntegration|Copy Kubernetes cluster name'),
- class: 'input-group-text btn-default') if cluster.read_only_kubernetes_platform_fields?
- = field.text_field :name, class: 'js-select-on-focus cluster-name', required: true,
- title: s_('ClusterIntegration|Cluster name is required.'),
- readonly: cluster.read_only_kubernetes_platform_fields?,
- label: s_('ClusterIntegration|Kubernetes cluster name'), label_class: 'label-bold',
- input_group_class: 'gl-field-error-anchor', append: copy_name_btn
+ .form-group
+ - copy_name_btn = clipboard_button(text: cluster.name, title: s_('ClusterIntegration|Copy Kubernetes cluster name'),
+ class: 'input-group-text btn-default') if cluster.read_only_kubernetes_platform_fields?
+ = field.label :name, s_('ClusterIntegration|Kubernetes cluster name'), class: 'label-bold required'
+ .input-group.gl-field-error-anchor
+ = field.text_field :name, class: 'form-control js-select-on-focus cluster-name', required: true,
+ title: s_('ClusterIntegration|Cluster name is required.'),
+ readonly: cluster.read_only_kubernetes_platform_fields?,
+ append: copy_name_btn
= field.fields_for :platform_kubernetes, platform do |platform_field|
- - copy_api_url = clipboard_button(text: platform.api_url, title: s_('ClusterIntegration|Copy API URL'),
- class: 'input-group-text btn-default') if cluster.read_only_kubernetes_platform_fields?
- = platform_field.text_field :api_url, class: 'js-select-on-focus', required: true,
- title: s_('ClusterIntegration|API URL should be a valid http/https url.'),
- readonly: cluster.read_only_kubernetes_platform_fields?,
- label: s_('ClusterIntegration|API URL'), label_class: 'label-bold',
- 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') if cluster.read_only_kubernetes_platform_fields?
- = platform_field.text_area :ca_cert, class: 'js-select-on-focus', rows: '10',
- 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
-
- = platform_field.password_field :token, type: 'password', class: 'js-select-on-focus js-cluster-token',
- readonly: cluster.read_only_kubernetes_platform_fields?, autocomplete: 'new-password',
- label: s_('ClusterIntegration|Enter new Service Token'), label_class: 'label-bold',
- input_group_class: 'gl-field-error-anchor'
-
- = platform_field.form_group :authorization_type do
- = platform_field.check_box :authorization_type, { disabled: true, label: s_('ClusterIntegration|RBAC-enabled cluster'),
- label_class: 'label-bold', inline: true }, 'rbac', 'abac'
+ .form-group
+ - copy_api_url = clipboard_button(text: platform.api_url, title: s_('ClusterIntegration|Copy API URL'),
+ class: 'input-group-text btn-default') if cluster.read_only_kubernetes_platform_fields?
+ = platform_field.label :api_url, s_('ClusterIntegration|API URL'), class: 'label-bold required'
+ .input-group.gl-field-error-anchor
+ = platform_field.text_field :api_url, class: 'form-control js-select-on-focus', required: true,
+ title: s_('ClusterIntegration|API URL should be a valid http/https url.'),
+ readonly: cluster.read_only_kubernetes_platform_fields?,
+ append: copy_api_url
+
+ .form-group
+ - copy_ca_cert_btn = clipboard_button(text: platform.ca_cert, title: s_('ClusterIntegration|Copy CA Certificate'),
+ class: 'input-group-text btn-default') if cluster.read_only_kubernetes_platform_fields?
+ = platform_field.label :ca_cert, s_('ClusterIntegration|CA Certificate'), class: 'label-bold'
+ .input-group.gl-field-error-anchor
+ = platform_field.text_area :ca_cert, class: 'form-control js-select-on-focus', rows: '10',
+ readonly: cluster.read_only_kubernetes_platform_fields?,
+ placeholder: s_('ClusterIntegration|Certificate Authority bundle (PEM format)'),
+ append: copy_ca_cert_btn
+
+ .form-group
+ = platform_field.label :token, s_('ClusterIntegration|Enter new Service Token'), class: 'label-bold required'
+ .input-group.gl-field-error-anchor
+ = platform_field.password_field :token, type: 'password', class: 'form-control js-select-on-focus js-cluster-token',
+ readonly: cluster.read_only_kubernetes_platform_fields?, autocomplete: 'new-password'
+
+ .form-group
+ .form-check
+ = platform_field.check_box :authorization_type, { disabled: true, inline: true, class: 'form-check-input' }, 'rbac', 'abac'
+ = platform_field.label :authorization_type, s_('ClusterIntegration|RBAC-enabled cluster'), class: 'form-check-label label-bold'
.form-text.text-muted
= 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.')
.form-group
- = field.check_box :managed, { label: s_('ClusterIntegration|GitLab-managed cluster'),
- class: 'js-gl-managed',
- label_class: 'label-bold' }
+ .form-check
+ = field.check_box :managed, { class: 'js-gl-managed form-check-input' }
+ = field.label :managed, s_('ClusterIntegration|GitLab-managed cluster'), class: 'form-check-label label-bold'
.form-text.text-muted
= s_('ClusterIntegration|Allow GitLab to manage namespaces and service accounts for this cluster.')
= link_to _('More information'), help_page_path('user/project/clusters/gitlab_managed_clusters.md'), target: '_blank', rel: 'noopener noreferrer'
.form-group
- = field.check_box :namespace_per_environment, { label: s_('ClusterIntegration|Namespace per environment'), label_class: 'label-bold' }
+ .form-check
+ = field.check_box :namespace_per_environment, { class: 'form-check-input' }
+ = field.label :namespace_per_environment, s_('ClusterIntegration|Namespace per environment'), class: 'form-check-label label-bold'
.form-text.text-muted
= s_('ClusterIntegration|Deploy each environment to its own namespace. Otherwise, environments within a project share a project-wide namespace. Note that anyone who can trigger a deployment of a namespace can read its secrets. If modified, existing environments will use their current namespaces until the cluster cache is cleared.')
= link_to _('More information'), help_page_path('user/project/clusters/deploy_to_cluster.md', anchor: 'custom-namespace'), target: '_blank', rel: 'noopener noreferrer'
diff --git a/app/views/clusters/clusters/user/_form.html.haml b/app/views/clusters/clusters/user/_form.html.haml
index 557c95f8478..ed169b2bfd1 100644
--- a/app/views/clusters/clusters/user/_form.html.haml
+++ b/app/views/clusters/clusters/user/_form.html.haml
@@ -7,48 +7,63 @@
- rbac_help_text = s_('ClusterIntegration|Enable this setting if using role-based access control (RBAC).') + ' '
- rbac_help_text << s_('ClusterIntegration|This option will allow you to install applications on RBAC clusters.')
-= bootstrap_form_for @user_cluster, html: { class: 'gl-show-field-errors' },
+= gitlab_ui_form_for @user_cluster, html: { class: 'gl-show-field-errors', role: 'form' },
url: clusterable.create_user_clusters_path, as: :cluster do |field|
- = field.text_field :name, required: true, title: s_('ClusterIntegration|Cluster name is required.'),
- label: s_('ClusterIntegration|Kubernetes cluster name'), label_class: 'label-bold'
- = field.text_field :environment_scope, required: true, title: s_('ClusterIntegration|Environment scope is required.'),
- label: s_('ClusterIntegration|Environment scope'), label_class: 'label-bold',
- help: s_('ClusterIntegration|Choose which of your environments will use this cluster.')
+ = form_errors(@user_cluster)
+
+ .form-group
+ = field.label :name, s_('ClusterIntegration|Kubernetes cluster name'), class: 'label-bold required'
+ = field.text_field :name, required: true, title: s_('ClusterIntegration|Cluster name is required.'), class: 'form-control'
+
+ .form-group
+ = field.label :environment_scope, s_('ClusterIntegration|Environment scope'), class: 'label-bold required'
+ = field.text_field :environment_scope, required: true, title: s_('ClusterIntegration|Environment scope is required.'), class: 'form-control'
+ %small.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|
- = platform_kubernetes_field.url_field :api_url, required: true,
- title: s_('ClusterIntegration|API URL should be a valid http/https url.'),
- label: s_('ClusterIntegration|API URL'), label_class: 'label-bold',
- help: '%{help_text} %{help_link}'.html_safe % { help_text: api_url_help_text, help_link: more_info_link }
-
- = platform_kubernetes_field.text_area :ca_cert,
- rows: '10',
- placeholder: s_('ClusterIntegration|Certificate Authority bundle (PEM format)'),
- label: s_('ClusterIntegration|CA Certificate'), label_class: 'label-bold',
- help: '%{help_text} %{help_link}'.html_safe % { help_text: ca_cert_help_text, help_link: more_info_link }
-
- = platform_kubernetes_field.text_field :token, required: true,
- title: s_('ClusterIntegration|Service token is required.'), label: s_('ClusterIntegration|Service Token'),
- autocomplete: 'off', label_class: 'label-bold',
- help: '%{help_text} %{help_link}'.html_safe % { help_text: token_help_text, help_link: more_info_link }
-
- = platform_kubernetes_field.form_group :authorization_type,
- { help: '%{help_text} %{help_link}'.html_safe % { help_text: rbac_help_text, help_link: rbac_help_link } } do
- = platform_kubernetes_field.check_box :authorization_type,
- { data: { qa_selector: 'rbac_checkbox'}, label: s_('ClusterIntegration|RBAC-enabled cluster'),
- label_class: 'label-bold', inline: true }, 'rbac', 'abac'
+ .form-group
+ = platform_kubernetes_field.label :api_url, s_('ClusterIntegration|API URL'), class: 'label-bold required'
+ = platform_kubernetes_field.url_field :api_url, required: true,
+ title: s_('ClusterIntegration|API URL should be a valid http/https url.'), class: 'form-control'
+ %small.form-text.text-muted
+ = '%{help_text} %{help_link}'.html_safe % { help_text: api_url_help_text, help_link: more_info_link }
+
+ .form-group
+ = platform_kubernetes_field.label :ca_cert, s_('ClusterIntegration|CA Certificate'), class: 'label-bold'
+ = platform_kubernetes_field.text_area :ca_cert,
+ rows: '10',
+ placeholder: s_('ClusterIntegration|Certificate Authority bundle (PEM format)'),
+ class: 'form-control'
+ %small.form-text.text-muted
+ = '%{help_text} %{help_link}'.html_safe % { help_text: ca_cert_help_text, help_link: more_info_link }
+
+ .form-group
+ = platform_kubernetes_field.label :token, s_('ClusterIntegration|Service Token'), class: 'label-bold required'
+ = platform_kubernetes_field.text_field :token, required: true, title: s_('ClusterIntegration|Service token is required.'), autocomplete: 'off', class: 'form-control'
+ %small.form-text.text-muted
+ = '%{help_text} %{help_link}'.html_safe % { help_text: token_help_text, help_link: more_info_link }
+
+ .form-group
+ .form-check
+ = platform_kubernetes_field.check_box :authorization_type, { data: { qa_selector: 'rbac_checkbox'}, inline: true, class: 'form-check-input' }, 'rbac', 'abac'
+ = platform_kubernetes_field.label :authorization_type, s_('ClusterIntegration|RBAC-enabled cluster'), class: 'form-check-label label-bold'
+ %small.form-text.text-muted
+ = '%{help_text} %{help_link}'.html_safe % { help_text: rbac_help_text, help_link: rbac_help_link }
.form-group
- = field.check_box :managed, { label: s_('ClusterIntegration|GitLab-managed cluster'),
- class: 'js-gl-managed',
- label_class: 'label-bold' }
+ .form-check
+ = field.check_box :managed, { class: 'js-gl-managed form-check-input' }
+ = field.label :managed, s_('ClusterIntegration|GitLab-managed cluster'), class: 'form-check-label label-bold'
.form-text.text-muted
= s_('ClusterIntegration|Allow GitLab to manage namespaces and service accounts for this cluster.')
= link_to _('Learn more.'), help_page_path('user/project/clusters/gitlab_managed_clusters.md'), target: '_blank', rel: 'noopener noreferrer'
.form-group
- = field.check_box :namespace_per_environment, { label: s_('ClusterIntegration|Namespace per environment'), label_class: 'label-bold' }
+ .form-check
+ = field.check_box :namespace_per_environment, { class: 'form-check-input' }
+ = field.label :namespace_per_environment, s_('ClusterIntegration|Namespace per environment'), class: 'form-check-label label-bold'
.form-text.text-muted
= s_('ClusterIntegration|Deploy each environment to its own namespace. Otherwise, environments within a project share a project-wide namespace. Note that anyone who can trigger a deployment of a namespace can read its secrets. If modified, existing environments will use their current namespaces until the cluster cache is cleared.')
= link_to _('Learn more.'), help_page_path('user/project/clusters/deploy_to_cluster.md', anchor: 'custom-namespace'), target: '_blank', rel: 'noopener noreferrer'