Skip to content

Commit

Permalink
Merge pull request #3953 from 3scale/THREESCALE-11500_fix-confusing-d…
Browse files Browse the repository at this point in the history
…esign-flaw-in-promote-ui

THREESCALE-11500: Fix confusing design flaw in "promote" UI (Part 1)
  • Loading branch information
lvillen authored Jan 9, 2025
2 parents 42acfd9 + 7b03258 commit a3461ff
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 47 deletions.
7 changes: 5 additions & 2 deletions app/subscribers/proxy_config_event_subscriber.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,11 @@
class ProxyConfigEventSubscriber
def call(event)
case event
when ProxyConfigs::AffectingObjectChangedEvent then ProxyConfigAffectingChangeWorker.perform_later(event.event_id)
else raise "Unknown event type #{event.class}"
when ProxyConfigs::AffectingObjectChangedEvent
proxy = Proxy.find(event.proxy_id)
proxy.affecting_change_history.touch
else
raise "Unknown event type #{event.class}"
end
end
end
21 changes: 0 additions & 21 deletions app/workers/proxy_config_affecting_change_worker.rb

This file was deleted.

4 changes: 3 additions & 1 deletion test/subscribers/proxy_config_event_subscriber_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,9 @@ class ProxyConfigEventSubscriberTest < ActiveSupport::TestCase
proxy_rule = FactoryBot.build_stubbed(:proxy_rule, proxy: proxy)
event = ProxyConfigs::AffectingObjectChangedEvent.create(proxy, proxy_rule)

ProxyConfigAffectingChangeWorker.expects(:perform_later).with(event.event_id)
Proxy.stubs(:find).with(event.proxy_id).returns(proxy)

proxy.affecting_change_history.expects(:touch)

ProxyConfigEventSubscriber.new.call(event)
end
Expand Down
23 changes: 0 additions & 23 deletions test/workers/proxy_config_affecting_change_worker_test.rb

This file was deleted.

0 comments on commit a3461ff

Please sign in to comment.