Skip to content

Commit

Permalink
update decidim
Browse files Browse the repository at this point in the history
  • Loading branch information
microstudi committed Jun 19, 2024
1 parent a9fbccd commit de7b087
Show file tree
Hide file tree
Showing 123 changed files with 48,838 additions and 1,431 deletions.
403 changes: 203 additions & 200 deletions Gemfile.lock

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions app/views/static/api/docs/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
<h3>
<a id="using-the-graphql-api" class="anchor" href="#using-the-graphql-api" aria-hidden="true"><span aria-hidden="true" class="octicon octicon-link"></span></a>Using the GraphQL APi</h3>
<p>The GraphQL format is a JSON formatted text that is specified in a query. Response is a JSON object as well. For details about specification check the official <a href="https://graphql.org/learn/">GraphQL site</a>.</p>
<p>Exercise caution when utilizing the output of this API, as it may include HTML that has not been escaped. Take particular care in handling this data, specially if you intend to render it on a webpage.</p>
<p>For instance, you can check the version of a Decidim installation by using <code>curl</code> in the terminal:</p>
<pre><code>curl -sSH "Content-Type: application/json" \
-d '{"query": "{ decidim { version } }"}' \
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ <h2>
<li><code><a href="/api/docs/object/meetings">Meetings</a></code></li>
<li><code><a href="/api/docs/object/pages">Pages</a></code></li>
<li><code><a href="/api/docs/object/proposals">Proposals</a></code></li>
<li><code><a href="/api/docs/object/result">Result</a></code></li>
<li><code><a href="/api/docs/object/sortitions">Sortitions</a></code></li>
<li><code><a href="/api/docs/object/surveys">Surveys</a></code></li>
</ul>
Expand Down
33 changes: 10 additions & 23 deletions app/views/static/api/docs/object/result/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,39 +6,20 @@ <h2>
<ul>
<li><code><a href="/api/docs/interface/categorizableinterface">CategorizableInterface</a></code></li>
<li><code><a href="/api/docs/interface/commentableinterface">CommentableInterface</a></code></li>
<li><code><a href="/api/docs/interface/componentinterface">ComponentInterface</a></code></li>
<li><code><a href="/api/docs/interface/scopableinterface">ScopableInterface</a></code></li>
</ul>
<h2>
<a id="fields" class="anchor" href="#fields" aria-hidden="true"><span aria-hidden="true" class="octicon octicon-link"></span></a>Fields</h2>
<div class="field-entry ">
<span id="id" class="field-name anchored">id (<code><a href="/api/docs/scalar/id">ID!</a></code>)</span>
<div class="description-wrapper">
<p>The internal ID for this result</p>
</div>
</div>
<div class="field-entry ">
<span id="name" class="field-name anchored">name (<code><a href="/api/docs/object/translatedfield">TranslatedField!</a></code>)</span>
<div class="description-wrapper">
<p>The name of this component.</p>
</div>
</div>
<div class="field-entry ">
<span id="weight" class="field-name anchored">weight (<code><a href="/api/docs/scalar/int">Int!</a></code>)</span>
<div class="description-wrapper">
<p>The order of this result</p>
</div>
</div>
<div class="field-entry ">
<span id="participatoryspace" class="field-name anchored">participatorySpace (<code><a href="/api/docs/object/participatoryspace">ParticipatorySpace!</a></code>)</span>
<span id="category" class="field-name anchored">category (<code><a href="/api/docs/object/category">Category</a></code>)</span>
<div class="description-wrapper">
<p>The participatory space in which this component belongs to.</p>
<p>The object's category</p>
</div>
</div>
<div class="field-entry ">
<span id="category" class="field-name anchored">category (<code><a href="/api/docs/object/category">Category</a></code>)</span>
<span id="id" class="field-name anchored">id (<code><a href="/api/docs/scalar/id">ID!</a></code>)</span>
<div class="description-wrapper">
<p>The object's category</p>
<p>The internal ID for this result</p>
</div>
</div>
<div class="field-entry ">
Expand Down Expand Up @@ -177,6 +158,12 @@ <h2>
<p>The number of children results</p>
</div>
</div>
<div class="field-entry ">
<span id="weight" class="field-name anchored">weight (<code><a href="/api/docs/scalar/int">Int!</a></code>)</span>
<div class="description-wrapper">
<p>The order of this result</p>
</div>
</div>
<div class="field-entry ">
<span id="externalid" class="field-name anchored">externalId (<code><a href="/api/docs/scalar/string">String</a></code>)</span>
<div class="description-wrapper">
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# frozen_string_literal: true
# This migration comes from decidim_comments (originally 20240304092558)

class AddCommentVoteCounterCacheToComments < ActiveRecord::Migration[6.1]
def change
add_column :decidim_comments_comments, :up_votes_count, :integer, null: false, default: 0, index: true
add_column :decidim_comments_comments, :down_votes_count, :integer, null: false, default: 0, index: true

# We cannot use the reset_counters as up_votes and down_votes are scoped associationws
reversible do |dir|
dir.up do
Decidim::Comments::Comment.reset_column_information
Decidim::Comments::Comment.find_each do |record|
# rubocop:disable Rails/SkipsModelValidations
record.class.update_counters(record.id, up_votes_count: record.up_votes.length)
record.class.update_counters(record.id, down_votes_count: record.down_votes.length)
# rubocop:enable Rails/SkipsModelValidations
end
end
end
end
end
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# frozen_string_literal: true
# This migration comes from decidim_proposals (originally 20240404202756)

class AddValuationAssignmentsCountToDecidimProposalsProposals < ActiveRecord::Migration[6.1]
def change
add_column :decidim_proposals_proposals, :valuation_assignments_count, :integer, default: 0

reversible do |dir|
dir.up do
Decidim::Proposals::Proposal.reset_column_information
Decidim::Proposals::Proposal.find_each do |record|
Decidim::Proposals::Proposal.reset_counters(record.id, :valuation_assignments)
end
end
end
end
end
55 changes: 54 additions & 1 deletion db/schema.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
#
# It's strongly recommended that you check this file into your version control system.

ActiveRecord::Schema.define(version: 2024_01_23_134318) do
ActiveRecord::Schema.define(version: 2024_06_19_121132) do

# These are extensions that must be enabled in order to support this database
enable_extension "ltree"
Expand Down Expand Up @@ -471,6 +471,8 @@
t.string "decidim_participatory_space_type"
t.integer "decidim_participatory_space_id"
t.datetime "deleted_at"
t.integer "up_votes_count", default: 0, null: false
t.integer "down_votes_count", default: 0, null: false
t.index ["created_at"], name: "index_decidim_comments_comments_on_created_at"
t.index ["decidim_author_id", "decidim_author_type"], name: "index_decidim_comments_comments_on_decidim_author"
t.index ["decidim_author_id"], name: "decidim_comments_comment_author"
Expand Down Expand Up @@ -658,6 +660,56 @@
t.index ["endorsements_count"], name: "idx_decidim_debates_debates_on_endorsemnts_count"
end

create_table "decidim_dummy_resources_coauthorable_dummy_resources", force: :cascade do |t|
t.jsonb "translatable_text"
t.string "title"
t.string "body"
t.text "address"
t.float "latitude"
t.float "longitude"
t.datetime "published_at"
t.integer "coauthorships_count", default: 0, null: false
t.integer "endorsements_count", default: 0, null: false
t.integer "comments_count", default: 0, null: false
t.bigint "decidim_component_id"
t.bigint "decidim_category_id"
t.bigint "decidim_scope_id"
t.string "reference"
t.datetime "created_at", precision: 6, null: false
t.datetime "updated_at", precision: 6, null: false
end

create_table "decidim_dummy_resources_dummy_resources", force: :cascade do |t|
t.jsonb "translatable_text"
t.jsonb "title"
t.string "body"
t.text "address"
t.float "latitude"
t.float "longitude"
t.datetime "published_at"
t.integer "coauthorships_count", default: 0, null: false
t.integer "endorsements_count", default: 0, null: false
t.integer "comments_count", default: 0, null: false
t.integer "follows_count", default: 0, null: false
t.bigint "decidim_component_id"
t.integer "decidim_author_id"
t.string "decidim_author_type"
t.integer "decidim_user_group_id"
t.bigint "decidim_category_id"
t.bigint "decidim_scope_id"
t.string "reference"
t.datetime "created_at", precision: 6, null: false
t.datetime "updated_at", precision: 6, null: false
end

create_table "decidim_dummy_resources_nested_dummy_resources", force: :cascade do |t|
t.jsonb "translatable_text"
t.string "title"
t.bigint "dummy_resource_id"
t.datetime "created_at", precision: 6, null: false
t.datetime "updated_at", precision: 6, null: false
end

create_table "decidim_editor_images", force: :cascade do |t|
t.bigint "decidim_author_id", null: false
t.bigint "decidim_organization_id", null: false
Expand Down Expand Up @@ -1367,6 +1419,7 @@
t.jsonb "body"
t.integer "comments_count", default: 0, null: false
t.integer "follows_count", default: 0, null: false
t.integer "valuation_assignments_count", default: 0
t.index "md5((body)::text)", name: "decidim_proposals_proposal_body_search"
t.index "md5((title)::text)", name: "decidim_proposals_proposal_title_search"
t.index ["created_at"], name: "index_decidim_proposals_proposals_on_created_at"
Expand Down
6 changes: 6 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,12 @@ services:
- MAPS_PROVIDER=${MAPS_PROVIDER:-here}
- RACK_ATTACK_SECRET
- CENSUS_URL
- OMNIAUTH_FACEBOOK_APP_ID
- OMNIAUTH_FACEBOOK_APP_SECRET
- OMNIAUTH_GOOGLE_CLIENT_ID
- OMNIAUTH_GOOGLE_CLIENT_SECRET
- RECAPTCHA_SITE_KEY
- RECAPTCHA_SECRET_KEY
depends_on:
- db
- redis
Expand Down
Loading

0 comments on commit de7b087

Please sign in to comment.