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

[35744] Use case-insenstive string comparison for action boards (#9112)

Oliver Günther57034bc7d6cc
diff --git a/frontend/src/app/modules/boards/board/board-actions/cached-board-action.service.ts b/frontend/src/app/modules/boards/board/board-actions/cached-board-action.service.ts
index e7a3354ab13..79168cee2cd 100644
--- a/frontend/src/app/modules/boards/board/board-actions/cached-board-action.service.ts
+++ b/frontend/src/app/modules/boards/board/board-actions/cached-board-action.service.ts
@@ -3,7 +3,7 @@ import {BoardActionService} from "core-app/modules/boards/board/board-actions/bo
import {input} from "reactivestates";
import {HalResource} from "core-app/modules/hal/resources/hal-resource";
import {Observable} from "rxjs";
-import {filter, map, take} from "rxjs/operators";
+import {map, take} from "rxjs/operators";
import {Board} from "core-app/modules/boards/board/board";
@Injectable()
@@ -21,7 +21,9 @@ export abstract class CachedBoardActionService extends BoardActionService {
.pipe(
map(results => {
if (matching) {
- return results.filter(resource => resource.name.includes(matching));
+ return results.filter(resource =>
+ new RegExp(matching, 'i').test(resource.name)
+ );
} else {
return results;
}
diff --git a/modules/boards/spec/features/action_boards/status_board_spec.rb b/modules/boards/spec/features/action_boards/status_board_spec.rb
index 456cb97db3e..2ccfbdc705f 100644
--- a/modules/boards/spec/features/action_boards/status_board_spec.rb
+++ b/modules/boards/spec/features/action_boards/status_board_spec.rb
@@ -84,6 +84,19 @@ describe 'Status action board', type: :feature, js: true do
end
context 'with full boards permissions' do
+ it 'can add a case-insensitive list (Regression #35744)' do
+ board_index.visit!
+
+ # Create new board
+ board_page = board_index.create_board action: :Status
+
+ # expect lists of default status
+ board_page.expect_list 'Open'
+
+ board_page.add_list option: 'Closed', query: 'closed'
+ board_page.expect_list 'Closed'
+ end
+
it 'allows management of boards' do
board_index.visit!
diff --git a/modules/boards/spec/features/support/board_page.rb b/modules/boards/spec/features/support/board_page.rb
index 0e3ec4e2dc0..66e954c32c8 100644
--- a/modules/boards/spec/features/support/board_page.rb
+++ b/modules/boards/spec/features/support/board_page.rb
@@ -177,7 +177,7 @@ module Pages
.perform
end
- def add_list(option: nil)
+ def add_list(option: nil, query: option)
if option.nil? && action?
raise "Must pass value option for action boards"
end
@@ -188,7 +188,7 @@ module Pages
page.find('.boards-list--add-item').click
expect(page).to have_selector('.board-list--container', count: count + 1)
else
- open_and_fill_add_list_modal option
+ open_and_fill_add_list_modal query
page.find('.ng-option-label', text: option, wait: 10).click
click_on 'Add'
end