Commit ba8464be authored by Hannes Rosenögger's avatar Hannes Rosenögger

add issues template

parent 086bf47e
v 8.1.0 (unreleased)
- added an issues template (Hannes Rosenögger)
v 8.0.1
- Correct gem dependency versions
- Re-add the "Help Text" feature that was inadvertently removed
......
......@@ -47,6 +47,12 @@ class Projects::IssuesController < Projects::ApplicationController
)
@issue = @project.issues.new(issue_params)
# Set Issue description based on project template
if @project.issues_template.present?
@issue.description = @project.issues_template
end
respond_with(@issue)
end
......
......@@ -201,7 +201,7 @@ class ProjectsController < ApplicationController
params.require(:project).permit(
:name, :path, :description, :issues_tracker, :tag_list,
:issues_enabled, :merge_requests_enabled, :snippets_enabled, :issues_tracker_id, :default_branch,
:wiki_enabled, :merge_requests_template, :visibility_level, :merge_requests_rebase_enabled,
:wiki_enabled, :issues_template, :merge_requests_template, :visibility_level, :merge_requests_rebase_enabled,
:import_url, :last_activity_at, :namespace_id, :avatar,
:approvals_before_merge, :approver_ids, :reset_approvals_on_push, :merge_requests_ff_only_enabled
)
......
%fieldset.issues-feature
%legend
Issues:
.form-group
= f.label :issues_template, class: 'control-label' do
Description template
.col-sm-10
= f.text_area :issues_template, placeholder: "This Issue should have: *", class: "form-control", rows: 3
......@@ -77,6 +77,8 @@
%br
%span.descr Share code pastes with others out of git repository
= render 'issues_settings', f: f
= render 'merge_request_settings', f: f
%fieldset.features
......
class AddIssuesTemplateToProject < ActiveRecord::Migration
def change
add_column :projects, :issues_template, :text
end
end
......@@ -11,7 +11,7 @@
#
# It's strongly recommended that you check this file into your version control system.
ActiveRecord::Schema.define(version: 20150920161119) do
ActiveRecord::Schema.define(version: 20150929160851) do
# These are extensions that must be enabled in order to support this database
enable_extension "plpgsql"
......@@ -679,6 +679,7 @@ ActiveRecord::Schema.define(version: 20150920161119) do
t.boolean "reset_approvals_on_push", default: true
t.integer "commit_count", default: 0
t.boolean "merge_requests_ff_only_enabled", default: false
t.text "issues_template"
end
add_index "projects", ["created_at", "id"], name: "index_projects_on_created_at_and_id", using: :btree
......
......@@ -77,6 +77,14 @@ class Spinach::Features::Project < Spinach::FeatureSteps
expect(find_field('project_merge_requests_template').value).to eq 'This merge request should contain the following.'
end
step 'I fill in issues template' do
fill_in 'project_issues_template', with: "This issue should contain the following."
end
step 'I should see project with issues template saved' do
expect(find_field('project_issues_template').value).to eq 'This issue should contain the following.'
end
step 'I should see project "Shop" README link' do
page.within '.project-side' do
expect(page).to have_content "README.md"
......
......@@ -10,7 +10,7 @@ module SharedProject
# Create a specific project called "Shop"
step 'I own project "Shop"' do
@project = Project.find_by(name: "Shop")
@project ||= create(:project, name: "Shop", namespace: @user.namespace, snippets_enabled: true, merge_requests_template: "This merge request should contain the following.")
@project ||= create(:project, name: "Shop", namespace: @user.namespace, snippets_enabled: true, issues_template: "This issue should contain the following.", merge_requests_template: "This merge request should contain the following.")
@project.team << [@user, :master]
end
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment