diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2023-02-20 13:49:51 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2023-02-20 13:49:51 +0000 |
commit | 71786ddc8e28fbd3cb3fcc4b3ff15e5962a1c82e (patch) | |
tree | 6a2d93ef3fb2d353bb7739e4b57e6541f51cdd71 /app/assets/javascripts/environments/components/environment_form.vue | |
parent | a7253423e3403b8c08f8a161e5937e1488f5f407 (diff) | |
download | gitlab-ce-71786ddc8e28fbd3cb3fcc4b3ff15e5962a1c82e.tar.gz |
Add latest changes from gitlab-org/gitlab@15-9-stable-eev15.9.0-rc42
Diffstat (limited to 'app/assets/javascripts/environments/components/environment_form.vue')
-rw-r--r-- | app/assets/javascripts/environments/components/environment_form.vue | 22 |
1 files changed, 17 insertions, 5 deletions
diff --git a/app/assets/javascripts/environments/components/environment_form.vue b/app/assets/javascripts/environments/components/environment_form.vue index 1bac0ef1359..ee5d95ae6f0 100644 --- a/app/assets/javascripts/environments/components/environment_form.vue +++ b/app/assets/javascripts/environments/components/environment_form.vue @@ -3,6 +3,10 @@ import { GlButton, GlForm, GlFormGroup, GlFormInput, GlLink, GlSprintf } from '@ import { helpPagePath } from '~/helpers/help_page_helper'; import { isAbsolute } from '~/lib/utils/url_utility'; import { __ } from '~/locale'; +import { + ENVIRONMENT_NEW_HELP_TEXT, + ENVIRONMENT_EDIT_HELP_TEXT, +} from 'ee_else_ce/environments/constants'; export default { components: { @@ -13,6 +17,7 @@ export default { GlLink, GlSprintf, }, + inject: ['protectedEnvironmentSettingsPath'], props: { environment: { required: true, @@ -34,9 +39,8 @@ export default { }, i18n: { header: __('Environments'), - helpMessage: __( - 'Environments allow you to track deployments of your application. %{linkStart}More information%{linkEnd}.', - ), + helpNewMessage: ENVIRONMENT_NEW_HELP_TEXT, + helpEditMessage: ENVIRONMENT_EDIT_HELP_TEXT, nameLabel: __('Name'), nameFeedback: __('This field is required'), nameDisabledHelp: __("You cannot rename an environment after it's created."), @@ -62,6 +66,9 @@ export default { isNameDisabled() { return Boolean(this.environment.id); }, + showEditHelp() { + return this.isNameDisabled && Boolean(this.protectedEnvironmentSettingsPath); + }, valid() { return { name: this.visited.name && this.environment.name !== '', @@ -89,9 +96,14 @@ export default { {{ $options.i18n.header }} </h4> <p class="gl-w-full"> - <gl-sprintf :message="$options.i18n.helpMessage"> + <gl-sprintf + :message="showEditHelp ? $options.i18n.helpEditMessage : $options.i18n.helpNewMessage" + > <template #link="{ content }"> - <gl-link :href="$options.helpPagePath">{{ content }}</gl-link> + <gl-link + :href="showEditHelp ? protectedEnvironmentSettingsPath : $options.helpPagePath" + >{{ content }}</gl-link + > </template> </gl-sprintf> </p> |