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
3b97b95b
Commit
3b97b95b
authored
Jan 18, 2022
by
Tiger
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Exclude revoked tokens from agent tokens list
https://gitlab.com/gitlab-org/gitlab/-/merge_requests/78420
parent
449d0055
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
26 additions
and
3 deletions
+26
-3
app/assets/javascripts/clusters/agents/components/show.vue
app/assets/javascripts/clusters/agents/components/show.vue
+2
-1
app/assets/javascripts/clusters/agents/constants.js
app/assets/javascripts/clusters/agents/constants.js
+1
-0
app/assets/javascripts/clusters/agents/graphql/queries/get_cluster_agent.query.graphql
...rs/agents/graphql/queries/get_cluster_agent.query.graphql
+8
-1
spec/frontend/clusters/agents/components/show_spec.js
spec/frontend/clusters/agents/components/show_spec.js
+15
-1
No files found.
app/assets/javascripts/clusters/agents/components/show.vue
View file @
3b97b95b
...
...
@@ -10,7 +10,7 @@ import {
}
from
'
@gitlab/ui
'
;
import
{
s__
,
__
}
from
'
~/locale
'
;
import
TimeAgoTooltip
from
'
~/vue_shared/components/time_ago_tooltip.vue
'
;
import
{
MAX_LIST_COUNT
}
from
'
../constants
'
;
import
{
MAX_LIST_COUNT
,
TOKEN_STATUS_ACTIVE
}
from
'
../constants
'
;
import
getClusterAgentQuery
from
'
../graphql/queries/get_cluster_agent.query.graphql
'
;
import
TokenTable
from
'
./token_table.vue
'
;
import
ActivityEvents
from
'
./activity_events_list.vue
'
;
...
...
@@ -30,6 +30,7 @@ export default {
return
{
agentName
:
this
.
agentName
,
projectPath
:
this
.
projectPath
,
tokenStatus
:
TOKEN_STATUS_ACTIVE
,
...
this
.
cursor
,
};
},
...
...
app/assets/javascripts/clusters/agents/constants.js
View file @
3b97b95b
...
...
@@ -36,3 +36,4 @@ export const EVENT_DETAILS = {
};
export
const
DEFAULT_ICON
=
'
token
'
;
export
const
TOKEN_STATUS_ACTIVE
=
'
ACTIVE
'
;
app/assets/javascripts/clusters/agents/graphql/queries/get_cluster_agent.query.graphql
View file @
3b97b95b
...
...
@@ -4,6 +4,7 @@
query
getClusterAgent
(
$projectPath
:
ID
!
$agentName
:
String
!
$tokenStatus
:
AgentTokenStatus
!
$first
:
Int
$last
:
Int
$afterToken
:
String
...
...
@@ -20,7 +21,13 @@ query getClusterAgent(
name
}
tokens
(
first
:
$first
,
last
:
$last
,
before
:
$beforeToken
,
after
:
$afterToken
)
{
tokens
(
status
:
$tokenStatus
first
:
$first
last
:
$last
before
:
$beforeToken
after
:
$afterToken
)
{
count
nodes
{
...
...
spec/frontend/clusters/agents/components/show_spec.js
View file @
3b97b95b
...
...
@@ -11,12 +11,14 @@ import { useFakeDate } from 'helpers/fake_date';
import
createMockApollo
from
'
helpers/mock_apollo_helper
'
;
import
waitForPromises
from
'
helpers/wait_for_promises
'
;
import
TimeAgoTooltip
from
'
~/vue_shared/components/time_ago_tooltip.vue
'
;
import
{
MAX_LIST_COUNT
,
TOKEN_STATUS_ACTIVE
}
from
'
~/clusters/agents/constants
'
;
const
localVue
=
createLocalVue
();
localVue
.
use
(
VueApollo
);
describe
(
'
ClusterAgentShow
'
,
()
=>
{
let
wrapper
;
let
agentQueryResponse
;
useFakeDate
([
2021
,
2
,
15
]);
const
provide
=
{
...
...
@@ -40,7 +42,7 @@ describe('ClusterAgentShow', () => {
};
const
createWrapper
=
({
clusterAgent
,
queryResponse
=
null
})
=>
{
const
agentQueryResponse
=
agentQueryResponse
=
queryResponse
||
jest
.
fn
().
mockResolvedValue
({
data
:
{
project
:
{
id
:
'
project-1
'
,
clusterAgent
}
}
});
const
apolloProvider
=
createMockApollo
([[
getAgentQuery
,
agentQueryResponse
]]);
...
...
@@ -84,6 +86,18 @@ describe('ClusterAgentShow', () => {
return
createWrapper
({
clusterAgent
:
defaultClusterAgent
});
});
it
(
'
sends expected params
'
,
()
=>
{
const
variables
=
{
agentName
:
provide
.
agentName
,
projectPath
:
provide
.
projectPath
,
tokenStatus
:
TOKEN_STATUS_ACTIVE
,
first
:
MAX_LIST_COUNT
,
last
:
null
,
};
expect
(
agentQueryResponse
).
toHaveBeenCalledWith
(
variables
);
});
it
(
'
displays the agent name
'
,
()
=>
{
expect
(
wrapper
.
text
()).
toContain
(
provide
.
agentName
);
});
...
...
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