Sha256: 853325e071b00c77584a9a3b2dbbfc84c7fd01027cc18df990cfb0a297df7ed8

Contents?: true

Size: 632 Bytes

Versions: 21

Compression:

Stored size: 632 Bytes

Contents

module Plugins
  module Core
    class TreeCell < Plugins::Core::Cell
      def checkboxes
        render
      end

      def dropdown
        render
      end

      private

      def value
        data&.[]('values') || @options[:default_value]
      end

      def render_select
        @options[:form].select 'data[values]', metadata_values, {selected: value}
      end

      def metadata_values
        values = [["-- Select an Option --", nil]]

        @options[:metadata]["data"]["tree_array"].map do |value|
          values << [value["node"]["name"], value["id"]]
        end

        values
      end
    end
  end
end

Version data entries

21 entries across 21 versions & 1 rubygems

Version Path
cortex-plugins-core-3.2.0 app/cells/plugins/core/tree_cell.rb
cortex-plugins-core-3.1.0 app/cells/plugins/core/tree_cell.rb
cortex-plugins-core-3.0.0 app/cells/plugins/core/tree_cell.rb
cortex-plugins-core-2.1.1 app/cells/plugins/core/tree_cell.rb
cortex-plugins-core-2.1.0 app/cells/plugins/core/tree_cell.rb
cortex-plugins-core-2.0.1 app/cells/plugins/core/tree_cell.rb
cortex-plugins-core-1.1.1 app/cells/plugins/core/tree_cell.rb
cortex-plugins-core-1.1.0 app/cells/plugins/core/tree_cell.rb
cortex-plugins-core-1.0.0 app/cells/plugins/core/tree_cell.rb
cortex-plugins-core-0.12.4 app/cells/plugins/core/tree_cell.rb
cortex-plugins-core-0.12.3 app/cells/plugins/core/tree_cell.rb
cortex-plugins-core-0.12.2 app/cells/plugins/core/tree_cell.rb
cortex-plugins-core-0.12.1 app/cells/plugins/core/tree_cell.rb
cortex-plugins-core-0.12.0 app/cells/plugins/core/tree_cell.rb
cortex-plugins-core-0.11.3 app/cells/plugins/core/tree_cell.rb
cortex-plugins-core-0.11.2 app/cells/plugins/core/tree_cell.rb
cortex-plugins-core-0.11.1 app/cells/plugins/core/tree_cell.rb
cortex-plugins-core-0.11.0 app/cells/plugins/core/tree_cell.rb
cortex-plugins-core-0.10.4 app/cells/plugins/core/tree_cell.rb
cortex-plugins-core-0.10.2 app/cells/plugins/core/tree_cell.rb