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
9ce56d2b
Commit
9ce56d2b
authored
Jan 01, 2017
by
Simon Vocella
Committed by
Tiago Botelho
Feb 28, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add text-warning class in profile settings if the personal_access_token expires soon
parent
a3dfb58e
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
3 deletions
+4
-3
app/views/profiles/personal_access_tokens/index.html.haml
app/views/profiles/personal_access_tokens/index.html.haml
+3
-2
spec/features/profiles/personal_access_tokens_spec.rb
spec/features/profiles/personal_access_tokens_spec.rb
+1
-1
No files found.
app/views/profiles/personal_access_tokens/index.html.haml
View file @
9ce56d2b
...
@@ -51,8 +51,9 @@
...
@@ -51,8 +51,9 @@
%td
=
token
.
name
%td
=
token
.
name
%td
=
token
.
created_at
.
to_date
.
to_s
(
:medium
)
%td
=
token
.
created_at
.
to_date
.
to_s
(
:medium
)
%td
%td
-
if
token
.
expires_at
.
present?
-
if
token
.
expires?
=
token
.
expires_at
.
to_date
.
to_s
(
:medium
)
%span
{
class:
(
'text-warning'
if
token
.
expires_soon?
)
}
In
#{
distance_of_time_in_words_to_now
(
token
.
expires_at
)
}
-
else
-
else
%span
.personal-access-tokens-never-expires-label
Never
%span
.personal-access-tokens-never-expires-label
Never
%td
=
token
.
scopes
.
present?
?
token
.
scopes
.
join
(
", "
)
:
"<no scopes selected>"
%td
=
token
.
scopes
.
present?
?
token
.
scopes
.
join
(
", "
)
:
"<no scopes selected>"
...
...
spec/features/profiles/personal_access_tokens_spec.rb
View file @
9ce56d2b
...
@@ -43,7 +43,7 @@ describe 'Profile > Personal Access Tokens', feature: true, js: true do
...
@@ -43,7 +43,7 @@ describe 'Profile > Personal Access Tokens', feature: true, js: true do
click_on
"Create Personal Access Token"
click_on
"Create Personal Access Token"
expect
(
active_personal_access_tokens
).
to
have_text
(
name
)
expect
(
active_personal_access_tokens
).
to
have_text
(
name
)
expect
(
active_personal_access_tokens
).
to
have_text
(
Date
.
today
.
next_month
.
at_beginning_of_month
.
to_s
(
:medium
)
)
expect
(
active_personal_access_tokens
).
to
have_text
(
'In'
)
expect
(
active_personal_access_tokens
).
to
have_text
(
'api'
)
expect
(
active_personal_access_tokens
).
to
have_text
(
'api'
)
expect
(
active_personal_access_tokens
).
to
have_text
(
'read_user'
)
expect
(
active_personal_access_tokens
).
to
have_text
(
'read_user'
)
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