Commit f670c1ee authored by Alex Kalderimis's avatar Alex Kalderimis

Rename Project#confluence_service to confluence_integration

This renames references to the `confluence_service` attribute to
`confluence_integration`.
parent 43697d06
...@@ -7,9 +7,8 @@ module Types ...@@ -7,9 +7,8 @@ module Types
::Integration.available_services_types(include_dev: false).each do |service_type| ::Integration.available_services_types(include_dev: false).each do |service_type|
replacement = Integration.integration_type_for_service_type(service_type) replacement = Integration.integration_type_for_service_type(service_type)
deprecation = { reason: :renamed, replacement: replacement, milestone: '14.0' } if replacement.present?
value service_type.underscore.upcase, value: service_type, description: "#{service_type} type", deprecation: deprecation value service_type.underscore.upcase, value: service_type, description: "#{service_type} type"
end end
::Integration.available_integration_types(include_dev: false).each do |type| ::Integration.available_integration_types(include_dev: false).each do |type|
......
...@@ -42,7 +42,7 @@ class Integration < ApplicationRecord ...@@ -42,7 +42,7 @@ class Integration < ApplicationRecord
RENAMED_TO_INTEGRATION = %w[ RENAMED_TO_INTEGRATION = %w[
asana assembla asana assembla
bamboo bugzilla buildkite bamboo bugzilla buildkite
campfire campfire confluence
].to_set.freeze ].to_set.freeze
serialize :properties, JSON # rubocop:disable Cop/ActiveRecordSerialize serialize :properties, JSON # rubocop:disable Cop/ActiveRecordSerialize
......
...@@ -161,7 +161,7 @@ class Project < ApplicationRecord ...@@ -161,7 +161,7 @@ class Project < ApplicationRecord
has_one :bugzilla_integration, class_name: 'Integrations::Bugzilla' has_one :bugzilla_integration, class_name: 'Integrations::Bugzilla'
has_one :buildkite_integration, class_name: 'Integrations::Buildkite' has_one :buildkite_integration, class_name: 'Integrations::Buildkite'
has_one :campfire_integration, class_name: 'Integrations::Campfire' has_one :campfire_integration, class_name: 'Integrations::Campfire'
has_one :confluence_service, class_name: 'Integrations::Confluence' has_one :confluence_integration, class_name: 'Integrations::Confluence'
has_one :custom_issue_tracker_service, class_name: 'Integrations::CustomIssueTracker' has_one :custom_issue_tracker_service, class_name: 'Integrations::CustomIssueTracker'
has_one :datadog_service, class_name: 'Integrations::Datadog' has_one :datadog_service, class_name: 'Integrations::Datadog'
has_one :discord_service, class_name: 'Integrations::Discord' has_one :discord_service, class_name: 'Integrations::Discord'
......
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
- wiki_confluence_epic_link_url = 'https://gitlab.com/groups/gitlab-org/-/epics/3629' - wiki_confluence_epic_link_url = 'https://gitlab.com/groups/gitlab-org/-/epics/3629'
- wiki_confluence_epic_link_start = '<a href="%{url}" target="_blank" rel="noopener noreferrer">'.html_safe % { url: wiki_confluence_epic_link_url } - wiki_confluence_epic_link_start = '<a href="%{url}" target="_blank" rel="noopener noreferrer">'.html_safe % { url: wiki_confluence_epic_link_url }
= s_("WikiEmpty|You've enabled the Confluence Workspace integration. Your wiki will be viewable directly within Confluence. We are hard at work integrating Confluence more seamlessly into GitLab. If you'd like to stay up to date, follow our %{wiki_confluence_epic_link_start}Confluence epic%{wiki_confluence_epic_link_end}.").html_safe % { wiki_confluence_epic_link_start: wiki_confluence_epic_link_start, wiki_confluence_epic_link_end: '</a>'.html_safe } = s_("WikiEmpty|You've enabled the Confluence Workspace integration. Your wiki will be viewable directly within Confluence. We are hard at work integrating Confluence more seamlessly into GitLab. If you'd like to stay up to date, follow our %{wiki_confluence_epic_link_start}Confluence epic%{wiki_confluence_epic_link_end}.").html_safe % { wiki_confluence_epic_link_start: wiki_confluence_epic_link_start, wiki_confluence_epic_link_end: '</a>'.html_safe }
= link_to @project.confluence_service.confluence_url, target: '_blank', rel: 'noopener noreferrer', class: 'gl-button btn btn-success external-url', title: s_('WikiEmpty|Go to Confluence') do = link_to @project.confluence_integration.confluence_url, target: '_blank', rel: 'noopener noreferrer', class: 'gl-button btn btn-success external-url', title: s_('WikiEmpty|Go to Confluence') do
= sprite_icon('external-link') = sprite_icon('external-link')
= s_('WikiEmpty|Go to Confluence') = s_('WikiEmpty|Go to Confluence')
...@@ -14852,12 +14852,18 @@ State of a Sentry error. ...@@ -14852,12 +14852,18 @@ State of a Sentry error.
| Value | Description | | Value | Description |
| ----- | ----------- | | ----- | ----------- |
| <a id="servicetypeasana_integration"></a>`ASANA_INTEGRATION` | AsanaIntegration integration. |
| <a id="servicetypeasana_service"></a>`ASANA_SERVICE` | AsanaService type. | | <a id="servicetypeasana_service"></a>`ASANA_SERVICE` | AsanaService type. |
| <a id="servicetypeassembla_integration"></a>`ASSEMBLA_INTEGRATION` | AssemblaIntegration integration. |
| <a id="servicetypeassembla_service"></a>`ASSEMBLA_SERVICE` | AssemblaService type. | | <a id="servicetypeassembla_service"></a>`ASSEMBLA_SERVICE` | AssemblaService type. |
| <a id="servicetypebamboo_integration"></a>`BAMBOO_INTEGRATION` | BambooIntegration integration. |
| <a id="servicetypebamboo_service"></a>`BAMBOO_SERVICE` | BambooService type. | | <a id="servicetypebamboo_service"></a>`BAMBOO_SERVICE` | BambooService type. |
| <a id="servicetypebugzilla_integration"></a>`BUGZILLA_INTEGRATION` | BugzillaIntegration integration. |
| <a id="servicetypebugzilla_service"></a>`BUGZILLA_SERVICE` | BugzillaService type. | | <a id="servicetypebugzilla_service"></a>`BUGZILLA_SERVICE` | BugzillaService type. |
| <a id="servicetypebuildkite_service"></a>`BUILDKITE_SERVICE` | BuildkiteService type. | | <a id="servicetypebuildkite_service"></a>`BUILDKITE_SERVICE` | BuildkiteService type. |
| <a id="servicetypecampfire_integration"></a>`CAMPFIRE_INTEGRATION` | CampfireIntegration integration. |
| <a id="servicetypecampfire_service"></a>`CAMPFIRE_SERVICE` | CampfireService type. | | <a id="servicetypecampfire_service"></a>`CAMPFIRE_SERVICE` | CampfireService type. |
| <a id="servicetypeconfluence_integration"></a>`CONFLUENCE_INTEGRATION` | ConfluenceIntegration integration. |
| <a id="servicetypeconfluence_service"></a>`CONFLUENCE_SERVICE` | ConfluenceService type. | | <a id="servicetypeconfluence_service"></a>`CONFLUENCE_SERVICE` | ConfluenceService type. |
| <a id="servicetypecustom_issue_tracker_service"></a>`CUSTOM_ISSUE_TRACKER_SERVICE` | CustomIssueTrackerService type. | | <a id="servicetypecustom_issue_tracker_service"></a>`CUSTOM_ISSUE_TRACKER_SERVICE` | CustomIssueTrackerService type. |
| <a id="servicetypedatadog_service"></a>`DATADOG_SERVICE` | DatadogService type. | | <a id="servicetypedatadog_service"></a>`DATADOG_SERVICE` | DatadogService type. |
......
...@@ -79,7 +79,7 @@ FactoryBot.define do ...@@ -79,7 +79,7 @@ FactoryBot.define do
end end
end end
factory :confluence_service, class: 'Integrations::Confluence' do factory :confluence_integration, class: 'Integrations::Confluence' do
project project
active { true } active { true }
confluence_url { 'https://example.atlassian.net/wiki' } confluence_url { 'https://example.atlassian.net/wiki' }
......
...@@ -12,7 +12,7 @@ RSpec.describe 'User views the Confluence page' do ...@@ -12,7 +12,7 @@ RSpec.describe 'User views the Confluence page' do
end end
it 'shows the page when the Confluence integration is enabled' do it 'shows the page when the Confluence integration is enabled' do
service = create(:confluence_service, project: project) service = create(:confluence_integration, project: project)
visit project_wikis_confluence_path(project) visit project_wikis_confluence_path(project)
......
...@@ -75,7 +75,7 @@ RSpec.describe 'Project > User views empty wiki' do ...@@ -75,7 +75,7 @@ RSpec.describe 'Project > User views empty wiki' do
context 'and Confluence is already enabled' do context 'and Confluence is already enabled' do
before do before do
create(:confluence_service, project: project) create(:confluence_integration, project: project)
end end
it_behaves_like 'empty wiki message', writable: true, issuable: true, confluence: false it_behaves_like 'empty wiki message', writable: true, issuable: true, confluence: false
......
...@@ -363,7 +363,7 @@ project: ...@@ -363,7 +363,7 @@ project:
- last_event - last_event
- integrations - integrations
- campfire_integration - campfire_integration
- confluence_service - confluence_integration
- datadog_service - datadog_service
- discord_service - discord_service
- drone_ci_service - drone_ci_service
......
...@@ -18,7 +18,7 @@ RSpec.describe Sidebars::Projects::Menus::ConfluenceMenu do ...@@ -18,7 +18,7 @@ RSpec.describe Sidebars::Projects::Menus::ConfluenceMenu do
end end
context 'when Confluence integration is present' do context 'when Confluence integration is present' do
let!(:confluence) { create(:confluence_service, project: project, active: active) } let!(:confluence) { create(:confluence_integration, project: project, active: active) }
context 'when integration is disabled' do context 'when integration is disabled' do
let(:active) { false } let(:active) { false }
......
...@@ -16,7 +16,7 @@ RSpec.describe Sidebars::Projects::Panel do ...@@ -16,7 +16,7 @@ RSpec.describe Sidebars::Projects::Panel do
subject { described_class.new(context).instance_variable_get(:@menus) } subject { described_class.new(context).instance_variable_get(:@menus) }
context 'when integration is present and active' do context 'when integration is present and active' do
let_it_be(:confluence) { create(:confluence_service, active: true) } let_it_be(:confluence) { create(:confluence_integration, active: true) }
let(:project) { confluence.project } let(:project) { confluence.project }
......
...@@ -72,19 +72,19 @@ RSpec.describe Integrations::Confluence do ...@@ -72,19 +72,19 @@ RSpec.describe Integrations::Confluence do
subject { project.project_setting.has_confluence? } subject { project.project_setting.has_confluence? }
it 'sets the property to true when service is active' do it 'sets the property to true when service is active' do
create(:confluence_service, project: project, active: true) create(:confluence_integration, project: project, active: true)
is_expected.to be(true) is_expected.to be(true)
end end
it 'sets the property to false when service is not active' do it 'sets the property to false when service is not active' do
create(:confluence_service, project: project, active: false) create(:confluence_integration, project: project, active: false)
is_expected.to be(false) is_expected.to be(false)
end end
it 'creates a project_setting record if one was not already created' do it 'creates a project_setting record if one was not already created' do
expect { create(:confluence_service) }.to change { ProjectSetting.count }.by(1) expect { create(:confluence_integration) }.to change(ProjectSetting, :count).by(1)
end end
end end
end end
...@@ -67,7 +67,7 @@ RSpec.describe Project, factory_default: :keep do ...@@ -67,7 +67,7 @@ RSpec.describe Project, factory_default: :keep do
it { is_expected.to have_one(:bugzilla_integration) } it { is_expected.to have_one(:bugzilla_integration) }
it { is_expected.to have_one(:ewm_service) } it { is_expected.to have_one(:ewm_service) }
it { is_expected.to have_one(:external_wiki_service) } it { is_expected.to have_one(:external_wiki_service) }
it { is_expected.to have_one(:confluence_service) } it { is_expected.to have_one(:confluence_integration) }
it { is_expected.to have_one(:project_feature) } it { is_expected.to have_one(:project_feature) }
it { is_expected.to have_one(:project_repository) } it { is_expected.to have_one(:project_repository) }
it { is_expected.to have_one(:container_expiration_policy) } it { is_expected.to have_one(:container_expiration_policy) }
......
...@@ -1005,7 +1005,7 @@ RSpec.describe 'layouts/nav/sidebar/_project' do ...@@ -1005,7 +1005,7 @@ RSpec.describe 'layouts/nav/sidebar/_project' do
end end
describe 'Confluence' do describe 'Confluence' do
let!(:service) { create(:confluence_service, project: project, active: active) } let!(:service) { create(:confluence_integration, project: project, active: active) }
before do before do
render render
......
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