diff --git a/app/assets/javascripts/snippets/constants.js b/app/assets/javascripts/snippets/constants.js index 2d2eede91377ddfd25a98817352d8814df6aae96..a4653b75bab2918f28ce60ab1f5861d83d665d92 100644 --- a/app/assets/javascripts/snippets/constants.js +++ b/app/assets/javascripts/snippets/constants.js @@ -21,6 +21,9 @@ export const SNIPPET_VISIBILITY = { label: __('Public'), icon: 'earth', description: __('The snippet can be accessed without any authentication.'), + description_project: __( + 'The snippet can be accessed without any authentication. To embed snippets, a project must be public.', + ), }, }; diff --git a/locale/gitlab.pot b/locale/gitlab.pot index 1c7218e249e2e04a74f27021dbf03bcd3bf349b6..eb44b232ae3ab61788e77694ba17cd93368c15e3 100644 --- a/locale/gitlab.pot +++ b/locale/gitlab.pot @@ -46284,6 +46284,9 @@ msgstr "" msgid "The snippet can be accessed without any authentication." msgstr "" +msgid "The snippet can be accessed without any authentication. To embed snippets, a project must be public." +msgstr "" + msgid "The snippet is visible only to me." msgstr "" diff --git a/spec/frontend/snippets/components/snippet_visibility_edit_spec.js b/spec/frontend/snippets/components/snippet_visibility_edit_spec.js index 70eb719f7061b44e710d19d2acd17c4aed314251..e2a9967f6ad74f05ceb343030a62aace2ccff232 100644 --- a/spec/frontend/snippets/components/snippet_visibility_edit_spec.js +++ b/spec/frontend/snippets/components/snippet_visibility_edit_spec.js @@ -134,6 +134,17 @@ describe('Snippet Visibility Edit component', () => { description: SNIPPET_VISIBILITY.private.description_project, }); }); + + it('when project snippet, renders special public description', () => { + createComponent({ propsData: { isProjectSnippet: true }, deep: true }); + + expect(findRadiosData()[2]).toEqual({ + value: VISIBILITY_LEVEL_PUBLIC_STRING, + icon: SNIPPET_VISIBILITY.public.icon, + text: SNIPPET_VISIBILITY.public.label, + description: SNIPPET_VISIBILITY.public.description_project, + }); + }); }); });