noosfero | WIP: Custom forms graphs (!1597)

Rodrigo Souto gitlab at mg.gitlab.com
Mon Aug 20 18:24:36 BRT 2018


Rodrigo Souto started a new discussion on plugins/custom_forms/lib/custom_forms_plugin/graph.rb:

>    # chartkick lib, to render a graph based on the show_as value.
> -  #
> -  # @answers_with_alternative_label have the format
> -  # {
> -  #   123 => { "1" => {"foo" : 5}, "2" => {"bla": 7}, "show_as" => "radio"},
> -  #   124 => { "21" => {"foo" : 2}, "2" => {"test": 15}, "show_as" => "check_box"}
> -  # }
> -  #
> -  # The keys 123 and 124 are the fields ids. In the hash "1" => {"foo" : 5} "1"
> -  # is the alternative id, "foo" is the alternative label and 5 is the number
> -  # of users that chose this alternative as answer to it respective field.
>  
>    AVAILABLE_FIELDS = %w(check_box radio select multiple_select text)
>  
>    def initialize(form)
> -    @answers_with_alternative_label = {}

After the removal of these codes this tree of methods is a little unecessary. I suggest you just dump `compute_results` and `report` and put the code straigh on the initialize.

-- 
Reply to this email directly or view it on GitLab: https://gitlab.com/noosfero/noosfero/merge_requests/1597#note_95703907
You're receiving this email because of your account on gitlab.com.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://listas.softwarelivre.org/pipermail/noosfero-dev/attachments/20180820/3b8dabc6/attachment-0001.html>


More information about the Noosfero-dev mailing list