Merge branch 'release/5.0' into dev

pull/4473/head
Oliver Günther 9 years ago
commit f893dc94aa
  1. 6
      app/controllers/projects_controller.rb
  2. 4
      app/models/work_package/pdf_export/work_package_list_to_pdf.rb
  3. 14
      app/seeders/demo_data/project_seeder.rb
  4. 1
      app/seeders/demo_data/query_seeder.rb
  5. 68
      config/locales/en.seeders.yml
  6. 28
      frontend/app/components/routing/wp-details/wp-details.controller.test.js
  7. 2
      frontend/app/components/routing/wp-details/wp-details.controller.ts
  8. 2
      frontend/app/components/routing/wp-show/wp-show.controller.ts
  9. 1
      frontend/app/components/routing/wp-show/wp.show.html
  10. 2
      spec/features/projects/projects_spec.rb
  11. 6
      spec/seeders/demo_data_seeder_spec.rb
  12. 2
      spec/support/pages/split_work_package_create.rb

@ -94,7 +94,7 @@ class ProjectsController < ApplicationController
respond_to do |format|
format.html do
flash[:notice] = l(:notice_successful_create)
work_packages_or_settings_redirect
redirect_work_packages_or_overview
end
end
else
@ -252,10 +252,10 @@ class ProjectsController < ApplicationController
render_404
end
def work_packages_or_settings_redirect
def redirect_work_packages_or_overview
return if redirect_to_project_menu_item(@project, :work_packages)
redirect_to controller: '/projects', action: 'settings', id: @project
redirect_to controller: '/projects', action: 'show', id: @project
end
def jump_to_project_menu_item

@ -158,13 +158,13 @@ class WorkPackage::PdfExport::WorkPackageListToPdf
def column_value(work_package, column)
if column.is_a?(QueryCustomFieldColumn)
custom_field_value column
custom_field_value work_package, column
else
field_value work_package, column.name
end
end
def custom_field_value(column)
def custom_field_value(work_package, column)
value = work_package
.custom_values
.detect { |v| v.custom_field_id == column.custom_field.id }

@ -61,7 +61,6 @@ module DemoData
def project_data_seeders(project)
seeders = [
DemoData::CustomFieldSeeder,
DemoData::WikiSeeder,
DemoData::WorkPackageSeeder,
DemoData::QuerySeeder
]
@ -133,10 +132,11 @@ module DemoData
def project_data
{
name: project_name,
identifier: project_identifier,
description: project_description,
types: project_types
name: project_name,
identifier: project_identifier,
description: project_description,
enabled_module_names: project_modules,
types: project_types
}
end
@ -156,6 +156,10 @@ module DemoData
Type.all
end
def project_modules
Setting.default_projects_modules - %w(news wiki meetings calendar)
end
def find_demo_project
Project.find_by(identifier: project_identifier)
end

@ -55,7 +55,6 @@ module DemoData
def data
[
{ name: "Bugs", filters: [Queries::WorkPackages::Filter.new(:status_id, operator: "o"), Queries::WorkPackages::Filter.new(:type_id, operator: "=", values: ['7'])], user_id: User.admin.first.id, is_public: true, column_names: [:id, :type, :status, :priority, :subject, :assigned_to, :create_at] },
{ name: "Epics", filters: [Queries::WorkPackages::Filter.new(:status_id, operator: "o"), Queries::WorkPackages::Filter.new(:type_id, operator: "=", values: ['5'])], user_id: User.admin.first.id, is_public: true, column_names: [:id, :type, :status, :priority, :subject, :assigned_to] },
{ name: "Milestones", filters: [Queries::WorkPackages::Filter.new(:status_id, operator: "o"), Queries::WorkPackages::Filter.new(:type_id, operator: "=", values: ['2'])], user_id: User.admin.first.id, is_public: true, column_names: [:id, :type, :status, :subject, :start_date, :due_date] },
{ name: "Phases", filters: [Queries::WorkPackages::Filter.new(:status_id, operator: "o"), Queries::WorkPackages::Filter.new(:type_id, operator: "=", values: ['3'])], user_id: User.admin.first.id, is_public: true, column_names: [:id, :type, :status, :subject, :start_date, :due_date] },
{ name: "Tasks", filters: [Queries::WorkPackages::Filter.new(:status_id, operator: "o"), Queries::WorkPackages::Filter.new(:type_id, operator: "=", values: ['1'])], user_id: User.admin.first.id, is_public: true, column_names: [:id, :type, :status, :priority, :subject, :assigned_to] },

@ -75,29 +75,9 @@ en:
status_name: :default_status_in_progress
type_name: :default_type_phase
start: 1
duration: 10
duration: 38
relations: []
children:
- subject: Collect ideas
status_name: :default_status_closed
type_name: :default_type_task
start: 1
duration: 3
relations: []
- subject: Ensure financing
status_name: :default_status_closed
type_name: :default_type_task
start: 1
duration: 3
relations: []
- subject: Build a project team
status_name: :default_status_in_progress
type_name: :default_type_task
start: 7
duration: 4
relations: []
children: []
- subject: Development
status_name: :default_status_scheduled
@ -106,14 +86,6 @@ en:
duration: 26
relations: []
children:
- subject: Nice feature
status_name: :default_status_in_development
type_name: :default_type_feature
start: 14
duration: 26
version: Sprint 1
relations: []
- subject: Great feature
status_name: :default_status_developed
type_name: :default_type_feature
@ -130,16 +102,6 @@ en:
version: Sprint 2
relations: []
- subject: Awful bug
status_name: :default_status_confirmed
type_name: :default_type_bug
start: 31
duration: 7
version: Sprint 1
relations:
- to: Terrible bug
type: relates
- subject: Terrible bug
status_name: :default_status_confirmed
type_name: :default_type_bug
@ -148,7 +110,7 @@ en:
version: Sprint 1
relations: []
- subject: Release public beta
- subject: Go-Live
status_name: :default_status_scheduled
type_name: :default_type_milestone
start: 41
@ -158,30 +120,6 @@ en:
type: 'follows'
children: []
- subject: Documentation and help resources
status_name: :default_status_new
type_name: :default_type_phase
start: 43
duration: 16
relations: []
children: []
- subject: Testing and bugfixing
status_name: :default_status_new
type_name: :default_type_phase
start: 43
duration: 16
relations: []
children: []
- subject: Go-Live
status_name: :default_status_to_be_scheduled
type_name: :default_type_milestone
start: 60
duration: 1
relations: []
children: []
wiki:
title: 'Demo Wiki'
content: "h1. Demo Wiki\r\n\r\nh2#. Text\r\n\r\nLorem *ipsum* dolor sit amet, consectetur +adipiscing+ elit. Morbi sodales commodo tristique. Donec _condimentum_ nunc eget elit rutrum vehicula. In eros odio, suscipit non libero feugiat, aliquam pretium metus. \r\n\r\nh2#. Bullets\r\n\r\n* Integer ac augue\r\n* ac nulla sagittis egestas.\r\n* Quisque tincidunt, eros ac\r\n\r\nh2#. Enumeration\r\n\r\n# Integer ac augue \r\n# Quisque tincidunt, eros ac\r\n# vulputate vulputate, lacus leo\r\n\r\nh2#. Quote\r\n\r\n> Cras at purus nunc. Integer _felis mauris_, pharetra non leo eu, pulvinar gravida nulla. Fusce auctor dui id eros suscipit, non blandit orci fermentum. Aenean at venenatis nibh. -Donec finibus- eu neque ut gravida.\r\n> \r\n\r\nh2#. Links\r\n\r\n* Wiki: [[Page 1]]\r\n* Externa: https://www.openproject.com\r\n* Work package (link only): #1 \r\n* Work package: ##1\r\n\r\nh2#. Code\r\n\r\n@sudo apt-get update\r\nsudo apt-get install openproject@\r\n\r\nh2#. Preformatted text\r\n\r\n<pre>\r\nvulputate vulputate, lacus leo ultricies \r\n</pre>"

@ -73,6 +73,11 @@ describe('WorkPackageDetailsController', function() {
elements: []
}
},
type: {
props: {
name: 'Milestone'
}
},
relations: [
{
props: {
@ -198,6 +203,12 @@ describe('WorkPackageDetailsController', function() {
expect(scope.relatedTo).to.be.ok;
});
});
it('is the embedded type', function() {
expect(promise).to.eventually.be.fulfilled.then(function() {
expect(scope.type.props.name).to.eql('Milestone');
});
});
});
});
@ -208,21 +219,4 @@ describe('WorkPackageDetailsController', function() {
});
});
});
describe('type', function() {
var type = { 'type': 'Type',
'name': 'type0815' };
beforeEach(function() {
workPackage.embedded.type = type;
return buildController();
});
it('is the embedded type', function() {
expect(promise).to.eventually.be.fulfilled.then(function() {
expect(scope.type).to.eql(type);
});
});
});
});

@ -176,7 +176,7 @@ function WorkPackageDetailsController($scope,
var tabLabel = I18n.t('js.work_packages.tabs.' + tab),
params = {
tab: tabLabel,
type: workPackage.props.type,
type: workPackage.embedded.type.props.name,
subject: workPackage.props.subject
};

@ -235,7 +235,7 @@ function WorkPackageShowController($scope,
var tabLabel = I18n.t('js.work_packages.tabs.' + tab),
params = {
tab: tabLabel,
type: workPackage.props.type,
type: workPackage.embedded.type.props.name,
subject: workPackage.props.subject
};

@ -68,6 +68,7 @@
</div>
<div class="work-packages--right-panel">
<div class="work-packages--panel-inner">
<span class="hidden-for-sighted" tabindex="-1" focus ng-bind="focusAnchorLabel"></span>
<div id="tabs">
<ul class="tabrow">
<!-- The hrefs with empty URLs are necessary for IE10 to focus these links

@ -68,7 +68,7 @@ describe 'Projects', type: :feature do
expect(page).to have_content 'Successful creation.'
expect(page).to have_content 'Foo bar'
expect(current_path).to eq '/projects/foo/settings'
expect(current_path).to eq '/projects/foo'
end
end

@ -44,9 +44,9 @@ describe 'seeds' do
expect(User.where(admin: true).count).to eq 1
expect(Project.count).to eq 1
expect(WorkPackage.count).to eq 15
expect(Wiki.count).to eq 1
expect(Query.count).to eq 6
expect(WorkPackage.count).to eq 7
expect(Wiki.count).to eq 0
expect(Query.count).to eq 5
ensure
ActionMailer::Base.perform_deliveries = perform_deliveries
end

@ -27,7 +27,7 @@
#++
require 'support/pages/page'
require 'support/pages/abstract_work_package'
require 'support/pages/abstract_work_package_create'
module Pages
class SplitWorkPackageCreate < AbstractWorkPackageCreate

Loading…
Cancel
Save