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
Boxiang Sun
gitlab-ce
Commits
dd146a59
Commit
dd146a59
authored
May 04, 2017
by
Phil Hughes
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Changed how the default avatar is set
parent
5996e8f9
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
33 additions
and
14 deletions
+33
-14
app/assets/javascripts/boards/boards_bundle.js
app/assets/javascripts/boards/boards_bundle.js
+3
-2
app/assets/javascripts/boards/models/issue.js
app/assets/javascripts/boards/models/issue.js
+2
-2
app/assets/javascripts/boards/models/list.js
app/assets/javascripts/boards/models/list.js
+3
-2
app/assets/javascripts/boards/models/user.js
app/assets/javascripts/boards/models/user.js
+2
-5
app/assets/javascripts/boards/stores/boards_store.js
app/assets/javascripts/boards/stores/boards_store.js
+2
-2
app/assets/javascripts/boards/utils/default_avatar.js
app/assets/javascripts/boards/utils/default_avatar.js
+0
-1
spec/javascripts/boards/issue_card_spec.js
spec/javascripts/boards/issue_card_spec.js
+21
-0
No files found.
app/assets/javascripts/boards/boards_bundle.js
View file @
dd146a59
...
@@ -59,7 +59,8 @@ $(() => {
...
@@ -59,7 +59,8 @@ $(() => {
issueLinkBase
:
$boardApp
.
dataset
.
issueLinkBase
,
issueLinkBase
:
$boardApp
.
dataset
.
issueLinkBase
,
rootPath
:
$boardApp
.
dataset
.
rootPath
,
rootPath
:
$boardApp
.
dataset
.
rootPath
,
bulkUpdatePath
:
$boardApp
.
dataset
.
bulkUpdatePath
,
bulkUpdatePath
:
$boardApp
.
dataset
.
bulkUpdatePath
,
detailIssue
:
Store
.
detail
detailIssue
:
Store
.
detail
,
defaultAvatar
:
$boardApp
.
dataset
.
defaultAvatar
,
},
},
computed
:
{
computed
:
{
detailIssueVisible
()
{
detailIssueVisible
()
{
...
@@ -82,7 +83,7 @@ $(() => {
...
@@ -82,7 +83,7 @@ $(() => {
gl
.
boardService
.
all
()
gl
.
boardService
.
all
()
.
then
((
resp
)
=>
{
.
then
((
resp
)
=>
{
resp
.
json
().
forEach
((
board
)
=>
{
resp
.
json
().
forEach
((
board
)
=>
{
const
list
=
Store
.
addList
(
board
);
const
list
=
Store
.
addList
(
board
,
this
.
defaultAvatar
);
if
(
list
.
type
===
'
closed
'
)
{
if
(
list
.
type
===
'
closed
'
)
{
list
.
position
=
Infinity
;
list
.
position
=
Infinity
;
...
...
app/assets/javascripts/boards/models/issue.js
View file @
dd146a59
...
@@ -6,7 +6,7 @@
...
@@ -6,7 +6,7 @@
import
Vue
from
'
vue
'
;
import
Vue
from
'
vue
'
;
class
ListIssue
{
class
ListIssue
{
constructor
(
obj
)
{
constructor
(
obj
,
defaultAvatar
)
{
this
.
globalId
=
obj
.
id
;
this
.
globalId
=
obj
.
id
;
this
.
id
=
obj
.
iid
;
this
.
id
=
obj
.
iid
;
this
.
title
=
obj
.
title
;
this
.
title
=
obj
.
title
;
...
@@ -19,7 +19,7 @@ class ListIssue {
...
@@ -19,7 +19,7 @@ class ListIssue {
this
.
position
=
obj
.
relative_position
||
Infinity
;
this
.
position
=
obj
.
relative_position
||
Infinity
;
if
(
obj
.
assignee
)
{
if
(
obj
.
assignee
)
{
this
.
assignee
=
new
ListUser
(
obj
.
assignee
);
this
.
assignee
=
new
ListUser
(
obj
.
assignee
,
defaultAvatar
);
}
}
if
(
obj
.
milestone
)
{
if
(
obj
.
milestone
)
{
...
...
app/assets/javascripts/boards/models/list.js
View file @
dd146a59
...
@@ -6,7 +6,7 @@ import queryData from '../utils/query_data';
...
@@ -6,7 +6,7 @@ import queryData from '../utils/query_data';
const
PER_PAGE
=
20
;
const
PER_PAGE
=
20
;
class
List
{
class
List
{
constructor
(
obj
)
{
constructor
(
obj
,
defaultAvatar
)
{
this
.
id
=
obj
.
id
;
this
.
id
=
obj
.
id
;
this
.
_uid
=
this
.
guid
();
this
.
_uid
=
this
.
guid
();
this
.
position
=
obj
.
position
;
this
.
position
=
obj
.
position
;
...
@@ -18,6 +18,7 @@ class List {
...
@@ -18,6 +18,7 @@ class List {
this
.
loadingMore
=
false
;
this
.
loadingMore
=
false
;
this
.
issues
=
[];
this
.
issues
=
[];
this
.
issuesSize
=
0
;
this
.
issuesSize
=
0
;
this
.
defaultAvatar
=
defaultAvatar
;
if
(
obj
.
label
)
{
if
(
obj
.
label
)
{
this
.
label
=
new
ListLabel
(
obj
.
label
);
this
.
label
=
new
ListLabel
(
obj
.
label
);
...
@@ -106,7 +107,7 @@ class List {
...
@@ -106,7 +107,7 @@ class List {
createIssues
(
data
)
{
createIssues
(
data
)
{
data
.
forEach
((
issueObj
)
=>
{
data
.
forEach
((
issueObj
)
=>
{
this
.
addIssue
(
new
ListIssue
(
issueObj
));
this
.
addIssue
(
new
ListIssue
(
issueObj
,
this
.
defaultAvatar
));
});
});
}
}
...
...
app/assets/javascripts/boards/models/user.js
View file @
dd146a59
/* eslint-disable no-unused-vars */
import
defaultAvatar
from
'
../utils/default_avatar
'
;
class
ListUser
{
class
ListUser
{
constructor
(
user
)
{
constructor
(
user
,
defaultAvatar
)
{
this
.
id
=
user
.
id
;
this
.
id
=
user
.
id
;
this
.
name
=
user
.
name
;
this
.
name
=
user
.
name
;
this
.
username
=
user
.
username
;
this
.
username
=
user
.
username
;
this
.
avatar
=
user
.
avatar_url
||
defaultAvatar
()
;
this
.
avatar
=
user
.
avatar_url
||
defaultAvatar
;
}
}
}
}
...
...
app/assets/javascripts/boards/stores/boards_store.js
View file @
dd146a59
...
@@ -23,8 +23,8 @@ gl.issueBoards.BoardsStore = {
...
@@ -23,8 +23,8 @@ gl.issueBoards.BoardsStore = {
this
.
state
.
lists
=
[];
this
.
state
.
lists
=
[];
this
.
filter
.
path
=
gl
.
utils
.
getUrlParamsArray
().
join
(
'
&
'
);
this
.
filter
.
path
=
gl
.
utils
.
getUrlParamsArray
().
join
(
'
&
'
);
},
},
addList
(
listObj
)
{
addList
(
listObj
,
defaultAvatar
)
{
const
list
=
new
List
(
listObj
);
const
list
=
new
List
(
listObj
,
defaultAvatar
);
this
.
state
.
lists
.
push
(
list
);
this
.
state
.
lists
.
push
(
list
);
return
list
;
return
list
;
...
...
app/assets/javascripts/boards/utils/default_avatar.js
deleted
100644 → 0
View file @
5996e8f9
export
default
()
=>
document
.
getElementById
(
'
board-app
'
).
dataset
.
defaultAvatar
;
spec/javascripts/boards/issue_card_spec.js
View file @
dd146a59
...
@@ -146,6 +146,27 @@ describe('Issue card component', () => {
...
@@ -146,6 +146,27 @@ describe('Issue card component', () => {
).
not
.
toBeNull
();
).
not
.
toBeNull
();
});
});
});
});
describe
(
'
assignee default avatar
'
,
()
=>
{
beforeEach
((
done
)
=>
{
component
.
issue
.
assignee
=
new
ListUser
({
id
:
1
,
name
:
'
testing 123
'
,
username
:
'
test
'
,
},
'
default_avatar
'
);
Vue
.
nextTick
(
done
);
});
it
(
'
displays defaults avatar if users avatar is null
'
,
()
=>
{
expect
(
component
.
$el
.
querySelector
(
'
.card-assignee img
'
),
).
not
.
toBeNull
();
expect
(
component
.
$el
.
querySelector
(
'
.card-assignee img
'
).
getAttribute
(
'
src
'
),
).
toBe
(
'
default_avatar
'
);
});
});
});
});
describe
(
'
labels
'
,
()
=>
{
describe
(
'
labels
'
,
()
=>
{
...
...
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