Skip to content

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

don't order absent versions, start date and due date to the end in both directions

Ivan Kuchin210d024f9678
diff --git a/app/models/queries/work_packages/selects/property_select.rb b/app/models/queries/work_packages/selects/property_select.rb
index 7963dfb8134..08426165910 100644
--- a/app/models/queries/work_packages/selects/property_select.rb
+++ b/app/models/queries/work_packages/selects/property_select.rb
@@ -97,17 +97,14 @@ class Queries::WorkPackages::Selects::PropertySelect < Queries::WorkPackages::Se
association: "version",
sortable: "name",
default_order: "ASC",
- null_handling: "NULLS LAST",
groupable: "#{WorkPackage.table_name}.version_id"
},
start_date: {
- sortable: "#{WorkPackage.table_name}.start_date",
- null_handling: "NULLS LAST"
+ sortable: "#{WorkPackage.table_name}.start_date"
},
due_date: {
highlightable: true,
- sortable: "#{WorkPackage.table_name}.due_date",
- null_handling: "NULLS LAST"
+ sortable: "#{WorkPackage.table_name}.due_date"
},
estimated_hours: {
sortable: "#{WorkPackage.table_name}.estimated_hours",
diff --git a/spec/models/query/results_version_integration_spec.rb b/spec/models/query/results_version_integration_spec.rb
index e06e3f5f4b3..70a43463069 100644
--- a/spec/models/query/results_version_integration_spec.rb
+++ b/spec/models/query/results_version_integration_spec.rb
@@ -102,7 +102,7 @@ RSpec.describe Query::Results, "Grouping and sorting for version" do
end
end
let(:work_packages_asc) { [old_version_wp, no_date_version_wp, new_version_wp, no_version_wp] }
- let(:work_packages_desc) { [new_version_wp, no_date_version_wp, old_version_wp, no_version_wp] }
+ let(:work_packages_desc) { [no_version_wp, new_version_wp, no_date_version_wp, old_version_wp] }
before do
login_as(user)
diff --git a/spec/models/query/sort_criteria_spec.rb b/spec/models/query/sort_criteria_spec.rb
index 04bf3de1617..db61ccc019a 100644
--- a/spec/models/query/sort_criteria_spec.rb
+++ b/spec/models/query/sort_criteria_spec.rb
@@ -87,7 +87,7 @@ RSpec.describe Query::SortCriteria do
it "adds the order handling (and the default order by id)" do
expect(subject)
- .to eq [["work_packages.start_date NULLS LAST"], ["work_packages.id DESC"]]
+ .to eq [["work_packages.start_date"], ["work_packages.id DESC"]]
end
end
@@ -96,7 +96,7 @@ RSpec.describe Query::SortCriteria do
it "adds the order handling (and the default order by id)" do
expect(subject)
- .to eq [["work_packages.start_date NULLS LAST"], ["work_packages.id DESC"]]
+ .to eq [["work_packages.start_date"], ["work_packages.id DESC"]]
end
end
@@ -105,7 +105,7 @@ RSpec.describe Query::SortCriteria do
it "adds the order handling (and the default order by id)" do
expect(subject)
- .to eq [["work_packages.start_date DESC NULLS LAST"], ["work_packages.id DESC"]]
+ .to eq [["work_packages.start_date DESC"], ["work_packages.id DESC"]]
end
end
@@ -114,8 +114,8 @@ RSpec.describe Query::SortCriteria do
it "adds the order handling (and the default order by id)" do
expect(subject)
- .to eq [["name DESC NULLS LAST"],
- ["work_packages.start_date NULLS LAST"],
+ .to eq [["name DESC"],
+ ["work_packages.start_date"],
["work_packages.id DESC"]]
end
end