Commit 568a5fdd authored by Tom Quirk's avatar Tom Quirk

Remove ability to create new service templates

- hides inactive service templates
- adds undismissible "danger" alert
parent 2e43d7fc
...@@ -9,7 +9,7 @@ class Admin::ServicesController < Admin::ApplicationController ...@@ -9,7 +9,7 @@ class Admin::ServicesController < Admin::ApplicationController
feature_category :integrations feature_category :integrations
def index def index
@services = Service.find_or_create_templates.sort_by(&:title) @activated_services = Service.for_template.active.sort_by(&:title)
@existing_instance_types = Service.for_instance.pluck(:type) # rubocop: disable CodeReuse/ActiveRecord @existing_instance_types = Service.for_instance.pluck(:type) # rubocop: disable CodeReuse/ActiveRecord
end end
......
= render "service_templates_deprecated_alert"
%h3.page-title %h3.page-title
= @service.title = @service.title
......
- doc_link_start = "<a href=\"#{integrations_help_page_path}\" target='_blank' rel='noopener noreferrer'>".html_safe
- settings_link_start = "<a href=\"#{integrations_admin_application_settings_path}\">".html_safe
.gl-alert.gl-alert-danger.gl-mt-5{ role: 'alert' }
= sprite_icon('error', css_class: 'gl-alert-icon gl-alert-icon-no-title')
%h4.gl-alert-title= _('Service templates are deprecated and will be removed in GitLab 14.0.')
.gl-alert-body
= html_escape(s_("AdminSettings|You can't add new templates or edit existing ones. To migrate or remove a Service template, create a new integration at %{settings_link_start}Settings > Integrations%{link_end}. Learn more about %{doc_link_start}Project integration management%{link_end}.")) % { settings_link_start: settings_link_start, doc_link_start: doc_link_start, link_end: '</a>'.html_safe }
- page_title _("Service Templates") - page_title _("Service Templates")
- @content_class = 'limit-container-width' unless fluid_layout - @content_class = 'limit-container-width' unless fluid_layout
- if show_service_templates_deprecated? = render "service_templates_deprecated_alert"
.gl-alert.gl-alert-tip.js-service-templates-deprecated.gl-mt-5{ role: 'alert', data: { feature_id: UserCalloutsHelper::SERVICE_TEMPLATES_DEPRECATED, dismiss_endpoint: user_callouts_path } }
= sprite_icon('bulb', css_class: 'gl-alert-icon gl-alert-icon-no-title')
%button.js-close.gl-alert-dismiss{ type: 'button', aria: { label: _('Dismiss') } }
= sprite_icon('close')
%h4.gl-alert-title= s_('AdminSettings|Service Templates will soon be deprecated.')
.gl-alert-body
= s_('AdminSettings|Try using the latest version of Integrations instead.')
.gl-alert-actions
= link_to _('Go to Integrations'), integrations_admin_application_settings_path, class: 'btn btn-info gl-alert-action gl-button'
= link_to _('Learn more'), help_page_path('user/admin_area/settings/project_integration_management'), class: 'btn btn-default gl-alert-action btn-secondary gl-button', target: '_blank', rel: 'noopener noreferrer'
%h3.page-title Service templates - if @activated_services.any?
%p.light= s_('AdminSettings|Service template allows you to set default values for integrations') %h3.page-title Service templates
%p.light= s_('AdminSettings|Service template allows you to set default values for integrations')
.table-holder .table-holder
%table.table %table.table
%colgroup %colgroup
%col %col
%col %col
%col %col
%col{ width: 135 } %col{ width: 135 }
%thead %thead
%tr
%th
%th= _('Service')
%th= _('Description')
%th= _('Last edit')
- @services.each do |service|
- if service.type.in?(@existing_instance_types)
%tr %tr
%td %th
%td %th= _('Service')
= link_to edit_admin_application_settings_integration_path(service.to_param), class: 'gl-text-blue-300!' do %th= _('Description')
%strong.has-tooltip{ title: s_('AdminSettings|Moved to integrations'), data: { container: 'body' } } %th= _('Last edit')
= service.title - @activated_services.each do |service|
%td.gl-cursor-default.gl-text-gray-400 - if service.type.in?(@existing_instance_types)
= service.description %tr
%td %td
- else %td
%tr = link_to edit_admin_application_settings_integration_path(service.to_param), class: 'gl-text-blue-300!' do
%td %strong.has-tooltip{ title: s_('AdminSettings|Moved to integrations'), data: { container: 'body' } }
= boolean_to_icon service.activated? = service.title
%td %td.gl-cursor-default.gl-text-gray-400
= link_to edit_admin_application_settings_service_path(service.id) do = service.description
%strong= service.title %td
%td - else
= service.description %tr
%td.light %td
= time_ago_with_tooltip service.updated_at = boolean_to_icon service.activated?
%td
= link_to edit_admin_application_settings_service_path(service.id) do
%strong= service.title
%td
= service.description
%td.light
= time_ago_with_tooltip service.updated_at
---
title: Remove ability to create new service templates
merge_request: 58624
author:
type: removed
...@@ -2328,9 +2328,6 @@ msgstr "" ...@@ -2328,9 +2328,6 @@ msgstr ""
msgid "AdminSettings|Select a template" msgid "AdminSettings|Select a template"
msgstr "" msgstr ""
msgid "AdminSettings|Service Templates will soon be deprecated."
msgstr ""
msgid "AdminSettings|Service template allows you to set default values for integrations" msgid "AdminSettings|Service template allows you to set default values for integrations"
msgstr "" msgstr ""
...@@ -2352,10 +2349,10 @@ msgstr "" ...@@ -2352,10 +2349,10 @@ msgstr ""
msgid "AdminSettings|The required pipeline configuration can be selected from the %{code_start}gitlab-ci%{code_end} directory inside of the configured %{link_start}instance template repository%{link_end} or from GitLab provided configurations." msgid "AdminSettings|The required pipeline configuration can be selected from the %{code_start}gitlab-ci%{code_end} directory inside of the configured %{link_start}instance template repository%{link_end} or from GitLab provided configurations."
msgstr "" msgstr ""
msgid "AdminSettings|Try using the latest version of Integrations instead." msgid "AdminSettings|When creating a new environment variable it will be protected by default."
msgstr "" msgstr ""
msgid "AdminSettings|When creating a new environment variable it will be protected by default." msgid "AdminSettings|You can't add new templates or edit existing ones. To migrate or remove a Service template, create a new integration at %{settings_link_start}Settings > Integrations%{link_end}. Learn more about %{doc_link_start}Project integration management%{link_end}."
msgstr "" msgstr ""
msgid "AdminStatistics|Active Users" msgid "AdminStatistics|Active Users"
...@@ -14771,9 +14768,6 @@ msgstr "" ...@@ -14771,9 +14768,6 @@ msgstr ""
msgid "Go full screen" msgid "Go full screen"
msgstr "" msgstr ""
msgid "Go to Integrations"
msgstr ""
msgid "Go to Webhooks" msgid "Go to Webhooks"
msgstr "" msgstr ""
...@@ -28302,6 +28296,9 @@ msgstr "" ...@@ -28302,6 +28296,9 @@ msgstr ""
msgid "Service URL" msgid "Service URL"
msgstr "" msgstr ""
msgid "Service templates are deprecated and will be removed in GitLab 14.0."
msgstr ""
msgid "ServiceDesk|Enable Service Desk" msgid "ServiceDesk|Enable Service Desk"
msgstr "" msgstr ""
......
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