-
-
Notifications
You must be signed in to change notification settings - Fork 398
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Show Bullet, Rack Profiler and WAI WCAG tools in the footer (#12629)
* Bump bullet from 7.0.7 to 7.1.6 * Show Bullet, Rack Profiler and WAI WCAG tools in the footer * Skip user in notifications for Bullet * Fix stylelint offense * Add counter cache for forms' AnswerOptions * Add counter cache for forms' MatrixRow * Add counter cache for forms' DisplayConditions * Add counter cache for forms' DisplayConditionsForOtherQuestions * Fix specs * Fix rubocop offenses * Add counter cache for Attachments As this is a polymorphic relation, we need to add it in the different ActiveRecord models that use it. * Roll our own counter_cache for attachments_count The problem is basically that in the case of the DummyResource class, we don't have a way of disabling this attribute, as it isn't a valid attribute in the table and that's what expects counter_cache. The solution is to have a more granular control of how the counter_cache is updated by manually handling the increment/decrement of the fields. * Add missing binstub for rails in decidim-forms * Make consistent the formatting of the belongs_to in DisplayCondition model * Revert "Add counter cache for Attachments" This reverts commit e99d03c. * Revert "Roll our own counter_cache for attachments_count" This reverts commit d8ea6ea. * Remove counter cache from attached_to relation * Fix bad merge * Ignore counter_cache in Bullet for proposals' attachments
- Loading branch information
1 parent
39c4749
commit 03d539e
Showing
22 changed files
with
126 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,4 @@ | ||
@import "stylesheets/decidim/dev/accessibility"; | ||
@import "stylesheets/decidim/dev/bullet"; | ||
@import "stylesheets/decidim/dev/rack_profiler"; | ||
@import "stylesheets/decidim/dev/map"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
details#bullet-footer { | ||
z-index: 77777 !important; | ||
bottom: 48px !important; | ||
} |
4 changes: 4 additions & 0 deletions
4
decidim-dev/app/packs/stylesheets/decidim/dev/_rack_profiler.scss
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
.profiler-results.profiler-bottom { | ||
bottom: 26px !important; | ||
z-index: 88888 !important; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
#!/usr/bin/env ruby | ||
# frozen_string_literal: true | ||
|
||
# This command will automatically be run when you run "rails" with Rails gems | ||
# installed from the root of your application. | ||
|
||
ENGINE_ROOT = File.expand_path("..", __dir__) | ||
ENGINE_PATH = File.expand_path("../lib/decidim/forms/engine", __dir__) | ||
|
||
# Set up gems listed in the Gemfile. | ||
ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../../Gemfile", __dir__) | ||
require "bundler/setup" | ||
|
||
require "rails/all" | ||
require "rails/engine/commands" |
16 changes: 16 additions & 0 deletions
16
decidim-forms/db/migrate/20240402092039_add_answer_options_counter_cache_to_questions.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
# frozen_string_literal: true | ||
|
||
class AddAnswerOptionsCounterCacheToQuestions < ActiveRecord::Migration[6.1] | ||
def change | ||
add_column :decidim_forms_questions, :answer_options_count, :integer, null: false, default: 0 | ||
|
||
reversible do |dir| | ||
dir.up do | ||
Decidim::Forms::Question.reset_column_information | ||
Decidim::Forms::Question.find_each do |record| | ||
record.class.reset_counters(record.id, :answer_options) | ||
end | ||
end | ||
end | ||
end | ||
end |
16 changes: 16 additions & 0 deletions
16
decidim-forms/db/migrate/20240402095253_add_matrix_row_counter_cache_to_questions.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
# frozen_string_literal: true | ||
|
||
class AddMatrixRowCounterCacheToQuestions < ActiveRecord::Migration[6.1] | ||
def change | ||
add_column :decidim_forms_questions, :matrix_rows_count, :integer, null: false, default: 0 | ||
|
||
reversible do |dir| | ||
dir.up do | ||
Decidim::Forms::Question.reset_column_information | ||
Decidim::Forms::Question.find_each do |record| | ||
record.class.reset_counters(record.id, :matrix_rows) | ||
end | ||
end | ||
end | ||
end | ||
end |
16 changes: 16 additions & 0 deletions
16
decidim-forms/db/migrate/20240416111953_add_display_conditions_counter_cache_to_questions.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
# frozen_string_literal: true | ||
|
||
class AddDisplayConditionsCounterCacheToQuestions < ActiveRecord::Migration[6.1] | ||
def change | ||
add_column :decidim_forms_questions, :display_conditions_count, :integer, null: false, default: 0 | ||
|
||
reversible do |dir| | ||
dir.up do | ||
Decidim::Forms::Question.reset_column_information | ||
Decidim::Forms::Question.find_each do |record| | ||
record.class.reset_counters(record.id, :display_conditions) | ||
end | ||
end | ||
end | ||
end | ||
end |
16 changes: 16 additions & 0 deletions
16
...e/20240416113926_add_display_conditions_for_other_questions_counter_cache_to_questions.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
# frozen_string_literal: true | ||
|
||
class AddDisplayConditionsForOtherQuestionsCounterCacheToQuestions < ActiveRecord::Migration[6.1] | ||
def change | ||
add_column :decidim_forms_questions, :display_conditions_for_other_questions_count, :integer, null: false, default: 0 | ||
|
||
reversible do |dir| | ||
dir.up do | ||
Decidim::Forms::Question.reset_column_information | ||
Decidim::Forms::Question.find_each do |record| | ||
record.class.reset_counters(record.id, :display_conditions_for_other_questions) | ||
end | ||
end | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters