summaryrefslogtreecommitdiff
path: root/app/controllers/projects/settings
diff options
context:
space:
mode:
authorMayra Cabrera <mcabrera@gitlab.com>2018-03-29 20:11:36 -0600
committerMayra Cabrera <mcabrera@gitlab.com>2018-04-06 21:20:16 -0500
commit345ac03b7afb1dc9b941c53bc45cc3dfcf22e61c (patch)
tree42da609254928d746a961465d9ecfbff3ab71ad4 /app/controllers/projects/settings
parent370fc05da7f95bf6621867a71d51493cf3899e25 (diff)
downloadgitlab-ce-345ac03b7afb1dc9b941c53bc45cc3dfcf22e61c.tar.gz
Address UX review
- Keep 'Deploy Section' open upon save, otherwise the token might get lost - When an error appears, display the error inside the form and also keep the Deploy Section open - Changue copy of revoke modal
Diffstat (limited to 'app/controllers/projects/settings')
-rw-r--r--app/controllers/projects/settings/repository_controller.rb8
1 files changed, 3 insertions, 5 deletions
diff --git a/app/controllers/projects/settings/repository_controller.rb b/app/controllers/projects/settings/repository_controller.rb
index 28897cc5946..ab6d8b3b10c 100644
--- a/app/controllers/projects/settings/repository_controller.rb
+++ b/app/controllers/projects/settings/repository_controller.rb
@@ -55,11 +55,9 @@ module Projects
end
def define_deploy_token
- @deploy_token = @project.deploy_tokens.build(deploy_token_attributes)
- end
-
- def deploy_token_attributes
- params.fetch(:deploy_token, {}).permit(:name, :expires_at, scopes: [])
+ attributes = @deploy_tokens.attributes_deploy_token
+ @deploy_token = @project.deploy_tokens.build(attributes)
+ @deploy_token.valid? unless attributes.empty?
end
end
end