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
Jérome Perrin
gitlab-ce
Commits
f60a030e
Commit
f60a030e
authored
Aug 10, 2016
by
Phil Hughes
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed issue with filtering by label on issue not updating dropdown
parent
2f0826b1
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
73 additions
and
11 deletions
+73
-11
app/assets/javascripts/boards/components/board_card.js.es6
app/assets/javascripts/boards/components/board_card.js.es6
+14
-1
app/assets/javascripts/boards/components/board_delete.js.es6
app/assets/javascripts/boards/components/board_delete.js.es6
+2
-1
app/assets/javascripts/boards/stores/boards_store.js.es6
app/assets/javascripts/boards/stores/boards_store.js.es6
+7
-4
app/assets/javascripts/copy_to_clipboard.js
app/assets/javascripts/copy_to_clipboard.js
+3
-5
spec/features/boards/boards_spec.rb
spec/features/boards/boards_spec.rb
+47
-0
No files found.
app/assets/javascripts/boards/components/board_card.js.es6
View file @
f60a030e
...
...
@@ -7,15 +7,28 @@
},
methods: {
filterByLabel: function (label, $event) {
let labelToggleText = label.title;
const labelIndex = BoardsStore.state.filters['label_name'].indexOf(label.title);
//
$($event.target).tooltip('hide');
$($event.target).tooltip('hide');
if (labelIndex === -1) {
BoardsStore.state.filters['label_name'].push(label.title);
$('.labels-filter').prepend(`<input type="hidden" name="label_name[]" value="${label.title}" />`);
} else {
BoardsStore.state.filters['label_name'].splice(labelIndex, 1);
labelToggleText = BoardsStore.state.filters['label_name'][0];
$(`.labels-filter input[name="label_name[]"][value="${label.title}"]`).remove();
}
const selectedLabels = BoardsStore.state.filters['label_name'];
if (selectedLabels.length === 0) {
labelToggleText = 'Label';
} else if (selectedLabels.length > 1) {
labelToggleText = `${selectedLabels[0]} + ${selectedLabels.length - 1} more`;
}
$('.labels-filter .dropdown-toggle-text').text(labelToggleText);
BoardsStore.updateFiltersUrl();
}
}
...
...
app/assets/javascripts/boards/components/board_delete.js.es6
View file @
f60a030e
...
...
@@ -4,7 +4,8 @@
list: Object
},
methods: {
deleteBoard: function () {
deleteBoard: function (e) {
e.stopImmediatePropagation();
$(this.$el).tooltip('hide');
if (confirm('Are you sure you want to delete this list?')) {
...
...
app/assets/javascripts/boards/stores/boards_store.js.es6
View file @
f60a030e
...
...
@@ -31,11 +31,14 @@
this.removeBlankState();
},
updateNewListDropdown: function () {
let data
= $('.js-new-board-list').data('glDropdown');
const glDropdown
= $('.js-new-board-list').data('glDropdown');
if (data) {
data = data.renderedData;
$('.js-new-board-list').data('glDropdown').renderData(data);
if (glDropdown) {
const renderedData = glDropdown.renderedData;
if (renderedData) {
glDropdown.renderData(renderedData);
}
}
},
shouldAddBlankState: function () {
...
...
app/assets/javascripts/copy_to_clipboard.js
View file @
f60a030e
...
...
@@ -35,11 +35,9 @@
$
(
function
()
{
var
clipboard
;
if
(
$
(
'
body
'
).
attr
(
'
data-page
'
)
!==
'
projects:boards:show
'
)
{
clipboard
=
new
Clipboard
(
'
[data-clipboard-target], [data-clipboard-text]
'
);
clipboard
.
on
(
'
success
'
,
genericSuccess
);
return
clipboard
.
on
(
'
error
'
,
genericError
);
}
clipboard
=
new
Clipboard
(
'
[data-clipboard-target], [data-clipboard-text]
'
);
clipboard
.
on
(
'
success
'
,
genericSuccess
);
return
clipboard
.
on
(
'
error
'
,
genericError
);
});
}).
call
(
this
);
spec/features/boards/boards_spec.rb
View file @
f60a030e
...
...
@@ -376,6 +376,53 @@ describe 'Issue Boards', feature: true, js: true do
expect
(
page
).
to
have_selector
(
'.card'
,
count:
0
)
end
end
it
'filters by clicking label button on issue'
do
page
.
within
'.issues-filters'
do
click_button
(
'Label'
)
page
.
within
'.dropdown-menu-labels'
do
click_link
(
bug
.
title
)
find
(
'.dropdown-menu-close'
).
click
end
end
page
.
within
(
first
(
'.board'
))
do
expect
(
page
.
find
(
'.board-header'
)).
to
have_content
(
'1'
)
expect
(
page
).
to
have_selector
(
'.card'
,
count:
1
)
end
page
.
within
(
all
(
'.board'
)[
1
])
do
expect
(
page
.
find
(
'.board-header'
)).
to
have_content
(
'0'
)
expect
(
page
).
to
have_selector
(
'.card'
,
count:
0
)
end
page
.
within
(
first
(
'.board'
))
do
page
.
within
(
first
(
'.card'
))
do
click_button
(
bug
.
title
)
end
expect
(
page
).
to
have_selector
(
'.card'
,
count:
5
)
end
page
.
within
(
'.labels-filter'
)
do
expect
(
find
(
'.dropdown-toggle-text'
)).
not_to
have_content
(
bug
.
title
)
end
end
it
'removes label filter by clicking label button on issue'
do
page
.
within
(
first
(
'.board'
))
do
page
.
within
(
first
(
'.card'
))
do
click_button
(
bug
.
title
)
end
expect
(
page
).
to
have_selector
(
'.card'
,
count:
1
)
end
page
.
within
(
'.labels-filter'
)
do
expect
(
find
(
'.dropdown-toggle-text'
)).
to
have_content
(
bug
.
title
)
end
end
end
end
...
...
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