Skip to content

Commit

Permalink
Add decidim awesome
Browse files Browse the repository at this point in the history
  • Loading branch information
HHassig committed Jun 27, 2024
1 parent 609fe7d commit 98504e0
Show file tree
Hide file tree
Showing 8 changed files with 1,172 additions and 0 deletions.
1,065 changes: 1,065 additions & 0 deletions app/views/static/api/docs/object/component/index.html

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# frozen_string_literal: true
# This migration comes from decidim_decidim_awesome (originally 20200324170000)

class CreateDecidimAwesomeConfig < ActiveRecord::Migration[5.2]
def change
create_table :decidim_awesome_config do |t|
t.jsonb :var
t.jsonb :value
t.integer :decidim_organization_id,
foreign_key: true,
index: { name: "index_decidim_awesome_on_decidim_organization_id" }

t.timestamps
t.index [:var, :decidim_organization_id], name: "index_decidim_awesome_organization_var", unique: true
end
end
end
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# frozen_string_literal: true
# This migration comes from decidim_decidim_awesome (originally 20200324230936)

class CreateAwesomeEditorImages < ActiveRecord::Migration[5.2]
def change
create_table :decidim_awesome_editor_images do |t|
t.string :image
t.string :path
t.references :decidim_author, null: false, foreign_key: { to_table: :decidim_users }, index: { name: "decidim_awesome_editor_images_author" }
t.references :decidim_organization, null: false, foreign_key: true, index: { name: "decidim_awesome_editor_images_constraint_organization" }

t.timestamps
end
end
end
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# frozen_string_literal: true
# This migration comes from decidim_decidim_awesome (originally 20200403142257)

class CreateDecidimAwesomeConfigConstraints < ActiveRecord::Migration[5.2]
def change
create_table :decidim_awesome_config_constraints do |t|
t.jsonb :settings

t.references :decidim_awesome_config, null: false, foreign_key: { to_table: :decidim_awesome_config }, index: { name: "decidim_awesome_config_constraints_config" }
t.timestamps
t.index [:settings, :decidim_awesome_config_id], name: "index_decidim_awesome_settings_awesome_config", unique: true
end
end
end
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# frozen_string_literal: true
# This migration comes from decidim_decidim_awesome (originally 20210628150825)

class ChangeAwesomeConfigVarType < ActiveRecord::Migration[5.2]
def change
change_column :decidim_awesome_config, :var, :string

Decidim::DecidimAwesome::AwesomeConfig.find_each do |config|
config.var.gsub!('"', "")
config.save!
end
end
end
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# frozen_string_literal: true
# This migration comes from decidim_decidim_awesome (originally 20231006113837)

class CreateDecidimAwesomeVoteWeights < ActiveRecord::Migration[6.0]
def change
create_table :decidim_awesome_vote_weights do |t|
# this might be polymorphic in the future (if other types of votes are supported)
t.references :proposal_vote, null: false, index: { name: "decidim_awesome_proposals_weights_vote" }

t.integer :weight, null: false, default: 1
t.timestamps
end
end
end
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# frozen_string_literal: true
# This migration comes from decidim_decidim_awesome (originally 20231006113841)

class CreateDecidimAwesomeProposalExtraFields < ActiveRecord::Migration[6.0]
def change
create_table :decidim_awesome_proposal_extra_fields do |t|
# this might be polymorphic in the future (if other types of votes are supported)
t.references :decidim_proposal, null: false, index: { name: "decidim_awesome_extra_fields_on_proposal" }

t.jsonb :vote_weight_totals
t.integer :weight_total, default: 0
t.timestamps
end
end
end
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# frozen_string_literal: true
# This migration comes from decidim_decidim_awesome (originally 20240306175331)

class RenameEditorImagesAwesomeConfig < ActiveRecord::Migration[6.1]
class AwesomeConfig < ApplicationRecord
self.table_name = :decidim_awesome_config
end

# rubocop:disable Rails/SkipsModelValidations
def up
AwesomeConfig.where(var: :allow_images_in_full_editor).update_all(var: :allow_images_in_editors)
AwesomeConfig.where(var: :allow_images_in_small_editor).destroy_all
end

def down
AwesomeConfig.where(var: :allow_images_in_editors).update_all(var: :allow_images_in_full_editor)
end
# rubocop:enable Rails/SkipsModelValidations
end

0 comments on commit 98504e0

Please sign in to comment.