Patch #28494

Recalculate issue priority position names if default value changed

Added by Holger Just 3 months ago. Updated about 1 month ago.

Status:ClosedStart date:
Priority:NormalDue date:
Assignee:Go MAEDA% Done:

0%

Category:Issues
Target version:4.0.0

Description

The attached patch fixes the logic to set the position names of issue priorities which are used to define issue colours is assigned issues.

Before this fix, the names were not re-calculated if the default issue priority was changed. This resulted in the the previous colours being used which thus would not match with the defined order anymore.

0001-Recalculate-issue-priority-position-names-if-default.patch Magnifier (1.07 KB) Holger Just, 2018-04-05 15:33

0002-Recalculate-issue-priority-position-names-if-default.patch Magnifier (1.57 KB) Tomomi Yuzuriha, 2018-05-08 08:03

28494-test.patch Magnifier - Test by Tomomi Yuzuriha (844 Bytes) Go MAEDA, 2018-05-08 09:33

Associated revisions

Revision 17329
Added by Go MAEDA about 1 month ago

Recalculate issue priority position names if default value changed (#28494).

Patch by Holger Just.

Revision 17330
Added by Go MAEDA about 1 month ago

Add test for r17329 (#28494).

Patch by Tomomi Yuzuriha.

History

#1 Updated by Go MAEDA 2 months ago

  • Target version set to 4.1.0

Confirmed the problem, setting target version to 4.1.0.

#2 Updated by Go MAEDA about 1 month ago

Steps to reproduce:

1. Assume that there are 5 active priorities, Low, Normal, High, Urgent, and Immediate. The default priority is Normal.
2. On the "Enumerations" page, edit the priority "High" and set the "Default value" flag true.
3. Check the CSS class for the issue whose priority is "High". The issue should have "priority-default" class but the actual class is "priority-high3".
4. Reorder priorities on "Enumerations" page.
5. Check the CSS class of the issue you saw in step 3. Position names are recalculated and the issue has correct CSS class "priority-default".

#3 Updated by Tomomi Yuzuriha about 1 month ago

I wrote a test so that this patch will be included in the Redmine core.
The test sets the first IssuePriority to the default and tests whether the position_name has changed.

#4 Updated by Go MAEDA about 1 month ago

Tomomi Yuzuriha wrote:

I wrote a test so that this patch will be included in the Redmine core.

Thank you for your contribution. I extracted a test from your work and changed the method name. We can apply the following patch to the core.

#5 Updated by Go MAEDA about 1 month ago

  • Status changed from New to Closed
  • Assignee set to Go MAEDA
  • Target version changed from 4.1.0 to 4.0.0

Committed the patch by Holger Just and the test by Tomomi Yuzuriha. Thanks.

Also available in: Atom PDF