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
fe7a7611
Commit
fe7a7611
authored
Jul 31, 2018
by
Mark Chao
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add date sourcing milestone titles in meta data for rendering
parent
dfb77a17
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
24 additions
and
3 deletions
+24
-3
ee/app/helpers/epics_helper.rb
ee/app/helpers/epics_helper.rb
+3
-1
ee/app/models/ee/epic.rb
ee/app/models/ee/epic.rb
+2
-0
ee/spec/helpers/epics_helper_spec.rb
ee/spec/helpers/epics_helper_spec.rb
+19
-2
No files found.
ee/app/helpers/epics_helper.rb
View file @
fe7a7611
...
...
@@ -27,9 +27,11 @@ module EpicsHelper
start_date_fixed:
epic
.
start_date_fixed
,
start_date_is_fixed:
epic
.
start_date_is_fixed?
,
start_date_from_milestones:
epic
.
start_date_from_milestones
,
start_date_sourcing_milestone_title:
epic
.
start_date_sourcing_milestone
&
.
title
,
due_date_fixed:
epic
.
due_date_fixed
,
due_date_is_fixed:
epic
.
due_date_is_fixed?
,
due_date_from_milestones:
epic
.
due_date_from_milestones
due_date_from_milestones:
epic
.
due_date_from_milestones
,
due_date_sourcing_milestone_title:
epic
.
due_date_sourcing_milestone
&
.
title
)
end
...
...
ee/app/models/ee/epic.rb
View file @
fe7a7611
...
...
@@ -13,6 +13,8 @@ module EE
belongs_to
:assignee
,
class_name:
"User"
belongs_to
:group
belongs_to
:start_date_sourcing_milestone
,
class_name:
'Milestone'
belongs_to
:due_date_sourcing_milestone
,
class_name:
'Milestone'
has_internal_id
:iid
,
scope: :group
,
init:
->
(
s
)
{
s
&
.
group
&
.
epics
&
.
maximum
(
:iid
)
}
...
...
ee/spec/helpers/epics_helper_spec.rb
View file @
fe7a7611
...
...
@@ -28,6 +28,19 @@ describe EpicsHelper do
end
context
'when user has edit permission'
do
let
(
:milestone
)
{
create
(
:milestone
,
title:
'make me a sandwich'
)
}
let!
(
:epic
)
do
create
(
:epic
,
author:
user
,
start_date_sourcing_milestone:
milestone
,
start_date:
Date
.
new
(
2000
,
1
,
1
),
due_date_sourcing_milestone:
milestone
,
due_date:
Date
.
new
(
2000
,
1
,
2
)
)
end
before
do
epic
.
group
.
add_developer
(
user
)
end
...
...
@@ -38,9 +51,13 @@ describe EpicsHelper do
expect
(
meta_data
.
keys
).
to
match_array
(
%w[
created author
start_date start_date_fixed start_date_is_fixed start_date_from_milestones
end_date due_date due_date_fixed due_date_is_fixed due_date_from_milestones
start_date start_date_fixed start_date_is_fixed start_date_from_milestones
start_date_sourcing_milestone_title
end_date due_date due_date_fixed due_date_is_fixed due_date_from_milestones
due_date_sourcing_milestone_title
]
)
expect
(
meta_data
[
'start_date'
]).
to
eq
(
'2000-01-01'
)
expect
(
meta_data
[
'start_date_sourcing_milestone_title'
]).
to
eq
(
milestone
.
title
)
expect
(
meta_data
[
'due_date'
]).
to
eq
(
'2000-01-02'
)
expect
(
meta_data
[
'due_date_sourcing_milestone_title'
]).
to
eq
(
milestone
.
title
)
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