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
826105df
Commit
826105df
authored
Feb 07, 2018
by
Phil Hughes
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'move-board-list-vue-component' into 'master'
Move board list vue component See merge request gitlab-org/gitlab-ce!16888
parents
586ecbc5
87ee18c9
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
97 additions
and
87 deletions
+97
-87
board.js
app/assets/javascripts/boards/components/board.js
+1
-1
board_list.vue
app/assets/javascripts/boards/components/board_list.vue
+90
-85
move-board-list-vue-component.yml
changelogs/unreleased/move-board-list-vue-component.yml
+5
-0
board_list_spec.js
spec/javascripts/boards/board_list_spec.js
+1
-1
No files found.
app/assets/javascripts/boards/components/board.js
View file @
826105df
...
@@ -2,7 +2,7 @@
...
@@ -2,7 +2,7 @@
import
Sortable
from
'vendor/Sortable'
;
import
Sortable
from
'vendor/Sortable'
;
import
Vue
from
'vue'
;
import
Vue
from
'vue'
;
import
AccessorUtilities
from
'../../lib/utils/accessor'
;
import
AccessorUtilities
from
'../../lib/utils/accessor'
;
import
boardList
from
'./board_list'
;
import
boardList
from
'./board_list
.vue
'
;
import
boardBlankState
from
'./board_blank_state'
;
import
boardBlankState
from
'./board_blank_state'
;
import
'./board_delete'
;
import
'./board_delete'
;
...
...
app/assets/javascripts/boards/components/board_list.
js
→
app/assets/javascripts/boards/components/board_list.
vue
View file @
826105df
<
script
>
import
Sortable
from
'vendor/Sortable'
;
import
Sortable
from
'vendor/Sortable'
;
import
boardNewIssue
from
'./board_new_issue'
;
import
boardNewIssue
from
'./board_new_issue'
;
import
boardCard
from
'./board_card.vue'
;
import
boardCard
from
'./board_card.vue'
;
...
@@ -8,6 +9,11 @@ const Store = gl.issueBoards.BoardsStore;
...
@@ -8,6 +9,11 @@ const Store = gl.issueBoards.BoardsStore;
export
default
{
export
default
{
name
:
'BoardList'
,
name
:
'BoardList'
,
components
:
{
boardCard
,
boardNewIssue
,
loadingIcon
,
},
props
:
{
props
:
{
disabled
:
{
disabled
:
{
type
:
Boolean
,
type
:
Boolean
,
...
@@ -42,46 +48,6 @@ export default {
...
@@ -42,46 +48,6 @@ export default {
showIssueForm
:
false
,
showIssueForm
:
false
,
};
};
},
},
components
:
{
boardCard
,
boardNewIssue
,
loadingIcon
,
},
methods
:
{
listHeight
()
{
return
this
.
$refs
.
list
.
getBoundingClientRect
().
height
;
},
scrollHeight
()
{
return
this
.
$refs
.
list
.
scrollHeight
;
},
scrollTop
()
{
return
this
.
$refs
.
list
.
scrollTop
+
this
.
listHeight
();
},
scrollToTop
()
{
this
.
$refs
.
list
.
scrollTop
=
0
;
},
loadNextPage
()
{
const
getIssues
=
this
.
list
.
nextPage
();
const
loadingDone
=
()
=>
{
this
.
list
.
loadingMore
=
false
;
};
if
(
getIssues
)
{
this
.
list
.
loadingMore
=
true
;
getIssues
.
then
(
loadingDone
)
.
catch
(
loadingDone
);
}
},
toggleForm
()
{
this
.
showIssueForm
=
!
this
.
showIssueForm
;
},
onScroll
()
{
if
(
!
this
.
loadingMore
&&
(
this
.
scrollTop
()
>
this
.
scrollHeight
()
-
this
.
scrollOffset
))
{
this
.
loadNextPage
();
}
},
},
watch
:
{
watch
:
{
filters
:
{
filters
:
{
handler
()
{
handler
()
{
...
@@ -157,51 +123,90 @@ export default {
...
@@ -157,51 +123,90 @@ export default {
eventHub
.
$off
(
`scroll-board-list-
${
this
.
list
.
id
}
`
,
this
.
scrollToTop
);
eventHub
.
$off
(
`scroll-board-list-
${
this
.
list
.
id
}
`
,
this
.
scrollToTop
);
this
.
$refs
.
list
.
removeEventListener
(
'scroll'
,
this
.
onScroll
);
this
.
$refs
.
list
.
removeEventListener
(
'scroll'
,
this
.
onScroll
);
},
},
template
:
`
methods
:
{
<div class="board-list-component">
listHeight
()
{
<div
return
this
.
$refs
.
list
.
getBoundingClientRect
().
height
;
class="board-list-loading text-center"
},
aria-label="Loading issues"
scrollHeight
()
{
v-if="loading">
return
this
.
$refs
.
list
.
scrollHeight
;
<loading-icon />
},
</div>
scrollTop
()
{
<board-new-issue
return
this
.
$refs
.
list
.
scrollTop
+
this
.
listHeight
();
:list="list"
},
v-if="list.type !== 'closed' && showIssueForm"/>
scrollToTop
()
{
<ul
this
.
$refs
.
list
.
scrollTop
=
0
;
class="board-list"
},
v-show="!loading"
loadNextPage
()
{
ref="list"
const
getIssues
=
this
.
list
.
nextPage
();
:data-board="list.id"
const
loadingDone
=
()
=>
{
:class="{ 'is-smaller': showIssueForm }">
this
.
list
.
loadingMore
=
false
;
<board-card
};
v-for="(issue, index) in issues"
ref="issue"
:index="index"
:list="list"
:issue="issue"
:issue-link-base="issueLinkBase"
:root-path="rootPath"
:disabled="disabled"
:key="issue.id" />
<li
class="board-list-count text-center"
v-if="showCount"
data-issue-id="-1">
<loading-icon
if
(
getIssues
)
{
v-show="list.loadingMore"
this
.
list
.
loadingMore
=
true
;
label="Loading more issues"
getIssues
/>
.
then
(
loadingDone
)
.
catch
(
loadingDone
);
}
},
toggleForm
()
{
this
.
showIssueForm
=
!
this
.
showIssueForm
;
},
onScroll
()
{
if
(
!
this
.
loadingMore
&&
(
this
.
scrollTop
()
>
this
.
scrollHeight
()
-
this
.
scrollOffset
))
{
this
.
loadNextPage
();
}
},
},
};
</
script
>
<span v-if="list.issues.length === list.issuesSize">
<
template
>
Showing all issues
<div
class=
"board-list-component"
>
</span>
<div
<span v-else>
class=
"board-list-loading text-center"
Showing {{ list.issues.length }} of {{ list.issuesSize }} issues
aria-label=
"Loading issues"
</span>
v-if=
"loading"
>
</li>
<loading-icon
/>
</ul>
</div>
</div>
`
,
<board-new-issue
};
:list=
"list"
v-if=
"list.type !== 'closed' && showIssueForm"
/>
<ul
class=
"board-list"
v-show=
"!loading"
ref=
"list"
:data-board=
"list.id"
:class=
"
{ 'is-smaller': showIssueForm }">
<board-card
v-for=
"(issue, index) in issues"
ref=
"issue"
:index=
"index"
:list=
"list"
:issue=
"issue"
:issue-link-base=
"issueLinkBase"
:root-path=
"rootPath"
:disabled=
"disabled"
:key=
"issue.id"
/>
<li
class=
"board-list-count text-center"
v-if=
"showCount"
data-issue-id=
"-1"
>
<loading-icon
v-show=
"list.loadingMore"
label=
"Loading more issues"
/>
<span
v-if=
"list.issues.length === list.issuesSize"
>
Showing all issues
</span>
<span
v-else
>
Showing
{{
list
.
issues
.
length
}}
of
{{
list
.
issuesSize
}}
issues
</span>
</li>
</ul>
</div>
</
template
>
changelogs/unreleased/move-board-list-vue-component.yml
0 → 100644
View file @
826105df
---
title
:
Move BoardList vue component to vue file
merge_request
:
16888
author
:
George Tsiolis
type
:
performance
spec/javascripts/boards/board_list_spec.js
View file @
826105df
...
@@ -5,7 +5,7 @@ import Vue from 'vue';
...
@@ -5,7 +5,7 @@ import Vue from 'vue';
import
MockAdapter
from
'axios-mock-adapter'
;
import
MockAdapter
from
'axios-mock-adapter'
;
import
axios
from
'~/lib/utils/axios_utils'
;
import
axios
from
'~/lib/utils/axios_utils'
;
import
Sortable
from
'vendor/Sortable'
;
import
Sortable
from
'vendor/Sortable'
;
import
BoardList
from
'~/boards/components/board_list'
;
import
BoardList
from
'~/boards/components/board_list
.vue
'
;
import
eventHub
from
'~/boards/eventhub'
;
import
eventHub
from
'~/boards/eventhub'
;
import
'~/boards/mixins/sortable_default_options'
;
import
'~/boards/mixins/sortable_default_options'
;
import
'~/boards/models/issue'
;
import
'~/boards/models/issue'
;
...
...
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