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
86fc145c
Commit
86fc145c
authored
Jun 07, 2017
by
Felipe Artur
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Order issues by priority
parent
ff7fe2d1
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
18 additions
and
16 deletions
+18
-16
app/models/concerns/milestoneish.rb
app/models/concerns/milestoneish.rb
+7
-5
app/models/issue.rb
app/models/issue.rb
+1
-1
app/views/shared/milestones/_issuables.html.haml
app/views/shared/milestones/_issuables.html.haml
+2
-2
app/views/shared/milestones/_sidebar.html.haml
app/views/shared/milestones/_sidebar.html.haml
+4
-4
app/views/shared/milestones/_tabs.html.haml
app/views/shared/milestones/_tabs.html.haml
+1
-1
changelogs/unreleased/issue_20900.yml
changelogs/unreleased/issue_20900.yml
+1
-1
lib/api/milestones.rb
lib/api/milestones.rb
+2
-2
No files found.
app/models/concerns/milestoneish.rb
View file @
86fc145c
module
Milestoneish
def
closed_items_count
(
user
)
memoize_per_user
(
user
,
:closed_items_count
)
do
(
count_issues_by_state
(
user
)[
'closed'
]
||
0
)
+
merge_requests
.
closed_and_merged
.
size
(
count_issues_by_state
(
user
)[
'closed'
]
.
count
||
0
)
+
merge_requests
.
closed_and_merged
.
size
end
end
...
...
@@ -12,7 +12,7 @@ module Milestoneish
end
def
total_issues_count
(
user
)
count_issues_by_state
(
user
).
values
.
sum
issues_visible_to_user
(
user
).
length
end
def
complete?
(
user
)
...
...
@@ -39,8 +39,8 @@ module Milestoneish
def
issues_visible_to_user
(
user
)
memoize_per_user
(
user
,
:issues_visible_to_user
)
do
IssuesFinder
.
new
(
user
,
issues_finder_params
)
.
execute
.
includes
(
:assignees
).
where
(
milestone_id:
milestoneish_ids
)
IssuesFinder
.
new
(
user
,
issues_finder_params
.
merge
({
sort:
'priority'
})
)
.
execute
.
preload
(
:assignees
).
where
(
milestone_id:
milestoneish_ids
)
end
end
...
...
@@ -66,7 +66,9 @@ module Milestoneish
def
count_issues_by_state
(
user
)
memoize_per_user
(
user
,
:count_issues_by_state
)
do
issues_visible_to_user
(
user
).
reorder
(
nil
).
group
(
:state
).
count
# Need to group and count using ruby array to not break
# label ordering
issues_visible_to_user
(
user
).
to_a
.
group_by
(
&
:state
)
end
end
...
...
app/models/issue.rb
View file @
86fc145c
...
...
@@ -44,7 +44,7 @@ class Issue < ActiveRecord::Base
scope
:created_after
,
->
(
datetime
)
{
where
(
"created_at >= ?"
,
datetime
)
}
scope
:
include_associations
,
->
{
includes
(
:labels
,
project: :namespace
)
}
scope
:
preload_associations
,
->
{
preload
(
:labels
,
project: :namespace
)
}
after_save
:expire_etag_cache
...
...
app/views/shared/milestones/_issuables.html.haml
View file @
86fc145c
...
...
@@ -8,11 +8,11 @@
=
title
-
if
show_counter
.counter
=
number_with_delimiter
(
issuables
.
size
)
=
number_with_delimiter
(
issuables
.
length
)
-
class_prefix
=
dom_class
(
issuables
).
pluralize
%ul
{
class:
"well-list milestone-#{class_prefix}-list"
,
id:
"#{class_prefix}-list-#{id}"
}
=
render
partial:
'shared/milestones/issuable'
,
collection:
issuables
.
recent
,
collection:
issuables
,
as: :issuable
,
locals:
{
show_project_name:
show_project_name
,
show_full_project_name:
show_full_project_name
}
app/views/shared/milestones/_sidebar.html.haml
View file @
86fc145c
...
...
@@ -68,10 +68,10 @@
.sidebar-collapsed-icon
%strong
=
icon
(
'hashtag'
,
'aria-hidden'
:
'true'
)
%span
=
milestone
.
issues_visible_to_user
(
current_user
).
count
%span
=
milestone
.
issues_visible_to_user
(
current_user
).
length
.title.hide-collapsed
Issues
%span
.badge
=
milestone
.
issues_visible_to_user
(
current_user
).
count
%span
.badge
=
milestone
.
issues_visible_to_user
(
current_user
).
length
-
if
project
&&
can?
(
current_user
,
:create_issue
,
project
)
=
link_to
new_namespace_project_issue_path
(
project
.
namespace
,
project
,
issue:
{
milestone_id:
milestone
.
id
}),
class:
"pull-right"
,
title:
"New Issue"
do
New issue
...
...
@@ -79,11 +79,11 @@
%span
.milestone-stat
=
link_to
milestones_browse_issuables_path
(
milestone
,
type: :issues
)
do
Open:
=
milestone
.
issues_visible_to_user
(
current_user
).
opened
.
count
=
milestone
.
issues_visible_to_user
(
current_user
).
opened
.
length
%span
.milestone-stat
=
link_to
milestones_browse_issuables_path
(
milestone
,
type: :issues
,
state:
'closed'
)
do
Closed:
=
milestone
.
issues_visible_to_user
(
current_user
).
closed
.
count
=
milestone
.
issues_visible_to_user
(
current_user
).
closed
.
length
.block.merge-requests
.sidebar-collapsed-icon
...
...
app/views/shared/milestones/_tabs.html.haml
View file @
86fc145c
...
...
@@ -31,7 +31,7 @@
.tab-content.milestone-content
-
if
milestone
.
is_a?
(
GlobalMilestone
)
||
can?
(
current_user
,
:read_issue
,
@project
)
.tab-pane.active
#tab-issues
{
data:
{
sort_endpoint:
(
sort_issues_namespace_project_milestone_path
(
@project
.
namespace
,
@project
,
@milestone
)
if
@project
&&
current_user
)
}
}
=
render
'shared/milestones/issues_tab'
,
issues:
milestone
.
issues_visible_to_user
(
current_user
).
include
_associations
,
show_project_name:
show_project_name
,
show_full_project_name:
show_full_project_name
=
render
'shared/milestones/issues_tab'
,
issues:
milestone
.
issues_visible_to_user
(
current_user
).
preload
_associations
,
show_project_name:
show_project_name
,
show_full_project_name:
show_full_project_name
.tab-pane
#tab-merge-requests
{
data:
{
sort_endpoint:
(
sort_merge_requests_namespace_project_milestone_path
(
@project
.
namespace
,
@project
,
@milestone
)
if
@project
&&
current_user
)
}
}
-# loaded async
=
render
"shared/milestones/tab_loading"
...
...
changelogs/unreleased/issue_20900.yml
View file @
86fc145c
---
title
:
Remove
Drag and
drop and sorting from milestone view
title
:
Remove
issues/merge requests drag n
drop and sorting from milestone view
merge_request
:
author
:
lib/api/milestones.rb
View file @
86fc145c
...
...
@@ -117,7 +117,7 @@ module API
finder_params
=
{
project_id:
user_project
.
id
,
milestone_title:
milestone
.
title
,
sort:
'
created_desc
'
sort:
'
label_priority
'
}
issues
=
IssuesFinder
.
new
(
current_user
,
finder_params
).
execute
...
...
@@ -140,7 +140,7 @@ module API
finder_params
=
{
project_id:
user_project
.
id
,
milestone_title:
milestone
.
title
,
sort:
'
created_desc
'
sort:
'
label_priority
'
}
merge_requests
=
MergeRequestsFinder
.
new
(
current_user
,
finder_params
).
execute
...
...
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