Class: Decidim::DecidimAwesome::Admin::AuthorizationGroupForm
- Inherits:
-
Form
- Object
- Form
- Decidim::DecidimAwesome::Admin::AuthorizationGroupForm
- Includes:
- TranslatableAttributes
- Defined in:
- app/forms/decidim/decidim_awesome/admin/authorization_group_form.rb
Instance Method Summary collapse
- #authorization_handler_options(handler_name) ⇒ Object
- #authorization_handlers_names ⇒ Object
-
#available_authorizations ⇒ Object
Helper for the view, at this point, ephemeral authorizations are not supported yet.
- #manifest(handler_name) ⇒ Object
- #options_attributes(handler_name) ⇒ Object
- #options_manifest(handler_name) ⇒ Object
- #options_schema(handler_name) ⇒ Object
- #parsed_authorization_handlers ⇒ Object
- #verification_settings ⇒ Object
Instance Method Details
#authorization_handler_options(handler_name) ⇒ Object
40 41 42 |
# File 'app/forms/decidim/decidim_awesome/admin/authorization_group_form.rb', line 40 def (handler_name) &.dig(handler_name.to_s) || &.dig(handler_name, "options").presence || {} end |
#authorization_handlers_names ⇒ Object
36 37 38 |
# File 'app/forms/decidim/decidim_awesome/admin/authorization_group_form.rb', line 36 def super.presence || .keys.map(&:to_s) end |
#available_authorizations ⇒ Object
Helper for the view, at this point, ephemeral authorizations are not supported yet
58 59 60 61 62 |
# File 'app/forms/decidim/decidim_awesome/admin/authorization_group_form.rb', line 58 def Decidim..filter do |workflow| current_organization..include?(workflow.name) && !workflow.ephemeral? end end |
#manifest(handler_name) ⇒ Object
49 50 51 |
# File 'app/forms/decidim/decidim_awesome/admin/authorization_group_form.rb', line 49 def manifest(handler_name) Decidim::Verifications.find_workflow_manifest(handler_name) end |
#options_attributes(handler_name) ⇒ Object
44 45 46 47 |
# File 'app/forms/decidim/decidim_awesome/admin/authorization_group_form.rb', line 44 def (handler_name) manifest = (handler_name) manifest ? manifest.attributes : [] end |
#options_manifest(handler_name) ⇒ Object
53 54 55 |
# File 'app/forms/decidim/decidim_awesome/admin/authorization_group_form.rb', line 53 def (handler_name) manifest(handler_name). end |
#options_schema(handler_name) ⇒ Object
32 33 34 |
# File 'app/forms/decidim/decidim_awesome/admin/authorization_group_form.rb', line 32 def (handler_name) (handler_name).schema.new((handler_name)) end |
#parsed_authorization_handlers ⇒ Object
21 22 23 24 25 26 27 28 29 30 |
# File 'app/forms/decidim/decidim_awesome/admin/authorization_group_form.rb', line 21 def .filter_map do |name| next if name.blank? [ name, { options: (name) } ] end.to_h end |
#verification_settings ⇒ Object
14 15 16 17 18 19 |
# File 'app/forms/decidim/decidim_awesome/admin/authorization_group_form.rb', line 14 def verification_settings { authorization_handlers: , force_authorization_help_text: || {} } end |