Skip to content

Commit

Permalink
rename stimulus controller by convetion
Browse files Browse the repository at this point in the history
  • Loading branch information
OlegPhenomenon committed Aug 16, 2023
1 parent 833e95e commit 4a93368
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 18 deletions.
12 changes: 6 additions & 6 deletions app/assets/builds/application.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions app/assets/builds/application.js.map

Large diffs are not rendered by default.

18 changes: 11 additions & 7 deletions app/components/common/table/component.rb
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,17 @@ def table_header_generator

def sortable_column(column, caption, option)
tag.th caption, **option,
data: { controller: 'table--sort-link',
action: 'click->table--sort-link#resortTable',
'table--sort-link-direction-value': next_direction(column),
'table--sort-link-column-value': column,
'table--sort-link-asc-class': sorting_asc_class,
'table--sort-link-desc-class': sorting_desc_class,
'table--sort-link-target': target_element_name }
data: { controller: stimulus_controller_name_dirty,
action: "click->#{stimulus_controller_name_dirty}#resortTable",
"#{stimulus_controller_name_dirty}-direction-value": next_direction(column),
"#{stimulus_controller_name_dirty}-column-value": column,
"#{stimulus_controller_name_dirty}-asc-class": sorting_asc_class,
"#{stimulus_controller_name_dirty}-desc-class": sorting_desc_class,
"#{stimulus_controller_name_dirty}-target": target_element_name }
end

def stimulus_controller_name_dirty
'table--ordeable'
end

def sorting_asc_class
Expand Down
4 changes: 2 additions & 2 deletions app/javascript/controllers/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ application.register("form--filter", Form__FilterController);
import Form__AutobiderSubmitController from "./form/autobider_submit_controller";
application.register("form--autobider-submit", Form__AutobiderSubmitController);

import Table__SortLinkController from "./table/sort_link_controller";
application.register("table--sort-link", Table__SortLinkController);
import Table__OrdeableController from "./table/ordeable_controller";
application.register("table--ordeable", Table__OrdeableController);

import AutotaxCounter from "./autotax_counter_controller";
application.register("autotax-counter", AutotaxCounter);
Expand Down

0 comments on commit 4a93368

Please sign in to comment.