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 @@ ...@@ -3,7 +3,7 @@
%h3.page-title %h3.page-title
= @service.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| = 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 = render 'shared/service_settings', form: form, integration: @service
...@@ -5,4 +5,4 @@ ...@@ -5,4 +5,4 @@
= sprite_icon('error', css_class: 'gl-alert-icon gl-alert-icon-no-title') = 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.') %h4.gl-alert-title= _('Service templates are deprecated and will be removed in GitLab 14.0.')
.gl-alert-body .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 @@ ...@@ -5,40 +5,39 @@
- if @activated_services.any? - if @activated_services.any?
%h3.page-title Service templates %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.b-table.gl-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')
- @activated_services.each do |service|
- if service.type.in?(@existing_instance_types)
%tr %tr
%th %td
%th= _('Service') %td
%th= _('Description') = link_to edit_admin_application_settings_integration_path(service.to_param), class: 'gl-text-blue-300!' do
%th= _('Last edit') %strong.has-tooltip{ title: s_('AdminSettings|Moved to integrations'), data: { container: 'body' } }
- @activated_services.each do |service| = service.title
- if service.type.in?(@existing_instance_types) %td.gl-cursor-default.gl-text-gray-400
%tr = service.description
%td %td
%td - else
= link_to edit_admin_application_settings_integration_path(service.to_param), class: 'gl-text-blue-300!' do %tr
%strong.has-tooltip{ title: s_('AdminSettings|Moved to integrations'), data: { container: 'body' } } %td
= service.title = boolean_to_icon service.activated?
%td.gl-cursor-default.gl-text-gray-400 %td
= service.description = link_to edit_admin_application_settings_service_path(service.id) do
%td %strong= service.title
- else %td
%tr = service.description
%td %td.light
= boolean_to_icon service.activated? = time_ago_with_tooltip service.updated_at
%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 ...@@ -283,13 +283,11 @@ RSpec.describe 'Admin updates settings' do
it 'defaults Deployment events to false for chat notification template settings', :js do it 'defaults Deployment events to false for chat notification template settings', :js do
first(:link, 'Service Templates').click first(:link, 'Service Templates').click
click_link 'Slack notifications' click_link 'Slack notifications'
expect(find_field('Deployment')).not_to be_checked expect(find_field('Deployment')).not_to be_checked
end end
end end
context 'Integration page', :js do context 'Integration page', :js do
before do before do
visit integrations_admin_application_settings_path visit integrations_admin_application_settings_path
......
...@@ -37,7 +37,7 @@ RSpec.describe 'Admin visits service templates' do ...@@ -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)) expect(page).not_to have_link('Slack', href: edit_admin_application_settings_integration_path(slack_service))
end end
end end
context 'with instance-level integration' do context 'with instance-level integration' do
before do before do
create(:slack_service, instance: true, project: nil) 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