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
48311f05
Commit
48311f05
authored
May 14, 2014
by
Dmitriy Zaporozhets
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'template_for_merge_request_description' into 'master'
Template for merge request description
parents
ccff1051
01a3f830
Changes
12
Hide whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
51 additions
and
3 deletions
+51
-3
CHANGELOG-EE
CHANGELOG-EE
+1
-1
app/assets/javascripts/project.js.coffee
app/assets/javascripts/project.js.coffee
+8
-0
app/controllers/projects/merge_requests_controller.rb
app/controllers/projects/merge_requests_controller.rb
+1
-0
app/models/project.rb
app/models/project.rb
+2
-1
app/views/projects/edit.html.haml
app/views/projects/edit.html.haml
+7
-0
db/migrate/20140508105809_add_mr_template_to_project.rb
db/migrate/20140508105809_add_mr_template_to_project.rb
+5
-0
db/schema.rb
db/schema.rb
+1
-0
features/project/merge_requests.feature
features/project/merge_requests.feature
+4
-0
features/project/project.feature
features/project/project.feature
+7
-0
features/steps/project/merge_requests.rb
features/steps/project/merge_requests.rb
+4
-0
features/steps/project/project.rb
features/steps/project/project.rb
+10
-0
features/steps/shared/project.rb
features/steps/shared/project.rb
+1
-1
No files found.
CHANGELOG-EE
View file @
48311f05
v 6.9.0
v 6.9.0
- Support Jira ticket mentions in format JIRA-123
- Add support for closing Jira tickets with commits and MR
- Add support for closing Jira tickets with commits and MR
- Template for Merge Request description can be added in project settings
v 6.8.0
v 6.8.0
- Customise sign-in page with custom text and logo
- Customise sign-in page with custom text and logo
...
...
app/assets/javascripts/project.js.coffee
View file @
48311f05
...
@@ -24,6 +24,14 @@ class Project
...
@@ -24,6 +24,14 @@ class Project
else
else
$
(
'#project_issues_tracker_id'
).
removeAttr
(
'disabled'
)
$
(
'#project_issues_tracker_id'
).
removeAttr
(
'disabled'
)
$
(
'#project_merge_requests_enabled'
).
change
->
if
(
$
(
this
).
is
(
':checked'
)
==
true
)
$
(
'#project_merge_requests_template'
).
removeAttr
(
'disabled'
)
else
$
(
'#project_merge_requests_template'
).
attr
(
'disabled'
,
'disabled'
)
$
(
'#project_merge_requests_template'
).
change
()
@
Project
=
Project
@
Project
=
Project
...
...
app/controllers/projects/merge_requests_controller.rb
View file @
48311f05
...
@@ -80,6 +80,7 @@ class Projects::MergeRequestsController < Projects::ApplicationController
...
@@ -80,6 +80,7 @@ class Projects::MergeRequestsController < Projects::ApplicationController
@diffs
=
compare_action
.
diffs
@diffs
=
compare_action
.
diffs
@merge_request
.
title
=
@merge_request
.
source_branch
.
titleize
.
humanize
@merge_request
.
title
=
@merge_request
.
source_branch
.
titleize
.
humanize
@merge_request
.
description
=
@merge_request
.
target_project
.
merge_requests_template
@target_project
=
@merge_request
.
target_project
@target_project
=
@merge_request
.
target_project
@target_repo
=
@target_project
.
repository
@target_repo
=
@target_project
.
repository
end
end
...
...
app/models/project.rb
View file @
48311f05
...
@@ -40,7 +40,8 @@ class Project < ActiveRecord::Base
...
@@ -40,7 +40,8 @@ class Project < ActiveRecord::Base
attr_accessible
:name
,
:path
,
:description
,
:issues_tracker
,
:label_list
,
attr_accessible
:name
,
:path
,
:description
,
:issues_tracker
,
:label_list
,
:issues_enabled
,
:wall_enabled
,
:merge_requests_enabled
,
:snippets_enabled
,
:issues_tracker_id
,
:issues_enabled
,
:wall_enabled
,
:merge_requests_enabled
,
:snippets_enabled
,
:issues_tracker_id
,
:wiki_enabled
,
:visibility_level
,
:import_url
,
:last_activity_at
,
as:
[
:default
,
:admin
]
:wiki_enabled
,
:visibility_level
,
:import_url
,
:last_activity_at
,
:merge_requests_template
,
as:
[
:default
,
:admin
]
attr_accessible
:namespace_id
,
:creator_id
,
as: :admin
attr_accessible
:namespace_id
,
:creator_id
,
as: :admin
...
...
app/views/projects/edit.html.haml
View file @
48311f05
...
@@ -66,6 +66,13 @@
...
@@ -66,6 +66,13 @@
=
f
.
check_box
:merge_requests_enabled
=
f
.
check_box
:merge_requests_enabled
%span
.descr
Submit changes to be merged upstream.
%span
.descr
Submit changes to be merged upstream.
.form-group
=
f
.
label
:merge_requests_template
,
class:
'control-label'
do
Merge request template
%span
.light
(optional)
.col-sm-10
=
f
.
text_area
:merge_requests_template
,
placeholder:
"This MR should have: *"
,
disabled:
!
@project
.
merge_requests_enabled
,
class:
"form-control"
,
rows:
3
.form-group
.form-group
=
f
.
label
:wiki_enabled
,
"Wiki"
,
class:
'control-label'
=
f
.
label
:wiki_enabled
,
"Wiki"
,
class:
'control-label'
.col-sm-10
.col-sm-10
...
...
db/migrate/20140508105809_add_mr_template_to_project.rb
0 → 100644
View file @
48311f05
class
AddMrTemplateToProject
<
ActiveRecord
::
Migration
def
change
add_column
:projects
,
:merge_requests_template
,
:text
end
end
db/schema.rb
View file @
48311f05
...
@@ -252,6 +252,7 @@ ActiveRecord::Schema.define(version: 20140513095908) do
...
@@ -252,6 +252,7 @@ ActiveRecord::Schema.define(version: 20140513095908) do
t
.
boolean
"archived"
,
default:
false
,
null:
false
t
.
boolean
"archived"
,
default:
false
,
null:
false
t
.
string
"import_status"
t
.
string
"import_status"
t
.
float
"repository_size"
,
default:
0.0
t
.
float
"repository_size"
,
default:
0.0
t
.
text
"merge_requests_template"
end
end
add_index
"projects"
,
[
"creator_id"
],
name:
"index_projects_on_creator_id"
,
using: :btree
add_index
"projects"
,
[
"creator_id"
],
name:
"index_projects_on_creator_id"
,
using: :btree
...
...
features/project/merge_requests.feature
View file @
48311f05
...
@@ -139,3 +139,7 @@ Feature: Project Merge Requests
...
@@ -139,3 +139,7 @@ Feature: Project Merge Requests
And
I click link
"Show inline discussion"
of the second file
And
I click link
"Show inline discussion"
of the second file
Then
I should see a comment like
"Line is wrong"
in the second file
Then
I should see a comment like
"Line is wrong"
in the second file
And
I should still see a comment like
"Line is correct"
in the first file
And
I should still see a comment like
"Line is correct"
in the first file
Scenario
:
I
submit new unassigned merge request with template description
Given
I click link
"New Merge Request"
Then
I should see description field pre-filled
features/project/project.feature
View file @
48311f05
...
@@ -24,3 +24,10 @@ Feature: Project Feature
...
@@ -24,3 +24,10 @@ Feature: Project Feature
When
I visit edit project
"Shop"
page
When
I visit edit project
"Shop"
page
And
change project path settings
And
change project path settings
Then
I should see project with new path settings
Then
I should see project with new path settings
Scenario
:
I
visit edit project and fill in merge request template
When
I visit edit project
"Shop"
page
Then
I should see project settings
And
I fill in merge request template
And
I save project
Then
I should see project with merge request template saved
features/steps/project/merge_requests.rb
View file @
48311f05
...
@@ -239,6 +239,10 @@ class ProjectMergeRequests < Spinach::FeatureSteps
...
@@ -239,6 +239,10 @@ class ProjectMergeRequests < Spinach::FeatureSteps
end
end
end
end
step
'I should see description field pre-filled'
do
find_field
(
'merge_request_description'
).
value
.
should
==
'This merge request should contain the following.'
end
def
project
def
project
@project
||=
Project
.
find_by!
(
name:
"Shop"
)
@project
||=
Project
.
find_by!
(
name:
"Shop"
)
end
end
...
...
features/steps/project/project.rb
View file @
48311f05
...
@@ -14,6 +14,8 @@ class ProjectFeature < Spinach::FeatureSteps
...
@@ -14,6 +14,8 @@ class ProjectFeature < Spinach::FeatureSteps
step
'I should see project with new settings'
do
step
'I should see project with new settings'
do
find_field
(
'project_name'
).
value
.
should
==
'NewName'
find_field
(
'project_name'
).
value
.
should
==
'NewName'
find
(
'#project_issues_enabled'
).
should_not
be_checked
find
(
'#project_merge_requests_enabled'
).
should
be_checked
end
end
step
'change project path settings'
do
step
'change project path settings'
do
...
@@ -24,4 +26,12 @@ class ProjectFeature < Spinach::FeatureSteps
...
@@ -24,4 +26,12 @@ class ProjectFeature < Spinach::FeatureSteps
step
'I should see project with new path settings'
do
step
'I should see project with new path settings'
do
project
.
path
.
should
==
"new-path"
project
.
path
.
should
==
"new-path"
end
end
step
'I fill in merge request template'
do
fill_in
'project_merge_requests_template'
,
with:
"This merge request should contain the following."
end
step
'I should see project with merge request template saved'
do
find_field
(
'project_merge_requests_template'
).
value
.
should
==
'This merge request should contain the following.'
end
end
end
features/steps/shared/project.rb
View file @
48311f05
...
@@ -10,7 +10,7 @@ module SharedProject
...
@@ -10,7 +10,7 @@ module SharedProject
# Create a specific project called "Shop"
# Create a specific project called "Shop"
And
'I own project "Shop"'
do
And
'I own project "Shop"'
do
@project
=
Project
.
find_by
(
name:
"Shop"
)
@project
=
Project
.
find_by
(
name:
"Shop"
)
@project
||=
create
(
:project
,
name:
"Shop"
,
namespace:
@user
.
namespace
)
@project
||=
create
(
:project
,
name:
"Shop"
,
namespace:
@user
.
namespace
,
merge_requests_template:
"This merge request should contain the following."
)
@project
.
team
<<
[
@user
,
:master
]
@project
.
team
<<
[
@user
,
:master
]
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