OpenProject is the leading open source project management software for product, project and portfolio management. A powerful Jira alternative with agile planning, issue tracking, roadmaps, Gantt charts, time tracking, collaboration features, and more. Available on premises or in the cloud. ⭐ Star us on GitHub
Ruby agile-developmentangularbcfboardsbug-trackerganttgantt-chartifcissue-trackerjira-alternativekanbanopenprojectproduct-managementproject-managementproject-planningroadmaprubyscrumtimelineworkflows
Re-add global news widget route
Henriette Darge5cab658227e1
diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rbindex dcafc202460..0db104a15d0 100644--- a/app/controllers/application_controller.rb+++ b/app/controllers/application_controller.rb@@ -264,6 +264,11 @@ class ApplicationController < ActionController::Base@project = Project.find(params[:project_id])end+ # Find project by project_id if given+ def find_optional_project+ @project = Project.find(params[:project_id]) if params[:project_id].present?+ end+# Finds and sets @project based on @object.projectdef find_project_from_associationrender_404 if @object.blank?diff --git a/modules/budgets/app/controllers/budgets_controller.rb b/modules/budgets/app/controllers/budgets_controller.rbindex 2e729949eae..11130aa1cd6 100644--- a/modules/budgets/app/controllers/budgets_controller.rb+++ b/modules/budgets/app/controllers/budgets_controller.rb@@ -221,10 +221,6 @@ class BudgetsController < ApplicationControllerendend- def find_optional_project- @project = Project.find(params[:project_id]) if params[:project_id].present?- end-def render_item_as_json(element_id, costs, unit, project, permission)response = {"#{element_id}_unit_name" => ActionController::Base.helpers.sanitize(unit),diff --git a/modules/costs/app/controllers/hourly_rates_controller.rb b/modules/costs/app/controllers/hourly_rates_controller.rbindex ae75c8a5f40..fbed7718979 100644--- a/modules/costs/app/controllers/hourly_rates_controller.rb+++ b/modules/costs/app/controllers/hourly_rates_controller.rb@@ -174,10 +174,6 @@ class HourlyRatesController < ApplicationController@project = Project.find(params[:project_id])end- def find_optional_project- @project = params[:project_id].blank? ? nil : Project.find(params[:project_id])- end-def find_user@user = params[:id] ? User.find(params[:id]) : User.currentenddiff --git a/modules/grids/app/controllers/grids/base_in_project_controller.rb b/modules/grids/app/controllers/grids/base_in_project_controller.rbindex a098d30861f..1f0c972868f 100644--- a/modules/grids/app/controllers/grids/base_in_project_controller.rb+++ b/modules/grids/app/controllers/grids/base_in_project_controller.rb@@ -1,6 +1,6 @@module ::Gridsclass BaseInProjectController < ::ApplicationController- before_action :find_project_by_project_id+ before_action :find_optional_projectbefore_action :authorizedef showdiff --git a/modules/meeting/app/controllers/recurring_meetings_controller.rb b/modules/meeting/app/controllers/recurring_meetings_controller.rbindex f8d7ae4bb14..592ab364b2f 100644--- a/modules/meeting/app/controllers/recurring_meetings_controller.rb+++ b/modules/meeting/app/controllers/recurring_meetings_controller.rb@@ -309,10 +309,6 @@ class RecurringMeetingsController < ApplicationControllerrender_400 unless @scheduled_meeting.meeting_id.nil?end- def find_optional_project- @project = Project.find(params[:project_id]) if params[:project_id].present?- end-def find_meeting@recurring_meeting = RecurringMeeting.visible.find(params[:id])enddiff --git a/modules/overviews/config/routes.rb b/modules/overviews/config/routes.rbindex ba918c70f4e..b3abccb5a94 100644--- a/modules/overviews/config/routes.rb+++ b/modules/overviews/config/routes.rb@@ -25,6 +25,12 @@ Rails.application.routes.draw doendend+ scope module: "overviews" do+ namespace :widgets do+ resource :news, only: %i[show]+ end+ end+resources :project_phases, controller: "overviews/project_phases", only: %i[edit update] doput :preview, on: :memberend