diff options
16 files changed, 41 insertions, 41 deletions
diff --git a/app/views/projects/services/_form.html.haml b/app/views/projects/services/_form.html.haml index 3c99b4c5e68..e8f3f6575aa 100644 --- a/app/views/projects/services/_form.html.haml +++ b/app/views/projects/services/_form.html.haml @@ -1,15 +1,15 @@ -- if lookup_context.template_exists?('top', "projects/services/#{@service.to_param}", true) - = render "projects/services/#{@service.to_param}/top" +- if lookup_context.template_exists?('top', "projects/services/#{integration.to_param}", true) + = render "projects/services/#{integration.to_param}/top", integration: integration %h3.page-title - = @service.title - - if @service.operating? + = integration.title + - if integration.operating? = sprite_icon('check', css_class: 'gl-text-green-500') -= form_for(@service, as: :service, url: scoped_integration_path(@service), method: :put, html: { class: 'gl-show-field-errors integration-settings-form js-integration-settings-form', data: { 'test-url' => test_project_service_path(@project, @service) } }) do |form| - = render 'shared/service_settings', form: form, integration: @service += form_for(integration, as: :service, url: scoped_integration_path(integration), method: :put, html: { class: 'gl-show-field-errors integration-settings-form js-integration-settings-form', data: { 'test-url' => test_project_service_path(@project, integration) } }) do |form| + = render 'shared/service_settings', form: form, integration: integration %input{ id: 'services_redirect_to', type: 'hidden', name: 'redirect_to', value: request.referrer } -- if lookup_context.template_exists?('show', "projects/services/#{@service.to_param}", true) +- if lookup_context.template_exists?('show', "projects/services/#{integration.to_param}", true) %hr - = render "projects/services/#{@service.to_param}/show" + = render "projects/services/#{integration.to_param}/show", integration: integration diff --git a/app/views/projects/services/edit.html.haml b/app/views/projects/services/edit.html.haml index 1aaea50c8d5..a250daafdbb 100644 --- a/app/views/projects/services/edit.html.haml +++ b/app/views/projects/services/edit.html.haml @@ -1,8 +1,9 @@ -- breadcrumb_title @service.title +- breadcrumb_title @integration.title - add_to_breadcrumbs _('Integration Settings'), project_settings_integrations_path(@project) -- page_title @service.title, _('Integrations') +- page_title @integration.title, _('Integrations') - @content_class = 'limit-container-width' unless fluid_layout -= render 'form' += render 'form', integration: @integration + - if @web_hook_logs - = render partial: 'projects/hook_logs/index', locals: { hook: @service.service_hook, hook_logs: @web_hook_logs, project: @project } + = render partial: 'projects/hook_logs/index', locals: { hook: @integration.service_hook, hook_logs: @web_hook_logs, project: @project } diff --git a/app/views/projects/services/mattermost_slash_commands/_detailed_help.html.haml b/app/views/projects/services/mattermost_slash_commands/_detailed_help.html.haml index fe983961657..9d8ce186232 100644 --- a/app/views/projects/services/mattermost_slash_commands/_detailed_help.html.haml +++ b/app/views/projects/services/mattermost_slash_commands/_detailed_help.html.haml @@ -57,7 +57,7 @@ .form-group = label_tag :request_url, s_('MattermostService|Request URL'), class: 'col-12 col-form-label label-bold' .col-12.input-group - = text_field_tag :request_url, service_trigger_url(subject), class: 'form-control form-control-sm', readonly: 'readonly' + = text_field_tag :request_url, service_trigger_url(integration), class: 'form-control form-control-sm', readonly: 'readonly' .input-group-append = clipboard_button(target: '#request_url', class: 'input-group-text') diff --git a/app/views/projects/services/mattermost_slash_commands/_help.html.haml b/app/views/projects/services/mattermost_slash_commands/_help.html.haml index 4a7757daebc..993df389fb0 100644 --- a/app/views/projects/services/mattermost_slash_commands/_help.html.haml +++ b/app/views/projects/services/mattermost_slash_commands/_help.html.haml @@ -10,8 +10,8 @@ %p.inline = s_("MattermostService|After you configure the integration, view your new Mattermost commands by entering") %kbd.inline /<trigger> help - - if !enabled && @service.project_level? - = render 'projects/services/mattermost_slash_commands/detailed_help', subject: @service + - if !enabled && integration.project_level? + = render 'projects/services/mattermost_slash_commands/detailed_help', integration: integration -- if enabled && @service.project_level? - = render 'projects/services/mattermost_slash_commands/installation_info', subject: @service +- if enabled && integration.project_level? + = render 'projects/services/mattermost_slash_commands/installation_info', integration: integration diff --git a/app/views/projects/services/mattermost_slash_commands/_installation_info.html.haml b/app/views/projects/services/mattermost_slash_commands/_installation_info.html.haml index 53ee363de53..38adc69dd5e 100644 --- a/app/views/projects/services/mattermost_slash_commands/_installation_info.html.haml +++ b/app/views/projects/services/mattermost_slash_commands/_installation_info.html.haml @@ -1,5 +1,5 @@ .services-installation-info - - unless @service.activated? + - unless integration.activated? .row .col-sm-9.offset-sm-3 = link_to new_project_mattermost_path(@project), class: 'btn gl-button btn-lg' do diff --git a/app/views/projects/services/prometheus/_configuration_banner.html.haml b/app/views/projects/services/prometheus/_configuration_banner.html.haml index 3786b845692..dfcadabe6c5 100644 --- a/app/views/projects/services/prometheus/_configuration_banner.html.haml +++ b/app/views/projects/services/prometheus/_configuration_banner.html.haml @@ -1,13 +1,13 @@ %h4 = s_('PrometheusService|Auto configuration') -- if service.manual_configuration? +- if integration.manual_configuration? .info-well = s_('PrometheusService|To enable the installation of Prometheus on your clusters, deactivate the manual configuration.') - else .container-fluid .row - - if service.prometheus_available? + - if integration.prometheus_available? .col-sm-2 .svg-container = image_tag 'illustrations/monitoring/getting_started.svg' diff --git a/app/views/projects/services/prometheus/_custom_metrics.html.haml b/app/views/projects/services/prometheus/_custom_metrics.html.haml index a901d5b3575..724950bcb39 100644 --- a/app/views/projects/services/prometheus/_custom_metrics.html.haml +++ b/app/views/projects/services/prometheus/_custom_metrics.html.haml @@ -6,7 +6,7 @@ = link_to s_('PrometheusService|More information'), help_page_path('operations/metrics/index.md', anchor: 'adding-custom-metrics'), target: '_blank', rel: "noopener noreferrer" .col-lg-9 - .card.custom-monitored-metrics.js-panel-custom-monitored-metrics{ data: { qa_selector: 'custom_metrics_container', active_custom_metrics: project_prometheus_metrics_path(project), environments_data: environments_list_data, service_active: "#{@service.active}" } } + .card.custom-monitored-metrics.js-panel-custom-monitored-metrics{ data: { qa_selector: 'custom_metrics_container', active_custom_metrics: project_prometheus_metrics_path(project), environments_data: environments_list_data, service_active: "#{integration.active}" } } .card-header %strong = s_('PrometheusService|Custom metrics') diff --git a/app/views/projects/services/prometheus/_external_alerts.html.haml b/app/views/projects/services/prometheus/_external_alerts.html.haml index b27b1ab8723..168b4853a9a 100644 --- a/app/views/projects/services/prometheus/_external_alerts.html.haml +++ b/app/views/projects/services/prometheus/_external_alerts.html.haml @@ -1,5 +1,5 @@ - return unless can?(current_user, :read_prometheus_alerts, @project) -- return unless @service.manual_configuration? +- return unless integration.manual_configuration? - notify_url = notify_project_prometheus_alerts_url(@project, format: :json) - authorization_key = @project.alerting_setting.try(:token) diff --git a/app/views/projects/services/prometheus/_help.html.haml b/app/views/projects/services/prometheus/_help.html.haml index 04bd800c47a..9b3cb8893c4 100644 --- a/app/views/projects/services/prometheus/_help.html.haml +++ b/app/views/projects/services/prometheus/_help.html.haml @@ -1,5 +1,5 @@ - if @project - = render 'projects/services/prometheus/configuration_banner', project: @project, service: @service + = render 'projects/services/prometheus/configuration_banner', project: @project, integration: integration %h4.gl-mb-3 = s_('PrometheusService|Manual configuration') diff --git a/app/views/projects/services/prometheus/_metrics.html.haml b/app/views/projects/services/prometheus/_metrics.html.haml index 4bafd4d06e0..09fe77b8a9c 100644 --- a/app/views/projects/services/prometheus/_metrics.html.haml +++ b/app/views/projects/services/prometheus/_metrics.html.haml @@ -1,6 +1,6 @@ - project = local_assigns.fetch(:project) -= render 'projects/services/prometheus/custom_metrics', project: project += render 'projects/services/prometheus/custom_metrics', project: project, integration: integration .col-lg-3 %p diff --git a/app/views/projects/services/prometheus/_show.html.haml b/app/views/projects/services/prometheus/_show.html.haml index 9ce61ed5c13..3350ac8a6c5 100644 --- a/app/views/projects/services/prometheus/_show.html.haml +++ b/app/views/projects/services/prometheus/_show.html.haml @@ -4,6 +4,6 @@ = s_('PrometheusService|Metrics') .row.gl-mb-3.prometheus-metrics-monitoring.js-prometheus-metrics-monitoring - = render 'projects/services/prometheus/metrics', project: @project + = render 'projects/services/prometheus/metrics', project: @project, integration: integration -= render 'projects/services/prometheus/external_alerts', project: @project += render 'projects/services/prometheus/external_alerts', project: @project, integration: integration diff --git a/app/views/projects/services/prometheus/_top.html.haml b/app/views/projects/services/prometheus/_top.html.haml index db02ea85865..f7446273a80 100644 --- a/app/views/projects/services/prometheus/_top.html.haml +++ b/app/views/projects/services/prometheus/_top.html.haml @@ -1,4 +1,4 @@ -- return unless @service.manual_configuration? +- return unless integration.manual_configuration? .row .col-lg-12 diff --git a/app/views/projects/services/slack_slash_commands/_help.html.haml b/app/views/projects/services/slack_slash_commands/_help.html.haml index b68addcb093..9702f9b08f2 100644 --- a/app/views/projects/services/slack_slash_commands/_help.html.haml +++ b/app/views/projects/services/slack_slash_commands/_help.html.haml @@ -11,7 +11,7 @@ %p.inline = s_("SlackService|See list of available commands in Slack after setting up this service, by entering") %kbd.inline /<command> help - - if @service.project_level? + - if integration.project_level? %p= _("To set up this service:") %ul.list-unstyled.indent-list %li @@ -39,7 +39,7 @@ .form-group = label_tag :url, 'URL', class: 'col-12 col-form-label label-bold' .col-12.input-group - = text_field_tag :url, service_trigger_url(subject), class: 'form-control form-control-sm', readonly: 'readonly' + = text_field_tag :url, service_trigger_url(integration), class: 'form-control form-control-sm', readonly: 'readonly' .input-group-append = clipboard_button(target: '#url', class: 'input-group-text') diff --git a/app/views/shared/_service_settings.html.haml b/app/views/shared/_service_settings.html.haml index 7af356c0820..c70fce7a38f 100644 --- a/app/views/shared/_service_settings.html.haml +++ b/app/views/shared/_service_settings.html.haml @@ -7,7 +7,7 @@ .js-integration-help-html.gl-display-none -# All content below will be repositioned in Vue - if lookup_context.template_exists?('help', "projects/services/#{integration.to_param}", true) - = render "projects/services/#{integration.to_param}/help", subject: integration + = render "projects/services/#{integration.to_param}/help", integration: integration - elsif integration.help.present? .info-well .well-segment diff --git a/spec/views/projects/services/_form.haml_spec.rb b/spec/views/projects/services/_form.haml_spec.rb index 5c48b17848e..8dd8bd98388 100644 --- a/spec/views/projects/services/_form.haml_spec.rb +++ b/spec/views/projects/services/_form.haml_spec.rb @@ -11,17 +11,16 @@ RSpec.describe 'projects/services/_form' do allow(controller).to receive(:current_user).and_return(user) - allow(view).to receive_messages(current_user: user, - can?: true, - current_application_settings: Gitlab::CurrentSettings.current_application_settings, - request: double(referrer: '/services')) + allow(view).to receive_messages( + current_user: user, + can?: true, + current_application_settings: Gitlab::CurrentSettings.current_application_settings, + integration: project.redmine_service, + request: double(referrer: '/services') + ) end context 'commit_events and merge_request_events' do - before do - assign(:service, project.redmine_service) - end - it 'display merge_request_events and commit_events descriptions' do allow(Integrations::Redmine).to receive(:supported_events).and_return(%w(commit merge_request)) diff --git a/spec/views/projects/services/edit.html.haml_spec.rb b/spec/views/projects/services/edit.html.haml_spec.rb index 785af6a5344..8ac0a3363be 100644 --- a/spec/views/projects/services/edit.html.haml_spec.rb +++ b/spec/views/projects/services/edit.html.haml_spec.rb @@ -3,12 +3,12 @@ require 'spec_helper' RSpec.describe 'projects/services/edit' do - let(:service) { create(:drone_ci_service, project: project) } + let(:integration) { create(:drone_ci_service, project: project) } let(:project) { create(:project) } before do assign :project, project - assign :service, service + assign :integration, integration end it do @@ -17,7 +17,7 @@ RSpec.describe 'projects/services/edit' do expect(rendered).not_to have_text('Recent Deliveries') end - context 'service using WebHooks' do + context 'integration using WebHooks' do before do assign(:web_hook_logs, []) end |