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

Task/55517 remove filter from `14.2` pending a more complete solution (#15780)

Kabiru Mwenjae836a5932524
diff --git a/app/components/settings/project_custom_fields/project_custom_field_mapping/row_component.html.erb b/app/components/settings/project_custom_fields/project_custom_field_mapping/row_component.html.erb
index c92f886b908..097b38764a0 100644
--- a/app/components/settings/project_custom_fields/project_custom_field_mapping/row_component.html.erb
+++ b/app/components/settings/project_custom_fields/project_custom_field_mapping/row_component.html.erb
@@ -27,14 +27,7 @@ See COPYRIGHT and LICENSE files for more details.
++#%>
-<%
- wrapper_data_attributes = {
- turbo: true,
- "projects--settings--available-project-mappings-filter-target": "searchItem"
- }
-%>
-
-<%= component_wrapper(tag: "tr", class: row_css_class, data: wrapper_data_attributes) do %>
+<%= component_wrapper(tag: "tr", class: row_css_class, data: { turbo: true }) do %>
<% columns.each do |column| %>
<td class="<%= column_css_class(column) %>">
<%= column_value(column) %>
diff --git a/app/views/admin/settings/project_custom_fields/project_mappings.html.erb b/app/views/admin/settings/project_custom_fields/project_mappings.html.erb
index d97890b6652..7699c86ac2b 100644
--- a/app/views/admin/settings/project_custom_fields/project_mappings.html.erb
+++ b/app/views/admin/settings/project_custom_fields/project_mappings.html.erb
@@ -27,11 +27,6 @@ See COPYRIGHT and LICENSE files for more details.
++#%>
-<% content_controller 'projects--settings--available-project-mappings-filter',
- dynamic: true
-%>
-
-
<%=
render(Settings::ProjectCustomFields::EditFormHeaderComponent.new(
custom_field: @custom_field,
@@ -41,19 +36,6 @@ See COPYRIGHT and LICENSE files for more details.
<%=
render(Primer::OpenProject::SubHeader.new) do |component|
- component.with_filter_input(
- name: "available-project-mappings-filter",
- label: I18n.t("projects.settings.project_custom_fields.project_mapping_filter.label"),
- visually_hide_label: true,
- placeholder: I18n.t("projects.settings.project_custom_fields.project_mapping_filter.placeholder"),
- show_clear_button: true,
- clear_button_id: "available-project-mappings-filter-clear-button",
- data: {
- action: "input->projects--settings--available-project-mappings-filter#filterLists",
- "projects--settings--available-project-mappings-filter-target": "filter"
- }
- )
-
component.with_action_component do
render(Settings::ProjectCustomFields::ProjectCustomFieldMapping::NewProjectMappingComponent.new(
project_mapping: @project_mapping,
diff --git a/config/locales/en.yml b/config/locales/en.yml
index 270d815a5b0..366e9de6f68 100644
--- a/config/locales/en.yml
+++ b/config/locales/en.yml
@@ -336,9 +336,6 @@ Project attributes and sections are defined in the <a href=%{admin_settings_url}
new_project_mapping_form:
add_projects: Add projects
include_sub_projects: Include sub-projects
- project_mapping_filter:
- label: Search project
- placeholder: Filter by text
types:
no_results_title_text: There are currently no types available.
form:
diff --git a/frontend/src/stimulus/controllers/dynamic/projects/settings/available-project-mappings-filter.controller.ts b/frontend/src/stimulus/controllers/dynamic/projects/settings/available-project-mappings-filter.controller.ts
deleted file mode 100644
index 3f568a37e7a..00000000000
--- a/frontend/src/stimulus/controllers/dynamic/projects/settings/available-project-mappings-filter.controller.ts
+++ /dev/null
@@ -1,73 +0,0 @@
-/*
- * -- copyright
- * OpenProject is an open source project management software.
- * Copyright (C) 2023 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.
- * ++
- */
-
-import { Controller } from '@hotwired/stimulus';
-
-export default class AvailableProjectMappingsFilterController extends Controller {
- static targets = [
- 'filter',
- 'searchItem',
- ];
-
- declare readonly filterTarget:HTMLInputElement;
- declare readonly searchItemTargets:HTMLInputElement[];
-
- connect():void {
- this.element.querySelector('#available-project-mappings-filter-clear-button')?.addEventListener('click', () => {
- this.resetFilterViaClearButton();
- });
- }
-
- disconnect():void {
- this.element.querySelector('#available-project-mappings-filter-clear-button')?.removeEventListener('click', () => {
- this.resetFilterViaClearButton();
- });
- }
-
- filterLists() {
- const query = this.filterTarget.value.toLowerCase();
-
- this.searchItemTargets.forEach((item) => {
- const text = item.textContent?.toLowerCase();
-
- if (text?.includes(query)) {
- (item as HTMLElement).classList.remove('d-none');
- } else {
- (item as HTMLElement).classList.add('d-none');
- }
- });
- }
-
- resetFilterViaClearButton() {
- this.searchItemTargets.forEach((item) => {
- (item as HTMLElement).classList.remove('d-none');
- });
- }
-}