Commit 09ca102f authored by Tom Quirk's avatar Tom Quirk

Make Service template table a gitlab-ui table

Also, fix a service template related spec.
parent e86cde7d
......@@ -3,7 +3,7 @@
%h3.page-title
= @service.title
%p #{@service.description} template.
%p= @service.description
= form_for :service, url: admin_application_settings_service_path, method: :put, html: { class: 'fieldset-form js-integration-settings-form' } do |form|
= render 'shared/service_settings', form: form, integration: @service
......@@ -5,4 +5,4 @@
= 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. To migrate or remove a Service template, create a new integration at %{settings_link_start}Settings &gt; 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 }
= html_escape_once(s_("AdminSettings|You can't add new templates. To migrate or remove a Service template, create a new integration at %{settings_link_start}Settings &gt; Integrations%{link_end}. Learn more about %{doc_link_start}Project integration management%{link_end}.")).html_safe % { settings_link_start: settings_link_start, doc_link_start: doc_link_start, link_end: '</a>'.html_safe }
......@@ -5,40 +5,39 @@
- if @activated_services.any?
%h3.page-title Service templates
%p.light= s_('AdminSettings|Service template allows you to set default values for integrations')
%p= s_('AdminSettings|Service template allows you to set default values for integrations')
.table-holder
%table.table
%colgroup
%col
%col
%col
%col{ width: 135 }
%thead
%table.table.b-table.gl-table
%colgroup
%col
%col
%col
%col{ width: 135 }
%thead
%tr
%th
%th= _('Service')
%th= _('Description')
%th= _('Last edit')
- @activated_services.each do |service|
- if service.type.in?(@existing_instance_types)
%tr
%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
%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
......@@ -283,13 +283,11 @@ RSpec.describe 'Admin updates settings' do
it 'defaults Deployment events to false for chat notification template settings', :js do
first(:link, 'Service Templates').click
click_link 'Slack notifications'
expect(find_field('Deployment')).not_to be_checked
end
end
context 'Integration page', :js do
before do
visit integrations_admin_application_settings_path
......
......@@ -37,7 +37,7 @@ RSpec.describe 'Admin visits service templates' do
expect(page).not_to have_link('Slack', href: edit_admin_application_settings_integration_path(slack_service))
end
end
context 'with instance-level integration' do
before do
create(:slack_service, instance: true, project: nil)
......
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