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
1750fe32
Commit
1750fe32
authored
8 years ago
by
Bryce
Committed by
Bryce Johnson
8 years ago
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add issues filters reset btn (ES6-ified).
(Also refactored checkChanged slightly.)
parent
fda07a25
No related merge requests found
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
33 additions
and
10 deletions
+33
-10
CHANGELOG
CHANGELOG
+1
-0
app/assets/javascripts/issuable.js.es6
app/assets/javascripts/issuable.js.es6
+25
-10
app/assets/stylesheets/framework/filters.scss
app/assets/stylesheets/framework/filters.scss
+4
-0
app/views/shared/issuable/_filter.html.haml
app/views/shared/issuable/_filter.html.haml
+3
-0
No files found.
CHANGELOG
View file @
1750fe32
...
...
@@ -107,6 +107,7 @@ v 8.11.3
- Fix external issue tracker "Issues" link leading to 404s
- Don't try to show merge conflict resolution info if a merge conflict contains non-UTF-8 characters
- Automatically expand hidden discussions when accessed by a permalink !5585 (Mike Greiling)
- Issues filters reset button
v 8.11.2
- Show "Create Merge Request" widget for push events to fork projects on the source project. !5978
...
...
This diff is collapsed.
Click to expand it.
app/assets/javascripts/issuable.js
→
app/assets/javascripts/issuable.js
.es6
View file @
1750fe32
...
...
@@ -8,6 +8,7 @@
Issuable.initTemplates();
Issuable.initSearch();
Issuable.initChecks();
Issuable.initResetFilters();
return Issuable.initLabelFilterRemove();
},
initTemplates: function() {
...
...
@@ -55,6 +56,17 @@
return Turbolinks.visit(issuesUrl);
};
})(this),
initResetFilters: function() {
$('.reset-filters').on('click', function(e) {
e.preventDefault();
const target = e.target;
const $form = $(target).parents('.js-filter-form');
const baseIssuesUrl = target.href;
$form.attr('action', baseIssuesUrl);
Turbolinks.visit(baseIssuesUrl);
});
},
initChecks: function() {
this.issuableBulkActions = $('.bulk-update').data('bulkActions');
$('.check_all_issues').off('click').on('click', function() {
...
...
@@ -64,19 +76,22 @@
return $('.selected_issue').off('change').on('change', Issuable.checkChanged.bind(this));
},
checkChanged: function() {
var
checked_issues
,
ids
;
checked_issues
=
$
(
'
.selected_issue:checked
'
);
if
(
checked_issues
.
length
>
0
)
{
ids
=
$
.
map
(
checked_issues
,
function
(
value
)
{
const $checkedIssues = $('.selected_issue:checked');
const $updateIssuesIds = $('#update_issues_ids');
const $issuesOtherFilters = $('.issues-other-filters');
const $issuesBulkUpdate = $('.issues_bulk_update');
if ($checkedIssues.length > 0) {
let ids = $.map($checkedIssues, function(value) {
return $(value).data('id');
});
$
(
'
#update_issues_ids
'
)
.
val
(
ids
);
$
(
'
.issues-other-filters
'
)
.
hide
();
$
(
'
.issues_bulk_update
'
)
.
show
();
$
updateIssuesIds
.val(ids);
$
issuesOtherFilters
.hide();
$
issuesBulkUpdate
.show();
} else {
$
(
'
#update_issues_ids
'
)
.
val
([]);
$
(
'
.issues_bulk_update
'
)
.
hide
();
$
(
'
.issues-other-filters
'
)
.
show
();
$
updateIssuesIds
.val([]);
$
issuesBulkUpdate
.hide();
$
issuesOtherFilters
.show();
this.issuableBulkActions.willUpdateLabels = false;
}
return true;
...
...
This diff is collapsed.
Click to expand it.
app/assets/stylesheets/framework/filters.scss
View file @
1750fe32
.filter-item
{
margin-right
:
6px
;
vertical-align
:
top
;
&
.reset-filters
{
padding
:
7px
;
}
}
@media
(
min-width
:
$screen-sm-min
)
{
...
...
This diff is collapsed.
Click to expand it.
app/views/shared/issuable/_filter.html.haml
View file @
1750fe32
...
...
@@ -26,6 +26,9 @@
.filter-item.inline.labels-filter
=
render
"shared/issuable/label_dropdown"
.filter-item.inline.reset-filters
%a
{
href:
page_filter_path
(
without:
[
:assignee_id
,
:author_id
,
:milestone_title
,
:label_name
,
:issue_search
])}
Reset filters
.pull-right
-
if
controller
.
controller_name
==
'boards'
#js-boards-seach
.issue-boards-search
...
...
This diff is collapsed.
Click to expand it.
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