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
feature_category :integrations
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
end
......
= render "service_templates_deprecated_alert"
%h3.page-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")
- @content_class = 'limit-container-width' unless fluid_layout
- if show_service_templates_deprecated?
.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'
= render "service_templates_deprecated_alert"
%h3.page-title Service templates
%p.light= s_('AdminSettings|Service template allows you to set default values for integrations')
- if @activated_services.any?
%h3.page-title Service templates
%p.light= s_('AdminSettings|Service template allows you to set default values for integrations')
.table-holder
%table.table
%colgroup
%col
%col
%col
%col{ width: 135 }
%thead
%tr
%th
%th= _('Service')
%th= _('Description')
%th= _('Last edit')
- @services.each do |service|
- if service.type.in?(@existing_instance_types)
.table-holder
%table.table
%colgroup
%col
%col
%col
%col{ width: 135 }
%thead
%tr
%td
%td
= link_to edit_admin_application_settings_integration_path(service.to_param), class: 'gl-text-blue-300!' do
%strong.has-tooltip{ title: s_('AdminSettings|Moved to integrations'), data: { container: 'body' } }
= service.title
%td.gl-cursor-default.gl-text-gray-400
= service.description
%td
- else
%tr
%td
= 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
%th
%th= _('Service')
%th= _('Description')
%th= _('Last edit')
- @activated_services.each do |service|
- if service.type.in?(@existing_instance_types)
%tr
%td
%td
= link_to edit_admin_application_settings_integration_path(service.to_param), class: 'gl-text-blue-300!' do
%strong.has-tooltip{ title: s_('AdminSettings|Moved to integrations'), data: { container: 'body' } }
= service.title
%td.gl-cursor-default.gl-text-gray-400
= service.description
%td
- else
%tr
%td
= 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 ""
msgid "AdminSettings|Select a template"
msgstr ""
msgid "AdminSettings|Service Templates will soon be deprecated."
msgstr ""
msgid "AdminSettings|Service template allows you to set default values for integrations"
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."
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 ""
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 ""
msgid "AdminStatistics|Active Users"
......@@ -14771,9 +14768,6 @@ msgstr ""
msgid "Go full screen"
msgstr ""
msgid "Go to Integrations"
msgstr ""
msgid "Go to Webhooks"
msgstr ""
......@@ -28302,6 +28296,9 @@ msgstr ""
msgid "Service URL"
msgstr ""
msgid "Service templates are deprecated and will be removed in GitLab 14.0."
msgstr ""
msgid "ServiceDesk|Enable Service Desk"
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