diff options
author | Mayra Cabrera <mcabrera@gitlab.com> | 2018-03-30 05:11:36 +0300 |
---|---|---|
committer | Mayra Cabrera <mcabrera@gitlab.com> | 2018-04-07 05:20:16 +0300 |
commit | 345ac03b7afb1dc9b941c53bc45cc3dfcf22e61c (patch) | |
tree | 42da609254928d746a961465d9ecfbff3ab71ad4 /app/controllers/projects/settings | |
parent | 370fc05da7f95bf6621867a71d51493cf3899e25 (diff) |
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.rb | 8 |
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 |