diff options
| author | Mayra Cabrera <mcabrera@gitlab.com> | 2018-03-29 20:11:36 -0600 |
|---|---|---|
| committer | Mayra Cabrera <mcabrera@gitlab.com> | 2018-04-06 21:20:16 -0500 |
| commit | 345ac03b7afb1dc9b941c53bc45cc3dfcf22e61c (patch) | |
| tree | 42da609254928d746a961465d9ecfbff3ab71ad4 /app/presenters | |
| parent | 370fc05da7f95bf6621867a71d51493cf3899e25 (diff) | |
| download | gitlab-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/presenters')
| -rw-r--r-- | app/presenters/projects/settings/deploy_tokens_presenter.rb | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/app/presenters/projects/settings/deploy_tokens_presenter.rb b/app/presenters/projects/settings/deploy_tokens_presenter.rb index cbad35431b3..bdb89bb9f02 100644 --- a/app/presenters/projects/settings/deploy_tokens_presenter.rb +++ b/app/presenters/projects/settings/deploy_tokens_presenter.rb @@ -23,14 +23,23 @@ module Projects end end - def new_deploy_token - @new_deploy_token ||= Gitlab::Redis::SharedState.with do |redis| + def temporal_token + @temporal_token ||= Gitlab::Redis::SharedState.with do |redis| token = redis.get(deploy_token_key) redis.del(deploy_token_key) token end end + def attributes_deploy_token + @attributes_deploy_token ||= Gitlab::Redis::SharedState.with do |redis| + attributes_key = deploy_token_key + ":attributes" + attributes_content = redis.get(attributes_key) || '{}' + redis.del(attributes_key) + JSON.parse(attributes_content) + end + end + private def scope_descriptions @@ -41,7 +50,7 @@ module Projects end def deploy_token_key - DeployToken.redis_shared_state_key(current_user.id) + @deploy_token_key ||= project.deploy_tokens.new.redis_shared_state_key(current_user.id) end end end |
