Sha256: 63cdc96d93bf029dba2fd9b9bda730c909bc296f09ac4c01c9027fc57c67fa54

Contents?: true

Size: 1000 Bytes

Versions: 1

Compression:

Stored size: 1000 Bytes

Contents

module Hatio
  module Generators
    class ReportViewUtil
  
      def self.generateStore(domain, out_params)
        output = "fields : [\n\t\t\t"    
        columnList = out_params.collect { |column| "{ name : '#{column.name}', type : 'string' }" }
        output << columnList.join(",\n\t\t\t")
        output << "\n\t\t]"
        output
      end
  
      def self.generateColumns(domain, out_params)
        output = "columns : [\n\t\t"
        columnList = out_params.collect { |column| "{ header : T('label.#{column.name}'), dataIndex : '#{column.name}' }" }
        output << columnList.join(",\n\t\t")
        output << "\n\t]"
        output
      end
  
      def self.generate_search_items(domain, in_params)
        output = "items : [\n\t\t"
        columnList = in_params.collect { |column| "{ name : '#{column.name}', fieldLabel : T('label.#{column.name}') }" }
        output << columnList.join(",\n\t\t")
        output << "\n\t]"
        output
      end
  
    end
    
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
hatio-core-0.0.6 lib/generators/hatio/util/report_view_util.rb