Commit 16c2ad5b authored by Natalia Tepluhina's avatar Natalia Tepluhina

Merge branch '33557-make-pages-settings-e-g-enablement-access-control-more-visible' into 'master'

Resolve "Make pages settings (e.g. enablement access-control) more visible."

See merge request gitlab-org/gitlab!19067
parents 82e2256d 68ce3e65
......@@ -13,5 +13,11 @@
- @project.pages_domains.each do |domain|
%p
= external_link(domain.url, domain.url)
- unless @project.public_pages?
.card-footer.alert-warning
- help_page = help_page_path('/user/project/pages/pages_access_control')
- link_start = '<a href="%{url}" target="_blank" class="alert-link" rel="noopener noreferrer">'.html_safe % { url: help_page }
- link_end = '</a>'.html_safe
= s_('GitLabPages|Access Control is enabled for this Pages website; only authorized users will be able to access it. To make your website publicly available, navigate to your project\'s %{strong_start}Settings > General > Visibility%{strong_end} and select %{strong_start}Everyone%{strong_end} in pages section. Read the %{link_start}documentation%{link_end} for more information.').html_safe % { link_start: link_start, link_end: link_end, strong_start: '<strong>'.html_safe, strong_end: '</strong>'.html_safe }
.card-footer.alert-primary
= s_('GitLabPages|It may take up to 30 minutes before the site is available after the first deployment.')
- page_title 'Pages'
%h3.page-title.with-button
= s_('GitLabPages|Pages')
- if @project.pages_enabled?
%h3.page-title.with-button
= s_('GitLabPages|Pages')
- if can?(current_user, :update_pages, @project) && (Gitlab.config.pages.external_http || Gitlab.config.pages.external_https)
= link_to new_project_pages_domain_path(@project), class: 'btn btn-success float-right', title: s_('GitLabPages|New Domain') do
= s_('GitLabPages|New Domain')
- if can?(current_user, :update_pages, @project) && (Gitlab.config.pages.external_http || Gitlab.config.pages.external_https)
= link_to new_project_pages_domain_path(@project), class: 'btn btn-success float-right', title: s_('GitLabPages|New Domain') do
= s_('GitLabPages|New Domain')
%p.light
= s_('GitLabPages|With GitLab Pages you can host your static websites on GitLab. Combined with the power of GitLab CI and the help of GitLab Runner you can deploy static pages for your individual projects, your user or your group.')
- if Gitlab.config.pages.external_https
= render 'https_only'
%p.light
= s_('GitLabPages|With GitLab Pages you can host your static websites on GitLab. Combined with the power of GitLab CI and the help of GitLab Runner you can deploy static pages for your individual projects, your user or your group.')
- if Gitlab.config.pages.external_https
= render 'https_only'
%hr.clearfix
%hr.clearfix
= render 'access'
= render 'use'
- if Gitlab.config.pages.external_http || Gitlab.config.pages.external_https
= render 'list'
= render 'access'
= render 'use'
- if Gitlab.config.pages.external_http || Gitlab.config.pages.external_https
= render 'list'
- else
= render 'no_domains'
= render 'destroy'
- else
= render 'no_domains'
= render 'destroy'
.bs-callout.bs-callout-warning
= s_('GitLabPages|GitLab Pages are disabled for this project. You can enable them on your project\'s %{strong_start}Settings > General > Visibility%{strong_end} page.').html_safe % { strong_start: '<strong>'.html_safe, strong_end: '</strong>'.html_safe }
---
title: Add warnings about pages access control settings
merge_request: 19067
author:
type: added
......@@ -8163,6 +8163,9 @@ msgstr ""
msgid "GitLabPages|%{domain} is not verified. To learn how to verify ownership, visit your %{link_start}domain details%{link_end}."
msgstr ""
msgid "GitLabPages|Access Control is enabled for this Pages website; only authorized users will be able to access it. To make your website publicly available, navigate to your project's %{strong_start}Settings > General > Visibility%{strong_end} and select %{strong_start}Everyone%{strong_end} in pages section. Read the %{link_start}documentation%{link_end} for more information."
msgstr ""
msgid "GitLabPages|Access pages"
msgstr ""
......@@ -8187,6 +8190,9 @@ msgstr ""
msgid "GitLabPages|Force HTTPS (requires valid certificates)"
msgstr ""
msgid "GitLabPages|GitLab Pages are disabled for this project. You can enable them on your project's %{strong_start}Settings > General > Visibility%{strong_end} page."
msgstr ""
msgid "GitLabPages|It may take up to 30 minutes before the site is available after the first deployment."
msgstr ""
......
......@@ -30,12 +30,52 @@ shared_examples 'pages settings editing' do
expect(page).to have_content('Access pages')
end
context 'when pages are disabled in the project settings' do
it 'renders disabled warning' do
project.project_feature.update!(pages_access_level: ProjectFeature::DISABLED)
visit project_pages_path(project)
expect(page).to have_content('GitLab Pages are disabled for this project')
end
end
it 'renders first deployment warning' do
visit project_pages_path(project)
expect(page).to have_content('It may take up to 30 minutes before the site is available after the first deployment.')
end
shared_examples 'does not render access control warning' do
it 'does not render access control warning' do
visit project_pages_path(project)
expect(page).not_to have_content('Access Control is enabled for this Pages website')
end
end
include_examples 'does not render access control warning'
context 'when access control is enabled in gitlab settings' do
before do
stub_pages_setting(access_control: true)
end
it 'renders access control warning' do
visit project_pages_path(project)
expect(page).to have_content('Access Control is enabled for this Pages website')
end
context 'when pages are public' do
before do
project.project_feature.update!(pages_access_level: ProjectFeature::PUBLIC)
end
include_examples 'does not render access control warning'
end
end
context 'when support for external domains is disabled' do
it 'renders message that support is disabled' do
visit project_pages_path(project)
......
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