summaryrefslogtreecommitdiff
path: root/app/assets/javascripts/environments/components
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2021-08-26 21:11:25 +0000
committerGitLab Bot <gitlab-bot@gitlab.com>2021-08-26 21:11:25 +0000
commit9f6c0ac9fd6921bc0b5190ed4d4eaf0ab1e1f2d7 (patch)
tree92f397ea19f1fec56491c99ce3b7862bb86fe8ce /app/assets/javascripts/environments/components
parenta56971e97f0385640c2f3568017bd221897b78ef (diff)
downloadgitlab-ce-9f6c0ac9fd6921bc0b5190ed4d4eaf0ab1e1f2d7.tar.gz
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/assets/javascripts/environments/components')
-rw-r--r--app/assets/javascripts/environments/components/edit_environment.vue2
-rw-r--r--app/assets/javascripts/environments/components/environment_form.vue15
2 files changed, 16 insertions, 1 deletions
diff --git a/app/assets/javascripts/environments/components/edit_environment.vue b/app/assets/javascripts/environments/components/edit_environment.vue
index 1cd960d7cd6..96742a11ebb 100644
--- a/app/assets/javascripts/environments/components/edit_environment.vue
+++ b/app/assets/javascripts/environments/components/edit_environment.vue
@@ -18,6 +18,7 @@ export default {
data() {
return {
formEnvironment: {
+ id: this.environment.id,
name: this.environment.name,
externalUrl: this.environment.external_url,
},
@@ -33,7 +34,6 @@ export default {
axios
.put(this.updateEnvironmentPath, {
id: this.environment.id,
- name: this.formEnvironment.name,
external_url: this.formEnvironment.externalUrl,
})
.then(({ data: { path } }) => visitUrl(path))
diff --git a/app/assets/javascripts/environments/components/environment_form.vue b/app/assets/javascripts/environments/components/environment_form.vue
index 6db8fe24e72..1d1d8d61b66 100644
--- a/app/assets/javascripts/environments/components/environment_form.vue
+++ b/app/assets/javascripts/environments/components/environment_form.vue
@@ -39,12 +39,17 @@ export default {
),
nameLabel: __('Name'),
nameFeedback: __('This field is required'),
+ nameDisabledHelp: __("You cannot rename an environment after it's created."),
+ nameDisabledLinkText: __('How do I rename an environment?'),
urlLabel: __('External URL'),
urlFeedback: __('The URL should start with http:// or https://'),
save: __('Save'),
cancel: __('Cancel'),
},
helpPagePath: helpPagePath('ci/environments/index.md'),
+ renamingDisabledHelpPagePath: helpPagePath('ci/environments/index.md', {
+ anchor: 'rename-an-environment',
+ }),
data() {
return {
visited: {
@@ -54,6 +59,9 @@ export default {
};
},
computed: {
+ isNameDisabled() {
+ return Boolean(this.environment.id);
+ },
valid() {
return {
name: this.visited.name && this.environment.name !== '',
@@ -102,10 +110,17 @@ export default {
:state="valid.name"
:invalid-feedback="$options.i18n.nameFeedback"
>
+ <template v-if="isNameDisabled" #description>
+ {{ $options.i18n.nameDisabledHelp }}
+ <gl-link :href="$options.renamingDisabledHelpPagePath" target="_blank">
+ {{ $options.i18n.nameDisabledLinkText }}
+ </gl-link>
+ </template>
<gl-form-input
id="environment_name"
:value="environment.name"
:state="valid.name"
+ :disabled="isNameDisabled"
name="environment[name]"
required
@input="onChange({ ...environment, name: $event })"