Project

General

Profile

Actions

Patch #23417

open

Make the ID column configurable in the issues listing like the other columns

Added by Marius BĂLTEANU over 7 years ago. Updated over 2 years ago.

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

0%

Estimated time:

Description

Currently, in the issues listing table, there are two "hard coded" columns:
  1. first column with the checkbox
  2. second column with the issue ID

In our custom theme, we want to have the subject in the first column in order to improve the readability of the issues and subtasks: .

To obtain that, we hide both columns from the CSS, but we weren't able to display the ID column as last column in the table by default without development (or let the users to decide the ID column position).

Attached is a patch that:
- makes the ID column configurable (like the other columns)
- adds the ID column as first column in the default Redmine settings
- migrates the default columns settings in order to add the ID column as first column.
- updates the existing tests to include this change
- removes some empty spaces


Files

id_column.png (156 KB) id_column.png Marius BĂLTEANU, 2016-07-24 23:42
make_id_column_configurable.patch (20.8 KB) make_id_column_configurable.patch Marius BĂLTEANU, 2016-07-25 01:05
make_id_column_configurable_v2.patch (21.8 KB) make_id_column_configurable_v2.patch Marius BĂLTEANU, 2016-07-28 17:47
make_id_column_configurable_v3.patch (21 KB) make_id_column_configurable_v3.patch Marius BĂLTEANU, 2016-08-22 11:20
3.4.0_make_id_column_configurable_v4.patch (20.5 KB) 3.4.0_make_id_column_configurable_v4.patch Marius BĂLTEANU, 2016-11-19 09:14
Actions #1

Updated by JW Fuchs over 7 years ago

+1
Very useful patch!

Actions #2

Updated by Marius BĂLTEANU over 7 years ago

The migration file is missing from the first patch. I've attached now the complete patch (make_id_column_configurable_v2.patch).

Actions #3

Updated by Toshi MARUYAMA over 7 years ago

  • Description updated (diff)
Actions #4

Updated by Toshi MARUYAMA over 7 years ago

  • "plugins/README" is deleted accidentally.
  • db/migrate is too hard to test.
    Could you use alternative way?
Actions #5

Updated by Toshi MARUYAMA over 7 years ago

Toshi MARUYAMA wrote:

  • db/migrate is too hard to test.
    Could you use alternative way?

Oh, I can see 20131004113137_support_for_multiple_commit_keywords.rb uses similar way.
source:tags/3.3.0/db/migrate/20131004113137_support_for_multiple_commit_keywords.rb

Actions #6

Updated by Marius BĂLTEANU over 7 years ago

Thanks Toshi for your feedback.

I've updated the patch in order to:
  • clearly apply on the current trunk
  • remove the accidentally "plugins/README" deletion
For testing the "db/migrate" I used the following scenarios:
  • open "settings?tab=issues" and "projects/<project_identifier>/issues?set_filter=1"
  • apply the patch without migration
  • refresh the admin page and observe that the default columns are still the same (without id)
  • refresh the issues list and observe that the ID column is no longer displayed in the issues table
  • run the migrations
  • refresh the admin page and observe that the ID column now is the first column in the default columns setting
  • refresh the issues list and observe that the ID column is displayed now in the issues table.
Regarding the implementation, I don't have another alternative way for the moment. The logic behind the current implementation was:
  • get the current default columns setting
  • check if the ID column already exists in the settings (on a standard Redmine setup (without patches and plugins) this case cannot exists, but I wanted to cover other cases where a plugin or a patch already made this column configurable)
  • if exists, do nothing
  • if doesn't exists, add the id column as first column
  • save the new settings.

Please let me know if you still want to find another way for migrations or make other changes to the patch.

Actions #7

Updated by Marius BĂLTEANU over 7 years ago

Toshi MARUYAMA wrote:

Toshi MARUYAMA wrote:

  • db/migrate is too hard to test.
    Could you use alternative way?

Oh, I can see 20131004113137_support_for_multiple_commit_keywords.rb uses similar way.
source:tags/3.3.0/db/migrate/20131004113137_support_for_multiple_commit_keywords.rb

Yes, my implementation was inspired from that file.

Actions #8

Updated by Toshi MARUYAMA over 7 years ago

  • Target version set to 3.4.0
Actions #9

Updated by Marius BĂLTEANU over 7 years ago

Updated the patch to cleanly apply on the current trunk.

Actions #10

Updated by Marius BĂLTEANU about 7 years ago

The patch is compatible with the latest trunk. @Jean-Philippe Lang, please let me know if is anything wrong with this patch.

Actions #11

Updated by Jean-Philippe Lang about 7 years ago

  • Target version deleted (3.4.0)

Marius, nothing is wrong with the patch but having the issue id in first position is part of the UI. Users should not have to handle this when choosing the information that they want to see on the issue list, and I prefer not to apply this change.

Note that saved queries would also have to be fixed in a migration (id column is missing from all saved queries after applying the patch). If you want to always have it in last position, you could alter Query#columns to append the id instead of inserting it in first position.

Actions #12

Updated by Marius BĂLTEANU about 7 years ago

Thanks for you feedback, Jean-Philippe.

Jean-Philippe Lang wrote:

If you want to always have it in last position, you could alter Query#columns to append the id instead of inserting it in first position.

No, I don't want to have it in last position, I prefer to let each user decide the position of the ID column in the issue list. For example, we have some projects where the ID is not added to the issue list because it is irrelevant.

Actions #14

Updated by ashraf alzyoud over 2 years ago

CAN U CREATE PLUGIN for it or update patch plz
i dont need issue id appear in my report (pdf,cvs)

Actions

Also available in: Atom PDF