Skip to content

Commit 162e00b

Browse files
committed
feat: Support configurable priority colors
Improve accessibility and UX by giving administrators an option to configure the colors used for issue priorities on the dashboard. This allows admins to choose colors according to their issue priority order and the need of their team members. Furthermore, enhance accessibility by giving overdue issues a distinct shape too, not only color. This ensures that users with color vision deficiencies can easily identify overdue issues on the dashboard. The colors can be chosen from a palette of 10 colors with 5 shades each, so that themes can adjust these colors e.g. for dark mode, high contrast, or matching the theme better. All colors are defined as CSS variables, and chosen based on a oklch color palette for visual distinction. Note: This is first feature that heavily patches into Redmine's core and requires a database migration. This will need some serious testing and feedback to ensure it works well across different Redmine versions and setups, including other plugins. Closes #802
1 parent 0448898 commit 162e00b

24 files changed

Lines changed: 907 additions & 59 deletions

.editorconfig-checker.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
{
22
"Exclude": [
3-
"LICENSE",
3+
".husky/",
4+
".ruby-lsp/",
45
"assets/javascripts/jquery.total-storage.js",
5-
"^vendor/",
6-
"^node_modules/",
7-
"^.husky/_/",
8-
"^.ruby-lsp/"
6+
"LICENSE",
7+
"node_modules/",
8+
"vendor/redmine/"
99
],
1010
"Disable": {
1111
"IndentSize": true

.husky/pre-commit

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
bun lint-staged
1+
lint-staged

README.md

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ This [Redmine](http://redmine.org) plugin adds an issue dashboard that supports
1313

1414
## Features List
1515

16-
- Drag-n-drop of issues
16+
- Drag-and-drop of issues
1717
- Configurable columns
1818
- Grouping & Filtering
1919
- Group folding
@@ -32,7 +32,8 @@ Please ask your questions, or tell us your stories or experience on [GitHub Disc
3232
1. Download the [latest release](https://github.com/jgraichen/redmine_dashboard/releases).
3333
2. Extract archive to `<redmine>/plugins`.
3434
Make **sure** the plugin directory is called `<redmine>/plugins/redmine_dashboard/` ([#11](https://github.com/jgraichen/redmine_dashboard/issues/11)).
35-
3. A database migration is not needed. Restart Redmine.
35+
3. Run database migrations with `bundle exec rake redmine:plugins:migrate RAILS_ENV=production`.
36+
4. Restart Redmine.
3637

3738
### Configure Redmine
3839

@@ -46,11 +47,11 @@ Please ask your questions, or tell us your stories or experience on [GitHub Disc
4647

4748
## Contribute
4849

49-
I appreciate any help and like Pull Requests. The `main` branch is the current stable branch for v2. The next version, Redmine Dashboard 3, a complete rewrite had been under development on the `develop` branch. Due to limited available time the project is in maintenance only mode but open to new contributors.
50+
I appreciate any help and like Pull Requests. The `main` branch is the current stable branch for v2. Due to limited available time the project is in maintenance-only mode but open to new contributions and bug fixes.
5051

5152
I gladly accept new translations or language additions for any version of Redmine Dashboard. I would prefer new translations via [Transifex](https://www.transifex.com/projects/p/redmine-dashboard/), but you can also send a Pull Request. Feel free to request new languages or to join the team directly on Transifex.
5253

5354
## License
5455

55-
Redmine dashboard is licensed under the Apache License, Version 2.0.
56+
Redmine Dashboard is licensed under the Apache License, Version 2.0.
5657
See LICENSE for more information.
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
<%= error_messages_for 'enumeration' %>
2+
3+
<div class="box tabular">
4+
<p><%= f.text_field :name %></p>
5+
<p><%= f.check_box :active %></p>
6+
<p><%= f.check_box :is_default %></p>
7+
8+
<% @enumeration.custom_field_values.each do |value| %>
9+
<p><%= custom_field_tag_with_label :enumeration, value %></p>
10+
<% end %>
11+
</div>
12+
13+
<% if @enumeration.respond_to?(:dashboard_color_css_class) && @enumeration.respond_to?(:dashboard_color) %>
14+
<fieldset class="box">
15+
<legend><%= I18n.t('rdb.enumeration.dashboard_color') %></legend>
16+
17+
<span class="rdb-enumeration-color-palettes">
18+
<% RedmineDashboard::Color::PALETTE.each do |_, colors| %>
19+
<ol>
20+
<% colors.each do |color| %>
21+
<li>
22+
<label class="rdb-enumeration-color-label rdb-color-<%= color %>">
23+
<%= f.radio_button :dashboard_color, color %>
24+
<span><%= color %></span>
25+
</label>
26+
</li>
27+
<% end %>
28+
</ol>
29+
<% end %>
30+
</span>
31+
</fieldset>
32+
<% end %>

app/views/rdb_dashboard/_footer.html.erb

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,16 +9,17 @@
99
<p><%= t(:rdb_legend_priorities) %></p>
1010

1111
<% IssuePriority.all.sort_by(&:position).each do |priority| %>
12-
<span class="rdb-priority rdb-priority-<%= priority.position %>">
12+
<%= tag.span(class: class_names("rdb-priority", priority.dashboard_color_css_class)) do %>
1313
<%= priority %>
14-
</span>
14+
<% end %>
1515
<% end %>
1616
</div>
1717

1818
<div>
1919
<p><%= t(:rdb_legend_warnings) %></p>
20-
<span class="rdb-overdue"><span>&nbsp;</span></span>
21-
<%= t(:rdb_issue_overdue) %>
20+
<span class="rdb-overdue">
21+
<%= t(:rdb_issue_overdue) %>
22+
</span>
2223
</div>
2324
</div>
2425

app/views/rdb_dashboard/issues/_card.html.erb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<div class="rdb-card">
2-
<div class="rdb-priority rdb-priority-<%= issue.priority.position %>">
2+
<%= tag.div(class: class_names("rdb-priority", issue.priority.dashboard_color_css_class)) do %>
33
<header class="rdb-card-header">
44
<div class="rdb-card-title">
55
<%= render partial: 'rdb_dashboard/issues/issue_menu', locals: {issue: issue} %>
@@ -22,5 +22,5 @@
2222

2323
<%= render partial: 'rdb_dashboard/issues/issue_properties', locals: {issue: issue} %>
2424
</div>
25-
</div>
25+
<% end %>
2626
</div>

app/views/rdb_dashboard/issues/_compact.html.erb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<div class="rdb-compact">
2-
<div class="rdb-priority rdb-priority-<%= issue.priority.position %>">
2+
<%= tag.div(class: class_names("rdb-priority", issue.priority.dashboard_color_css_class)) do %>
33
<div class="rdb-compact-progress">
44
<div
55
class="rdb-compact-progress-bar"
@@ -22,5 +22,5 @@
2222
<%= issue.subject %>
2323
</div>
2424
</div>
25-
</div>
25+
<% end %>
2626
</div>
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
/ ISSUE COMPACT
2+
.rdb-compact
3+
.rdb-priority class=issue.priority.dashboard_color_css_class
4+
5+
.rdb-compact-progress
6+
.rdb-compact-progress-bar style="width: #{issue.done_ratio}%"
7+
header.rdb-compact-header
8+
.rdb-compact-title
9+
= render partial: 'rdb_dashboard/issues/issue_menu', locals: {issue: issue}
10+
.rdb-compact-header-data
11+
= render partial: 'rdb_dashboard/issues/issue_properties', locals: {issue: issue}
12+
13+
.rdb-compact-content
14+
.rdb-compact-subject.rdb-property-subject = issue.subject
15+
/ ISSUE COMPACT END

app/views/rdb_dashboard/taskboard/_column_dialog.html.erb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<div>
22
<div class="rdb-card rdb-card-dialog">
3-
<div class="rdb-priority rdb-priority-<%= @issue.priority.position %>">
3+
<%= tag.div(class: class_names("rdb-priority", @issue.priority.dashboard_color_css_class)) do %>
44
<header class="rdb-card-header">
55
<span class="rdb-card-title">
66
<%= link_to "#{@board.abbreviation(@issue.project_id)}#{@issue.id}", @issue %>
@@ -31,6 +31,6 @@
3131
<% end %>
3232
</ul>
3333
</div>
34-
</div>
34+
<% end %>
3535
</div>
3636
</div>

assets/stylesheets/dashboard.css

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -195,7 +195,7 @@ a#rdb-reset {
195195
}
196196

197197
#rdb-legend div {
198-
padding: 0 0 4px;
198+
padding: 0 0 0.75em;
199199
}
200200

201201
#rdb-legend p {
@@ -214,12 +214,11 @@ a#rdb-reset {
214214
}
215215

216216
#rdb-legend .rdb-overdue {
217-
padding: 0;
218-
}
219-
220-
#rdb-legend .rdb-overdue span {
221-
border: 1px solid red;
222-
padding: 0;
217+
padding: 1px 0.25em;
218+
margin: 0 3px 0 0;
219+
border: 1px solid var(--rdb-overdue-color);
220+
border-radius: 3px;
221+
outline: 1px dotted var(--rdb-overdue-color);
223222
}
224223

225224
#rdb-footer {

0 commit comments

Comments
 (0)