diff --git a/app/controllers/projects_controller.rb b/app/controllers/projects_controller.rb index 8f5b83f19e..ac89eae9fb 100644 --- a/app/controllers/projects_controller.rb +++ b/app/controllers/projects_controller.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 diff --git a/app/models/work_package/pdf_export/work_package_list_to_pdf.rb b/app/models/work_package/pdf_export/work_package_list_to_pdf.rb index 7930e9195e..07ab26dc47 100644 --- a/app/models/work_package/pdf_export/work_package_list_to_pdf.rb +++ b/app/models/work_package/pdf_export/work_package_list_to_pdf.rb @@ -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 } diff --git a/app/seeders/demo_data/project_seeder.rb b/app/seeders/demo_data/project_seeder.rb index bc90210417..7c76be7d6a 100644 --- a/app/seeders/demo_data/project_seeder.rb +++ b/app/seeders/demo_data/project_seeder.rb @@ -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 diff --git a/app/seeders/demo_data/query_seeder.rb b/app/seeders/demo_data/query_seeder.rb index 8d882ba15e..7dfb255537 100644 --- a/app/seeders/demo_data/query_seeder.rb +++ b/app/seeders/demo_data/query_seeder.rb @@ -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] }, diff --git a/config/locales/en.seeders.yml b/config/locales/en.seeders.yml index bfab9092bd..d5177af769 100644 --- a/config/locales/en.seeders.yml +++ b/config/locales/en.seeders.yml @@ -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
\r\nvulputate vulputate, lacus leo ultricies \r\n
" diff --git a/frontend/app/components/routing/wp-details/wp-details.controller.test.js b/frontend/app/components/routing/wp-details/wp-details.controller.test.js index d0cb90b860..437302878f 100644 --- a/frontend/app/components/routing/wp-details/wp-details.controller.test.js +++ b/frontend/app/components/routing/wp-details/wp-details.controller.test.js @@ -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); - }); - }); - }); }); diff --git a/frontend/app/components/routing/wp-details/wp-details.controller.ts b/frontend/app/components/routing/wp-details/wp-details.controller.ts index a18e1844f3..41c33d07b6 100644 --- a/frontend/app/components/routing/wp-details/wp-details.controller.ts +++ b/frontend/app/components/routing/wp-details/wp-details.controller.ts @@ -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 }; diff --git a/frontend/app/components/routing/wp-show/wp-show.controller.ts b/frontend/app/components/routing/wp-show/wp-show.controller.ts index fe004aca00..f4727d5e3a 100644 --- a/frontend/app/components/routing/wp-show/wp-show.controller.ts +++ b/frontend/app/components/routing/wp-show/wp-show.controller.ts @@ -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 }; diff --git a/frontend/app/components/routing/wp-show/wp.show.html b/frontend/app/components/routing/wp-show/wp.show.html index 24ef730aa2..792827b5e3 100644 --- a/frontend/app/components/routing/wp-show/wp.show.html +++ b/frontend/app/components/routing/wp-show/wp.show.html @@ -68,6 +68,7 @@
+