Commit 8de40345 authored by Luke Duncalfe's avatar Luke Duncalfe

Confluence nav links to new landing page

The Confluence nav item now links to a landing page for the user.

https://gitlab.com/gitlab-org/gitlab/-/issues/220934
parent 55541a90
# 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 @@
= render 'layouts/nav/sidebar/analytics_links', links: project_analytics_navbar_links(@project, current_user)
- if project_nav_tab?(:confluence)
- confluence_url = @project.confluence_service.confluence_url
- confluence_url = project_wikis_confluence_path(@project)
= nav_link do
= link_to confluence_url, class: 'shortcuts-confluence' do
.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
get :new
get '/', to: redirect { |params, request| "#{request.path}/home" }
post '/', to: 'wikis#create'
scope '-' do
resource :confluence, only: :show
end
end
scope(path: 'wikis/*id', as: :wiki, format: false) do
......
......@@ -26420,12 +26420,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."
msgstr ""
msgid "WikiEmpty|Confluence is enabled"
msgstr ""
msgid "WikiEmpty|Create your first page"
msgstr ""
msgid "WikiEmpty|Enable the Confluence Wiki integration"
msgstr ""
msgid "WikiEmpty|Go to Confluence"
msgstr ""
msgid "WikiEmpty|Suggest wiki improvement"
msgstr ""
......@@ -26447,6 +26453,9 @@ msgstr ""
msgid "WikiEmpty|You must be a project member in order to add wiki pages."
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."
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
let(:active) { true }
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
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