Skip to content

Commit

Permalink
Refactor - use city-in-country instead of course_controller
Browse files Browse the repository at this point in the history
  • Loading branch information
bryszard committed Nov 18, 2023
1 parent 709adb1 commit ba0165c
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 107 deletions.
4 changes: 2 additions & 2 deletions spec/dummy/app/avo/resources/course_resource.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ class CourseResource < Avo::BaseResource
scope.ransack(id_eq: params[:q], name_cont: params[:q], m: "or").result(distinct: false)
end
self.keep_filters_panel_open = true
self.stimulus_controllers = "course-resource toggle-fields"
self.stimulus_controllers = "city-in-country toggle-fields"

field :id, as: :id
field :name, as: :text, html: {
Expand Down Expand Up @@ -68,7 +68,7 @@ class CourseResource < Avo::BaseResource
edit: {
input: {
data: {
action: "course-resource#onCountryChange"
action: "city-in-country#onCountryChange"
}
}
}
Expand Down
2 changes: 0 additions & 2 deletions spec/dummy/app/javascript/avo.custom.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { Application } from "@hotwired/stimulus";
import CourseResourceController from "./avo_custom/course_resource_controller";
import CityInCountryController from "./avo_custom/city_in_country_controller";
import NestedForm from "stimulus-rails-nested-form";

Expand All @@ -10,7 +9,6 @@ const application = Application.start();

// Configure Stimulus development experience
application.debug = window?.localStorage.getItem("avo.debug");
application.register("course-resource", CourseResourceController);
application.register("city-in-country", CityInCountryController);
application.register("nested-form", NestedForm);

Expand Down
102 changes: 0 additions & 102 deletions spec/dummy/app/javascript/avo_custom/course_resource_controller.js

This file was deleted.

2 changes: 1 addition & 1 deletion spec/system/avo/stimulus_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
end
end

describe "course_controller#onCountryChange" do
describe "city-in-country#onCountryChange" do
it "changes the cities" do
visit "/admin/resources/courses/#{course.id}/edit"

Expand Down

0 comments on commit ba0165c

Please sign in to comment.