Skip to content
Snippets Groups Projects
Commit 0b0d6a03 authored by Stanislav Lashmanov's avatar Stanislav Lashmanov Committed by Frédéric Caplette
Browse files

Add Members page link to Project settings

Changelog: added
parent 6c094f95
No related branches found
No related tags found
1 merge request!91700Add Members page link to Project settings
......@@ -182,6 +182,10 @@ export default {
required: false,
default: false,
},
membersPagePath: {
type: String,
required: true,
},
},
data() {
const defaults = {
......@@ -521,12 +525,22 @@ export default {
/>
</div>
</div>
<span v-if="!visibilityAllowed(visibilityLevel)" class="form-text text-muted">{{
s__(
'ProjectSettings|Visibility options for this fork are limited by the current visibility of the source project.',
)
}}</span>
<span class="form-text text-muted">{{ visibilityLevelDescription }}</span>
<span
v-if="!visibilityAllowed(visibilityLevel)"
class="gl-display-block gl-text-gray-500 gl-mt-2"
>{{
s__(
'ProjectSettings|Visibility options for this fork are limited by the current visibility of the source project.',
)
}}</span
>
<span class="gl-display-block gl-text-gray-500 gl-mt-2">
<gl-sprintf :message="visibilityLevelDescription">
<template #membersPageLink="{ content }">
<gl-link class="gl-link" :href="membersPagePath">{{ content }}</gl-link>
</template>
</gl-sprintf>
</span>
<div v-if="showAdditonalSettings" class="gl-mt-4">
<strong class="gl-display-block">{{ s__('ProjectSettings|Additional options') }}</strong>
<label
......
......@@ -8,12 +8,10 @@ export const visibilityOptions = {
export const visibilityLevelDescriptions = {
[visibilityOptions.PRIVATE]: __(
'The project is accessible only by members of the project. Access must be granted explicitly to each user.',
),
[visibilityOptions.INTERNAL]: __('The project can be accessed by any user who is logged in.'),
[visibilityOptions.PUBLIC]: __(
'The project can be accessed by anyone, regardless of authentication.',
`Only accessible by %{membersPageLinkStart}project members%{membersPageLinkEnd}. Membership must be explicitly granted to each user.`,
),
[visibilityOptions.INTERNAL]: __('Accessible by any user who is logged in.'),
[visibilityOptions.PUBLIC]: __('Accessible by anyone, regardless of authentication.'),
};
export const featureAccessLevel = {
......
......@@ -388,7 +388,8 @@ def project_permissions_panel_data(project)
pagesAccessControlEnabled: Gitlab.config.pages.access_control,
pagesAccessControlForced: ::Gitlab::Pages.access_control_is_forced?,
pagesHelpPath: help_page_path('user/project/pages/introduction', anchor: 'gitlab-pages-access-control'),
issuesHelpPath: help_page_path('user/project/issues/index')
issuesHelpPath: help_page_path('user/project/issues/index'),
membersPagePath: project_project_members_path(project)
}
end
......
......@@ -1979,6 +1979,12 @@ msgstr ""
msgid "AccessibilityReport|The accessibility scanning found an error of the following type: %{code}"
msgstr ""
 
msgid "Accessible by any user who is logged in."
msgstr ""
msgid "Accessible by anyone, regardless of authentication."
msgstr ""
msgid "Account"
msgstr ""
 
......@@ -27093,6 +27099,9 @@ msgstr ""
msgid "Only Task can be assigned as a child in hierarchy."
msgstr ""
 
msgid "Only accessible by %{membersPageLinkStart}project members%{membersPageLinkEnd}. Membership must be explicitly granted to each user."
msgstr ""
msgid "Only active projects show up in the search and on the dashboard."
msgstr ""
 
......@@ -38859,21 +38868,12 @@ msgstr ""
msgid "The project can be accessed by any logged in user except external users."
msgstr ""
 
msgid "The project can be accessed by any user who is logged in."
msgstr ""
msgid "The project can be accessed by anyone, regardless of authentication."
msgstr ""
msgid "The project can be accessed without any authentication."
msgstr ""
 
msgid "The project has already been added to your dashboard."
msgstr ""
 
msgid "The project is accessible only by members of the project. Access must be granted explicitly to each user."
msgstr ""
msgid "The project is still being deleted. Please try again later."
msgstr ""
 
......@@ -16,7 +16,7 @@
visibility_select_container = find('.project-visibility-setting')
expect(visibility_select_container.find('select').value).to eq project.visibility_level.to_s
expect(visibility_select_container).to have_content 'The project can be accessed by anyone, regardless of authentication.'
expect(visibility_select_container).to have_content 'Accessible by anyone, regardless of authentication.'
end
it 'project visibility description updates on change' do
......@@ -25,7 +25,7 @@
visibility_select.select('Private')
expect(visibility_select.value).to eq '0'
expect(visibility_select_container).to have_content 'Access must be granted explicitly to each user.'
expect(visibility_select_container).to have_content 'Only accessible by project members. Membership must be explicitly granted to each user.'
end
context 'merge requests select' do
......@@ -86,7 +86,7 @@
visibility_select_container = find('.project-visibility-setting')
expect(visibility_select_container).to have_selector 'select[name="project[visibility_level]"]:disabled'
expect(visibility_select_container).to have_content 'The project can be accessed by anyone, regardless of authentication.'
expect(visibility_select_container).to have_content 'Accessible by anyone, regardless of authentication.'
end
context 'disable email notifications' do
......
......@@ -51,6 +51,7 @@ const defaultProps = {
requestCveAvailable: true,
confirmationPhrase: 'my-fake-project',
showVisibilityConfirmModal: false,
membersPagePath: '/my-fake-project/-/project_members',
};
const FEATURE_ACCESS_LEVEL_ANONYMOUS = 30;
......@@ -59,7 +60,7 @@ describe('Settings Panel', () => {
let wrapper;
const mountComponent = (
{ currentSettings = {}, glFeatures = {}, ...customProps } = {},
{ currentSettings = {}, glFeatures = {}, stubs = {}, ...customProps } = {},
mountFn = shallowMount,
) => {
const propsData = {
......@@ -76,6 +77,7 @@ describe('Settings Panel', () => {
...glFeatures,
},
},
stubs,
});
};
......@@ -176,7 +178,7 @@ describe('Settings Panel', () => {
);
it('should set the visibility level description based upon the selected visibility level', () => {
wrapper = mountComponent();
wrapper = mountComponent({ stubs: { GlSprintf } });
findProjectVisibilityLevelInput().setValue(visibilityOptions.INTERNAL);
......
......@@ -969,6 +969,10 @@ def license_name
containerRegistryAccessLevel: project.project_feature.container_registry_access_level
)
end
it 'includes membersPagePath' do
expect(subject).to include(membersPagePath: project_project_members_path(project))
end
end
describe '#project_classes' do
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment