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
0d688fff
Commit
0d688fff
authored
Jul 04, 2018
by
Kushal Pandya
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add Group filter dropdown support
parent
66ea5291
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
54 additions
and
22 deletions
+54
-22
app/assets/javascripts/pages/dashboard/todos/index/todos.js
app/assets/javascripts/pages/dashboard/todos/index/todos.js
+11
-1
app/assets/stylesheets/pages/todos.scss
app/assets/stylesheets/pages/todos.scss
+16
-0
app/views/dashboard/todos/index.html.haml
app/views/dashboard/todos/index.html.haml
+27
-21
No files found.
app/assets/javascripts/pages/dashboard/todos/index/todos.js
View file @
0d688fff
...
@@ -39,6 +39,7 @@ export default class Todos {
...
@@ -39,6 +39,7 @@ export default class Todos {
}
}
initFilters
()
{
initFilters
()
{
this
.
initFilterDropdown
(
$
(
'
.js-group-search
'
),
'
group_id
'
,
[
'
text
'
]);
this
.
initFilterDropdown
(
$
(
'
.js-project-search
'
),
'
project_id
'
,
[
'
text
'
]);
this
.
initFilterDropdown
(
$
(
'
.js-project-search
'
),
'
project_id
'
,
[
'
text
'
]);
this
.
initFilterDropdown
(
$
(
'
.js-type-search
'
),
'
type
'
);
this
.
initFilterDropdown
(
$
(
'
.js-type-search
'
),
'
type
'
);
this
.
initFilterDropdown
(
$
(
'
.js-action-search
'
),
'
action_id
'
);
this
.
initFilterDropdown
(
$
(
'
.js-action-search
'
),
'
action_id
'
);
...
@@ -53,7 +54,16 @@ export default class Todos {
...
@@ -53,7 +54,16 @@ export default class Todos {
filterable
:
searchFields
?
true
:
false
,
filterable
:
searchFields
?
true
:
false
,
search
:
{
fields
:
searchFields
},
search
:
{
fields
:
searchFields
},
data
:
$dropdown
.
data
(
'
data
'
),
data
:
$dropdown
.
data
(
'
data
'
),
clicked
:
()
=>
$dropdown
.
closest
(
'
form.filter-form
'
).
submit
(),
clicked
:
()
=>
{
const
$formEl
=
$dropdown
.
closest
(
'
form.filter-form
'
);
const
mutexDropdowns
=
{
group_id
:
'
project_id
'
,
project_id
:
'
group_id
'
,
};
$formEl
.
find
(
`input[name="
${
mutexDropdowns
[
fieldName
]}
"]`
).
remove
();
$formEl
.
submit
();
},
});
});
}
}
...
...
app/assets/stylesheets/pages/todos.scss
View file @
0d688fff
...
@@ -174,6 +174,18 @@
...
@@ -174,6 +174,18 @@
}
}
}
}
@include
media-breakpoint-down
(
lg
)
{
.todos-filters
{
.filter-categories
{
width
:
75%
;
.filter-item
{
margin-bottom
:
10px
;
}
}
}
}
@include
media-breakpoint-down
(
xs
)
{
@include
media-breakpoint-down
(
xs
)
{
.todo
{
.todo
{
.avatar
{
.avatar
{
...
@@ -199,6 +211,10 @@
...
@@ -199,6 +211,10 @@
}
}
.todos-filters
{
.todos-filters
{
.filter-categories
{
width
:
auto
;
}
.dropdown-menu-toggle
{
.dropdown-menu-toggle
{
width
:
100%
;
width
:
100%
;
}
}
...
...
app/views/dashboard/todos/index.html.haml
View file @
0d688fff
...
@@ -30,7 +30,13 @@
...
@@ -30,7 +30,13 @@
.todos-filters
.todos-filters
.row-content-block.second-block
.row-content-block.second-block
=
form_tag
todos_filter_path
(
without:
[
:project_id
,
:author_id
,
:type
,
:action_id
]),
method: :get
,
class:
'filter-form'
do
=
form_tag
todos_filter_path
(
without:
[
:project_id
,
:author_id
,
:type
,
:action_id
]),
method: :get
,
class:
'filter-form d-sm-flex'
do
.filter-categories.flex-fill
.filter-item.inline
-
if
params
[
:group_id
].
present?
=
hidden_field_tag
(
:group_id
,
params
[
:group_id
])
=
dropdown_tag
(
group_dropdown_label
(
params
[
:group_id
],
'Group'
),
options:
{
toggle_class:
'js-group-search js-filter-submit'
,
title:
'Filter by group'
,
filter:
true
,
filterInput:
'input#group-search'
,
dropdown_class:
'dropdown-menu-selectable dropdown-menu-group js-filter-submit'
,
placeholder:
'Search groups'
,
data:
{
data:
todo_group_options
,
default_label:
'Group'
,
display:
'static'
}
})
.filter-item.inline
.filter-item.inline
-
if
params
[
:project_id
].
present?
-
if
params
[
:project_id
].
present?
=
hidden_field_tag
(
:project_id
,
params
[
:project_id
])
=
hidden_field_tag
(
:project_id
,
params
[
:project_id
])
...
...
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