Method: Lesli::Shared::Dashboard.options

Defined in:
app/models/lesli/shared/dashboard.rb

.options(current_user, query) ⇒ Hash

Returns Hash containing the options to create and manage dashboards.

Examples:

CloudHouse::Dashboard.options(User.find(2), nil)


104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
# File 'app/models/lesli/shared/dashboard.rb', line 104

def self.options(current_user, query)
    dynamic_info = self.dynamic_info
    component_model = dynamic_info[:module_model_component]

    component_ids = component_model.component_ids.map do |comp|
        {
            value: comp,
            text: comp
        }
    end

    options = {
        component_ids: component_ids,
        #components_configuration_options: component_model.configuration_options,
        descriptions: {}
    }

    if block_given?
        yield(options)
    else
        return options
    end
end