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
1
Merge Requests
1
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
nexedi
gitlab-ce
Commits
53180d13
Commit
53180d13
authored
Jun 17, 2021
by
Austin Regnery
Committed by
Olena Horal-Koretska
Jun 17, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Relabel access token fields
Changelog: changed
parent
853aafad
Changes
10
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
40 additions
and
20 deletions
+40
-20
app/views/admin/impersonation_tokens/index.html.haml
app/views/admin/impersonation_tokens/index.html.haml
+2
-1
app/views/profiles/personal_access_tokens/index.html.haml
app/views/profiles/personal_access_tokens/index.html.haml
+2
-1
app/views/projects/settings/access_tokens/index.html.haml
app/views/projects/settings/access_tokens/index.html.haml
+2
-1
app/views/shared/access_tokens/_form.html.haml
app/views/shared/access_tokens/_form.html.haml
+13
-5
app/views/shared/access_tokens/_table.html.haml
app/views/shared/access_tokens/_table.html.haml
+1
-1
locale/gitlab.pot
locale/gitlab.pot
+12
-3
spec/features/admin/admin_users_impersonation_tokens_spec.rb
spec/features/admin/admin_users_impersonation_tokens_spec.rb
+2
-2
spec/features/profiles/personal_access_tokens_spec.rb
spec/features/profiles/personal_access_tokens_spec.rb
+3
-3
spec/features/projects/settings/access_tokens_spec.rb
spec/features/projects/settings/access_tokens_spec.rb
+2
-2
spec/features/projects/settings/user_searches_in_settings_spec.rb
...tures/projects/settings/user_searches_in_settings_spec.rb
+1
-1
No files found.
app/views/admin/impersonation_tokens/index.html.haml
View file @
53180d13
...
...
@@ -19,7 +19,8 @@
path:
admin_user_impersonation_tokens_path
,
impersonation:
true
,
token:
@impersonation_token
,
scopes:
@scopes
scopes:
@scopes
,
help_path:
help_page_path
(
'api/README'
,
anchor:
'impersonation-tokens'
)
=
render
'shared/access_tokens/table'
,
type:
type
,
...
...
app/views/profiles/personal_access_tokens/index.html.haml
View file @
53180d13
...
...
@@ -24,7 +24,8 @@
type:
type
,
path:
profile_personal_access_tokens_path
,
token:
@personal_access_token
,
scopes:
@scopes
scopes:
@scopes
,
help_path:
help_page_path
(
'user/profile/personal_access_tokens.md'
,
anchor:
'personal-access-token-scopes'
)
=
render
'shared/access_tokens/table'
,
type:
type
,
...
...
app/views/projects/settings/access_tokens/index.html.haml
View file @
53180d13
...
...
@@ -35,7 +35,8 @@
path:
project_settings_access_tokens_path
(
@project
),
token:
@project_access_token
,
scopes:
@scopes
,
prefix: :project_access_token
prefix: :project_access_token
,
help_path:
help_page_path
(
'user/project/settings/project_access_tokens'
,
anchor:
'limiting-scopes-of-a-project-access-token'
)
=
render
'shared/access_tokens/table'
,
active_tokens:
@active_project_access_tokens
,
...
...
app/views/shared/access_tokens/_form.html.haml
View file @
53180d13
-
title
=
local_assigns
.
fetch
(
:title
,
_
(
'Add a %{type}'
)
%
{
type:
type
})
-
prefix
=
local_assigns
.
fetch
(
:prefix
,
:personal_access_token
)
-
help_path
=
local_assigns
.
fetch
(
:help_path
)
%h5
.gl-mt-0
=
title
...
...
@@ -11,13 +12,16 @@
=
form_errors
(
token
)
.row
.form-group.col-md-6
=
f
.
label
:name
,
_
(
'Name'
),
class:
'label-bold'
=
f
.
text_field
:name
,
class:
'form-control gl-form-input'
,
required:
true
,
data:
{
qa_selector:
'access_token_name_field'
}
.form-group.col
.row
=
f
.
label
:name
,
_
(
'Token name'
),
class:
'label-bold col-md-12'
.col-md-6
=
f
.
text_field
:name
,
class:
'form-control gl-form-input'
,
required:
true
,
data:
{
qa_selector:
'access_token_name_field'
},
:'aria-describedby'
=>
'access_token_help_text'
%span
.form-text.text-muted.col-md-12
#access_token_help_text
=
_
(
'For example, the application using the token or the purpose of the token.'
)
.row
.form-group.col-md-6
=
f
.
label
:expires_at
,
_
(
'Expir
es at
'
),
class:
'label-bold'
=
f
.
label
:expires_at
,
_
(
'Expir
ation date
'
),
class:
'label-bold'
.input-icon-wrapper
=
render_if_exists
'personal_access_tokens/callout_max_personal_access_token_lifetime'
...
...
@@ -26,7 +30,11 @@
=
f
.
text_field
:expires_at
,
class:
'datepicker gl-datepicker-input form-control gl-form-input'
,
placeholder:
'YYYY-MM-DD'
,
autocomplete:
'off'
,
data:
{
js_name:
'expiresAt'
}
.form-group
=
f
.
label
:scopes
,
_
(
'Scopes'
),
class:
'label-bold'
%b
{
:'aria-describedby'
=>
'select_scope_help_text'
}
=
s_
(
'Tokens|Select scopes'
)
%p
.text-secondary
#select_scope_help_text
=
s_
(
'Tokens|Scopes set the permission levels granted to the token.'
)
=
link_to
"Learn more."
,
help_path
,
target:
'_blank'
=
render
'shared/tokens/scopes_form'
,
prefix:
prefix
,
token:
token
,
scopes:
scopes
-
if
prefix
==
:personal_access_token
&&
Feature
.
enabled?
(
:personal_access_tokens_scoped_to_projects
,
current_user
)
...
...
app/views/shared/access_tokens/_table.html.haml
View file @
53180d13
...
...
@@ -14,7 +14,7 @@
%table
.table.active-tokens
%thead
%tr
%th
=
_
(
'
N
ame'
)
%th
=
_
(
'
Token n
ame'
)
%th
=
s_
(
'AccessTokens|Created'
)
%th
=
_
(
'Last Used'
)
...
...
locale/gitlab.pot
View file @
53180d13
...
...
@@ -13326,9 +13326,6 @@ msgstr ""
msgid "Expires"
msgstr ""
msgid "Expires at"
msgstr ""
msgid "Expires at (optional)"
msgstr ""
...
...
@@ -14269,6 +14266,9 @@ msgstr ""
msgid "For each job, re-use the project workspace. If the workspace doesn't exist, use %{code_open}git clone%{code_close}."
msgstr ""
msgid "For example, the application using the token or the purpose of the token."
msgstr ""
msgid "For general work"
msgstr ""
...
...
@@ -34291,9 +34291,18 @@ msgstr ""
msgid "Token"
msgstr ""
msgid "Token name"
msgstr ""
msgid "Token valid until revoked"
msgstr ""
msgid "Tokens|Scopes set the permission levels granted to the token."
msgstr ""
msgid "Tokens|Select scopes"
msgstr ""
msgid "Tomorrow"
msgstr ""
...
...
spec/features/admin/admin_users_impersonation_tokens_spec.rb
View file @
53180d13
...
...
@@ -28,10 +28,10 @@ RSpec.describe 'Admin > Users > Impersonation Tokens', :js do
name
=
'Hello World'
visit
admin_user_impersonation_tokens_path
(
user_id:
user
.
username
)
fill_in
"
N
ame"
,
with:
name
fill_in
"
Token n
ame"
,
with:
name
# Set date to 1st of next month
find_field
(
"Expir
es at
"
).
click
find_field
(
"Expir
ation date
"
).
click
find
(
".pika-next"
).
click
click_on
"1"
...
...
spec/features/profiles/personal_access_tokens_spec.rb
View file @
53180d13
...
...
@@ -42,10 +42,10 @@ RSpec.describe 'Profile > Personal Access Tokens', :js do
name
=
'My PAT'
visit
profile_personal_access_tokens_path
fill_in
"
N
ame"
,
with:
name
fill_in
"
Token n
ame"
,
with:
name
# Set date to 1st of next month
find_field
(
"Expir
es at
"
).
click
find_field
(
"Expir
ation date
"
).
click
find
(
".pika-next"
).
click
click_on
"1"
...
...
@@ -66,7 +66,7 @@ RSpec.describe 'Profile > Personal Access Tokens', :js do
it
"displays an error message"
do
disallow_personal_access_token_saves!
visit
profile_personal_access_tokens_path
fill_in
"
N
ame"
,
with:
'My PAT'
fill_in
"
Token n
ame"
,
with:
'My PAT'
expect
{
click_on
"Create personal access token"
}.
not_to
change
{
PersonalAccessToken
.
count
}
expect
(
page
).
to
have_content
(
"Name cannot be nil"
)
...
...
spec/features/projects/settings/access_tokens_spec.rb
View file @
53180d13
...
...
@@ -51,10 +51,10 @@ RSpec.describe 'Project > Settings > Access Tokens', :js do
name
=
'My project access token'
visit
project_settings_access_tokens_path
(
project
)
fill_in
'
N
ame'
,
with:
name
fill_in
'
Token n
ame'
,
with:
name
# Set date to 1st of next month
find_field
(
'Expir
es at
'
).
click
find_field
(
'Expir
ation date
'
).
click
find
(
'.pika-next'
).
click
click_on
'1'
...
...
spec/features/projects/settings/user_searches_in_settings_spec.rb
View file @
53180d13
...
...
@@ -39,7 +39,7 @@ RSpec.describe 'User searches project settings', :js do
visit
project_settings_access_tokens_path
(
project
)
end
it_behaves_like
'can highlight results'
,
'Expir
es at
'
it_behaves_like
'can highlight results'
,
'Expir
ation date
'
end
context
'in Repository page'
do
...
...
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