diff options
Diffstat (limited to 'app/assets/javascripts/deploy_tokens/components/new_deploy_token.vue')
-rw-r--r-- | app/assets/javascripts/deploy_tokens/components/new_deploy_token.vue | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/app/assets/javascripts/deploy_tokens/components/new_deploy_token.vue b/app/assets/javascripts/deploy_tokens/components/new_deploy_token.vue index 639dd21bd7b..81d74c64124 100644 --- a/app/assets/javascripts/deploy_tokens/components/new_deploy_token.vue +++ b/app/assets/javascripts/deploy_tokens/components/new_deploy_token.vue @@ -109,10 +109,11 @@ export default { writePackageRegistryHelp: s__( 'DeployTokens|Allows read and write access to the package registry.', ), + createTokenFailedAlert: s__('DeployTokens|Failed to create a new deployment token'), }, computed: { formattedExpiryDate() { - return formatDate(this.expiresAt, 'yyyy-mm-dd'); + return this.expiresAt ? formatDate(this.expiresAt, 'yyyy-mm-dd') : ''; }, newTokenCreatedMessage() { return this.tokenType === 'group' @@ -129,6 +130,9 @@ export default { name: this.name, read_repository: this.readRepository, read_registry: this.readRegistry, + write_registry: this.writeRegistry, + read_package_registry: this.readPackageRegistry, + write_package_registry: this.writePackageRegistry, username: this.username, }, }) @@ -142,7 +146,8 @@ export default { }) .catch((error) => { createAlert({ - message: error.response.data.message, + message: + error?.response?.data?.message || this.$options.translations.createTokenFailedAlert, }); }); }, @@ -228,13 +233,7 @@ export default { :description="$options.translations.addTokenNameDescription" label-for="deploy_token_name" > - <gl-form-input - id="deploy_token_name" - v-model="name" - name="deploy_token_name" - class="qa-deploy-token-name" - data-qa-selector="deploy_token_name_field" - /> + <gl-form-input id="deploy_token_name" v-model="name" name="deploy_token_name" /> </gl-form-group> <gl-form-group :label="$options.translations.addTokenExpiryLabel" |