View Issue Details

IDProjectCategoryView StatusLast Update
0023550mantisbtcustomizationpublic2019-04-21 02:53
Reportercproensa Assigned Todregad  
PrioritynormalSeverityminorReproducibilityhave not tried
Status closedResolutionfixed 
Product Version2.8.0 
Target Version2.21.0Fixed in Version2.21.0 
Summary0023550: Modification to status colors css
Description

The generated css for status colors has definitions for "color" and "background-color".
There are two issues:
1) Currently the status css is used for coloring fa-square icons, which only use the "color" attribute.
2) Having both color and background defined in the same rule is not useful, to be able to reuse this class, i would probably need either color, or background, but not both. For examle, this class as is would render a text in the same color as background.

bug_update_page uses this class to apply background coulour. Fortunately, the only content in the cell is an input that is not affected by those color styles.

The proposal is to have both:
status-xx-color: defining only "color" attribute
status-xx-background-color: defining only "background-color" attribute

And use them appropiately, and have it available to be used for customizations.

TagsNo tags attached.

Relationships

has duplicate 0024534 closedatrol Bad generated CSS for status icon 
has duplicate 0025632 closeddregad Status color boxes should not have background css set 
related to 0025650 closeddregad Show status with a color square instead of background color on Bug Update Page 
related to 0025651 closeddregad Update color when new Status is selected in Bug Update Page 

Activities

atrol

atrol

2017-10-26 07:14

developer   ~0058063

Do we need the background color?
We could also remove it and change bug_update_page to display the colored square.

cproensa

cproensa

2017-10-26 10:04

developer   ~0058068

We could also remove it and change bug_update_page to display the colored square.

Probably yes. However, with any method, there is some inconsistency when the field is editable and you select a different status, the color does not change.

We could also remove it and change bug_update_page to display the colored square.

In my case, i'd want to use those in customizations, eg: plugins, custom functions... Having those available is a great help.

jeromedl

jeromedl

2019-03-11 11:53

reporter   ~0061665

Having both color + background set equally together creates two issues.
The one reported in (duplicate) ticket 0024534
and when a status cannot be changed, there is no dropdown button, therefore the status cannot be read.

From my point of view on the UX, the color should be limited to the status square and nothing more.

Kind Regards

jingshaochen

jingshaochen

2019-03-22 11:59

reporter   ~0061740

I agree with @atrol. we should use the same fg color square in the bug_update_page. Consistent with other views.

dregad

dregad

2019-03-25 05:21

developer   ~0061770

After @jingshaochen opened 0025632, I proposed PR https://github.com/mantisbt/mantisbt/pull/1484. Then I realized that it was indeed a duplicate of this issue, so I'm moving the discussion back here as the issue is older and has other people involved.

I am fine with changing bug_update_page.php to use the colored square instead of background color. That should be covered by a separate issue though.

The proposal is to have both:
status-xx-color: defining only "color" attribute
status-xx-background-color: defining only "background-color" attribute

This is basically what I implemented in the PR. And I agree with @cproensa that having 2 distinct classes can be useful in plugin or customization scenarios, even if the background-color class is not used in MantisBT core anymore.

dregad

dregad

2019-03-25 05:39

developer   ~0061775

there is some inconsistency when the field is editable and you select a different status, the color does not change

Fixable with a bit of javascript

atrol

atrol

2019-03-25 06:41

developer   ~0061776

Does it make sense to have 2 distinct classes that provide the same color without having 2 distinct configuration options, e.g. $g_status_colors_bg in addition to $g_status_colors (which should be renamed/obsoleted to $g_status_colors_fg after that) ?

dregad

dregad

2019-03-25 07:34

developer   ~0061777

Does it make sense to have 2 distinct classes that provide the same color without having 2 distinct configuration options

In my opinion it does make sense, because it is essentially the same color (i.e. resolved is green); the only difference is about the way said color is used to provide visual feedback to the end user. Defining a different set of colors for fore/background would be needlessly complicating things.

dregad

dregad

2019-03-25 08:19

developer   ~0061778

Last edited: 2019-03-25 08:23

changing bug_update_page.php to use the colored square instead of background color

Created 0025650 to track this.

when the field is editable and you select a different status, the color does not change

And 0025651 for that.

dregad

dregad

2019-04-01 05:44

developer   ~0061806

@cproensa I think this issue has been addressed with the merge of PR https://github.com/mantisbt/mantisbt/pull/1484, so I'm marking the issue as resolved. Feel free to reopen if not.

Related Changesets

MantisBT: master fc6bf8e6

2019-03-22 04:18

dregad


Details Diff
Distinct classes for status color fore/background

Currently the CSS classes defined in status_config.php set both the
foreground and background colors. This sometimes causes display glitches
on the status color boxes.

This commit fixes the problem as follows:
- add new html_get_status_css_fg() / html_get_status_css_bg() functions
- define new, distinct status color classes (status-XX-fg and
status-XX-bg) to replace the single status-XX-color used previously
- update MantisBT pages to use the new classes / API functions

Code cleanup: some variables were renamed to match coding guidelines and
better reflect their purpose.

Issue 0023550
Affected Issues
0023550
mod - account_sponsor_page.php Diff File
mod - bug_update_page.php Diff File
mod - bug_view_inc.php Diff File
mod - core/bug_group_action_api.php Diff File
mod - core/columns_api.php Diff File
mod - core/custom_function_api.php Diff File
mod - core/html_api.php Diff File
mod - core/relationship_api.php Diff File
mod - css/status_config.php Diff File
mod - my_view_inc.php Diff File