Skip to content

Commit

Permalink
### 0.0.5
Browse files Browse the repository at this point in the history
* Filter on `parent_tracker` (specific depth)
* Filter on `parent_status` (specific depth)
* Prefix plugin name with `Redmine`
  • Loading branch information
Jan Catrysse committed Aug 9, 2023
1 parent ffe4d6f commit 56fe60e
Show file tree
Hide file tree
Showing 13 changed files with 222 additions and 90 deletions.
9 changes: 7 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,12 @@
# CHANGELOG
### 0.0.5
* Filter on `parent_tracker` (specific depth)
* Filter on `parent_status` (specific depth)
* Prefix plugin name with `Redmine`

### 0.0.4
* Filter on `a_parent_tracker` (any)
* Filter on `a_parent_status` (any)
* Filter on `parent_tracker` (any depth)
* Filter on `parent_status` (any depth)
* Add plugin settings to enable filters

### 0.0.3
Expand Down
61 changes: 41 additions & 20 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,33 +1,54 @@
# Redmine Parent Child Filters Plugin
This plugin allows filtering on the `trackers` and `status` of parent and child issues.
This plugin provides advanced filtering capabilities for issues in Redmine based on their hierarchical relationships, allowing you to filter based on the `trackers` and `status` of parent and child issues.

Link to Redmine plugin page: https://www.redmine.org/plugins/redmine_parent_child_filters
Link to Redmine plugin page: [Redmine Parent Child Filters Plugin](https://www.redmine.org/plugins/redmine_parent_child_filters)

## Compatibility
* Version 0.0.1 >= Redmine 4 (including Redmine 5)
* Redmine 4.x and Redmine 5.x.

## Features
* Filter on `root`
* Filter on `root_tracker`
* Filter on `root_status`
* Filter on `parent_tracker`
* Filter on `parent_status`
* Filter on `parent_tracker` (any parent)
* Filter on `parent_status` (any parent)
* Filter on `child_tracker`
* Filter on `child_status`
* Operator `not equal to` on `start_date` and `end_date`
* **Root Level Filtering**: Enables you to filter issues based on the root-level attributes.
* `root`
* `root_tracker`
* `root_status`

* **Immediate Parent Filtering**: Target issues based on their immediate parent attributes.
* `parent_tracker`
* `parent_status`

* **Any Parent Filtering**: Extend your filtering criteria to any level of the issue's ancestry.
* `parent_tracker` (any parent)
* `parent_status` (any parent)

* **Depth-Based Parent Filtering**: A powerful feature allowing filtering based on the depth of the issue's ancestry. If multiple depths are selected, the filter considers only the smallest depth.
* `parent_tracker` (with depth selection)
* `parent_status` (with depth selection)

* **Child Level Filtering**: Directly target child issues with the following attributes.
* `child_tracker`
* `child_status`

* **Additional Operators**: Enhance your filtering capabilities with additional operators.
* Operator `not equal to` on `start_date` and `end_date`

* **Settings**: The plugin provides a dedicated Settings menu where
* Each filter can be enabled or disabled as per your requirements.
* Additionally, you can configure the depth settings for depth-based filters.

## Install
Type below commands:
* $ `cd $RAILS_ROOT/plugins`
* $ `git clone https://github.com/jcatrysse/redmine_parent_child_filters.git`
Follow the commands below for a smooth installation:
* Navigate to your plugins directory:
* `$ cd $RAILS_ROOT/plugins`
* Clone the repository:
* `$ git clone https://github.com/jcatrysse/redmine_parent_child_filters.git`
* Migrate the plugin:
* `$ bundle exec rake redmine:plugins:migrate NAME=redmine_parent_child_filters RAILS_ENV=production`

Then, restart your Redmine.
Don't forget to restart your Redmine afterward!

## Uninstall
* Remove plugin folder
* Restart Redmine
* Simply remove the plugin folder.
* Restart Redmine for the changes to take effect.

## License
GPLv2
Distributed under the MIT License. Enjoy the flexibility and freedom it brings!
95 changes: 50 additions & 45 deletions app/views/settings/_parent_child_filters_settings.erb
Original file line number Diff line number Diff line change
@@ -1,45 +1,50 @@
<p>
<%= label_tag 'enable_root_id_filter', t('labels.enable_root_id_filter') %>
<%= check_box_tag 'settings[enable_root_id_filter]', 1,
@settings['enable_root_id_filter'] %>
</p>
<p>
<%= label_tag 'enable_root_tracker_id_filter', t('labels.enable_root_tracker_id_filter') %>
<%= check_box_tag 'settings[enable_root_tracker_id_filter]', 1,
@settings['enable_root_tracker_id_filter'] %>
</p>
<p>
<%= label_tag 'enable_root_status_id_filter', t('labels.enable_root_status_id_filter') %>
<%= check_box_tag 'settings[enable_root_status_id_filter]', 1,
@settings['enable_root_status_id_filter'] %>
</p>
<p>
<%= label_tag 'enable_parent_tracker_id_filter', t('labels.enable_parent_tracker_id_filter') %>
<%= check_box_tag 'settings[enable_parent_tracker_id_filter]', 1,
@settings['enable_parent_tracker_id_filter'] %>
</p>
<p>
<%= label_tag 'enable_parent_status_id_filter', t('labels.enable_parent_status_id_filter') %>
<%= check_box_tag 'settings[enable_parent_status_id_filter]', 1,
@settings['enable_parent_status_id_filter'] %>
</p>
<p>
<%= label_tag 'enable_a_parent_tracker_id_filter', t('labels.enable_a_parent_tracker_id_filter') %>
<%= check_box_tag 'settings[enable_a_parent_tracker_id_filter]', 1,
@settings['enable_a_parent_tracker_id_filter'] %>
</p>
<p>
<%= label_tag 'enable_a_parent_status_id_filter', t('labels.enable_a_parent_status_id_filter') %>
<%= check_box_tag 'settings[enable_a_parent_status_id_filter]', 1,
@settings['enable_a_parent_status_id_filter'] %>
</p>
<p>
<%= label_tag 'enable_child_tracker_id_filter', t('labels.enable_child_tracker_id_filter') %>
<%= check_box_tag 'settings[enable_child_tracker_id_filter]', 1,
@settings['enable_child_tracker_id_filter'] %>
</p>
<p>
<%= label_tag 'enable_child_status_id_filter', t('labels.enable_child_status_id_filter') %>
<%= check_box_tag 'settings[enable_child_status_id_filter]', 1,
@settings['enable_child_status_id_filter'] %>
</p>
<%
def render_check_box(setting_key)
content_tag :p do
label_tag(setting_key, t("label_#{setting_key}")) +
check_box_tag("settings[#{setting_key}]", 1, @settings[setting_key])
end
end
%>
<fieldset class="box tabular settings">
<legend><%= l(:label_general_filters_settings) %></legend>
<%= render_check_box('enable_root_id_filter') %>
<%= render_check_box('enable_root_tracker_id_filter') %>
<%= render_check_box('enable_root_status_id_filter') %>
<%= render_check_box('enable_parent_tracker_id_filter') %>
<%= render_check_box('enable_parent_status_id_filter') %>
<%= render_check_box('enable_a_parent_tracker_id_filter') %>
<%= render_check_box('enable_a_parent_status_id_filter') %>
<%= render_check_box('enable_child_tracker_id_filter') %>
<%= render_check_box('enable_child_status_id_filter') %>
</fieldset>

<fieldset class="box tabular settings">
<legend><%= l(:label_specific_filters_settings) %></legend>
<%= render_check_box('enable_a_specific_parent_tracker_id_filter') %>
<%= render_check_box('enable_a_specific_parent_status_id_filter') %>
<p>
<%= label_tag 'min_depth', t('label_min_depth') %>
<%= select_tag 'settings[min_depth]', options_for_select((1..10).to_a, @settings['min_depth'].to_i) %>
</p>
<p>
<%= label_tag 'max_depth', t('label_max_depth') %>
<%= select_tag 'settings[max_depth]', options_for_select((1..10).to_a, @settings['max_depth'].to_i) %>
</p>
</fieldset>

<%= javascript_tag do %>
function checkMinMax(){
var minDepth = parseInt($('#settings_min_depth').val());
var maxDepth = parseInt($('#settings_max_depth').val());
var changedElement = $(document.activeElement);
if (changedElement.attr('id') === 'settings_min_depth' && minDepth > maxDepth) {
$('#settings_max_depth').val(minDepth);
} else if (changedElement.attr('id') === 'settings_max_depth' && maxDepth < minDepth) {
$('#settings_min_depth').val(maxDepth);
}
}
$('#settings_min_depth, #settings_max_depth').change(checkMinMax);
$(document).ready(function() { checkMinMax(); });
<% end %>

5 changes: 5 additions & 0 deletions config/locales/de.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,8 @@ de:
label_enable_a_parent_status_id_filter: Eltern Statusfilter aktivieren (alle)
label_enable_child_tracker_id_filter: Kindes Trackerfilter aktivieren
label_enable_child_status_id_filter: Kindes Statusfilter aktivieren
label_min_depth: Minimale Filtertiefe
label_max_depth: Maximale Filtertiefe
label_general_filters_settings: Allgemeine Filtereinstellungen
label_specific_filters_settings: Spezifische Elternfilter- & Tiefeneinstellungen

26 changes: 17 additions & 9 deletions config/locales/en.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,23 @@ en:
label_filter_parent_tracker_id: Parent tracker
label_filter_a_parent_status_id: Parent (any) status
label_filter_a_parent_tracker_id: Parent (any) tracker
label_filter_a_specific_parent_status_id: Parent (specific) status
label_filter_a_specific_parent_tracker_id: Parent (specific) tracker
label_filter_root: Root
label_filter_root_status_id: Root status
label_filter_root_tracker_id: Root tracker
label_enable_root_id_filter: Enable Root Filter
label_enable_root_tracker_id_filter: Enable Root Tracker Filter
label_enable_root_status_id_filter: Enable Root Status Filter
label_enable_parent_tracker_id_filter: Enable Parent Tracker Filter
label_enable_parent_status_id_filter: Enable Parent Status Filter
label_enable_a_parent_tracker_id_filter: Enable Parent (any) Tracker Filter
label_enable_a_parent_status_id_filter: Enable Parent (any) Status Filter
label_enable_child_tracker_id_filter: Enable Child Tracker Filter
label_enable_child_status_id_filter: Enable Child Status Filter
label_enable_root_id_filter: Root Filter
label_enable_root_tracker_id_filter: Root Tracker Filter
label_enable_root_status_id_filter: Root Status Filter
label_enable_parent_tracker_id_filter: Parent Tracker Filter
label_enable_parent_status_id_filter: Parent Status Filter
label_enable_a_parent_tracker_id_filter: Parent (any) Tracker Filter
label_enable_a_parent_status_id_filter: Parent (any) Status Filter
label_enable_a_specific_parent_tracker_id_filter: Parent (specific) Tracker Filter
label_enable_a_specific_parent_status_id_filter: Parent (specific) Status Filter
label_enable_child_tracker_id_filter: Child Tracker Filter
label_enable_child_status_id_filter: Child Status Filter
label_min_depth: Minimum filter depth
label_max_depth: Maximum filter depth
label_general_filters_settings: General Filters Settings
label_specific_filters_settings: Specific Parent Filters & Depth Settings
4 changes: 4 additions & 0 deletions config/locales/es.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,7 @@ es:
label_enable_a_parent_status_id_filter: habilitar el filtro de estado parental (todos)
label_enable_child_tracker_id_filter : Habilitar filtro de rastreador de niños
label_enable_child_status_id_filter: Habilitar filtro de estado de niños
label_min_depth: Profundidad mínima del filtro
label_max_depth: Profundidad máxima del filtro
label_general_filters_settings: Configuraciones Generales de Filtros
label_specific_filters_settings: Configuraciones de Filtros Específicos de Padres y Profundidad
4 changes: 4 additions & 0 deletions config/locales/fr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,7 @@ fr:
label_enable_a_parent_status_id_filter: Activer le filtre de statut parent (tout)
label_enable_child_tracker_id_filter: Activer le filtre de suivi de l'enfant
label_enable_child_status_id_filter: Activer le filtre de statut de l'enfant
label_min_depth: Profondeur minimale du filtre
label_max_depth: Profondeur maximale du filtre
label_general_filters_settings: Paramètres Généraux des Filtres
label_specific_filters_settings: Paramètres des Filtres Spécifiques Parents & Profondeur
31 changes: 20 additions & 11 deletions config/locales/nl.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,26 @@ nl:
label_filter_child_tracker_id: Child tracker
label_filter_parent_status_id: Parent status
label_filter_parent_tracker_id: Parent tracker
label_filter_a_parent_status_id: Parent (alle) status
label_filter_a_parent_tracker_id: Parent (alle) tracker
label_filter_a_parent_status_id: Parent (elke) status
label_filter_a_parent_tracker_id: Parent (elke) tracker
label_filter_a_specific_parent_status_id: Parent (specifiek) status
label_filter_a_specific_parent_tracker_id: Parent (specifiek) tracker
label_filter_root: Root
label_filter_root_status_id: Root status
label_filter_root_tracker_id: Root tracker
label_enable_root_id_filter: Enable Root Filter
label_enable_root_tracker_id_filter: Root Tracker Filter inschakelen
label_enable_root_status_id_filter: Root Status Filter inschakelen
label_enable_parent_tracker_id_filter: Parent Tracker Filter inschakelen
label_enable_parent_status_id_filter: Parent Status Filter inschakelen
label_enable_a_parent_tracker_id_filter: Parent (any) Tracker Filter inschakelen
label_enable_a_parent_status_id_filter: Parent (any) Status Filter inschakelen
label_enable_child_tracker_id_filter: Child Tracker Filter inschakelen
label_enable_child_status_id_filter: Child Status Filter inschakelen
label_enable_root_id_filter: Root Filter
label_enable_root_tracker_id_filter: Root Tracker Filter
label_enable_root_status_id_filter: Root Status Filter
label_enable_parent_tracker_id_filter: Parent Tracker Filter
label_enable_parent_status_id_filter: Parent Status Filter
label_enable_a_parent_tracker_id_filter: Parent (elke) Tracker Filter
label_enable_a_parent_status_id_filter: Parent (elke) Status Filter
label_enable_a_specific_parent_tracker_id_filter: Parent (specifiek) Tracker Filter
label_enable_a_specific_parent_status_id_filter: Parent (Specifiek) Status Filter
label_enable_child_tracker_id_filter: Child Tracker Filter
label_enable_child_status_id_filter: Child Status Filter
label_min_depth: Minimale filterdiepte
label_max_depth: Maximale filterdiepte
label_general_filters_settings: Algemene Filterinstellingen
label_specific_filters_settings: Specifieke Parent Filters & Diepte Instellingen

4 changes: 4 additions & 0 deletions config/locales/ro.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,7 @@ ro:
label_enable_a_parent_status_id_filter: Activați filtrul de stare Parent (orice).
label_enable_child_tracker_id_filter: Activați filtrul de urmărire a copiilor
label_enable_child_status_id_filter: Activați filtrul pentru starea copilului
label_min_depth: Adâncime minimă a filtrului
label_max_depth: Adâncime maximă a filtrului
label_general_filters_settings: Setări Generale pentru Filtre
label_specific_filters_settings: Setări pentru Filtre Specifice Părinte & Adâncime
4 changes: 4 additions & 0 deletions config/locales/zh.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,7 @@ zh:
label_enable_a_parent_status_id_filter: 启用父状态过滤器(全部)
label_enable_child_tracker_id_filter: 启用子跟踪器过滤器
label_enable_child_status_id_filter: 启用子状态过滤器
label_min_depth: 过滤器最小深度
label_max_depth: 过滤器最大深度
label_general_filters_settings: 一般过滤器设置
label_specific_filters_settings: 特定父级过滤器和深度设置
8 changes: 6 additions & 2 deletions init.rb
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
Redmine::Plugin.register :redmine_parent_child_filters do
name 'Parent Child Filters Plugin'
name 'Redmine Parent Child Filters Plugin'
author 'Jan Catrysse'
description 'Search issues by parent and child tracker and status'
version '0.0.4'
version '0.0.5'
url 'https://github.com/jcatrysse/redmine_parent_child_filters'
author_url 'https://github.com/jcatrysse'

Expand All @@ -16,8 +16,12 @@
'enable_parent_status_id_filter' => true,
'enable_a_parent_tracker_id_filter' => true,
'enable_a_parent_status_id_filter' => true,
'enable_a_specific_parent_tracker_id_filter' => true,
'enable_a_specific_parent_status_id_filter' => true,
'enable_child_tracker_id_filter' => true,
'enable_child_status_id_filter' => true,
'min_depth' => '1',
'max_depth' => '5'
}, partial: 'settings/parent_child_filters_settings'
end

Expand Down
Loading

0 comments on commit 56fe60e

Please sign in to comment.