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
0
Merge Requests
0
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
Léo-Paul Géneau
gitlab-ce
Commits
6202657e
Commit
6202657e
authored
Mar 21, 2018
by
Phil Hughes
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Changes empty project avatar to identicon in the IDE
Closes #44298
parent
aa2a97b5
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
62 additions
and
7 deletions
+62
-7
app/assets/javascripts/ide/components/ide_project_tree.vue
app/assets/javascripts/ide/components/ide_project_tree.vue
+18
-7
changelogs/unreleased/ide-project-avatar-identicon.yml
changelogs/unreleased/ide-project-avatar-identicon.yml
+5
-0
spec/javascripts/ide/components/ide_project_tree_spec.js
spec/javascripts/ide/components/ide_project_tree_spec.js
+39
-0
No files found.
app/assets/javascripts/ide/components/ide_project_tree.vue
View file @
6202657e
<
script
>
<
script
>
import
projectAvatarImage
from
'
~/vue_shared/components/project_avatar/image.vue
'
;
import
ProjectAvatarImage
from
'
~/vue_shared/components/project_avatar/image.vue
'
;
import
branchesTree
from
'
./ide_project_branches_tree.vue
'
;
import
Identicon
from
'
../../vue_shared/components/identicon.vue
'
;
import
externalLinks
from
'
./ide_external_links.vue
'
;
import
BranchesTree
from
'
./ide_project_branches_tree.vue
'
;
import
ExternalLinks
from
'
./ide_external_links.vue
'
;
export
default
{
export
default
{
components
:
{
components
:
{
branchesTree
,
BranchesTree
,
externalLinks
,
ExternalLinks
,
projectAvatarImage
,
ProjectAvatarImage
,
Identicon
,
},
},
props
:
{
props
:
{
project
:
{
project
:
{
...
@@ -25,7 +27,10 @@ export default {
...
@@ -25,7 +27,10 @@ export default {
:title=
"project.name"
:title=
"project.name"
:href=
"project.web_url"
:href=
"project.web_url"
>
>
<div
class=
"avatar-container s40 project-avatar"
>
<div
v-if=
"project.avatar_url"
class=
"avatar-container s40 project-avatar"
>
<project-avatar-image
<project-avatar-image
class=
"avatar-container project-avatar"
class=
"avatar-container project-avatar"
:link-href=
"project.path"
:link-href=
"project.path"
...
@@ -34,6 +39,12 @@ export default {
...
@@ -34,6 +39,12 @@ export default {
:img-size=
"40"
:img-size=
"40"
/>
/>
</div>
</div>
<identicon
v-else
size-class=
"s40"
:entity-id=
"project.id"
:entity-name=
"project.name"
/>
<div
class=
"sidebar-context-title"
>
<div
class=
"sidebar-context-title"
>
{{
project
.
name
}}
{{
project
.
name
}}
</div>
</div>
...
...
changelogs/unreleased/ide-project-avatar-identicon.yml
0 → 100644
View file @
6202657e
---
title
:
Make project avatar in IDE consistent with the rest of GitLab
merge_request
:
author
:
type
:
changed
spec/javascripts/ide/components/ide_project_tree_spec.js
0 → 100644
View file @
6202657e
import
Vue
from
'
vue
'
;
import
ProjectTree
from
'
~/ide/components/ide_project_tree.vue
'
;
import
createComponent
from
'
spec/helpers/vue_mount_component_helper
'
;
describe
(
'
IDE project tree
'
,
()
=>
{
const
Component
=
Vue
.
extend
(
ProjectTree
);
let
vm
;
beforeEach
(()
=>
{
vm
=
createComponent
(
Component
,
{
project
:
{
id
:
1
,
name
:
'
test
'
,
web_url
:
gl
.
TEST_HOST
,
avatar_url
:
''
,
branches
:
[],
},
});
});
afterEach
(()
=>
{
vm
.
$destroy
();
});
it
(
'
renders identicon when projct has no avatar
'
,
()
=>
{
expect
(
vm
.
$el
.
querySelector
(
'
.identicon
'
)).
not
.
toBeNull
();
});
it
(
'
renders avatar image if project has avatar
'
,
done
=>
{
vm
.
project
.
avatar_url
=
gl
.
TEST_HOST
;
vm
.
$nextTick
(()
=>
{
expect
(
vm
.
$el
.
querySelector
(
'
.identicon
'
)).
toBeNull
();
expect
(
vm
.
$el
.
querySelector
(
'
img.avatar
'
)).
not
.
toBeNull
();
done
();
});
});
});
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