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
c5ac6e5e
Commit
c5ac6e5e
authored
Mar 04, 2022
by
Tom Quirk
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use GlAvatar in security dashboard
Changelog: changed EE: true
parent
b3d42e53
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
18 additions
and
4 deletions
+18
-4
ee/app/assets/javascripts/security_dashboard/components/instance/project_list.vue
...s/security_dashboard/components/instance/project_list.vue
+7
-2
ee/app/assets/javascripts/security_dashboard/graphql/queries/instance_projects.query.graphql
...dashboard/graphql/queries/instance_projects.query.graphql
+1
-0
ee/spec/frontend/security_dashboard/components/instance/project_list_spec.js
...curity_dashboard/components/instance/project_list_spec.js
+10
-2
No files found.
ee/app/assets/javascripts/security_dashboard/components/instance/project_list.vue
View file @
c5ac6e5e
...
@@ -4,7 +4,7 @@ import projectsQuery from 'ee/security_dashboard/graphql/queries/instance_projec
...
@@ -4,7 +4,7 @@ import projectsQuery from 'ee/security_dashboard/graphql/queries/instance_projec
import
{
PROJECT_LOADING_ERROR_MESSAGE
}
from
'
ee/security_dashboard/helpers
'
;
import
{
PROJECT_LOADING_ERROR_MESSAGE
}
from
'
ee/security_dashboard/helpers
'
;
import
createFlash
from
'
~/flash
'
;
import
createFlash
from
'
~/flash
'
;
import
{
s__
}
from
'
~/locale
'
;
import
{
s__
}
from
'
~/locale
'
;
import
ProjectAvatar
from
'
~/vue_shared/components/
deprecated_project_avatar/default
.vue
'
;
import
ProjectAvatar
from
'
~/vue_shared/components/
project_avatar
.vue
'
;
export
default
{
export
default
{
i18n
:
{
i18n
:
{
...
@@ -76,7 +76,12 @@ export default {
...
@@ -76,7 +76,12 @@ export default {
:key=
"project.id"
:key=
"project.id"
class=
"gl-display-flex gl-align-items-center gl-py-2 js-projects-list-project-item"
class=
"gl-display-flex gl-align-items-center gl-py-2 js-projects-list-project-item"
>
>
<project-avatar
class=
"gl-flex-shrink-0"
:project=
"project"
:size=
"32"
/>
<project-avatar
class=
"gl-mr-3"
:project-name=
"project.name"
:project-avatar-url=
"project.avatarUrl"
:size=
"32"
/>
{{
project
.
nameWithNamespace
}}
{{
project
.
nameWithNamespace
}}
<gl-button
<gl-button
v-gl-tooltip
v-gl-tooltip
...
...
ee/app/assets/javascripts/security_dashboard/graphql/queries/instance_projects.query.graphql
View file @
c5ac6e5e
...
@@ -5,6 +5,7 @@ query instanceProjects($search: String, $pageSize: Int) {
...
@@ -5,6 +5,7 @@ query instanceProjects($search: String, $pageSize: Int) {
id
id
name
name
nameWithNamespace
nameWithNamespace
avatarUrl
}
}
}
}
}
}
...
...
ee/spec/frontend/security_dashboard/components/instance/project_list_spec.js
View file @
c5ac6e5e
...
@@ -7,7 +7,7 @@ import projectsQuery from 'ee/security_dashboard/graphql/queries/instance_projec
...
@@ -7,7 +7,7 @@ import projectsQuery from 'ee/security_dashboard/graphql/queries/instance_projec
import
createMockApollo
from
'
helpers/mock_apollo_helper
'
;
import
createMockApollo
from
'
helpers/mock_apollo_helper
'
;
import
waitForPromises
from
'
helpers/wait_for_promises
'
;
import
waitForPromises
from
'
helpers/wait_for_promises
'
;
import
{
extendedWrapper
}
from
'
helpers/vue_test_utils_helper
'
;
import
{
extendedWrapper
}
from
'
helpers/vue_test_utils_helper
'
;
import
ProjectAvatar
from
'
~/vue_shared/components/
deprecated_project_avatar/default
.vue
'
;
import
ProjectAvatar
from
'
~/vue_shared/components/
project_avatar
.vue
'
;
Vue
.
use
(
VueApollo
);
Vue
.
use
(
VueApollo
);
...
@@ -19,6 +19,7 @@ const generateMockProjects = (count) => {
...
@@ -19,6 +19,7 @@ const generateMockProjects = (count) => {
id
:
i
,
id
:
i
,
name
:
`project
${
i
}
`
,
name
:
`project
${
i
}
`
,
nameWithNamespace
:
`group/project
${
i
}
`
,
nameWithNamespace
:
`group/project
${
i
}
`
,
avatarUrl
:
'
/avatar
'
,
});
});
}
}
...
@@ -97,7 +98,14 @@ describe('Project List component', () => {
...
@@ -97,7 +98,14 @@ describe('Project List component', () => {
});
});
it
(
'
renders a project item with an avatar
'
,
()
=>
{
it
(
'
renders a project item with an avatar
'
,
()
=>
{
expect
(
getFirstProjectItem
().
findComponent
(
ProjectAvatar
).
exists
()).
toBe
(
true
);
const
projectAvatar
=
getFirstProjectItem
().
findComponent
(
ProjectAvatar
);
const
project
=
projects
[
0
];
expect
(
projectAvatar
.
exists
()).
toBe
(
true
);
expect
(
projectAvatar
.
props
()).
toMatchObject
({
projectName
:
project
.
name
,
projectAvatarUrl
:
project
.
avatarUrl
,
});
});
});
it
(
'
renders a project item with a project name
'
,
()
=>
{
it
(
'
renders a project item with a project name
'
,
()
=>
{
...
...
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