Commit 4d9ab71a authored by Martin Wortschack's avatar Martin Wortschack

Merge branch...

Merge branch '218737-rename-container-registry-expiration-policies-to-cleanup-policy-for-tags' into 'master'

Rename Container Expiration Policies to Cleanup policy for tags

See merge request gitlab-org/gitlab!35315
parents 3c698738 657830ab
<script> <script>
import { mapActions, mapGetters, mapState } from 'vuex'; import { mapActions, mapGetters, mapState } from 'vuex';
import { GlAlert, GlSprintf, GlLink } from '@gitlab/ui'; import { GlAlert, GlSprintf, GlLink } from '@gitlab/ui';
import { s__ } from '~/locale';
import { FETCH_SETTINGS_ERROR_MESSAGE } from '../../shared/constants'; import { FETCH_SETTINGS_ERROR_MESSAGE } from '../../shared/constants';
import SettingsForm from './settings_form.vue'; import SettingsForm from './settings_form.vue';
import {
UNAVAILABLE_FEATURE_TITLE,
UNAVAILABLE_FEATURE_INTRO_TEXT,
UNAVAILABLE_USER_FEATURE_TEXT,
UNAVAILABLE_ADMIN_FEATURE_TEXT,
} from '../constants';
export default { export default {
components: { components: {
...@@ -15,17 +20,9 @@ export default { ...@@ -15,17 +20,9 @@ export default {
GlLink, GlLink,
}, },
i18n: { i18n: {
unavailableFeatureTitle: s__( UNAVAILABLE_FEATURE_TITLE,
`ContainerRegistry|Container Registry tag expiration and retention policy is disabled`, UNAVAILABLE_FEATURE_INTRO_TEXT,
), FETCH_SETTINGS_ERROR_MESSAGE,
unavailableFeatureIntroText: s__(
`ContainerRegistry|The Container Registry tag expiration and retention policies for this project have not been enabled.`,
),
unavailableUserFeatureText: s__(`ContainerRegistry|Please contact your administrator.`),
unavailableAdminFeatureText: s__(
`ContainerRegistry| Please visit the %{linkStart}administration settings%{linkEnd} to enable this feature.`,
),
fetchSettingsErrorText: FETCH_SETTINGS_ERROR_MESSAGE,
}, },
data() { data() {
return { return {
...@@ -42,9 +39,7 @@ export default { ...@@ -42,9 +39,7 @@ export default {
return this.isDisabled && !this.fetchSettingsError; return this.isDisabled && !this.fetchSettingsError;
}, },
unavailableFeatureMessage() { unavailableFeatureMessage() {
return this.isAdmin return this.isAdmin ? UNAVAILABLE_ADMIN_FEATURE_TEXT : UNAVAILABLE_USER_FEATURE_TEXT;
? this.$options.i18n.unavailableAdminFeatureText
: this.$options.i18n.unavailableUserFeatureText;
}, },
}, },
mounted() { mounted() {
...@@ -60,39 +55,24 @@ export default { ...@@ -60,39 +55,24 @@ export default {
<template> <template>
<div> <div>
<p>
{{ s__('ContainerRegistry|Tag expiration policy is designed to:') }}
</p>
<ul>
<li>{{ s__('ContainerRegistry|Keep and protect the images that matter most.') }}</li>
<li>
{{
s__(
"ContainerRegistry|Automatically remove extra images that aren't designed to be kept.",
)
}}
</li>
</ul>
<settings-form v-if="showSettingForm" /> <settings-form v-if="showSettingForm" />
<template v-else> <template v-else>
<gl-alert <gl-alert
v-if="showDisabledFormMessage" v-if="showDisabledFormMessage"
:dismissible="false" :dismissible="false"
:title="$options.i18n.unavailableFeatureTitle" :title="$options.i18n.UNAVAILABLE_FEATURE_TITLE"
variant="tip" variant="tip"
> >
{{ $options.i18n.unavailableFeatureIntroText }} {{ $options.i18n.UNAVAILABLE_FEATURE_INTRO_TEXT }}
<gl-sprintf :message="unavailableFeatureMessage"> <gl-sprintf :message="unavailableFeatureMessage">
<template #link="{ content }"> <template #link="{ content }">
<gl-link :href="adminSettingsPath" target="_blank"> <gl-link :href="adminSettingsPath" target="_blank">{{ content }}</gl-link>
{{ content }}
</gl-link>
</template> </template>
</gl-sprintf> </gl-sprintf>
</gl-alert> </gl-alert>
<gl-alert v-else-if="fetchSettingsError" variant="warning" :dismissible="false"> <gl-alert v-else-if="fetchSettingsError" variant="warning" :dismissible="false">
<gl-sprintf :message="$options.i18n.fetchSettingsErrorText" /> <gl-sprintf :message="$options.i18n.FETCH_SETTINGS_ERROR_MESSAGE" />
</gl-alert> </gl-alert>
</template> </template>
</div> </div>
......
...@@ -2,12 +2,13 @@ ...@@ -2,12 +2,13 @@
import { mapActions, mapState, mapGetters } from 'vuex'; import { mapActions, mapState, mapGetters } from 'vuex';
import { GlCard, GlDeprecatedButton, GlLoadingIcon } from '@gitlab/ui'; import { GlCard, GlDeprecatedButton, GlLoadingIcon } from '@gitlab/ui';
import Tracking from '~/tracking'; import Tracking from '~/tracking';
import { mapComputed } from '~/vuex_shared/bindings';
import { import {
UPDATE_SETTINGS_ERROR_MESSAGE, UPDATE_SETTINGS_ERROR_MESSAGE,
UPDATE_SETTINGS_SUCCESS_MESSAGE, UPDATE_SETTINGS_SUCCESS_MESSAGE,
} from '../../shared/constants'; } from '../../shared/constants';
import { mapComputed } from '~/vuex_shared/bindings';
import ExpirationPolicyFields from '../../shared/components/expiration_policy_fields.vue'; import ExpirationPolicyFields from '../../shared/components/expiration_policy_fields.vue';
import { SET_CLEANUP_POLICY_BUTTON, CLEANUP_POLICY_CARD_HEADER } from '../constants';
export default { export default {
components: { components: {
...@@ -21,6 +22,10 @@ export default { ...@@ -21,6 +22,10 @@ export default {
cols: 3, cols: 3,
align: 'right', align: 'right',
}, },
i18n: {
CLEANUP_POLICY_CARD_HEADER,
SET_CLEANUP_POLICY_BUTTON,
},
data() { data() {
return { return {
tracking: { tracking: {
...@@ -60,7 +65,7 @@ export default { ...@@ -60,7 +65,7 @@ export default {
<form ref="form-element" @submit.prevent="submit" @reset.prevent="reset"> <form ref="form-element" @submit.prevent="submit" @reset.prevent="reset">
<gl-card> <gl-card>
<template #header> <template #header>
{{ s__('ContainerRegistry|Tag expiration policy') }} {{ $options.i18n.CLEANUP_POLICY_CARD_HEADER }}
</template> </template>
<template #default> <template #default>
<expiration-policy-fields <expiration-policy-fields
...@@ -88,7 +93,7 @@ export default { ...@@ -88,7 +93,7 @@ export default {
variant="success" variant="success"
class="d-flex justify-content-center align-items-center js-no-auto-disable" class="d-flex justify-content-center align-items-center js-no-auto-disable"
> >
{{ __('Save expiration policy') }} {{ $options.i18n.SET_CLEANUP_POLICY_BUTTON }}
<gl-loading-icon v-if="isLoading" class="ml-2" /> <gl-loading-icon v-if="isLoading" class="ml-2" />
</gl-deprecated-button> </gl-deprecated-button>
</div> </div>
......
import { s__, __ } from '~/locale';
export const SET_CLEANUP_POLICY_BUTTON = s__('ContainerRegistry|Set cleanup policy');
export const CLEANUP_POLICY_CARD_HEADER = s__('ContainerRegistry|Tag expiration policy');
export const UNAVAILABLE_FEATURE_TITLE = s__(
`ContainerRegistry|Cleanup policy for tags is disabled`,
);
export const UNAVAILABLE_FEATURE_INTRO_TEXT = s__(
`ContainerRegistry|This project's cleanup policy for tags is not enabled.`,
);
export const UNAVAILABLE_USER_FEATURE_TEXT = __(`Please contact your administrator.`);
export const UNAVAILABLE_ADMIN_FEATURE_TEXT = s__(
`ContainerRegistry| Please visit the %{linkStart}administration settings%{linkEnd} to enable this feature.`,
);
...@@ -168,7 +168,7 @@ export default { ...@@ -168,7 +168,7 @@ export default {
v-model="enabled" v-model="enabled"
:disabled="isLoading" :disabled="isLoading"
/> />
<span class="mb-2 ml-1 lh-2"> <span class="mb-2 ml-2 lh-2">
<gl-sprintf :message="$options.i18n.enableToggleDescription"> <gl-sprintf :message="$options.i18n.enableToggleDescription">
<template #toggleStatus> <template #toggleStatus>
<strong>{{ policyEnabledText }}</strong> <strong>{{ policyEnabledText }}</strong>
......
import { s__, __ } from '~/locale'; import { s__, __ } from '~/locale';
export const FETCH_SETTINGS_ERROR_MESSAGE = s__( export const FETCH_SETTINGS_ERROR_MESSAGE = s__(
'ContainerRegistry|Something went wrong while fetching the expiration policy.', 'ContainerRegistry|Something went wrong while fetching the cleanup policy.',
); );
export const UPDATE_SETTINGS_ERROR_MESSAGE = s__( export const UPDATE_SETTINGS_ERROR_MESSAGE = s__(
'ContainerRegistry|Something went wrong while updating the expiration policy.', 'ContainerRegistry|Something went wrong while updating the cleanup policy.',
); );
export const UPDATE_SETTINGS_SUCCESS_MESSAGE = s__( export const UPDATE_SETTINGS_SUCCESS_MESSAGE = s__(
'ContainerRegistry|Expiration policy successfully saved.', 'ContainerRegistry|Cleanup policy successfully saved.',
); );
export const NAME_REGEX_LENGTH = 255; export const NAME_REGEX_LENGTH = 255;
export const ENABLED_TEXT = __('enabled'); export const ENABLED_TEXT = __('Enabled');
export const DISABLED_TEXT = __('disabled'); export const DISABLED_TEXT = __('Disabled');
export const ENABLE_TOGGLE_LABEL = s__('ContainerRegistry|Expiration policy:'); export const ENABLE_TOGGLE_LABEL = s__('ContainerRegistry|Cleanup policy:');
export const ENABLE_TOGGLE_DESCRIPTION = s__( export const ENABLE_TOGGLE_DESCRIPTION = s__(
'ContainerRegistry|Docker tag expiration policy is %{toggleStatus}', 'ContainerRegistry|%{toggleStatus} - Tags matching the patterns defined below will be scheduled for deletion',
); );
export const TEXT_AREA_INVALID_FEEDBACK = s__( export const TEXT_AREA_INVALID_FEEDBACK = s__(
...@@ -34,12 +34,12 @@ export const NAME_REGEX_LABEL = s__( ...@@ -34,12 +34,12 @@ export const NAME_REGEX_LABEL = s__(
); );
export const NAME_REGEX_PLACEHOLDER = '.*'; export const NAME_REGEX_PLACEHOLDER = '.*';
export const NAME_REGEX_DESCRIPTION = s__( export const NAME_REGEX_DESCRIPTION = s__(
'ContainerRegistry|Regular expressions such as %{codeStart}.*-test%{codeEnd} or %{codeStart}dev-.*%{codeEnd} are supported. To select all tags, use %{codeStart}.*%{codeEnd}', 'ContainerRegistry|Wildcards such as %{codeStart}.*-test%{codeEnd} or %{codeStart}dev-.*%{codeEnd} are supported. To select all tags, use %{codeStart}.*%{codeEnd}',
); );
export const NAME_REGEX_KEEP_LABEL = s__( export const NAME_REGEX_KEEP_LABEL = s__(
'ContainerRegistry|Tags with names matching this regex pattern will %{italicStart}be preserved:%{italicEnd}', 'ContainerRegistry|Tags with names matching this regex pattern will %{italicStart}be preserved:%{italicEnd}',
); );
export const NAME_REGEX_KEEP_PLACEHOLDER = ''; export const NAME_REGEX_KEEP_PLACEHOLDER = '';
export const NAME_REGEX_KEEP_DESCRIPTION = s__( export const NAME_REGEX_KEEP_DESCRIPTION = s__(
'ContainerRegistry|Regular expressions such as %{codeStart}.*-master%{codeEnd} or %{codeStart}release-.*%{codeEnd} are supported', 'ContainerRegistry|Wildcards such as %{codeStart}.*-master%{codeEnd} or %{codeStart}release-.*%{codeEnd} are supported',
); );
...@@ -66,11 +66,11 @@ ...@@ -66,11 +66,11 @@
%section.settings.no-animate#js-registry-policies{ class: ('expanded' if expanded) } %section.settings.no-animate#js-registry-policies{ class: ('expanded' if expanded) }
.settings-header .settings-header
%h4 %h4
= _("Container Registry tag expiration policy") = _("Cleanup policy for tags")
= link_to icon('question-circle'), help_page_path('user/packages/container_registry/index', anchor: 'expiration-policy'), target: '_blank', rel: 'noopener noreferrer'
%button.btn.js-settings-toggle{ type: 'button' } %button.btn.js-settings-toggle{ type: 'button' }
= expanded ? _('Collapse') : _('Expand') = expanded ? _('Collapse') : _('Expand')
%p %p
= _("Expiration policy for the Container Registry is a perfect solution for keeping the Registry space down while still enjoying the full power of GitLab CI/CD.") = _("Save space and find tags in the Container Registry more easily. Enable the cleanup policy to remove stale tags and keep only the ones you need.")
= link_to _('More information'), help_page_path('user/packages/container_registry/index', anchor: 'expiration-policy', target: '_blank', rel: 'noopener noreferrer')
.settings-content .settings-content
= render 'projects/registry/settings/index' = render 'projects/registry/settings/index'
---
title: Rename Container Expiration Policies to Cleanup policy for tags
merge_request: 35315
author:
type: changed
...@@ -4656,6 +4656,9 @@ msgstr "" ...@@ -4656,6 +4656,9 @@ msgstr ""
msgid "ClassificationLabelUnavailable|is unavailable: %{reason}" msgid "ClassificationLabelUnavailable|is unavailable: %{reason}"
msgstr "" msgstr ""
msgid "Cleanup policy for tags"
msgstr ""
msgid "Clear" msgid "Clear"
msgstr "" msgstr ""
...@@ -6131,9 +6134,6 @@ msgstr "" ...@@ -6131,9 +6134,6 @@ msgstr ""
msgid "Container Registry" msgid "Container Registry"
msgstr "" msgstr ""
msgid "Container Registry tag expiration policy"
msgstr ""
msgid "Container Scanning" msgid "Container Scanning"
msgstr "" msgstr ""
...@@ -6168,7 +6168,7 @@ msgstr "" ...@@ -6168,7 +6168,7 @@ msgstr ""
msgid "ContainerRegistry|%{title} was successfully scheduled for deletion" msgid "ContainerRegistry|%{title} was successfully scheduled for deletion"
msgstr "" msgstr ""
msgid "ContainerRegistry|Automatically remove extra images that aren't designed to be kept." msgid "ContainerRegistry|%{toggleStatus} - Tags matching the patterns defined below will be scheduled for deletion"
msgstr "" msgstr ""
msgid "ContainerRegistry|Build an image" msgid "ContainerRegistry|Build an image"
...@@ -6177,10 +6177,16 @@ msgstr "" ...@@ -6177,10 +6177,16 @@ msgstr ""
msgid "ContainerRegistry|CLI Commands" msgid "ContainerRegistry|CLI Commands"
msgstr "" msgstr ""
msgid "ContainerRegistry|Container Registry" msgid "ContainerRegistry|Cleanup policy for tags is disabled"
msgstr "" msgstr ""
msgid "ContainerRegistry|Container Registry tag expiration and retention policy is disabled" msgid "ContainerRegistry|Cleanup policy successfully saved."
msgstr ""
msgid "ContainerRegistry|Cleanup policy:"
msgstr ""
msgid "ContainerRegistry|Container Registry"
msgstr "" msgstr ""
msgid "ContainerRegistry|Copy build command" msgid "ContainerRegistry|Copy build command"
...@@ -6198,9 +6204,6 @@ msgstr "" ...@@ -6198,9 +6204,6 @@ msgstr ""
msgid "ContainerRegistry|Docker connection error" msgid "ContainerRegistry|Docker connection error"
msgstr "" msgstr ""
msgid "ContainerRegistry|Docker tag expiration policy is %{toggleStatus}"
msgstr ""
msgid "ContainerRegistry|Expiration interval:" msgid "ContainerRegistry|Expiration interval:"
msgstr "" msgstr ""
...@@ -6210,15 +6213,9 @@ msgstr "" ...@@ -6210,15 +6213,9 @@ msgstr ""
msgid "ContainerRegistry|Expiration policy is disabled" msgid "ContainerRegistry|Expiration policy is disabled"
msgstr "" msgstr ""
msgid "ContainerRegistry|Expiration policy successfully saved."
msgstr ""
msgid "ContainerRegistry|Expiration policy will run in %{time}" msgid "ContainerRegistry|Expiration policy will run in %{time}"
msgstr "" msgstr ""
msgid "ContainerRegistry|Expiration policy:"
msgstr ""
msgid "ContainerRegistry|Expiration schedule:" msgid "ContainerRegistry|Expiration schedule:"
msgstr "" msgstr ""
...@@ -6237,9 +6234,6 @@ msgstr "" ...@@ -6237,9 +6234,6 @@ msgstr ""
msgid "ContainerRegistry|Image tags" msgid "ContainerRegistry|Image tags"
msgstr "" msgstr ""
msgid "ContainerRegistry|Keep and protect the images that matter most."
msgstr ""
msgid "ContainerRegistry|Login" msgid "ContainerRegistry|Login"
msgstr "" msgstr ""
...@@ -6249,21 +6243,12 @@ msgstr "" ...@@ -6249,21 +6243,12 @@ msgstr ""
msgid "ContainerRegistry|Number of tags to retain:" msgid "ContainerRegistry|Number of tags to retain:"
msgstr "" msgstr ""
msgid "ContainerRegistry|Please contact your administrator."
msgstr ""
msgid "ContainerRegistry|Published %{timeInfo}" msgid "ContainerRegistry|Published %{timeInfo}"
msgstr "" msgstr ""
msgid "ContainerRegistry|Push an image" msgid "ContainerRegistry|Push an image"
msgstr "" msgstr ""
msgid "ContainerRegistry|Regular expressions such as %{codeStart}.*-master%{codeEnd} or %{codeStart}release-.*%{codeEnd} are supported"
msgstr ""
msgid "ContainerRegistry|Regular expressions such as %{codeStart}.*-test%{codeEnd} or %{codeStart}dev-.*%{codeEnd} are supported. To select all tags, use %{codeStart}.*%{codeEnd}"
msgstr ""
msgid "ContainerRegistry|Remember to run %{docLinkStart}garbage collection%{docLinkEnd} to remove the stale data from storage." msgid "ContainerRegistry|Remember to run %{docLinkStart}garbage collection%{docLinkEnd} to remove the stale data from storage."
msgstr "" msgstr ""
...@@ -6275,7 +6260,10 @@ msgid_plural "ContainerRegistry|Remove tags" ...@@ -6275,7 +6260,10 @@ msgid_plural "ContainerRegistry|Remove tags"
msgstr[0] "" msgstr[0] ""
msgstr[1] "" msgstr[1] ""
msgid "ContainerRegistry|Something went wrong while fetching the expiration policy." msgid "ContainerRegistry|Set cleanup policy"
msgstr ""
msgid "ContainerRegistry|Something went wrong while fetching the cleanup policy."
msgstr "" msgstr ""
msgid "ContainerRegistry|Something went wrong while fetching the repository list." msgid "ContainerRegistry|Something went wrong while fetching the repository list."
...@@ -6293,7 +6281,7 @@ msgstr "" ...@@ -6293,7 +6281,7 @@ msgstr ""
msgid "ContainerRegistry|Something went wrong while scheduling %{title} for deletion. Please try again." msgid "ContainerRegistry|Something went wrong while scheduling %{title} for deletion. Please try again."
msgstr "" msgstr ""
msgid "ContainerRegistry|Something went wrong while updating the expiration policy." msgid "ContainerRegistry|Something went wrong while updating the cleanup policy."
msgstr "" msgstr ""
msgid "ContainerRegistry|Sorry, your filter produced no results." msgid "ContainerRegistry|Sorry, your filter produced no results."
...@@ -6302,9 +6290,6 @@ msgstr "" ...@@ -6302,9 +6290,6 @@ msgstr ""
msgid "ContainerRegistry|Tag expiration policy" msgid "ContainerRegistry|Tag expiration policy"
msgstr "" msgstr ""
msgid "ContainerRegistry|Tag expiration policy is designed to:"
msgstr ""
msgid "ContainerRegistry|Tag successfully marked for deletion." msgid "ContainerRegistry|Tag successfully marked for deletion."
msgstr "" msgstr ""
...@@ -6317,9 +6302,6 @@ msgstr "" ...@@ -6317,9 +6302,6 @@ msgstr ""
msgid "ContainerRegistry|Tags with names matching this regex pattern will %{italicStart}expire:%{italicEnd}" msgid "ContainerRegistry|Tags with names matching this regex pattern will %{italicStart}expire:%{italicEnd}"
msgstr "" msgstr ""
msgid "ContainerRegistry|The Container Registry tag expiration and retention policies for this project have not been enabled."
msgstr ""
msgid "ContainerRegistry|The last tag related to this image was recently removed. This empty image and any associated data will be automatically removed as part of the regular Garbage Collection process. If you have any questions, contact your administrator." msgid "ContainerRegistry|The last tag related to this image was recently removed. This empty image and any associated data will be automatically removed as part of the regular Garbage Collection process. If you have any questions, contact your administrator."
msgstr "" msgstr ""
...@@ -6341,12 +6323,21 @@ msgstr "" ...@@ -6341,12 +6323,21 @@ msgstr ""
msgid "ContainerRegistry|This image repository is scheduled for deletion" msgid "ContainerRegistry|This image repository is scheduled for deletion"
msgstr "" msgstr ""
msgid "ContainerRegistry|This project's cleanup policy for tags is not enabled."
msgstr ""
msgid "ContainerRegistry|To widen your search, change or remove the filters above." msgid "ContainerRegistry|To widen your search, change or remove the filters above."
msgstr "" msgstr ""
msgid "ContainerRegistry|We are having trouble connecting to the Registry, which could be due to an issue with your project name or path. %{docLinkStart}More information%{docLinkEnd}" msgid "ContainerRegistry|We are having trouble connecting to the Registry, which could be due to an issue with your project name or path. %{docLinkStart}More information%{docLinkEnd}"
msgstr "" msgstr ""
msgid "ContainerRegistry|Wildcards such as %{codeStart}.*-master%{codeEnd} or %{codeStart}release-.*%{codeEnd} are supported"
msgstr ""
msgid "ContainerRegistry|Wildcards such as %{codeStart}.*-test%{codeEnd} or %{codeStart}dev-.*%{codeEnd} are supported. To select all tags, use %{codeStart}.*%{codeEnd}"
msgstr ""
msgid "ContainerRegistry|With the Container Registry, every project can have its own space to store its Docker images. %{docLinkStart}More Information%{docLinkEnd}" msgid "ContainerRegistry|With the Container Registry, every project can have its own space to store its Docker images. %{docLinkStart}More Information%{docLinkEnd}"
msgstr "" msgstr ""
...@@ -9418,9 +9409,6 @@ msgstr "" ...@@ -9418,9 +9409,6 @@ msgstr ""
msgid "Expiration not enforced" msgid "Expiration not enforced"
msgstr "" msgstr ""
msgid "Expiration policy for the Container Registry is a perfect solution for keeping the Registry space down while still enjoying the full power of GitLab CI/CD."
msgstr ""
msgid "Expired" msgid "Expired"
msgstr "" msgstr ""
...@@ -16788,6 +16776,9 @@ msgstr "" ...@@ -16788,6 +16776,9 @@ msgstr ""
msgid "Please complete your profile with email address" msgid "Please complete your profile with email address"
msgstr "" msgstr ""
msgid "Please contact your administrator."
msgstr ""
msgid "Please convert %{linkStart}them to Git%{linkEnd}, and go through the %{linkToImportFlow} again." msgid "Please convert %{linkStart}them to Git%{linkEnd}, and go through the %{linkToImportFlow} again."
msgstr "" msgstr ""
...@@ -19854,15 +19845,15 @@ msgstr "" ...@@ -19854,15 +19845,15 @@ msgstr ""
msgid "Save comment" msgid "Save comment"
msgstr "" msgstr ""
msgid "Save expiration policy"
msgstr ""
msgid "Save password" msgid "Save password"
msgstr "" msgstr ""
msgid "Save pipeline schedule" msgid "Save pipeline schedule"
msgstr "" msgstr ""
msgid "Save space and find tags in the Container Registry more easily. Enable the cleanup policy to remove stale tags and keep only the ones you need."
msgstr ""
msgid "Save template" msgid "Save template"
msgstr "" msgstr ""
......
...@@ -20,10 +20,10 @@ RSpec.describe 'Project > Settings > CI/CD > Container registry tag expiration p ...@@ -20,10 +20,10 @@ RSpec.describe 'Project > Settings > CI/CD > Container registry tag expiration p
it 'shows available section' do it 'shows available section' do
settings_block = find('#js-registry-policies') settings_block = find('#js-registry-policies')
expect(settings_block).to have_text 'Container Registry tag expiration policy' expect(settings_block).to have_text 'Cleanup policy for tags'
end end
it 'saves expiration policy submit the form' do it 'saves cleanup policy submit the form' do
within '#js-registry-policies' do within '#js-registry-policies' do
within '.card-body' do within '.card-body' do
select('7 days until tags are automatically removed', from: 'Expiration interval:') select('7 days until tags are automatically removed', from: 'Expiration interval:')
...@@ -36,10 +36,10 @@ RSpec.describe 'Project > Settings > CI/CD > Container registry tag expiration p ...@@ -36,10 +36,10 @@ RSpec.describe 'Project > Settings > CI/CD > Container registry tag expiration p
submit_button.click submit_button.click
end end
toast = find('.gl-toast') toast = find('.gl-toast')
expect(toast).to have_content('Expiration policy successfully saved.') expect(toast).to have_content('Cleanup policy successfully saved.')
end end
it 'does not save expiration policy submit form with invalid regex' do it 'does not save cleanup policy submit form with invalid regex' do
within '#js-registry-policies' do within '#js-registry-policies' do
within '.card-body' do within '.card-body' do
fill_in('Tags with names matching this regex pattern will expire:', with: '*-production') fill_in('Tags with names matching this regex pattern will expire:', with: '*-production')
...@@ -49,7 +49,7 @@ RSpec.describe 'Project > Settings > CI/CD > Container registry tag expiration p ...@@ -49,7 +49,7 @@ RSpec.describe 'Project > Settings > CI/CD > Container registry tag expiration p
submit_button.click submit_button.click
end end
toast = find('.gl-toast') toast = find('.gl-toast')
expect(toast).to have_content('Something went wrong while updating the expiration policy.') expect(toast).to have_content('Something went wrong while updating the cleanup policy.')
end end
end end
......
...@@ -2,24 +2,6 @@ ...@@ -2,24 +2,6 @@
exports[`Registry Settings App renders 1`] = ` exports[`Registry Settings App renders 1`] = `
<div> <div>
<p>
Tag expiration policy is designed to:
</p>
<ul>
<li>
Keep and protect the images that matter most.
</li>
<li>
Automatically remove extra images that aren't designed to be kept.
</li>
</ul>
<settings-form-stub /> <settings-form-stub />
</div> </div>
`; `;
...@@ -5,6 +5,11 @@ import SettingsForm from '~/registry/settings/components/settings_form.vue'; ...@@ -5,6 +5,11 @@ import SettingsForm from '~/registry/settings/components/settings_form.vue';
import { createStore } from '~/registry/settings/store/'; import { createStore } from '~/registry/settings/store/';
import { SET_SETTINGS, SET_INITIAL_STATE } from '~/registry/settings/store/mutation_types'; import { SET_SETTINGS, SET_INITIAL_STATE } from '~/registry/settings/store/mutation_types';
import { FETCH_SETTINGS_ERROR_MESSAGE } from '~/registry/shared/constants'; import { FETCH_SETTINGS_ERROR_MESSAGE } from '~/registry/shared/constants';
import {
UNAVAILABLE_FEATURE_INTRO_TEXT,
UNAVAILABLE_USER_FEATURE_TEXT,
} from '~/registry/settings/constants';
import { stringifiedFormOptions } from '../../shared/mock_data'; import { stringifiedFormOptions } from '../../shared/mock_data';
describe('Registry Settings App', () => { describe('Registry Settings App', () => {
...@@ -68,10 +73,8 @@ describe('Registry Settings App', () => { ...@@ -68,10 +73,8 @@ describe('Registry Settings App', () => {
it('shows an alert', () => { it('shows an alert', () => {
const text = findAlert().text(); const text = findAlert().text();
expect(text).toContain( expect(text).toContain(UNAVAILABLE_FEATURE_INTRO_TEXT);
'The Container Registry tag expiration and retention policies for this project have not been enabled.', expect(text).toContain(UNAVAILABLE_USER_FEATURE_TEXT);
);
expect(text).toContain('Please contact your administrator.');
}); });
describe('an admin is visiting the page', () => { describe('an admin is visiting the page', () => {
......
...@@ -6,7 +6,7 @@ exports[`Expiration Policy Form renders 1`] = ` ...@@ -6,7 +6,7 @@ exports[`Expiration Policy Form renders 1`] = `
> >
<gl-form-group-stub <gl-form-group-stub
id="expiration-policy-toggle-group" id="expiration-policy-toggle-group"
label="Expiration policy:" label="Cleanup policy:"
label-align="right" label-align="right"
label-cols="3" label-cols="3"
label-for="expiration-policy-toggle" label-for="expiration-policy-toggle"
...@@ -20,12 +20,12 @@ exports[`Expiration Policy Form renders 1`] = ` ...@@ -20,12 +20,12 @@ exports[`Expiration Policy Form renders 1`] = `
/> />
<span <span
class="mb-2 ml-1 lh-2" class="mb-2 ml-2 lh-2"
> >
Docker tag expiration policy is
<strong> <strong>
disabled Disabled
</strong> </strong>
- Tags matching the patterns defined below will be scheduled for deletion
</span> </span>
</div> </div>
</gl-form-group-stub> </gl-form-group-stub>
......
...@@ -2,7 +2,7 @@ import { shallowMount } from '@vue/test-utils'; ...@@ -2,7 +2,7 @@ import { shallowMount } from '@vue/test-utils';
import { GlSprintf } from '@gitlab/ui'; import { GlSprintf } from '@gitlab/ui';
import component from '~/registry/shared/components/expiration_policy_fields.vue'; import component from '~/registry/shared/components/expiration_policy_fields.vue';
import { NAME_REGEX_LENGTH } from '~/registry/shared/constants'; import { NAME_REGEX_LENGTH, ENABLED_TEXT, DISABLED_TEXT } from '~/registry/shared/constants';
import { formOptions } from '../mock_data'; import { formOptions } from '../mock_data';
describe('Expiration Policy Form', () => { describe('Expiration Policy Form', () => {
...@@ -169,13 +169,13 @@ describe('Expiration Policy Form', () => { ...@@ -169,13 +169,13 @@ describe('Expiration Policy Form', () => {
it('toggleDescriptionText show disabled when settings.enabled is false', () => { it('toggleDescriptionText show disabled when settings.enabled is false', () => {
mountComponent(); mountComponent();
const toggleHelpText = findFormGroup('toggle').find('span'); const toggleHelpText = findFormGroup('toggle').find('span');
expect(toggleHelpText.html()).toContain('disabled'); expect(toggleHelpText.html()).toContain(DISABLED_TEXT);
}); });
it('toggleDescriptionText show enabled when settings.enabled is true', () => { it('toggleDescriptionText show enabled when settings.enabled is true', () => {
mountComponent({ value: { enabled: true } }); mountComponent({ value: { enabled: true } });
const toggleHelpText = findFormGroup('toggle').find('span'); const toggleHelpText = findFormGroup('toggle').find('span');
expect(toggleHelpText.html()).toContain('enabled'); expect(toggleHelpText.html()).toContain(ENABLED_TEXT);
}); });
}); });
}); });
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