Class: Karafka::Web::Pro::Loader

Inherits:
Object
  • Object
show all
Defined in:
lib/karafka/web/pro/loader.rb

Overview

Loader requires and loads all the pro components only when they are needed

Class Method Summary collapse

Class Method Details

.post_setup_all(config) ⇒ Object

Runs post setup features configuration operations

Parameters:

  • config (Karafka::Core::Configurable::Node)


40
41
42
43
44
45
# File 'lib/karafka/web/pro/loader.rb', line 40

def post_setup_all(config)
  Commanding.post_setup(config)
  Ui::Lib::Branding.post_setup(config)
  Ui::Lib::Policies.post_setup(config)
  Ui::Lib::Search.post_setup(config)
end

.pre_setup_all(config) ⇒ Object

Loads all the Web UI pro components and configures them wherever it is expected

Parameters:

  • config (Karafka::Core::Configurable::Node)

    web config that we can alter with pro components



23
24
25
26
27
28
29
30
31
32
33
34
35
# File 'lib/karafka/web/pro/loader.rb', line 23

def pre_setup_all(config)
  # Expand the config with commanding configuration
  config.instance_eval do
    setting(:commanding, default: Commanding::Config.config)
  end

  # Expand UI config with extra search capabilities settings
  config.ui.instance_eval do
    setting(:branding, default: Ui::Lib::Branding::Config.config)
    setting(:policies, default: Ui::Lib::Policies::Config.config)
    setting(:search, default: Ui::Lib::Search::Config.config)
  end
end