Skip to content

OpenProject is the leading open source project management software for product, project and portfolio management. A powerful Jira alternative with agile planning, issue tracking, roadmaps, Gantt charts, time tracking, collaboration features, and more. Available on premises or in the cloud. ⭐ Star us on GitHub

Provide option to hide highlight on col

Oliver Günther47da171ac11a
diff --git a/app/components/projects/table_component.html.erb b/app/components/projects/table_component.html.erb
index 6a1acbe642a..a697d0ca23a 100644
--- a/app/components/projects/table_component.html.erb
+++ b/app/components/projects/table_component.html.erb
@@ -34,7 +34,7 @@ See COPYRIGHT and LICENSE files for more details.
<table class="generic-table" data-controller="table-highlighting" <%= table_id ? "id=\"#{table_id}\"".html_safe : '' %>>
<colgroup>
<% columns.each do |column| %>
- <col>
+ <%= tag :col, data: { highlight: column.attribute != :hierarchy } %>
<% end %>
<col>
</colgroup>
diff --git a/app/components/table_component.html.erb b/app/components/table_component.html.erb
index da9808b991d..9449d5dc489 100644
--- a/app/components/table_component.html.erb
+++ b/app/components/table_component.html.erb
@@ -34,7 +34,7 @@ See COPYRIGHT and LICENSE files for more details.
<% headers.each do |_name, _options| %>
<col>
<% end %>
- <col>
+ <col data-highlight="false">
</colgroup>
<thead>
<tr>
diff --git a/app/views/attribute_help_texts/_tab.html.erb b/app/views/attribute_help_texts/_tab.html.erb
index 12f569dd415..8b59eed7383 100644
--- a/app/views/attribute_help_texts/_tab.html.erb
+++ b/app/views/attribute_help_texts/_tab.html.erb
@@ -7,7 +7,7 @@
<col>
<col>
<col>
- <col>
+ <col data-highlight="false">
</colgroup>
<thead>
<tr>
diff --git a/app/views/custom_fields/_custom_options.html.erb b/app/views/custom_fields/_custom_options.html.erb
index a70d9f0942d..f20f6934f71 100644
--- a/app/views/custom_fields/_custom_options.html.erb
+++ b/app/views/custom_fields/_custom_options.html.erb
@@ -37,7 +37,7 @@ See COPYRIGHT and LICENSE files for more details.
<col>
<col>
<col>
- <col>
+ <col data-highlight="false">
</colgroup>
<thead>
<tr>
diff --git a/app/views/custom_fields/_tab.html.erb b/app/views/custom_fields/_tab.html.erb
index 4dea4e198b7..5616d519974 100644
--- a/app/views/custom_fields/_tab.html.erb
+++ b/app/views/custom_fields/_tab.html.erb
@@ -49,7 +49,7 @@ See COPYRIGHT and LICENSE files for more details.
<% end %>
<col>
<col>
- <col>
+ <col data-highlight="false">
</colgroup>
<thead>
<tr>
diff --git a/app/views/forums/index.html.erb b/app/views/forums/index.html.erb
index aa1a2dde488..73a2c166a9a 100644
--- a/app/views/forums/index.html.erb
+++ b/app/views/forums/index.html.erb
@@ -54,7 +54,7 @@ See COPYRIGHT and LICENSE files for more details.
<col>
<% if User.current.allowed_in_project?(:manage_forums, @project) %>
<col>
- <col>
+ <col data-highlight="false">
<% end %>
</colgroup>
<thead>
diff --git a/app/views/groups/_memberships.html.erb b/app/views/groups/_memberships.html.erb
index 8064048d3a4..a7d554fff61 100644
--- a/app/views/groups/_memberships.html.erb
+++ b/app/views/groups/_memberships.html.erb
@@ -39,7 +39,7 @@ See COPYRIGHT and LICENSE files for more details.
<colgroup>
<col>
<col>
- <col>
+ <col data-highlight="false">
</colgroup>
<thead>
<tr>
diff --git a/app/views/groups/_users_table.html.erb b/app/views/groups/_users_table.html.erb
index 1b9f1e9a4bd..3cf29cddc2c 100644
--- a/app/views/groups/_users_table.html.erb
+++ b/app/views/groups/_users_table.html.erb
@@ -29,8 +29,8 @@ See COPYRIGHT and LICENSE files for more details.
<table class="generic-table users">
<colgroup>
- <col colightCol>
<col>
+ <col data-highlight="false">
</colgroup>
<thead>
<tr>
diff --git a/app/views/groups/index.html.erb b/app/views/groups/index.html.erb
index 00bb41da9c7..2634231994f 100644
--- a/app/views/groups/index.html.erb
+++ b/app/views/groups/index.html.erb
@@ -58,7 +58,7 @@ See COPYRIGHT and LICENSE files for more details.
<colgroup>
<col>
<col>
- <col>
+ <col data-highlight="false">
</colgroup>
<thead>
<tr>
diff --git a/app/views/principals/_global_roles.html.erb b/app/views/principals/_global_roles.html.erb
index 2959891a119..cfed1b097d0 100644
--- a/app/views/principals/_global_roles.html.erb
+++ b/app/views/principals/_global_roles.html.erb
@@ -42,7 +42,7 @@ See COPYRIGHT and LICENSE files for more details.
<table class="generic-table principal_roles" id="table_principal_roles" data-controller="table-highlighting">
<colgroup>
<col>
- <col>
+ <col data-highlight="false">
</colgroup>
<thead>
<tr>
diff --git a/app/views/projects/settings/categories/show.html.erb b/app/views/projects/settings/categories/show.html.erb
index 9edd0865de8..8b8a000aaba 100644
--- a/app/views/projects/settings/categories/show.html.erb
+++ b/app/views/projects/settings/categories/show.html.erb
@@ -48,7 +48,7 @@ See COPYRIGHT and LICENSE files for more details.
<colgroup>
<col>
<col>
- <col>
+ <col data-highlight="false">
</colgroup>
<thead>
<tr>
diff --git a/app/views/repositories/_dir_list.html.erb b/app/views/repositories/_dir_list.html.erb
index 41e8a8990fd..89cd99600bd 100644
--- a/app/views/repositories/_dir_list.html.erb
+++ b/app/views/repositories/_dir_list.html.erb
@@ -31,7 +31,7 @@ See COPYRIGHT and LICENSE files for more details.
<table class="generic-table" data-controller="table-highlighting" data-repository-navigation-target="repoBrowser">
<colgroup>
<col>
- <col>
+ <col data-highlight="false">
<col>
<col>
<col>
diff --git a/app/views/repositories/_revisions.html.erb b/app/views/repositories/_revisions.html.erb
index ce14ce62e69..ed2ec6c0888 100644
--- a/app/views/repositories/_revisions.html.erb
+++ b/app/views/repositories/_revisions.html.erb
@@ -33,8 +33,8 @@ See COPYRIGHT and LICENSE files for more details.
<table class="generic-table changesets">
<colgroup>
<col>
- <col>
- <col>
+ <col data-highlight="false">
+ <col data-highlight="false">
<col>
<col>
<col>
diff --git a/app/views/roles/index.html.erb b/app/views/roles/index.html.erb
index 9462e7a2435..2348b1f8ce5 100644
--- a/app/views/roles/index.html.erb
+++ b/app/views/roles/index.html.erb
@@ -58,7 +58,7 @@ See COPYRIGHT and LICENSE files for more details.
<col>
<col>
<col>
- <col>
+ <col data-highlight="false">
</colgroup>
<thead>
<tr>
diff --git a/app/views/types/index.html.erb b/app/views/types/index.html.erb
index 4b037c98998..7794772696f 100644
--- a/app/views/types/index.html.erb
+++ b/app/views/types/index.html.erb
@@ -57,13 +57,13 @@ See COPYRIGHT and LICENSE files for more details.
<table class="generic-table" data-controller="table-highlighting">
<colgroup>
<col>
+ <col data-highlight="false">
<col>
<col>
<col>
<col>
<col>
- <col>
- <col>
+ <col data-highlight="false">
</colgroup>
<thead>
<tr>
diff --git a/app/views/wiki/history.html.erb b/app/views/wiki/history.html.erb
index 0034b8120c7..41994db6b0c 100644
--- a/app/views/wiki/history.html.erb
+++ b/app/views/wiki/history.html.erb
@@ -38,12 +38,12 @@ See COPYRIGHT and LICENSE files for more details.
<table class="generic-table wiki-page-versions">
<colgroup>
<col>
+ <col data-highlight="false">
+ <col data-highlight="false">
<col>
<col>
<col>
- <col>
- <col>
- <col>
+ <col data-highlight="false">
</colgroup>
<caption class="hidden-for-sighted">
<span>
diff --git a/app/views/workflows/show.html.erb b/app/views/workflows/show.html.erb
index e46e59a272b..132c765088f 100644
--- a/app/views/workflows/show.html.erb
+++ b/app/views/workflows/show.html.erb
@@ -36,13 +36,13 @@ See COPYRIGHT and LICENSE files for more details.
<div class="generic-table--results-container">
<table class="generic-table" data-controller="table-highlighting">
<colgroup>
+ <col data-highlight="false">
<col>
<col>
<col>
<col>
<col>
- <col>
- <col>
+ <col data-highlight="false">
</colgroup>
<thead>
<tr>
diff --git a/frontend/src/app/features/work-packages/components/wp-table/wp-table.component.html b/frontend/src/app/features/work-packages/components/wp-table/wp-table.component.html
index 9c75b972055..93a506c9b6b 100644
--- a/frontend/src/app/features/work-packages/components/wp-table/wp-table.component.html
+++ b/frontend/src/app/features/work-packages/components/wp-table/wp-table.component.html
@@ -2,15 +2,16 @@
<div class="work-packages-tabletimeline--table-side work-package-table--container __hidden_overflow_container">
<table
class="keyboard-accessible-list generic-table work-package-table"
+ data-controller="table-highlighting"
[class.op-table-baseline]="baselineEnabled"
>
<colgroup>
- <col *ngIf="configuration.dragAndDropEnabled">
- <col *ngIf="baselineEnabled">
+ <col data-highlight="false" *ngIf="configuration.dragAndDropEnabled">
+ <col data-highlight="false" *ngIf="baselineEnabled">
<!-- Generate col elements dynamically(!) for each requested column plus one for the action menu's column. -->
<col *ngFor="let column of [].constructor(columns.length)">
<col *ngIf="configuration.columnMenuEnabled">
- <col *ngIf="!configuration.columnMenuEnabled">
+ <col data-highlight="false" *ngIf="!configuration.columnMenuEnabled">
</colgroup>
<caption class="hidden-for-sighted">
<span>{{text.tableSummary}}</span>
diff --git a/frontend/src/app/shared/components/datepicker/modal-single-date-picker/modal-single-date-picker.component.ts b/frontend/src/app/shared/components/datepicker/modal-single-date-picker/modal-single-date-picker.component.ts
index 7fd79ec67a8..06a412e4b57 100644
--- a/frontend/src/app/shared/components/datepicker/modal-single-date-picker/modal-single-date-picker.component.ts
+++ b/frontend/src/app/shared/components/datepicker/modal-single-date-picker/modal-single-date-picker.component.ts
@@ -28,7 +28,6 @@
import {
AfterContentInit,
- ChangeDetectionStrategy,
ChangeDetectorRef,
Component,
ElementRef,
@@ -55,11 +54,11 @@ import {
} from 'core-app/spot/components/drop-modal/drop-modal-teleportation.service';
import { delay } from 'rxjs';
+// eslint-disable-next-line change-detection-strategy/on-push
@Component({
selector: 'op-modal-single-date-picker',
templateUrl: './modal-single-date-picker.component.html',
styleUrls: ['../styles/datepicker.modal.sass', './modal-single-date-picker.component.sass'],
- changeDetection: ChangeDetectionStrategy.OnPush,
encapsulation: ViewEncapsulation.None,
providers: [
{
diff --git a/frontend/src/app/shared/components/grids/widgets/time-entries/list/time-entries-list.component.html b/frontend/src/app/shared/components/grids/widgets/time-entries/list/time-entries-list.component.html
index cf5b7f6f8d9..e4c53d0f056 100644
--- a/frontend/src/app/shared/components/grids/widgets/time-entries/list/time-entries-list.component.html
+++ b/frontend/src/app/shared/components/grids/widgets/time-entries/list/time-entries-list.component.html
@@ -24,7 +24,7 @@
<col>
<col>
<col>
- <col>
+ <col data-highlight="false">
</colgroup>
<thead class="-sticky">
<tr>
diff --git a/frontend/src/stimulus/controllers/table-highlighting.controller.ts b/frontend/src/stimulus/controllers/table-highlighting.controller.ts
index 365dd3cbd40..4702a8aa0ca 100644
--- a/frontend/src/stimulus/controllers/table-highlighting.controller.ts
+++ b/frontend/src/stimulus/controllers/table-highlighting.controller.ts
@@ -70,11 +70,16 @@ export default class TableHighlightingController extends ApplicationController {
const th = target.closest('th') as HTMLElement;
const index = this.parentIndex(th);
- if (index !== null) {
- return this.colgroup.children.item(index) as HTMLElement|null;
+ if (index === null) {
+ return null;
}
+ const col = this.colgroup.children.item(index) as HTMLElement|null;
- return null;
+ if (!col || col.dataset.highlight === 'false') {
+ return null;
+ }
+
+ return col;
}
private parentIndex(element:HTMLElement):number|null {
diff --git a/modules/budgets/app/views/budgets/subform/_material_budget_subform.html.erb b/modules/budgets/app/views/budgets/subform/_material_budget_subform.html.erb
index d486662fcb0..5ddca76cbce 100644
--- a/modules/budgets/app/views/budgets/subform/_material_budget_subform.html.erb
+++ b/modules/budgets/app/views/budgets/subform/_material_budget_subform.html.erb
@@ -47,7 +47,7 @@ See COPYRIGHT and LICENSE files for more details.
<% if User.current.allowed_in_project?(:view_cost_rates, @project)%>
<col>
<%end%>
- <col>
+ <col data-highlight="false">
</colgroup>
<thead>
<tr>
diff --git a/modules/costs/app/views/cost_types/_list.html.erb b/modules/costs/app/views/cost_types/_list.html.erb
index 3daee22e263..0e721aa7390 100644
--- a/modules/costs/app/views/cost_types/_list.html.erb
+++ b/modules/costs/app/views/cost_types/_list.html.erb
@@ -42,7 +42,7 @@ See COPYRIGHT and LICENSE files for more details.
<col>
<col>
<col>
- <col>
+ <col data-highlight="false">
</colgroup>
<thead>
<tr>
diff --git a/modules/costs/app/views/cost_types/_list_deleted.html.erb b/modules/costs/app/views/cost_types/_list_deleted.html.erb
index a619cd78251..7b618f93677 100644
--- a/modules/costs/app/views/cost_types/_list_deleted.html.erb
+++ b/modules/costs/app/views/cost_types/_list_deleted.html.erb
@@ -41,7 +41,7 @@ See COPYRIGHT and LICENSE files for more details.
<col>
<col>
<col>
- <col>
+ <col data-highlight="false">
</colgroup>
<thead>
<tr>
diff --git a/modules/costs/app/views/cost_types/edit.html.erb b/modules/costs/app/views/cost_types/edit.html.erb
index 51831734e16..c3e74048802 100644
--- a/modules/costs/app/views/cost_types/edit.html.erb
+++ b/modules/costs/app/views/cost_types/edit.html.erb
@@ -70,7 +70,7 @@ See COPYRIGHT and LICENSE files for more details.
<colgroup>
<col>
<col>
- <col>
+ <col data-highlight="false">
</colgroup>
<thead>
<tr>
diff --git a/modules/costs/app/views/hourly_rates/edit.html.erb b/modules/costs/app/views/hourly_rates/edit.html.erb
index 9ebeb2d903f..fc67aa38ef3 100644
--- a/modules/costs/app/views/hourly_rates/edit.html.erb
+++ b/modules/costs/app/views/hourly_rates/edit.html.erb
@@ -50,7 +50,7 @@ See COPYRIGHT and LICENSE files for more details.
<colgroup>
<col>
<col>
- <col>
+ <col data-highlight="false">
</colgroup>
<thead>
<tr>
diff --git a/spec/features/admin/working_days_spec.rb b/spec/features/admin/working_days_spec.rb
index 1e9bd9208b3..2ea8a1af623 100644
--- a/spec/features/admin/working_days_spec.rb
+++ b/spec/features/admin/working_days_spec.rb
@@ -192,7 +192,6 @@ RSpec.describe "Working Days", :js, :with_cuprite do
# Check if a date is correctly highlighted after selecting it in different time zones
datepicker.select_day 5
- datepicker.expect_day "5"
# It can cancel and reopen
within_test_selector("op-datepicker-modal") do
diff --git a/spec/support/components/datepicker/datepicker_modal.rb b/spec/support/components/datepicker/datepicker_modal.rb
index a0edafdbf16..002f86a14bb 100644
--- a/spec/support/components/datepicker/datepicker_modal.rb
+++ b/spec/support/components/datepicker/datepicker_modal.rb
@@ -17,5 +17,24 @@ module Components
raise "Expected date to equal #{date}, but got #{input.value}" unless input.value == date.iso8601
end
end
+
+ ##
+ # Select day from datepicker
+ def select_day(value)
+ unless (1..31).cover?(value.to_i)
+ raise ArgumentError, "Invalid value #{value} for day, expected 1-31"
+ end
+
+ expect(flatpickr_container).to have_text(value)
+
+ retry_block do
+ flatpickr_container
+ .first(".flatpickr-days .flatpickr-day:not(.nextMonthDay):not(.prevMonthDay)",
+ text: value)
+ .click
+
+ raise "Expected #{value} to be selected" unless flatpickr_container.has_css?(".flatpickr-day.selected", text: value)
+ end
+ end
end
end