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
Allow using updated_at in project filters, selects and orders
Jan Sandbrink735d7b873826
diff --git a/app/components/projects/projects_filters_component.rb b/app/components/projects/projects_filters_component.rbindex 35b284cd572..2d563bfc164 100644--- a/app/components/projects/projects_filters_component.rb+++ b/app/components/projects/projects_filters_component.rb@@ -59,7 +59,8 @@ class Projects::ProjectsFiltersComponent < Filter::FilterComponentQueries::Projects::Filters::ProjectStatusFilter,Queries::Projects::Filters::PublicFilter,Queries::Projects::Filters::TemplatedFilter,- Queries::Projects::Filters::TypeFilter+ Queries::Projects::Filters::TypeFilter,+ Queries::Projects::Filters::UpdatedAtFilter]allowlist.any? { |clazz| filter.is_a? clazz }diff --git a/app/components/projects/row_component.rb b/app/components/projects/row_component.rbindex 4fe26d5335c..e95ad68eb36 100644--- a/app/components/projects/row_component.rb+++ b/app/components/projects/row_component.rb@@ -116,6 +116,10 @@ module Projectshelpers.format_date(project.latest_activity_at)end+ def updated_at+ helpers.format_date(project.updated_at)+ end+def required_disk_spacereturn "" unless project.required_disk_space.to_i > 0diff --git a/app/models/queries/projects.rb b/app/models/queries/projects.rbindex 93ba0f9cffd..0a92fbdd018 100644--- a/app/models/queries/projects.rb+++ b/app/models/queries/projects.rb@@ -52,6 +52,7 @@ module Queries::Projectsfilter Filters::TemplatedFilterfilter Filters::TypeFilterfilter Filters::TypeaheadFilter+ filter Filters::UpdatedAtFilterfilter Filters::UserActionFilterfilter Filters::VisibleFilter@@ -63,6 +64,7 @@ module Queries::Projectsorder Orders::ProjectStatusOrderorder Orders::RequiredDiskSpaceOrderorder Orders::TypeaheadOrder+ order Orders::UpdatedAtOrderselect Selects::CreatedAtselect Selects::CustomField@@ -72,5 +74,6 @@ module Queries::Projectsselect Selects::ProjectPhaseselect Selects::RequiredDiskSpaceselect Selects::Status+ select Selects::UpdatedAtendenddiff --git a/app/models/queries/projects/filters/updated_at_filter.rb b/app/models/queries/projects/filters/updated_at_filter.rbnew file mode 100644index 00000000000..413a53ca535--- /dev/null+++ b/app/models/queries/projects/filters/updated_at_filter.rb@@ -0,0 +1,35 @@+# frozen_string_literal: true++#-- copyright+# OpenProject is an open source project management software.+# Copyright (C) the OpenProject GmbH+#+# This program is free software; you can redistribute it and/or+# modify it under the terms of the GNU General Public License version 3.+#+# OpenProject is a fork of ChiliProject, which is a fork of Redmine. The copyright follows:+# Copyright (C) 2006-2013 Jean-Philippe Lang+# Copyright (C) 2010-2013 the ChiliProject Team+#+# This program is free software; you can redistribute it and/or+# modify it under the terms of the GNU General Public License+# as published by the Free Software Foundation; either version 2+# of the License, or (at your option) any later version.+#+# This program is distributed in the hope that it will be useful,+# but WITHOUT ANY WARRANTY; without even the implied warranty of+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the+# GNU General Public License for more details.+#+# You should have received a copy of the GNU General Public License+# along with this program; if not, write to the Free Software+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.+#+# See COPYRIGHT and LICENSE files for more details.+#++++class Queries::Projects::Filters::UpdatedAtFilter < Queries::Projects::Filters::Base+ def type+ :datetime_past+ end+enddiff --git a/app/models/queries/projects/orders/updated_at_order.rb b/app/models/queries/projects/orders/updated_at_order.rbnew file mode 100644index 00000000000..c9e8ecae564--- /dev/null+++ b/app/models/queries/projects/orders/updated_at_order.rb@@ -0,0 +1,37 @@+# frozen_string_literal: true++#-- copyright+# OpenProject is an open source project management software.+# Copyright (C) the OpenProject GmbH+#+# This program is free software; you can redistribute it and/or+# modify it under the terms of the GNU General Public License version 3.+#+# OpenProject is a fork of ChiliProject, which is a fork of Redmine. The copyright follows:+# Copyright (C) 2006-2013 Jean-Philippe Lang+# Copyright (C) 2010-2013 the ChiliProject Team+#+# This program is free software; you can redistribute it and/or+# modify it under the terms of the GNU General Public License+# as published by the Free Software Foundation; either version 2+# of the License, or (at your option) any later version.+#+# This program is distributed in the hope that it will be useful,+# but WITHOUT ANY WARRANTY; without even the implied warranty of+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the+# GNU General Public License for more details.+#+# You should have received a copy of the GNU General Public License+# along with this program; if not, write to the Free Software+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.+#+# See COPYRIGHT and LICENSE files for more details.+#++++class Queries::Projects::Orders::UpdatedAtOrder < Queries::Orders::Base+ self.model = Project++ def self.key+ :updated_at+ end+enddiff --git a/app/models/queries/projects/selects/updated_at.rb b/app/models/queries/projects/selects/updated_at.rbnew file mode 100644index 00000000000..48e9dff7ec4--- /dev/null+++ b/app/models/queries/projects/selects/updated_at.rb@@ -0,0 +1,35 @@+# frozen_string_literal: true++# -- copyright+# OpenProject is an open source project management software.+# Copyright (C) the OpenProject GmbH+#+# This program is free software; you can redistribute it and/or+# modify it under the terms of the GNU General Public License version 3.+#+# OpenProject is a fork of ChiliProject, which is a fork of Redmine. The copyright follows:+# Copyright (C) 2006-2013 Jean-Philippe Lang+# Copyright (C) 2010-2013 the ChiliProject Team+#+# This program is free software; you can redistribute it and/or+# modify it under the terms of the GNU General Public License+# as published by the Free Software Foundation; either version 2+# of the License, or (at your option) any later version.+#+# This program is distributed in the hope that it will be useful,+# but WITHOUT ANY WARRANTY; without even the implied warranty of+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the+# GNU General Public License for more details.+#+# You should have received a copy of the GNU General Public License+# along with this program; if not, write to the Free Software+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.+#+# See COPYRIGHT and LICENSE files for more details.+# ++++class Queries::Projects::Selects::UpdatedAt < Queries::Selects::Base+ def self.key+ :updated_at+ end+enddiff --git a/spec/models/queries/projects/project_query_spec.rb b/spec/models/queries/projects/project_query_spec.rbindex 54ec11ad873..5d723e0c700 100644--- a/spec/models/queries/projects/project_query_spec.rb+++ b/spec/models/queries/projects/project_query_spec.rb@@ -149,6 +149,7 @@ RSpec.describe ProjectQuery dobudget_plannedbudget_spentbudget_spent_ratio+ updated_at])endend@@ -177,6 +178,7 @@ RSpec.describe ProjectQuery dobudget_plannedbudget_spentbudget_spent_ratio+ updated_at])endend