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
105c80b6
Commit
105c80b6
authored
Aug 19, 2016
by
Phil Hughes
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Shows count at bottom of list
Only visible when scrollable area is larger than height
parent
4f341ed8
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
52 additions
and
13 deletions
+52
-13
app/assets/javascripts/boards/components/board_list.js.es6
app/assets/javascripts/boards/components/board_list.js.es6
+12
-1
app/assets/stylesheets/pages/boards.scss
app/assets/stylesheets/pages/boards.scss
+10
-5
app/views/projects/boards/components/_board.html.haml
app/views/projects/boards/components/_board.html.haml
+6
-1
spec/features/boards/boards_spec.rb
spec/features/boards/boards_spec.rb
+15
-0
spec/javascripts/boards/mock_data.js.es6
spec/javascripts/boards/mock_data.js.es6
+9
-6
No files found.
app/assets/javascripts/boards/components/board_list.js.es6
View file @
105c80b6
...
@@ -20,7 +20,8 @@
...
@@ -20,7 +20,8 @@
data () {
data () {
return {
return {
scrollOffset: 250,
scrollOffset: 250,
filters: Store.state.filters
filters: Store.state.filters,
showCount: false
};
};
},
},
watch: {
watch: {
...
@@ -30,6 +31,15 @@
...
@@ -30,6 +31,15 @@
this.$els.list.scrollTop = 0;
this.$els.list.scrollTop = 0;
},
},
deep: true
deep: true
},
issues () {
this.$nextTick(() => {
if (this.scrollHeight() > this.listHeight()) {
this.showCount = true;
} else {
this.showCount = false;
}
});
}
}
},
},
methods: {
methods: {
...
@@ -58,6 +68,7 @@
...
@@ -58,6 +68,7 @@
group: 'issues',
group: 'issues',
sort: false,
sort: false,
disabled: this.disabled,
disabled: this.disabled,
filter: '.board-list-count',
onStart: (e) => {
onStart: (e) => {
const card = this.$refs.issue[e.oldIndex];
const card = this.$refs.issue[e.oldIndex];
...
...
app/assets/stylesheets/pages/boards.scss
View file @
105c80b6
...
@@ -142,11 +142,6 @@
...
@@ -142,11 +142,6 @@
}
}
}
}
.board-header-loading-spinner
{
margin-right
:
10px
;
color
:
$gray-darkest
;
}
.board-inner-container
{
.board-inner-container
{
border-bottom
:
1px
solid
$border-color
;
border-bottom
:
1px
solid
$border-color
;
padding
:
$gl-padding
;
padding
:
$gl-padding
;
...
@@ -279,3 +274,13 @@
...
@@ -279,3 +274,13 @@
width
:
210px
;
width
:
210px
;
}
}
}
}
.board-list-count
{
padding
:
10px
0
;
color
:
$gl-placeholder-color
;
font-size
:
13px
;
>
.fa
{
margin-right
:
5px
;
}
}
app/views/projects/boards/components/_board.html.haml
View file @
105c80b6
...
@@ -20,7 +20,6 @@
...
@@ -20,7 +20,6 @@
"v-if"
=>
"!list.preset && list.id"
}
"v-if"
=>
"!list.preset && list.id"
}
%button
.board-delete.has-tooltip.pull-right
{
type:
"button"
,
title:
"Delete list"
,
"aria-label"
=>
"Delete list"
,
data:
{
placement:
"bottom"
},
"@click.stop"
=>
"deleteBoard"
}
%button
.board-delete.has-tooltip.pull-right
{
type:
"button"
,
title:
"Delete list"
,
"aria-label"
=>
"Delete list"
,
data:
{
placement:
"bottom"
},
"@click.stop"
=>
"deleteBoard"
}
=
icon
(
"trash"
)
=
icon
(
"trash"
)
=
icon
(
"spinner spin"
,
class:
"board-header-loading-spinner pull-right"
,
"v-show"
=>
"list.loadingMore"
)
%board-list
{
"inline-template"
=>
true
,
%board-list
{
"inline-template"
=>
true
,
"v-if"
=>
"list.type !== 'blank'"
,
"v-if"
=>
"list.type !== 'blank'"
,
":list"
=>
"list"
,
":list"
=>
"list"
,
...
@@ -34,5 +33,11 @@
...
@@ -34,5 +33,11 @@
"v-show"
=>
"!loading"
,
"v-show"
=>
"!loading"
,
":data-board"
=>
"list.id"
}
":data-board"
=>
"list.id"
}
=
render
"projects/boards/components/card"
=
render
"projects/boards/components/card"
%li
.board-list-count.text-center
{
"v-if"
=>
"showCount"
}
=
icon
(
"spinner spin"
,
"v-show"
=>
"list.loadingMore"
)
%span
{
"v-if"
=>
"list.issues.length === list.issuesSize"
}
Showing all issues
%span
{
"v-else"
=>
true
}
Showing {{ list.issues.length }} of {{ list.issuesSize }} issues
-
if
can?
(
current_user
,
:admin_list
,
@project
)
-
if
can?
(
current_user
,
:admin_list
,
@project
)
=
render
"projects/boards/components/blank_state"
=
render
"projects/boards/components/blank_state"
spec/features/boards/boards_spec.rb
View file @
105c80b6
...
@@ -184,11 +184,19 @@ describe 'Issue Boards', feature: true, js: true do
...
@@ -184,11 +184,19 @@ describe 'Issue Boards', feature: true, js: true do
page
.
within
(
find
(
'.board'
,
match: :first
))
do
page
.
within
(
find
(
'.board'
,
match: :first
))
do
expect
(
page
.
find
(
'.board-header'
)).
to
have_content
(
'56'
)
expect
(
page
.
find
(
'.board-header'
)).
to
have_content
(
'56'
)
expect
(
page
).
to
have_selector
(
'.card'
,
count:
20
)
expect
(
page
).
to
have_selector
(
'.card'
,
count:
20
)
expect
(
page
).
to
have_content
(
'Showing 20 of 56 issues'
)
evaluate_script
(
"document.querySelectorAll('.board .board-list')[0].scrollTop = document.querySelectorAll('.board .board-list')[0].scrollHeight"
)
evaluate_script
(
"document.querySelectorAll('.board .board-list')[0].scrollTop = document.querySelectorAll('.board .board-list')[0].scrollHeight"
)
wait_for_vue_resource
(
spinner:
false
)
wait_for_vue_resource
(
spinner:
false
)
expect
(
page
).
to
have_selector
(
'.card'
,
count:
40
)
expect
(
page
).
to
have_selector
(
'.card'
,
count:
40
)
expect
(
page
).
to
have_content
(
'Showing 40 of 56 issues'
)
evaluate_script
(
"document.querySelectorAll('.board .board-list')[0].scrollTop = document.querySelectorAll('.board .board-list')[0].scrollHeight"
)
wait_for_vue_resource
(
spinner:
false
)
expect
(
page
).
to
have_selector
(
'.card'
,
count:
56
)
expect
(
page
).
to
have_content
(
'Showing all issues'
)
end
end
end
end
...
@@ -480,10 +488,17 @@ describe 'Issue Boards', feature: true, js: true do
...
@@ -480,10 +488,17 @@ describe 'Issue Boards', feature: true, js: true do
page
.
within
(
find
(
'.board'
,
match: :first
))
do
page
.
within
(
find
(
'.board'
,
match: :first
))
do
expect
(
page
.
find
(
'.board-header'
)).
to
have_content
(
'51'
)
expect
(
page
.
find
(
'.board-header'
)).
to
have_content
(
'51'
)
expect
(
page
).
to
have_selector
(
'.card'
,
count:
20
)
expect
(
page
).
to
have_selector
(
'.card'
,
count:
20
)
expect
(
page
).
to
have_content
(
'Showing 20 of 51 issues'
)
evaluate_script
(
"document.querySelectorAll('.board .board-list')[0].scrollTop = document.querySelectorAll('.board .board-list')[0].scrollHeight"
)
evaluate_script
(
"document.querySelectorAll('.board .board-list')[0].scrollTop = document.querySelectorAll('.board .board-list')[0].scrollHeight"
)
expect
(
page
).
to
have_selector
(
'.card'
,
count:
40
)
expect
(
page
).
to
have_selector
(
'.card'
,
count:
40
)
expect
(
page
).
to
have_content
(
'Showing 40 of 51 issues'
)
evaluate_script
(
"document.querySelectorAll('.board .board-list')[0].scrollTop = document.querySelectorAll('.board .board-list')[0].scrollHeight"
)
expect
(
page
).
to
have_selector
(
'.card'
,
count:
51
)
expect
(
page
).
to
have_content
(
'Showing all issues'
)
end
end
end
end
...
...
spec/javascripts/boards/mock_data.js.es6
View file @
105c80b6
...
@@ -26,12 +26,15 @@ const listObjDuplicate = {
...
@@ -26,12 +26,15 @@ const listObjDuplicate = {
const BoardsMockData = {
const BoardsMockData = {
'GET': {
'GET': {
'/test/issue-boards/board/lists{/id}/issues': [{
'/test/issue-boards/board/lists{/id}/issues': {
title: 'Testing',
issues: [{
iid: 1,
title: 'Testing',
confidential: false,
iid: 1,
labels: []
confidential: false,
}]
labels: []
}],
size: 1
}
},
},
'POST': {
'POST': {
'/test/issue-boards/board/lists{/id}': listObj
'/test/issue-boards/board/lists{/id}': listObj
...
...
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