From 34ca056ca4f72f2598002cf73419843bd360e33f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Oliver=20G=C3=BCnther?= Date: Fri, 16 Aug 2024 08:57:58 +0200 Subject: [PATCH] Provide option to hide highlight on col --- app/components/projects/table_component.html.erb | 2 +- app/components/table_component.html.erb | 2 +- app/views/attribute_help_texts/_tab.html.erb | 2 +- app/views/custom_fields/_custom_options.html.erb | 2 +- app/views/custom_fields/_tab.html.erb | 2 +- app/views/forums/index.html.erb | 2 +- app/views/groups/_memberships.html.erb | 2 +- app/views/groups/_users_table.html.erb | 2 +- app/views/groups/index.html.erb | 2 +- app/views/principals/_global_roles.html.erb | 2 +- app/views/projects/settings/categories/show.html.erb | 2 +- app/views/repositories/_dir_list.html.erb | 2 +- app/views/repositories/_revisions.html.erb | 4 ++-- app/views/roles/index.html.erb | 2 +- app/views/types/index.html.erb | 4 ++-- app/views/wiki/history.html.erb | 6 +++--- app/views/workflows/show.html.erb | 4 ++-- .../components/wp-table/wp-table.component.html | 7 ++++--- .../list/time-entries-list.component.html | 2 +- .../controllers/table-highlighting.controller.ts | 11 ++++++++--- .../budgets/subform/_material_budget_subform.html.erb | 2 +- modules/costs/app/views/cost_types/_list.html.erb | 2 +- .../costs/app/views/cost_types/_list_deleted.html.erb | 2 +- modules/costs/app/views/cost_types/edit.html.erb | 2 +- modules/costs/app/views/hourly_rates/edit.html.erb | 2 +- 25 files changed, 40 insertions(+), 34 deletions(-) diff --git a/app/components/projects/table_component.html.erb b/app/components/projects/table_component.html.erb index 6a1acbe642ab..a697d0ca23ab 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. > <% columns.each do |column| %> - + <%= tag :col, data: { highlight: column.attribute != :hierarchy } %> <% end %> diff --git a/app/components/table_component.html.erb b/app/components/table_component.html.erb index da9808b991d3..9449d5dc4894 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| %> <% end %> - + diff --git a/app/views/attribute_help_texts/_tab.html.erb b/app/views/attribute_help_texts/_tab.html.erb index 12f569dd415c..8b59eed73835 100644 --- a/app/views/attribute_help_texts/_tab.html.erb +++ b/app/views/attribute_help_texts/_tab.html.erb @@ -7,7 +7,7 @@ - + diff --git a/app/views/custom_fields/_custom_options.html.erb b/app/views/custom_fields/_custom_options.html.erb index a70d9f0942d8..f20f6934f719 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. - + diff --git a/app/views/custom_fields/_tab.html.erb b/app/views/custom_fields/_tab.html.erb index 608dadc0db32..60d5ff479e11 100644 --- a/app/views/custom_fields/_tab.html.erb +++ b/app/views/custom_fields/_tab.html.erb @@ -60,7 +60,7 @@ See COPYRIGHT and LICENSE files for more details. <% end %> - + diff --git a/app/views/forums/index.html.erb b/app/views/forums/index.html.erb index aa1a2dde488c..73a2c166a9a7 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. <% if User.current.allowed_in_project?(:manage_forums, @project) %> - + <% end %> diff --git a/app/views/groups/_memberships.html.erb b/app/views/groups/_memberships.html.erb index 8064048d3a4a..a7d554fff612 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. - + diff --git a/app/views/groups/_users_table.html.erb b/app/views/groups/_users_table.html.erb index 1b9f1e9a4bd7..3cf29cddc2c2 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.
- + diff --git a/app/views/groups/index.html.erb b/app/views/groups/index.html.erb index 00bb41da9c72..2634231994fc 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. - + diff --git a/app/views/principals/_global_roles.html.erb b/app/views/principals/_global_roles.html.erb index 2959891a1190..cfed1b097d01 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.
- + diff --git a/app/views/projects/settings/categories/show.html.erb b/app/views/projects/settings/categories/show.html.erb index 9edd0865de8b..8b8a000aaba6 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. - + diff --git a/app/views/repositories/_dir_list.html.erb b/app/views/repositories/_dir_list.html.erb index 41e8a8990fd3..89cd99600bd8 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.
- + diff --git a/app/views/repositories/_revisions.html.erb b/app/views/repositories/_revisions.html.erb index ce14ce62e69d..ed2ec6c08886 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.
- - + + diff --git a/app/views/roles/index.html.erb b/app/views/roles/index.html.erb index 9462e7a24354..2348b1f8ce5f 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. - + diff --git a/app/views/types/index.html.erb b/app/views/types/index.html.erb index 4b037c989988..7794772696fe 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.
+ - - + diff --git a/app/views/wiki/history.html.erb b/app/views/wiki/history.html.erb index 0034b8120c75..41994db6b0c7 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.
+ + - - - +
diff --git a/app/views/workflows/show.html.erb b/app/views/workflows/show.html.erb index e46e59a272b3..132c765088fb 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.
+ - - + 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 9c75b9720555..93a506c9b6bd 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 @@
- - + + - + - + diff --git a/frontend/src/stimulus/controllers/table-highlighting.controller.ts b/frontend/src/stimulus/controllers/table-highlighting.controller.ts index 365dd3cbd407..4702a8aa0caf 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 d486662fcb06..5ddca76cbceb 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)%> <%end%> - + diff --git a/modules/costs/app/views/cost_types/_list.html.erb b/modules/costs/app/views/cost_types/_list.html.erb index 3daee22e2635..0e721aa73901 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. - + 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 a619cd78251d..7b618f936772 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. - + diff --git a/modules/costs/app/views/cost_types/edit.html.erb b/modules/costs/app/views/cost_types/edit.html.erb index 51831734e163..c3e740488028 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. - + diff --git a/modules/costs/app/views/hourly_rates/edit.html.erb b/modules/costs/app/views/hourly_rates/edit.html.erb index 9ebeb2d903f7..fc67aa38ef3b 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. - +
{{text.tableSummary}} 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 cf5b7f6f8d95..e4c53d0f0560 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 @@