Commit c764142c authored by Justin Ho's avatar Justin Ho

Apply shared integrations view to project level

Admin and group level integrations reuse the same
partial to display the table of integrations. The project
one was slightly different since it used a different partial.

This change aims to reconcile this by reusing the same
partial throughout the 3 levels.
parent 31dc7d6d
...@@ -80,7 +80,7 @@ module ServicesHelper ...@@ -80,7 +80,7 @@ module ServicesHelper
def scoped_edit_integration_path(integration) def scoped_edit_integration_path(integration)
if @project.present? if @project.present?
edit_project_settings_integration_path(@project, integration) edit_project_service_path(@project, integration)
elsif @group.present? elsif @group.present?
edit_group_settings_integration_path(@group, integration) edit_group_settings_integration_path(@group, integration)
else else
......
.row.prepend-top-default
.col-lg-4
%h4.prepend-top-0
= _('Integrations')
%p= _('Integrations allow you to integrate GitLab with other applications')
.col-lg-8
%table.table
%colgroup
%col
%col
%col
%col{ width: "120" }
%thead
%tr
%th
%th= _('Integration')
%th.d-none.d-sm-block= _("Description")
%th= s_("ProjectService|Last edit")
- @services.sort_by(&:title).each do |service|
%tr
%td{ "aria-label" => (service.activated? ? s_("ProjectService|%{service_title}: status on") : s_("ProjectService|%{service_title}: status off")) % { service_title: service.title } }
= boolean_to_icon service.activated?
%td
= link_to edit_project_service_path(@project, service.to_param), { data: { qa_selector: "#{service.title.downcase.gsub(/[\s\(\)]/,'_')}_link" } } do
%strong= service.title
%td.d-none.d-sm-block
= service.description
%td.light
- if service.updated_at.present?
= time_ago_with_tooltip service.updated_at
- @content_class = "limit-container-width" unless fluid_layout
- breadcrumb_title _('Integration Settings') - breadcrumb_title _('Integration Settings')
- page_title _('Integrations') - page_title _('Integrations')
- @content_class = 'limit-container-width' unless fluid_layout
- if show_webhooks_moved_alert? - if show_webhooks_moved_alert?
.gl-alert.gl-alert-info.js-webhooks-moved-alert.prepend-top-default{ role: 'alert', data: { feature_id: UserCalloutsHelper::WEBHOOKS_MOVED, dismiss_endpoint: user_callouts_path } } .gl-alert.gl-alert-info.js-webhooks-moved-alert.prepend-top-default{ role: 'alert', data: { feature_id: UserCalloutsHelper::WEBHOOKS_MOVED, dismiss_endpoint: user_callouts_path } }
...@@ -12,4 +12,6 @@ ...@@ -12,4 +12,6 @@
.gl-alert-actions .gl-alert-actions
= link_to _('Go to Webhooks'), project_hooks_path(@project), class: 'btn gl-alert-action btn-info new-gl-button' = link_to _('Go to Webhooks'), project_hooks_path(@project), class: 'btn gl-alert-action btn-info new-gl-button'
= render 'projects/services/index' %h4= s_('Integrations')
%p= s_('Integrations allow you to integrate GitLab with other applications')
= render 'shared/integrations/integrations', integrations: @services
...@@ -13,11 +13,12 @@ ...@@ -13,11 +13,12 @@
%tbody{ role: 'rowgroup' } %tbody{ role: 'rowgroup' }
- integrations.each do |integration| - integrations.each do |integration|
- activated_label = (integration.activated? ? s_("ProjectService|%{service_title}: status on") : s_("ProjectService|%{service_title}: status off")) % { service_title: integration.title }
%tr{ role: 'row' } %tr{ role: 'row' }
%td{ role: 'cell', 'aria-colindex': 1 } %td{ role: 'cell', 'aria-colindex': 1, 'aria-label': activated_label }
= boolean_to_icon integration.activated? = boolean_to_icon integration.activated?
%td{ role: 'cell', 'aria-colindex': 2 } %td{ role: 'cell', 'aria-colindex': 2 }
= link_to scoped_edit_integration_path(integration) do = link_to scoped_edit_integration_path(integration), { data: { qa_selector: "#{integration.title.downcase.gsub(/[\s\(\)]/,'_')}_link" } } do
%strong= integration.title %strong= integration.title
%td.d-none.d-sm-block{ role: 'cell', 'aria-colindex': 3 } %td.d-none.d-sm-block{ role: 'cell', 'aria-colindex': 3 }
= integration.description = integration.description
......
---
title: Apply shared integrations view to project level
merge_request: 30971
author:
type: changed
...@@ -16107,9 +16107,6 @@ msgstr "" ...@@ -16107,9 +16107,6 @@ msgstr ""
msgid "ProjectService|Comment will be posted on each event" msgid "ProjectService|Comment will be posted on each event"
msgstr "" msgstr ""
msgid "ProjectService|Last edit"
msgstr ""
msgid "ProjectService|Perform common operations on GitLab project: %{project_name}" msgid "ProjectService|Perform common operations on GitLab project: %{project_name}"
msgstr "" msgstr ""
......
...@@ -6,8 +6,8 @@ module QA ...@@ -6,8 +6,8 @@ module QA
module Project module Project
module Settings module Settings
class Integrations < QA::Page::Base class Integrations < QA::Page::Base
view 'app/views/projects/services/_index.html.haml' do view 'app/views/shared/integrations/_integrations.html.haml' do
element :jenkins_ci_link, '{ data: { qa_selector: "#{service.title.downcase.gsub' # rubocop:disable QA/ElementWithPattern element :jenkins_ci_link, '{ data: { qa_selector: "#{integration.title.downcase.gsub' # rubocop:disable QA/ElementWithPattern
end end
def click_jenkins_ci_link def click_jenkins_ci_link
......
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