Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Léo-Paul Géneau
gitlab-ce
Commits
46a6036c
Commit
46a6036c
authored
Apr 02, 2018
by
Mayra Cabrera
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Addreses frontend review
Also fixes spec failures on presenter and docs
parent
560ed922
Changes
8
Show whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
27 additions
and
27 deletions
+27
-27
app/assets/stylesheets/pages/settings.scss
app/assets/stylesheets/pages/settings.scss
+3
-2
app/presenters/projects/settings/deploy_tokens_presenter.rb
app/presenters/projects/settings/deploy_tokens_presenter.rb
+2
-2
app/views/projects/deploy_tokens/_form.html.haml
app/views/projects/deploy_tokens/_form.html.haml
+4
-4
app/views/projects/deploy_tokens/_index.html.haml
app/views/projects/deploy_tokens/_index.html.haml
+4
-5
app/views/projects/deploy_tokens/_new_deploy_token.html.haml
app/views/projects/deploy_tokens/_new_deploy_token.html.haml
+4
-4
app/views/projects/deploy_tokens/_revoke_modal.html.haml
app/views/projects/deploy_tokens/_revoke_modal.html.haml
+5
-5
doc/user/project/deploy_tokens/index.md
doc/user/project/deploy_tokens/index.md
+2
-2
spec/presenters/projects/settings/deploy_tokens_presenter_spec.rb
...senters/projects/settings/deploy_tokens_presenter_spec.rb
+3
-3
No files found.
app/assets/stylesheets/pages/settings.scss
View file @
46a6036c
...
...
@@ -299,7 +299,8 @@
margin-left
:
5px
;
}
.help-block
{
margin-top
:
4px
;
.deploy-token-help-block
{
display
:
block
;
margin-bottom
:
0
;
}
}
app/presenters/projects/settings/deploy_tokens_presenter.rb
View file @
46a6036c
...
...
@@ -44,8 +44,8 @@ module Projects
def
scope_descriptions
{
'read_repo'
=>
'Allows read-only access to the repository'
,
'read_registry'
=>
'Allows read-only access to the registry images'
'read_repo'
=>
s_
(
'Allows read-only access to the repository'
)
,
'read_registry'
=>
s_
(
'Allows read-only access to the registry images'
)
}
end
...
...
app/views/projects/deploy_tokens/_form.html.haml
View file @
46a6036c
%p
.profile-settings-content
Pick a name for the application, and we'll give you a unique deploy token.
=
s_
(
"Pick a name for the application, and we'll give you a unique deploy token."
)
=
form_for
token
,
url:
project_deploy_tokens_path
(
project
),
method: :post
do
|
f
|
=
form_errors
(
token
)
.form-group
=
f
.
label
:name
,
class:
'label-light'
=
f
.
text_field
:name
,
class:
"form-control"
,
required:
true
=
f
.
text_field
:name
,
class:
'form-control'
,
required:
true
.form-group
=
f
.
label
:expires_at
,
class:
'label-light'
=
f
.
text_field
:expires_at
,
class:
"datepicker form-control"
=
f
.
text_field
:expires_at
,
class:
'datepicker form-control'
.form-group
=
f
.
label
:scopes
,
class:
'label-light'
...
...
@@ -18,4 +18,4 @@
=
render
'projects/deploy_tokens/scope_form'
,
token:
token
,
scope:
scope
,
presenter:
presenter
.prepend-top-default
=
f
.
submit
"Create deploy token"
,
class:
"btn btn-create"
=
f
.
submit
s_
(
'Create deploy token'
),
class:
'btn btn-success'
app/views/projects/deploy_tokens/_index.html.haml
View file @
46a6036c
...
...
@@ -2,18 +2,17 @@
%section
.settings.no-animate
{
class:
(
'expanded'
if
expanded
)
}
.settings-header
%h4
Deploy Tokens
%button
.btn.js-settings-toggle.qa-expand-deploy-keys
%h4
=
s_
(
'Deploy Tokens'
)
%button
.btn.js-settings-toggle.qa-expand-deploy-keys
{
type:
'button'
}
=
expanded
?
'Collapse'
:
'Expand'
%p
Deploy tokens allow read-only access to your repository and registry images.
=
s_
(
'Deploy tokens allow read-only access to your repository and registry images.'
)
.settings-content
-
if
@deploy_tokens
.
temporal_token
=
render
'projects/deploy_tokens/new_deploy_token'
,
new_token:
@deploy_tokens
.
temporal_token
%h5
.prepend-top-0
Add a deploy token
=
s_
(
'Add a deploy token'
)
=
render
'projects/deploy_tokens/form'
,
project:
@project
,
token:
@deploy_token
,
presenter:
@deploy_tokens
%hr
=
render
'projects/deploy_tokens/table'
,
project:
@project
,
active_tokens:
@deploy_tokens
app/views/projects/deploy_tokens/_new_deploy_token.html.haml
View file @
46a6036c
.created-deploy-token-container
%h5
.prepend-top-0
Your New Deploy Token
=
s_
(
'Your New Deploy Token'
)
.form-group
=
text_field_tag
'deploy-token'
,
new_token
,
readonly:
true
,
class:
"deploy-token-field form-control js-select-on-focus"
,
'aria-describedby'
=>
"deploy-token-help-block"
=
clipboard_button
(
text:
new_token
,
title:
"Copy deploy token to clipboard"
,
placement:
"left"
)
%span
.deploy-token
.help-block.text-danger
Make sure you save it - you won't be able to access it again.
=
text_field_tag
'deploy-token'
,
new_token
,
readonly:
true
,
class:
'deploy-token-field form-control js-select-on-focus'
=
clipboard_button
(
text:
new_token
,
title:
s_
(
'Copy deploy token to clipboard'
),
placement:
'left'
)
%span
.deploy-token
-help-block.prepend-top-5.text-danger
=
s_
(
"Make sure you save it - you won't be able to access it again."
)
%hr
app/views/projects/deploy_tokens/_revoke_modal.html.haml
View file @
46a6036c
...
...
@@ -5,13 +5,13 @@
%h4
.modal-title.pull-left
Revoke
%b
#{
token
.
name
}
?
%button
.close
.pull-right
{
"aria-label"
=>
"Close"
,
data:
{
dismiss:
"modal"
}
}
%span
{
"aria-hidden"
=>
"true"
}
×
%button
.close
{
'aria-label'
=>
'Close'
,
'data-dismiss'
=>
'modal'
,
type:
'button'
}
%span
{
'aria-hidden'
=>
'true'
}
×
.modal-body
%p
You are about to revoke
=
s_
(
'You are about to revoke'
)
%b
#{
token
.
name
}
.
This action cannot be undone.
=
s_
(
'This action cannot be undone.'
)
.modal-footer
%a
{
href:
'#'
,
data:
{
dismiss:
'modal'
},
class:
'btn btn-default'
}
Cancel
%a
{
href:
'#'
,
data:
{
dismiss:
'modal'
},
class:
'btn btn-default'
}
=
s_
(
'Cancel'
)
=
link_to
"Revoke
#{
token
.
name
}
"
,
revoke_project_deploy_token_path
(
project
,
token
),
method: :put
,
class:
'btn btn-danger'
doc/user/project/deploy_tokens/index.md
View file @
46a6036c
...
...
@@ -37,7 +37,7 @@ the following table.
| Scope | Description |
| ----- | ----------- |
|
`read_repo`
| Allows read-access to the repository through
`git clone`
|
|
`read_registry`
| Allows read-access to[container registry] images if a project is private and authorization is required. |
|
`read_registry`
| Allows read-access to
[container registry] images if a project is private and authorization is required. |
## Usage
...
...
@@ -69,4 +69,4 @@ Just replace `<username>` and `<deploy_token>` with the proper values.
[
ce-17894
]:
https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/17894
[
ce-11845
]:
https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/11845
[
container registry
]:
../
project/
container_registry.md
[
container registry
]:
../container_registry.md
spec/presenters/projects/settings/deploy_tokens_presenter_spec.rb
View file @
46a6036c
...
...
@@ -28,18 +28,18 @@ describe Projects::Settings::DeployTokensPresenter do
end
end
describe
'#
new_deploy
_token'
do
describe
'#
temporal
_token'
do
context
'when a deploy token has been created recently'
do
it
'returns the token of the deploy'
do
deploy_token
=
::
DeployTokens
::
CreateService
.
new
(
project
,
user
,
attributes_for
(
:deploy_token
)).
execute
expect
(
presenter
.
new_deploy
_token
).
to
eq
(
deploy_token
.
token
)
expect
(
presenter
.
temporal
_token
).
to
eq
(
deploy_token
.
token
)
end
end
context
'when a deploy token has not been created recently'
do
it
'does returns nil'
do
expect
(
presenter
.
new_deploy
_token
).
to
be_nil
expect
(
presenter
.
temporal
_token
).
to
be_nil
end
end
end
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment