Skip to content

Commit

Permalink
Before naming
Browse files Browse the repository at this point in the history
  • Loading branch information
JoonasAapro committed Dec 18, 2023
1 parent e0d59a8 commit d7dea1c
Show file tree
Hide file tree
Showing 12 changed files with 0 additions and 307 deletions.
14 changes: 0 additions & 14 deletions app/commands/decidim/decidim_awesome/command.rb

This file was deleted.

16 changes: 0 additions & 16 deletions db/migrate/20200324170000_create_decidim_awesome_config.rb

This file was deleted.

This file was deleted.

12 changes: 0 additions & 12 deletions db/migrate/20210628150825_change_awesome_config_var_type.rb

This file was deleted.

2 changes: 0 additions & 2 deletions lib/decidim/decidim_awesome/admin_engine.rb
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
# frozen_string_literal: true

require "decidim/decidim_awesome/awesome_helpers"

module Decidim
module DecidimAwesome
# This is the engine that runs on the public interface of `DecidimAwesome`.
class AdminEngine < ::Rails::Engine
include AwesomeHelpers

isolate_namespace Decidim::DecidimAwesome::Admin

Expand Down
45 changes: 0 additions & 45 deletions lib/decidim/decidim_awesome/awesome.rb
Original file line number Diff line number Diff line change
Expand Up @@ -130,19 +130,6 @@ module DecidimAwesome
{}
end

# custom fields for proposals using JSON specification:
# https://github.com/jsonform/jsonform/wiki
# Valid values uses the same structure as :scoped_styles
# :disabled => false and non available, hidden from admins
# Hash => hash of different JSON texts, each key will be used for the contraints
# Admins can create this hash dynamically but some pre-defined css boxes can be created here as:
# {
# some_identifier: "{ ... some definition... }"
# }
config_accessor :proposal_custom_fields do
{}
end

# allows to keep modifications for the main menu
# can return :disabled to completly remove this feature
# otherwise it should be an array (some overrides can be specified by default):
Expand Down Expand Up @@ -245,38 +232,6 @@ module DecidimAwesome
[:participatory_space_roles, :admin_roles]
end

# Roles for which it is necessary to show admin_accountability
config_accessor :participatory_space_roles do
[
"Decidim::AssemblyUserRole",
"Decidim::ParticipatoryProcessUserRole",
"Decidim::ConferenceUserRole"
]
end

# Which components will be tampered to add the voting registry override
config_accessor :voting_components do
[:proposals, :reporting_propposals]
end

# Public: Stores an instance of ContentBlockRegistry
def self.voting_registry
@voting_registry ||= Decidim::ManifestRegistry.new("decidim_awesome/voting")
end

#
# HELPERS
#
# pass a single config var or an array of them
# any non disabled match will return as true
def self.possible_additional_proposal_sortings
@possible_additional_proposal_sortings ||= additional_proposal_sortings.to_a.filter_map do |sort|
next unless sort.to_sym.in?([:az, :za, :supported_first, :supported_last])

sort.to_s
end
end

def self.collation_for(locale)
@collation_for ||= {}
@collation_for[locale] ||= begin
Expand Down
16 changes: 0 additions & 16 deletions lib/decidim/decidim_awesome/awesome_helpers.rb
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,6 @@ def awesome_config
@awesome_config ||= awesome_config_instance.config
end

def javascript_config_vars
awesome_config.except(:scoped_styles, :proposal_custom_fields, :scoped_admins).to_json.html_safe
end

def show_public_intergram?
return unless awesome_config[:intergram_for_public]
return true unless awesome_config[:intergram_for_public_settings][:require_login]
Expand Down Expand Up @@ -56,18 +52,6 @@ def awesome_scoped_admins
@awesome_scoped_admins ||= awesome_config_instance.collect_sub_configs_values("scoped_admin")
end

# Collects all proposal custom fields that is applied in the current URL context
def awesome_proposal_custom_fields
@awesome_proposal_custom_fields ||= awesome_config_instance.collect_sub_configs_values("proposal_custom_field")
end

# this will check if the current component has been configured to use a custom voting manifest
def awesome_voting_manifest_for(component)
return nil unless component.settings.respond_to? :awesome_voting_manifest

DecidimAwesome.voting_registry.find(component.settings.awesome_voting_manifest)
end

def version_prefix
"v#{Decidim.version[0..3]}"
end
Expand Down
11 changes: 0 additions & 11 deletions lib/decidim/decidim_awesome/config.rb
Original file line number Diff line number Diff line change
Expand Up @@ -150,17 +150,6 @@ def sub_configs_for(singular_key)

private

def map_defaults
defaults.to_h do |key, val|
value = false
unless val == :disabled
value = yield(key, val)
value = val.merge(value.transform_keys(&:to_sym)) if val.is_a?(Hash) && value.is_a?(Hash)
end
[key, value]
end
end

def calculate_config
# filter vars compliant with current context
valid = @vars.filter { |item| enabled_for_organization?(item.var) && valid_in_context?(item.all_constraints) }
Expand Down

This file was deleted.

This file was deleted.

103 changes: 0 additions & 103 deletions lib/decidim/decidim_awesome/context_analyzers/request_analyzer.rb

This file was deleted.

6 changes: 0 additions & 6 deletions lib/decidim/decidim_awesome/engine.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,11 @@
require "rails"
require "deface"
require "decidim/core"
require "decidim/decidim_awesome/awesome_helpers"

module Decidim
module DecidimAwesome
# This is the engine that runs on the public interface of decidim_awesome.
class Engine < ::Rails::Engine
include AwesomeHelpers

isolate_namespace Decidim::DecidimAwesome

Expand All @@ -25,10 +23,6 @@ class Engine < ::Rails::Engine
ActiveSupport.on_load :action_controller do
helper Decidim::LayoutHelper if respond_to?(:helper)
end
# Include additional helpers globally
ActionView::Base.include(Decidim::DecidimAwesome::AwesomeHelpers)
# Also for cells
Decidim::ViewModel.include(Decidim::DecidimAwesome::AwesomeHelpers)

# Late registering of components to take into account initializer values
DecidimAwesome.registered_components.each do |manifest, block|
Expand Down

0 comments on commit d7dea1c

Please sign in to comment.