BigW Consortium Gitlab
Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gitlab-ce
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Forest Godfrey
gitlab-ce
Commits
7eabb7a9
Commit
7eabb7a9
authored
Mar 09, 2017
by
Phil Hughes
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use reduce instead of a forEach
Changed an isArray check to use -1 Added comment to boards search manager to explain behaviour
parent
236d6595
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
34 additions
and
11 deletions
+34
-11
boards_bundle.js
app/assets/javascripts/boards/boards_bundle.js
+13
-2
board_card.js
app/assets/javascripts/boards/components/board_card.js
+2
-1
issue_card_inner.js
app/assets/javascripts/boards/components/issue_card_inner.js
+9
-1
filtered_search_boards.js
app/assets/javascripts/boards/filtered_search_boards.js
+3
-0
list.js
app/assets/javascripts/boards/models/list.js
+7
-7
No files found.
app/assets/javascripts/boards/boards_bundle.js
View file @
7eabb7a9
...
...
@@ -62,7 +62,13 @@ $(() => {
created
()
{
gl
.
boardService
=
new
BoardService
(
this
.
endpoint
,
this
.
bulkUpdatePath
,
this
.
boardId
);
gl
.
boardsFilterManager
=
new
FilteredSearchBoards
(
Store
.
filter
,
true
);
this
.
filterManager
=
new
FilteredSearchBoards
(
Store
.
filter
,
true
);
// Listen for updateTokens event
this
.
$on
(
'updateTokens'
,
this
.
updateTokens
);
},
beforeDestroy
()
{
this
.
$off
(
'updateTokens'
,
this
.
updateTokens
);
},
mounted
()
{
Store
.
disabled
=
this
.
disabled
;
...
...
@@ -81,7 +87,12 @@ $(() => {
Store
.
addBlankState
();
this
.
loading
=
false
;
});
}
},
methods
:
{
updateTokens
()
{
this
.
filterManager
.
updateTokens
();
}
},
});
gl
.
IssueBoardsSearch
=
new
Vue
({
...
...
app/assets/javascripts/boards/components/board_card.js
View file @
7eabb7a9
...
...
@@ -17,7 +17,8 @@ export default {
:list="list"
:issue="issue"
:issue-link-base="issueLinkBase"
:root-path="rootPath" />
:root-path="rootPath"
:update-filters="true" />
</li>
`
,
components
:
{
...
...
app/assets/javascripts/boards/components/issue_card_inner.js
View file @
7eabb7a9
...
...
@@ -23,6 +23,11 @@
type
:
String
,
required
:
true
,
},
updateFilters
:
{
type
:
Boolean
,
required
:
false
,
default
:
false
,
},
},
methods
:
{
showLabel
(
label
)
{
...
...
@@ -31,6 +36,8 @@
return
!
this
.
list
.
label
||
label
.
id
!==
this
.
list
.
label
.
id
;
},
filterByLabel
(
label
,
e
)
{
if
(
!
this
.
updateFilters
)
return
;
const
filterPath
=
gl
.
issueBoards
.
BoardsStore
.
filter
.
path
.
split
(
'&'
);
const
labelTitle
=
encodeURIComponent
(
label
.
title
);
const
param
=
`label_name[]=
${
labelTitle
}
`
;
...
...
@@ -46,7 +53,8 @@
gl
.
issueBoards
.
BoardsStore
.
filter
.
path
=
filterPath
.
join
(
'&'
);
Store
.
updateFiltersUrl
();
gl
.
boardsFilterManager
.
updateTokens
();
gl
.
IssueBoardsApp
.
$emit
(
'updateTokens'
);
},
labelStyle
(
label
)
{
return
{
...
...
app/assets/javascripts/boards/filtered_search_boards.js
View file @
7eabb7a9
...
...
@@ -4,6 +4,9 @@ export default class FilteredSearchBoards extends gl.FilteredSearchManager {
this
.
store
=
store
;
this
.
updateUrl
=
updateUrl
;
// Issue boards is slightly different, we handle all the requests async
// instead or reloading the page, we just re-fire the list ajax requests
this
.
isHandledAsync
=
true
;
}
...
...
app/assets/javascripts/boards/models/list.js
View file @
7eabb7a9
...
...
@@ -64,16 +64,14 @@ class List {
}
getIssues
(
emptyIssues
=
true
)
{
const
data
=
{
page
:
this
.
page
};
gl
.
issueBoards
.
BoardsStore
.
filter
.
path
.
split
(
'&'
).
forEach
((
filterParam
)
=>
{
if
(
filterParam
===
''
)
return
;
const
data
=
gl
.
issueBoards
.
BoardsStore
.
filter
.
path
.
split
(
'&'
).
reduce
((
data
,
filterParam
)
=>
{
if
(
filterParam
===
''
)
return
data
;
const
paramSplit
=
filterParam
.
split
(
'='
);
const
paramKeyNormalized
=
paramSplit
[
0
].
replace
(
'[]'
,
''
);
const
isArray
=
paramSplit
[
0
].
indexOf
(
'[]'
);
let
value
=
decodeURIComponent
(
paramSplit
[
1
]);
value
=
value
.
replace
(
/
\+
/g
,
' '
);
const
value
=
decodeURIComponent
(
paramSplit
[
1
]).
replace
(
/
\+
/g
,
' '
);
if
(
isArray
>=
0
)
{
if
(
isArray
!==
-
1
)
{
if
(
!
data
[
paramKeyNormalized
])
{
data
[
paramKeyNormalized
]
=
[];
}
...
...
@@ -82,7 +80,9 @@ class List {
}
else
{
data
[
paramKeyNormalized
]
=
value
;
}
});
return
data
;
},
{
page
:
this
.
page
});
if
(
this
.
label
&&
data
.
label_name
)
{
data
.
label_name
=
data
.
label_name
.
filter
(
label
=>
label
!==
this
.
label
.
title
);
...
...
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