Commit f9a17865 authored by Ezekiel Kigbo's avatar Ezekiel Kigbo

Merge branch '220934-confluence-wiki-confluence-landing-page' into 'master'

Confluence nav item links to landing page

See merge request gitlab-org/gitlab!36523
parents daff3f8c 8de40345
# frozen_string_literal: true
class Projects::ConfluencesController < Projects::ApplicationController
before_action :ensure_confluence
def show
end
private
def ensure_confluence
render_404 unless project.has_confluence?
end
end
...@@ -294,7 +294,7 @@ ...@@ -294,7 +294,7 @@
= render 'layouts/nav/sidebar/analytics_links', links: project_analytics_navbar_links(@project, current_user) = render 'layouts/nav/sidebar/analytics_links', links: project_analytics_navbar_links(@project, current_user)
- if project_nav_tab?(:confluence) - if project_nav_tab?(:confluence)
- confluence_url = @project.confluence_service.confluence_url - confluence_url = project_wikis_confluence_path(@project)
= nav_link do = nav_link do
= link_to confluence_url, class: 'shortcuts-confluence' do = link_to confluence_url, class: 'shortcuts-confluence' do
.nav-icon-container .nav-icon-container
......
- breadcrumb_title _('Confluence')
- page_title _('Confluence')
= render layout: 'shared/empty_states/wikis_layout', locals: { image_path: 'illustrations/wiki_login_empty.svg' } do
%h4
= s_('WikiEmpty|Confluence is enabled')
%p
- 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 }
= 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: 'btn btn-success external-url', title: s_('WikiEmpty|Go to Confluence') do
= sprite_icon('external-link')
= s_('WikiEmpty|Go to Confluence')
...@@ -5,6 +5,9 @@ scope(controller: :wikis) do ...@@ -5,6 +5,9 @@ scope(controller: :wikis) do
get :new get :new
get '/', to: redirect { |params, request| "#{request.path}/home" } get '/', to: redirect { |params, request| "#{request.path}/home" }
post '/', to: 'wikis#create' post '/', to: 'wikis#create'
scope '-' do
resource :confluence, only: :show
end
end end
scope(path: 'wikis/*id', as: :wiki, format: false) do scope(path: 'wikis/*id', as: :wiki, format: false) do
......
...@@ -26435,12 +26435,18 @@ msgstr "" ...@@ -26435,12 +26435,18 @@ msgstr ""
msgid "WikiEmpty|A wiki is where you can store all the details about your project. This can include why you've created it, its principles, how to use it, and so on." msgid "WikiEmpty|A wiki is where you can store all the details about your project. This can include why you've created it, its principles, how to use it, and so on."
msgstr "" msgstr ""
msgid "WikiEmpty|Confluence is enabled"
msgstr ""
msgid "WikiEmpty|Create your first page" msgid "WikiEmpty|Create your first page"
msgstr "" msgstr ""
msgid "WikiEmpty|Enable the Confluence Wiki integration" msgid "WikiEmpty|Enable the Confluence Wiki integration"
msgstr "" msgstr ""
msgid "WikiEmpty|Go to Confluence"
msgstr ""
msgid "WikiEmpty|Suggest wiki improvement" msgid "WikiEmpty|Suggest wiki improvement"
msgstr "" msgstr ""
...@@ -26462,6 +26468,9 @@ msgstr "" ...@@ -26462,6 +26468,9 @@ msgstr ""
msgid "WikiEmpty|You must be a project member in order to add wiki pages." msgid "WikiEmpty|You must be a project member in order to add wiki pages."
msgstr "" msgstr ""
msgid "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}."
msgstr ""
msgid "WikiHistoricalPage|This is an old version of this page." msgid "WikiHistoricalPage|This is an old version of this page."
msgstr "" msgstr ""
......
# frozen_string_literal: true
require 'spec_helper'
RSpec.describe 'User views the Confluence page' do
let_it_be(:user) { create(:user) }
let(:project) { create(:project, :public) }
before do
sign_in(user)
end
it 'shows the page when the Confluence integration is enabled' do
service = create(:confluence_service, project: project)
visit project_wikis_confluence_path(project)
element = page.find('.row.empty-state')
expect(element).to have_link('Go to Confluence', href: service.confluence_url)
end
it 'does not show the page when the Confluence integration disabled' do
visit project_wikis_confluence_path(project)
expect(page).to have_gitlab_http_status(:not_found)
end
end
...@@ -120,7 +120,7 @@ RSpec.describe 'layouts/nav/sidebar/_project' do ...@@ -120,7 +120,7 @@ RSpec.describe 'layouts/nav/sidebar/_project' do
let(:active) { true } let(:active) { true }
it 'shows the Confluence tab' do it 'shows the Confluence tab' do
expect(rendered).to have_link('Confluence', href: service.confluence_url) expect(rendered).to have_link('Confluence', href: project_wikis_confluence_path(project))
end end
it 'does not show the GitLab wiki tab' do it 'does not show the GitLab wiki tab' do
......
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