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
moving show-filters method to the filters controller from projects helper
Behrokh Satarnejad80c963ce57ae
diff --git a/app/components/filters_component.html.erb b/app/components/filters_component.html.erbindex b9bd38766df..e0a8b738dfc 100644--- a/app/components/filters_component.html.erb+++ b/app/components/filters_component.html.erb@@ -1,6 +1,6 @@<div data-controller="filters"data-application-target="dynamic"- data-filters-display-filters-value="<%= helpers.show_filters_section? %>">+ data-filters-display-filters-value="<%= show_filters_section? %>"><div class="op-filters-header"><%= render(Primer::Beta::Button.new(diff --git a/app/components/filters_component.rb b/app/components/filters_component.rbindex 4e9090f242c..c08ff7b4948 100644--- a/app/components/filters_component.rb+++ b/app/components/filters_component.rb@@ -30,17 +30,21 @@class FiltersComponent < ApplicationComponentoptions :query-+renders_many :buttons, lambda { |**system_arguments|system_arguments[:ml] ||= 2Primer::Beta::Button.new(**system_arguments)}-++ def show_filters_section?+ params[:filters].present? && !params.key?(:hide_filters_section)+ end+def allowed_filtersquery.available_filtersend-+def filters_countquery.filters.countenddiff --git a/app/helpers/projects_helper.rb b/app/helpers/projects_helper.rbindex 693d77967ac..923fcae521f 100644--- a/app/helpers/projects_helper.rb+++ b/app/helpers/projects_helper.rb@@ -29,10 +29,6 @@module ProjectsHelperinclude WorkPackagesFilterHelper- def show_filters_section?- params[:filters].present? && !params.key?(:hide_filters_section)- end-def no_projects_result_box_paramsif User.current.allowed_globally?(:add_project){ action_url: new_project_path, display_action: true }diff --git a/app/views/projects/index.html.erb b/app/views/projects/index.html.erbindex 8e189ba4ded..fab7a7bcd94 100644--- a/app/views/projects/index.html.erb+++ b/app/views/projects/index.html.erb@@ -29,8 +29,7 @@ See COPYRIGHT and LICENSE files for more details.<% html_title(t(:label_project_plural)) -%><div data-controller="project"- data-application-target="dynamic"- data-project-display-filters-value="<%= show_filters_section? %>">+ data-application-target="dynamic"><%= render Projects::IndexPageHeaderComponent.new(projects: @projects,query: @query,diff --git a/config/locales/en.yml b/config/locales/en.ymlindex cae6cc85dca..c099e7dc823 100644--- a/config/locales/en.yml+++ b/config/locales/en.yml@@ -1915,8 +1915,7 @@ en:label_feeds_access_key_type: "RSS"label_file_plural: "Files"label_filter_add: "Add filter"- label_filter: "Filter"- label_filter_by_text: "Filter by text"+ label_filter: "Filters"label_filter_plural: "Filters"label_filters_toggle: "Show/hide filters"label_float: "Float"