Commit 22530534 authored by Savas Vedova's avatar Savas Vedova

Merge branch '18792-move-container-registry-input' into 'master'

Move the container registry visibility setting to _not_ be nested within the Repository visibility setting

See merge request gitlab-org/gitlab!67484
parents fbbf4bd6 84aef766
......@@ -523,36 +523,6 @@ export default {
name="project[project_feature_attributes][forking_access_level]"
/>
</project-setting-row>
<project-setting-row
v-if="registryAvailable"
ref="container-registry-settings"
:help-path="registryHelpPath"
:label="$options.i18n.containerRegistryLabel"
:help-text="
s__('ProjectSettings|Every project can have its own space to store its Docker images')
"
>
<div v-if="showContainerRegistryPublicNote" class="text-muted">
<gl-sprintf
:message="
s__(
`ProjectSettings|Note: The container registry is always visible when a project is public and the container registry is set to '%{access_level_description}'`,
)
"
>
<template #access_level_description>{{
featureAccessLevelDescriptions[featureAccessLevel.EVERYONE]
}}</template>
</gl-sprintf>
</div>
<project-feature-setting
v-model="containerRegistryAccessLevel"
:options="repoFeatureAccessLevelOptions"
:disabled-input="!repositoryEnabled"
:label="$options.i18n.containerRegistryLabel"
name="project[project_feature_attributes][container_registry_access_level]"
/>
</project-setting-row>
<project-setting-row
v-if="lfsAvailable"
ref="git-lfs-settings"
......@@ -606,18 +576,47 @@ export default {
name="project[packages_enabled]"
/>
</project-setting-row>
<project-setting-row
ref="pipeline-settings"
:label="$options.i18n.ciCdLabel"
:help-text="s__('ProjectSettings|Build, test, and deploy your changes.')"
>
<project-feature-setting
v-model="buildsAccessLevel"
:label="$options.i18n.ciCdLabel"
:options="repoFeatureAccessLevelOptions"
:disabled-input="!repositoryEnabled"
name="project[project_feature_attributes][builds_access_level]"
/>
</project-setting-row>
</div>
<project-setting-row
ref="pipeline-settings"
:label="$options.i18n.ciCdLabel"
:help-text="s__('ProjectSettings|Build, test, and deploy your changes.')"
v-if="registryAvailable"
ref="container-registry-settings"
:help-path="registryHelpPath"
:label="$options.i18n.containerRegistryLabel"
:help-text="
s__('ProjectSettings|Every project can have its own space to store its Docker images')
"
>
<div v-if="showContainerRegistryPublicNote" class="text-muted">
<gl-sprintf
:message="
s__(
`ProjectSettings|Note: The container registry is always visible when a project is public and the container registry is set to '%{access_level_description}'`,
)
"
>
<template #access_level_description>{{
featureAccessLevelDescriptions[featureAccessLevel.EVERYONE]
}}</template>
</gl-sprintf>
</div>
<project-feature-setting
v-model="buildsAccessLevel"
:label="$options.i18n.ciCdLabel"
:options="repoFeatureAccessLevelOptions"
:disabled-input="!repositoryEnabled"
name="project[project_feature_attributes][builds_access_level]"
v-model="containerRegistryAccessLevel"
:options="featureAccessLevelOptions"
:label="$options.i18n.containerRegistryLabel"
name="project[project_feature_attributes][container_registry_access_level]"
/>
</project-setting-row>
<project-setting-row
......
......@@ -311,24 +311,6 @@ describe('Settings Panel', () => {
expect(findContainerRegistryPublicNoteGlSprintfComponent().exists()).toBe(false);
});
it('should enable the container registry input when the repository is enabled', () => {
wrapper = mountComponent({
currentSettings: { repositoryAccessLevel: featureAccessLevel.EVERYONE },
registryAvailable: true,
});
expect(findContainerRegistryAccessLevelInput().props('disabledInput')).toBe(false);
});
it('should disable the container registry input when the repository is disabled', () => {
wrapper = mountComponent({
currentSettings: { repositoryAccessLevel: featureAccessLevel.NOT_ENABLED },
registryAvailable: true,
});
expect(findContainerRegistryAccessLevelInput().props('disabledInput')).toBe(true);
});
it('has label for the toggle', () => {
wrapper = mountComponent({
currentSettings: { visibilityLevel: visibilityOptions.PUBLIC },
......
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