From e2550a5d8a28a4506a4e2f97cdb831f84994dbf1 Mon Sep 17 00:00:00 2001 From: Tobias Dillmann Date: Mon, 14 Oct 2024 08:35:43 +0200 Subject: [PATCH] [#52147] fix cop errors --- app/helpers/sort_helper.rb | 5 ++++- .../controllers/dynamic/table-action-menu.controller.ts | 4 ++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/app/helpers/sort_helper.rb b/app/helpers/sort_helper.rb index dd673ca038dc..c011d5d59c36 100644 --- a/app/helpers/sort_helper.rb +++ b/app/helpers/sort_helper.rb @@ -77,7 +77,9 @@ # - Introduces instance variables: @sort_default, @sort_criteria # - Introduces param :sort # - +# rubocop:disable Lint/RedundantCopDisableDirective, Rails/HelperInstanceVariable +# TODO: We should not use instance variables in our rails helpers. Since this is a bigger piece of work, for now +# we just disable the respective cop. Due to a bug, we must also disable the redundancy cop. module SortHelper class SortCriteria attr_reader :criteria @@ -554,3 +556,4 @@ def get_caption(column, options) caption end end +# rubocop:enable Rails/HelperInstanceVariable, Lint/RedundantCopDisableDirective diff --git a/frontend/src/stimulus/controllers/dynamic/table-action-menu.controller.ts b/frontend/src/stimulus/controllers/dynamic/table-action-menu.controller.ts index 00feed62859e..b05c79dec0c0 100644 --- a/frontend/src/stimulus/controllers/dynamic/table-action-menu.controller.ts +++ b/frontend/src/stimulus/controllers/dynamic/table-action-menu.controller.ts @@ -47,9 +47,9 @@ export default class TableActionMenuController extends Controller { } } - filterBy(event: Event) { + filterBy(event:Event) { // Sometimes the filterController was not loaded during `connect`, so we try again here: - if (!this.filterController) { this.findFilterController() } + if (!this.filterController) { this.findFilterController(); } const button = event.currentTarget as HTMLElement;