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
[36517] Fix placeholder filter returning query object, not AR collection (#9071)
Oliver Günthera023ccf372bd
diff --git a/app/controllers/placeholder_users_controller.rb b/app/controllers/placeholder_users_controller.rbindex 7643f7d26b0..fcce9e2800c 100644--- a/app/controllers/placeholder_users_controller.rb+++ b/app/controllers/placeholder_users_controller.rb@@ -42,7 +42,7 @@ class PlaceholderUsersController < ApplicationControllerdestroy]def index- @placeholder_users = PlaceholderUsers::PlaceholderUserFilterCell.filter params+ @placeholder_users = PlaceholderUsers::PlaceholderUserFilterCell.query paramsrespond_to do |format|format.html dodiff --git a/app/models/queries/placeholder_users/orders/default_order.rb b/app/models/queries/placeholder_users/orders/default_order.rbindex dfa84c9ed3e..edfb3be10e9 100644--- a/app/models/queries/placeholder_users/orders/default_order.rb+++ b/app/models/queries/placeholder_users/orders/default_order.rb@@ -32,6 +32,6 @@ class Queries::PlaceholderUsers::Orders::DefaultOrder < Queries::BaseOrderself.model = PlaceholderUserdef self.key- /\A(id|name)\z/+ /\A(id|name|created_at|updated_at)\z/endenddiff --git a/frontend/src/app/sentry/sentry-reporter.ts b/frontend/src/app/sentry/sentry-reporter.tsindex fc2cbc88b67..e2de2c02196 100644--- a/frontend/src/app/sentry/sentry-reporter.ts+++ b/frontend/src/app/sentry/sentry-reporter.ts@@ -175,7 +175,7 @@ export class SentryReporter implements ErrorReporter {private filterEvent(event:SentryEvent):SentryEvent|null {const unsupportedBrowser = document.body.classList.contains('-unsupported-browser');if (unsupportedBrowser) {- console.warn("Browser is not supported, skipping sentry reporting completely.")+ console.warn("Browser is not supported, skipping sentry reporting completely.");return null;}diff --git a/spec/features/placeholder_users/index_spec.rb b/spec/features/placeholder_users/index_spec.rbindex ce12534816d..82a623a793f 100644--- a/spec/features/placeholder_users/index_spec.rb+++ b/spec/features/placeholder_users/index_spec.rb@@ -33,17 +33,17 @@ describe 'index placeholder users', type: :feature dolet!(:anonymous) { FactoryBot.create :anonymous }let!(:placeholder_user_1) doFactoryBot.create(:placeholder_user,- name: 'One',+ name: 'B',created_at: 3.minute.ago)endlet!(:placeholder_user_2) doFactoryBot.create(:placeholder_user,- name: 'Two',+ name: 'A',created_at: 2.minute.ago)endlet!(:placeholder_user_3) doFactoryBot.create(:placeholder_user,- name: 'Three',+ name: 'C',created_at: 1.minute.ago)endlet(:index_page) { Pages::Admin::PlaceholderUsers::Index.new }@@ -58,11 +58,17 @@ describe 'index placeholder users', type: :feature do# so first ones created are on top.index_page.expect_listed(placeholder_user_1, placeholder_user_2, placeholder_user_3)+ index_page.order_by('Name')+ index_page.expect_ordered(placeholder_user_2, placeholder_user_1, placeholder_user_3)++ index_page.order_by('Name')+ index_page.expect_ordered(placeholder_user_3, placeholder_user_1, placeholder_user_2)+index_page.order_by('Created on')- index_page.expect_listed(placeholder_user_3, placeholder_user_2, placeholder_user_1)+ index_page.expect_ordered(placeholder_user_3, placeholder_user_2, placeholder_user_1)index_page.order_by('Created on')- index_page.expect_listed(placeholder_user_1, placeholder_user_2, placeholder_user_3)+ index_page.expect_ordered(placeholder_user_1, placeholder_user_2, placeholder_user_3)index_page.filter_by_name(placeholder_user_3.name)index_page.expect_listed(placeholder_user_3)diff --git a/spec/support/pages/admin/placeholder_users/index.rb b/spec/support/pages/admin/placeholder_users/index.rbindex 1fa72d7687b..07352e0ede0 100644--- a/spec/support/pages/admin/placeholder_users/index.rb+++ b/spec/support/pages/admin/placeholder_users/index.rb@@ -41,6 +41,11 @@ module Pagesexpect(rows.map(&:text)).to include(*placeholder_users.map(&:name))end+ def expect_ordered(*placeholder_users)+ rows = page.all 'td.name'+ expect(rows.map(&:text)).to eq(placeholder_users.map(&:name))+ end+def expect_not_listed(*users)rows = page.all 'td.name'expect(rows.map(&:text)).to_not include(*users.map(&:name))