Project

General

Profile

Actions

Defect #26023

open

Category filter only shows categories of current project

Added by Felix Schäfer almost 7 years ago. Updated almost 3 years ago.

Status:
New
Priority:
Normal
Assignee:
-
Category:
Issues filter
Start date:
Due date:
% Done:

0%

Estimated time:
Resolution:
Affected version:

Description

The category filter currently only shows the categories of the current project, this means the global query can not use categories, and projects with subprojects can not use the categories from the subproject as filters.

I will provide a patch shortly to solve this issue.


Files

26023.patch (2.78 KB) 26023.patch Felix Schäfer, 2017-05-23 13:13
26023-screenshot@2x.png (27.8 KB) 26023-screenshot@2x.png Go MAEDA, 2017-05-23 13:29
26023_test_added.patch (5.64 KB) 26023_test_added.patch Takenori TAKAKI, 2018-09-26 06:47
26023_tests_visibility_fix.patch (7.31 KB) 26023_tests_visibility_fix.patch Felix Schäfer, 2018-10-01 21:37
category_filter.patch (4.63 KB) category_filter.patch Jean-Philippe Lang, 2018-10-11 19:09

Related issues

Related to Redmine - Feature #8192: Make a global category filter available from issues list at All Issues levelNew2011-04-19

Actions
Related to Redmine - Feature #17761: Add freetext category filter to issue query when listing issues of more than one projectNew

Actions
Related to Redmine - Defect #23198: Group by Category does not group across projectsNew

Actions
Related to Redmine - Patch #26091: Allow to filter by any visible version on the global issues viewClosedGo MAEDA

Actions
Related to Redmine - Feature #6793: Report for issues with no category for all projectsNew2010-11-02

Actions
Has duplicate Redmine - Defect #8854: Filter on category across subprojects does not workNew2011-07-19

Actions
Actions #1

Updated by Felix Schäfer almost 7 years ago

Please note that this patch does not differentiate between categories from different projects with the same name. It is also not possible currently to filter by a string match on the name of the category currently.

Actions #2

Updated by Felix Schäfer almost 7 years ago

A quick word regarding the rationale: in #25501#note-4 custom fields were changed to behave in the way implemented in the proposed patch, i.e. only limit the categories to the categories of the current project and its subprojects if we are in a project context.

Actions #3

Updated by Go MAEDA almost 7 years ago

Interesting. Thank you for submitting the patch.

Actions #4

Updated by Go MAEDA almost 7 years ago

I think we can merge this patch if tests are added.

Actions #5

Updated by Go MAEDA almost 7 years ago

The patch also resolves #8192, #17761 and #23198.

Actions #6

Updated by Toshi MARUYAMA almost 7 years ago

  • Related to Feature #8192: Make a global category filter available from issues list at All Issues level added
Actions #7

Updated by Toshi MARUYAMA almost 7 years ago

  • Related to Feature #17761: Add freetext category filter to issue query when listing issues of more than one project added
Actions #8

Updated by Toshi MARUYAMA almost 7 years ago

  • Related to Defect #23198: Group by Category does not group across projects added
Actions #9

Updated by Go MAEDA over 6 years ago

  • Has duplicate Defect #8854: Filter on category across subprojects does not work added
Actions #10

Updated by Toshi MARUYAMA over 6 years ago

  • Related to Patch #26091: Allow to filter by any visible version on the global issues view added
Actions #11

Updated by Go MAEDA over 6 years ago

  • Related to Feature #6793: Report for issues with no category for all projects added
Actions #12

Updated by Takenori TAKAKI over 5 years ago

I think this feature is very useful.
I have added a test code to the patch.
I am looking forward to this feature availabled!

Actions #13

Updated by Go MAEDA over 5 years ago

  • Status changed from New to Needs feedback
  • Assignee set to Felix Schäfer

I would like Felix to review the patch 26023_test_added.patch.

Actions #14

Updated by Felix Schäfer over 5 years ago

Takaki-san thank you very much for your tests, I have been able to integrate them in my patch. I hope you will be mentioned as author of this patch too.

I have reworked two small syntax details in the patch. I have also noticed a visibility issue in the first version of my patch. The category filter on the issue list in an issue would show the categories of all subprojects, even if the current user did not have the permission to see them. The updated patch attached to this comment contains a fix and a test for this issue.

Actions #15

Updated by Takenori TAKAKI over 5 years ago

Thank you for reviewing, Felix.
I also did't notice the visibility caused by permission.
I confirmed that the new patch(26023_test_added.patch) works fine and passes the tests!

Actions #16

Updated by Go MAEDA over 5 years ago

  • Status changed from Needs feedback to New
  • Assignee changed from Felix Schäfer to Go MAEDA
  • Target version changed from Candidate for next major release to 4.0.0

I think we can deliver this in 4.0.0.

Actions #17

Updated by Jeremy Bailey over 5 years ago

With this change, will there be a way of enabling the legacy behavior? My team uses Category as a hack to allow non-admin users to maintain their own list of people who initiate work with them, most of whom are not Redmine users. What makes categories special is that the admins don’t have to edit values that are possible, unlike custom fields.

So for us, it wouldn’t be good if every project showed categories for every project (subprojects might be okay). If the categories in other projects could be shown or hidden depending on a setting, or if the cagetories in the main project can be shown first with a separator before the others in a project context (sort of like how custom fields are grouped in the issue filter), the system would be more flexible.

Actions #18

Updated by Felix Schäfer over 5 years ago

There is no setting, no.

Currently the category filter on a project's issue list will show only the categories of the current project. On the global issue list there is currently no category filter.

With the patch, the global issue list will have a category filter with all categories from the projects the current user has access to. On a project's issue list it will show all the categories of the current project as well as categories from subprojects the current user has access to.

Actions #19

Updated by Go MAEDA over 5 years ago

  • Assignee deleted (Go MAEDA)
Actions #20

Updated by Jeremy Bailey over 5 years ago

Thanks, Felix.

On a project's issue list it will show all the categories of the current project as well as categories from subprojects the current user has access to.

Thanks for clarifying. Is it possible to display the categories of the current project first, then a separator before any categories found within subprojects?

Actions #21

Updated by Jean-Philippe Lang over 5 years ago

When reading at all the related issues, we can see that it's pretty common to have the same category in multiple projects (eg. Security), even if they are different records from a database point of view (since we can't share categories across projects).

With the proposed patch, we would have a category filter filled with multiple Security values. And if you filter on one of these values, you will only get the security issues of a single project. That's not what is expected. I think we should filter by category names, eg. being able to list all issues with the Security category. Also, when grouping by category, all Security issues should appear under the same group (#23198).

I have a patch that implements this solution, please let me know what you think.

Actions #22

Updated by Marius BĂLTEANU over 5 years ago

Jean-Philippe Lang wrote:

When reading at all the related issues, we can see that it's pretty common to have the same category in multiple projects (eg. Security), even if they are different records from a database point of view (since we can't share categories across projects).

With the proposed patch, we would have a category filter filled with multiple Security values. And if you filter on one of these values, you will only get the security issues of a single project. That's not what is expected. I think we should filter by category names, eg. being able to list all issues with the Security category. Also, when grouping by category, all Security issues should appear under the same group (#23198).

I have a patch that implements this solution, please let me know what you think.

I’m in favour of your proposed solution.

I have only one concern regarding the filter behavior which will be different than other filters like Target version and I’m asking if is not better to add this feature as a new filter named “Category name”. In this way, if we add in the future the posibility to share category between projects (feature requested by many users in #5358) it will not be necessary to revert the behavior of the current Category filter.

On the same topic, a user requested in #27192 to filter the target version by name and not by id (I mention this because is somehow related).

Actions #23

Updated by Yuuki NARA over 5 years ago

The current 'version' has functions that inherit in subprojects and make them available in all projects.

I think the same processing (inheritance) is good for versions and categories and projects.
I believe that the inheritance process of the current version is simple and user-friendly.

On Redmine 3.4.6, I put the same processing as version on category.
(I just made the category the same code as the version.)

http://www.redmine.org/issues/5358#note-97
http://www.redmine.org/issues/5358#note-98

The current user data can be used as it is.
If inheritance is set for the category definition, it can be used from subprojects as well.

Actions #24

Updated by Go MAEDA over 5 years ago

The patch seems to be controversial. Is it better to put off implementing this feature until 4.1.0?

Actions #25

Updated by Felix Schäfer over 5 years ago

Jean-Philippe Lang wrote:

When reading at all the related issues, we can see that it's pretty common to have the same category in multiple projects (eg. Security), even if they are different records from a database point of view (since we can't share categories across projects).

With the proposed patch, we would have a category filter filled with multiple Security values. And if you filter on one of these values, you will only get the security issues of a single project. That's not what is expected. I think we should filter by category names, eg. being able to list all issues with the Security category. Also, when grouping by category, all Security issues should appear under the same group (#23198).

I have a patch that implements this solution, please let me know what you think.

I'm really not sure that having the "normal" Category filter be name- instead of ID-specific would be a good idea, as this would make the filter work differently from all other filters. If there's multiple users called "Jean Dupont", the search by author will yield only results for one user, not for all users with that name. This change would make the Category filter behave differently from the other filters.

Regarding the ability to search by Categories with the same name in different projects: This would already be possible by using the multi-match filter (expand the dropdown with the possible values to a list, select all categories with the name to search). I agree this wouldn't be as easy as matching on the name, but this would at least not make the filter work differently from all other filters.

Note that I am not opposed to be able to filter by the name of the Category instead of by the ID, but this would need to be a different filter or a new operator, to 1. still be able to search by ID if this is what the user needs, and 2. avoid differing behaviour for same-looking filters (subtly different results for things "looking" the same is always difficult to explain to new users and difficult for them to remember).

One thing that could be improved in my patch proposal in #26023#note-14 would be to group categories by project or to prepend the category name with the project name. It currently wouldn't be possible to distinguish between categories with the same name in different projects in the list. If this is something of interest I could prepare an updated patch.

Actions #26

Updated by Jérôme BATAILLE over 5 years ago

Hi,

I agree with the fact to keep too filters for Categories, one by Id and the other by Name, to keep the coherence with other filters behavior. And in the filter by Id the project Prefix seems a good idea to me.

Actions #27

Updated by Jean-Philippe Lang over 5 years ago

  • Target version changed from 4.0.0 to Candidate for next major release
Actions #28

Updated by Felix Schäfer almost 3 years ago

Felix Schäfer wrote:

One thing that could be improved in my patch proposal in #26023#note-14 would be to group categories by project or to prepend the category name with the project name. It currently wouldn't be possible to distinguish between categories with the same name in different projects in the list. If this is something of interest I could prepare an updated patch.

I have been rethinking about this a little bit and in the vein of keeping one entry matching only one category, as every other list filter currently works, I think there are 2 options:
- project name - category name, which would match the behaviour of the fixed versions filter, fixed versions are grouped by status though, which could be done by status for categories
- group categories by project, with the categories of the current project at the top and top-level, and below grouped by project other categories

I think I'd prefer the second option, but the first would be consistent with the fixed versions.

Please note that we have the basic version of this, i.e. the version where all rolled up issues are just shown as is, in use at Planio and no user has currently gotten in touch because they got mixed up. I think improving the current filter by adding shared categories would be a good first step, and we can think about improving filters and/or adding a name-based filter in another ticket?

Actions

Also available in: Atom PDF