Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
李少辉-开发者
gitlab-foss
提交
46a6036c
G
gitlab-foss
项目概览
李少辉-开发者
/
gitlab-foss
通知
15
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
G
gitlab-foss
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
46a6036c
编写于
4月 02, 2018
作者:
M
Mayra Cabrera
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Addreses frontend review
Also fixes spec failures on presenter and docs
上级
560ed922
变更
8
隐藏空白更改
内联
并排
Showing
8 changed file
with
27 addition
and
27 deletion
+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
未找到文件。
app/assets/stylesheets/pages/settings.scss
浏览文件 @
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
浏览文件 @
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
浏览文件 @
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
浏览文件 @
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
浏览文件 @
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
浏览文件 @
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
浏览文件 @
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
浏览文件 @
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
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录