Skip to content

Commit

Permalink
Add Initiatives to antispam (#271)
Browse files Browse the repository at this point in the history
* Redesign: rename tests (decidim#11184)

* Remove skip_unless_redesing_enabled calls in tests

* Remove redesign_helpers for tests

* Unskip and adapt REDESIGN_PENDING examples

* Remove deprecated examples

* Allow to configure the default header level of attributes titles in diff cell

* Ensure accessibility of h in collaborative draft show

* Recover accessibility tests in proposals

* Remove comments

* Unskip and adapt test

* Fix expected text of link in test

* Remove check for removed follow actions in participatory text index

* Unskip tests

* Unskip and adapt to vote proposal tests

* Remove deprecated methods

* Remove deprecations in tests

* Remove collaborative drafts and proposals deprecated m cells

* Adapt proposal m cell cache hash to l cell

* Adapt proposal m-cell specs to l-cell

* Replace use of proposal_m card

* Remove condition on redesign from test

* Rename shared examples for attachments to not use redesign term

* Remove tests for CTA behavior deprecated in processes card-g

* Avoid duplicated ids of highlighted participatory process in menu breadcrumb

* Recover skipped examples

* Recover accessibility tests in participatory processes

* Remove participatory process description specs and include expected contents with metadata content block enabled

* Unskip REDESIGN_PENDING tests

* Move common statistics cells tests to shared examples

* Remove unused process metadata item

* Remove deprecated proceses m card and add tests for l and g cards

* Remove deprecated process group m card cell

* Recover tests after redesign in initiatives

* Remove skipped deprecated tests

* Remove assemblies description page test and move examples to show page with appropriate content blocks

* Remove assembly m card and related tests

* Unskip tests after completing redesing

* Adapt sorting test to redesigned interface

* Remove deprecated sorting tests because the redesigned interface prevents incomplete sortings

* Unskip tests

* Remove post m card cell

* Remove reference to redesign from test

* Remove comment m card

* Unskip accessibility test in debates versions

* Remove deprecated test

* Remove deprecated comments about redesign

* Remove deprecated test

The proposals card-l does not show the supports count in the metadata,
so there is no difference when supports are enabled on proposals
component or not

* Remove useless reference to redesign in test

* Remove REDESIGN_PENDING comment: do not use card-l cell for media links

* Remove REDESIGN_PENDING comments

* Remove unused partial

* Unskip tests

* Remove conference m card cell

* Adapt authorizations tests to redesign

* Remove deprecated tests

* Avoid errors in upload modal when file validation fails

* Unskip tests

* Remove deprecated test

* Remove REDESIGN_PENDING comments

* Update map styles in proposals

* Uncomment tests

* Uncomment and adapt selector in tests

* Remove reference to redesign

* Fix linter offense

* Remove obsolete brakeman skip and update other in proposals

* Remove unused translations and add some wizards keys to ignore unused

* Update expected url in activity cell with comments activities

* Increase header levels in version cell to include h1

* Recover missing data attribute in hero content block

* Fix coordinates update in add_proposal js

* Hide map only if there is no address with coordinates

* Empty address field before changing it in test

* Add issue reference to skipped tests

* Display replies on deleted comments and keep then with AJAX deletion refresh

* Unskip test

* Update decidim-core/app/cells/decidim/version/show.erb

Co-authored-by: Alexandru Emil Lupu <[email protected]>

* Use h2 tag

* Move shared examples require to core

* Replace actions with method doing the same

* Fix test

* Remove references to redesign in shared examples

---------

Co-authored-by: Alexandru Emil Lupu <[email protected]>

* Redesign: refactor the scope of the main Javascript initializer (decidim#11317)

* set the scope of all functions that are initialized at startup

* scope the datepicker as well

* remove precated js stuff (testing)

* fix lint & place accordingly the initializations

* Redesign: deprecate foundation-datepicker from public site (decidim#11420)

* deprecate foundation-datepicker public site

* fix core tests

* fix datepicker tests

* fix lint and rubocop

* replace now with current

* fix tests

* fix more tests

* fix tests

* remove byebugs

* Redesign: don't submit forms on modal's cancel

* Update documentation for here map configuration (decidim#11447)

* Two-columns layout fix (decidim#11400)

* Column conversations fix

* suggested changes added to &__aside

* &__main updated

* Changes made to span on &__main

* test

* spacing cli test

* Disabler for pointer events (decidim#11449)

* Added a disabler for pointer event

* Improved workaround for the tabs +1

* Indentation line 19

* Fix test component (decidim#11436)

* Fix label position on report button (decidim#11435)

* Fix pipeline after decidim#11449 (decidim#11455)

* Upgrade postgres from 11 to 14 (decidim#11453)

* Fix initiatives ransack filters (decidim#11329)

* Revert "Lock ChromeDriver to the latest working version (decidim#11391)" (decidim#11458)

This reverts commit 2450714.

* Force capital starting letter for PR titles (decidim#11457)

* Force capital starting letter for PR titles

* Force the starting character to be capitalized

* Allow disabling password expiration (decidim#11135)

* Allow disabling password expiration

NIST does not recommend expiring passwords:
https://pages.nist.gov/800-63-FAQ/#q-b05

* Add documentation about the new option

* Fix linter

* Fix linter

* Fix autocomplete result list duplicates (decidim#11442)

* Fix autocomplete user group duplication / Add system test

* Fix test

* Redesign: organization colors (decidim#11451)

* refactor the organization colors

* typo

* remove specs about them_color input

* fix specs

* use old red for testing

* set the default redesign colors to the organization factory (color-contrast)

* replace the uses of legacy primary color

* Redesign: axe accessibility issues (decidim#11403)

* dropdown card does not require an id

* add aria-label to progress bar

* disable dropdown for desktop navigation

* Refactor the use of filter_text_for to be in views instead of helpers

* Allow passing an id to filter_text_for method

* remove element_id (testing)

* pass the id to the label

* distinguish filters and order controls

* distinguish all uses of dropdown-menus

* rename control

* don't use a list when you need divs

* disable dropdown for desktop navigation

* update code for emoji

* remove ids from tests

* fix core tests

* fix election tests

* fix tests

* remove profile__user-role class

* remove needless aria-attribute

* remove duplicated ids

* empty merge

* Include alternative title for images when there's nothing but the title

* disable dropdown for desktop

* add alt text to default image

* user profile must not be an h5

* duplicate_id and copy button SR text

* fix odd layout for edit initiative

* redesign committee requests form

* fix a11y issue on budgets project list

* mark layout item header al role=complementary since it's outside

* do not expand elements if the page has very few contents

* fix a11y issue on debates, sortitions and forms

* fix rubocop

* fix erblint

* use the units as the aria-label

* standarize arias for progress bars

* initiatives style glitch

---------

Co-authored-by: Eduardo Martinez Echevarria <[email protected]>

* Integrate Bullet in decidim-dev (decidim#11416)

* Initial commit on bullet integration

* remove uneeded condition

* Disable failing actions

* Disable failing workflows

* Disable all the workflows

* Refactor actions

* Revert generator change

* Redesign: comment button (decidim#11461)

* render the comment button depending of the settings

* enhance condition: initiatives is not a component

* handle comments_blocked? in case of null

* fix offenses

* refactor duplicated views (decidim#11459)

* Redesign: remove the item itself from nav menu (decidim#11452)

* remove the item itself from nav menu

* fix i18n

* fix specs

* fix specs

* Refactor Decidim jobs to inherit from Decidim::ApplicationJob (decidim#11468)

* Add Initiatives to antispam

* Add initiatives specs

---------

Co-authored-by: Eduardo Martínez <[email protected]>
Co-authored-by: Hugoren Martinako <[email protected]>
Co-authored-by: Sina Eftekhar <[email protected]>
Co-authored-by: Tom <[email protected]>
Co-authored-by: Antti Hukkanen <[email protected]>
Co-authored-by: Carlo Beltrame <[email protected]>
Co-authored-by: JoonasAapro <[email protected]>
  • Loading branch information
8 people authored Aug 10, 2023
1 parent 9ac577c commit 720333b
Show file tree
Hide file tree
Showing 336 changed files with 1,440 additions and 3,071 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build_app.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:
RUBYOPT: '-W:no-deprecated'
services:
postgres:
image: postgres:11
image: postgres:14
ports: ["5432:5432"]
options: >-
--health-cmd pg_isready
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/ci_accountability.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,3 +38,7 @@ jobs:
with:
working-directory: "decidim-accountability"
test_command: bundle exec parallel_test --type rspec --pattern spec/
bullet_enabled: false
bullet_counter_cache: false
bullet_n_plus_one: false
bullet_unused_eager_loading: false
4 changes: 4 additions & 0 deletions .github/workflows/ci_admin.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,3 +39,7 @@ jobs:
with:
working-directory: "decidim-admin"
test_command: ${{ matrix.test-command }}
bullet_enabled: false
bullet_counter_cache: false
bullet_n_plus_one: false
bullet_unused_eager_loading: false
4 changes: 4 additions & 0 deletions .github/workflows/ci_api.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,3 +34,7 @@ jobs:
with:
working-directory: "decidim-api"
test_command: bundle exec parallel_test --type rspec --pattern spec/
bullet_enabled: true
bullet_counter_cache: true
bullet_n_plus_one: true
bullet_unused_eager_loading: true
4 changes: 4 additions & 0 deletions .github/workflows/ci_assemblies.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,3 +33,7 @@ jobs:
with:
working-directory: "decidim-assemblies"
test_command: bundle exec parallel_test --type rspec --pattern spec/
bullet_enabled: true
bullet_counter_cache: true
bullet_n_plus_one: true
bullet_unused_eager_loading: true
4 changes: 4 additions & 0 deletions .github/workflows/ci_blogs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,3 +36,7 @@ jobs:
with:
working-directory: "decidim-blogs"
test_command: bundle exec parallel_test --type rspec --pattern spec/
bullet_enabled: false
bullet_counter_cache: false
bullet_n_plus_one: false
bullet_unused_eager_loading: false
4 changes: 4 additions & 0 deletions .github/workflows/ci_budgets.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,3 +35,7 @@ jobs:
with:
working-directory: "decidim-budgets"
test_command: bundle exec parallel_test --type rspec --pattern spec/
bullet_enabled: false
bullet_counter_cache: false
bullet_n_plus_one: false
bullet_unused_eager_loading: false
4 changes: 4 additions & 0 deletions .github/workflows/ci_comments.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,3 +33,7 @@ jobs:
with:
working-directory: "decidim-comments"
test_command: bundle exec parallel_test --type rspec --pattern spec/
bullet_enabled: false
bullet_counter_cache: false
bullet_n_plus_one: false
bullet_unused_eager_loading: false
4 changes: 4 additions & 0 deletions .github/workflows/ci_conferences.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,3 +34,7 @@ jobs:
with:
working-directory: "decidim-conferences"
test_command: bundle exec parallel_test --type rspec --pattern spec/
bullet_enabled: false
bullet_counter_cache: false
bullet_n_plus_one: false
bullet_unused_eager_loading: false
4 changes: 4 additions & 0 deletions .github/workflows/ci_core.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,4 +40,8 @@ jobs:
with:
working-directory: "decidim-core"
test_command: ${{ matrix.test-command }}
bullet_enabled: false
bullet_counter_cache: false
bullet_n_plus_one: false
bullet_unused_eager_loading: false

4 changes: 4 additions & 0 deletions .github/workflows/ci_debates.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,3 +34,7 @@ jobs:
with:
working-directory: "decidim-debates"
test_command: bundle exec parallel_test --type rspec --pattern spec/
bullet_enabled: false
bullet_counter_cache: false
bullet_n_plus_one: false
bullet_unused_eager_loading: false
4 changes: 4 additions & 0 deletions .github/workflows/ci_dev_system.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,3 +31,7 @@ jobs:
with:
working-directory: "decidim-dev"
test_command: bundle exec parallel_test --type rspec --pattern spec/
bullet_enabled: true
bullet_counter_cache: true
bullet_n_plus_one: true
bullet_unused_eager_loading: true
4 changes: 4 additions & 0 deletions .github/workflows/ci_elections.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,3 +43,7 @@ jobs:
with:
working-directory: "decidim-elections"
test_command: ${{ matrix.test-command }}
bullet_enabled: false
bullet_counter_cache: false
bullet_n_plus_one: false
bullet_unused_eager_loading: false
4 changes: 4 additions & 0 deletions .github/workflows/ci_forms.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,3 +33,7 @@ jobs:
with:
working-directory: "decidim-forms"
test_command: bundle exec parallel_test --type rspec --pattern spec/
bullet_enabled: false
bullet_counter_cache: false
bullet_n_plus_one: false
bullet_unused_eager_loading: false
2 changes: 1 addition & 1 deletion .github/workflows/ci_generators.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ jobs:
timeout-minutes: 60
services:
postgres:
image: postgres:11
image: postgres:14
ports: ["5432:5432"]
options: >-
--health-cmd pg_isready
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/ci_initiatives.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,3 +43,7 @@ jobs:
with:
working-directory: "decidim-initiatives"
test_command: ${{ matrix.test-command }}
bullet_enabled: false
bullet_counter_cache: false
bullet_n_plus_one: false
bullet_unused_eager_loading: false
4 changes: 4 additions & 0 deletions .github/workflows/ci_meetings.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,3 +43,7 @@ jobs:
with:
working-directory: "decidim-meetings"
test_command: ${{ matrix.test-command }}
bullet_enabled: false
bullet_counter_cache: false
bullet_n_plus_one: false
bullet_unused_eager_loading: false
4 changes: 4 additions & 0 deletions .github/workflows/ci_pages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,3 +33,7 @@ jobs:
with:
working-directory: "decidim-pages"
test_command: bundle exec parallel_test --type rspec --pattern spec/
bullet_enabled: true
bullet_counter_cache: true
bullet_n_plus_one: true
bullet_unused_eager_loading: true
4 changes: 4 additions & 0 deletions .github/workflows/ci_participatory_processes.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,3 +34,7 @@ jobs:
with:
working-directory: "decidim-participatory_processes"
test_command: bundle exec parallel_test --type rspec --pattern spec/
bullet_enabled: false
bullet_counter_cache: false
bullet_n_plus_one: false
bullet_unused_eager_loading: false
2 changes: 1 addition & 1 deletion .github/workflows/ci_performance_metrics_monitoring.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ jobs:
timeout-minutes: 60
services:
postgres:
image: postgres:11
image: postgres:14
ports: ["5432:5432"]
options: >-
--health-cmd pg_isready
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/ci_proposals.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,5 +46,9 @@ jobs:
with:
working-directory: "decidim-proposals"
test_command: ${{ matrix.test-command }}
bullet_enabled: false
bullet_counter_cache: false
bullet_n_plus_one: false
bullet_unused_eager_loading: false


4 changes: 4 additions & 0 deletions .github/workflows/ci_sortitions.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,3 +35,7 @@ jobs:
with:
working-directory: "decidim-sortitions"
test_command: REDESIGN_ENABLED="false" bundle exec parallel_test --type rspec --pattern spec/
bullet_enabled: false
bullet_counter_cache: false
bullet_n_plus_one: false
bullet_unused_eager_loading: false
4 changes: 4 additions & 0 deletions .github/workflows/ci_surveys.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,3 +36,7 @@ jobs:
with:
working-directory: "decidim-surveys"
test_command: bundle exec parallel_test --type rspec --pattern spec/
bullet_enabled: false
bullet_counter_cache: false
bullet_n_plus_one: false
bullet_unused_eager_loading: false
4 changes: 4 additions & 0 deletions .github/workflows/ci_system.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,3 +32,7 @@ jobs:
with:
working-directory: "decidim-system"
test_command: REDESIGN_ENABLED="false" bundle exec parallel_test --type rspec --pattern spec/
bullet_enabled: true
bullet_counter_cache: true
bullet_n_plus_one: true
bullet_unused_eager_loading: true
4 changes: 4 additions & 0 deletions .github/workflows/ci_templates.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,3 +35,7 @@ jobs:
with:
working-directory: "decidim-templates"
test_command: REDESIGN_ENABLED="false" bundle exec parallel_test --type rspec --pattern spec/
bullet_enabled: false
bullet_counter_cache: false
bullet_n_plus_one: false
bullet_unused_eager_loading: false
4 changes: 4 additions & 0 deletions .github/workflows/ci_verifications.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,3 +33,7 @@ jobs:
with:
working-directory: "decidim-verifications"
test_command: bundle exec parallel_test --type rspec --pattern spec/
bullet_enabled: true
bullet_counter_cache: true
bullet_n_plus_one: true
bullet_unused_eager_loading: true
1 change: 1 addition & 0 deletions .github/workflows/lint_pr_format.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,5 +18,6 @@ jobs:
with:
disallowed_prefixes: "feat/,feature/,fix/,chore/,build/,ci/,refactor/,docs/,wip/,fix:"
prefix_case_sensitive: false
regex: "^[A-Z].+"
min_length: 5
max_length: 100
30 changes: 25 additions & 5 deletions .github/workflows/test_app.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,26 @@ on:
description: 'The testing command to be ran'
required: true
type: string
bullet_enabled:
description: 'Enable bullet performance testing'
required: false
default: false
type: boolean
bullet_n_plus_one:
description: 'Enable bullet n+1 testing'
required: false
default: false
type: boolean
bullet_counter_cache:
description: 'Enable bullet counter cache testing'
required: false
default: false
type: boolean
bullet_unused_eager_loading:
description: 'Enable bullet unused eager loading testing'
required: false
default: false
type: boolean

jobs:
build_app:
Expand All @@ -35,7 +55,7 @@ jobs:
image: ghcr.io/validator/validator:latest
ports: ["8888:8888"]
postgres:
image: postgres:11
image: postgres:14
ports: ["5432:5432"]
options: >-
--health-cmd pg_isready
Expand Down Expand Up @@ -64,10 +84,6 @@ jobs:
ruby-version: ${{ inputs.ruby_version }}
bundler-cache: true
- uses: nanasess/setup-chromedriver@v2
with:
# TODO: Unpin when nanasess/setup-chromedriver#190 is fixed:
# https://github.com/nanasess/setup-chromedriver/issues/190
chromedriver-version: 114.0.5735.90
- uses: actions/cache@v3
id: app-cache
with:
Expand All @@ -89,6 +105,10 @@ jobs:
RUBY_VERSION: ${{ inputs.ruby_version }}
DECIDIM_MODULE: ${{ inputs.working-directory }}
CODECOV_TOKEN: ${{ inputs.codecov_token }}
DECIDIM_BULLET_ENABLED: ${{ inputs.bullet_enabled }}
DECIDIM_BULLET_N_PLUS_ONE: ${{ inputs.bullet_n_plus_one }}
DECIDIM_BULLET_COUNTER_CACHE: ${{ inputs.bullet_counter_cache }}
DECIDIM_BULLET_UNUSED_EAGER: ${{ inputs.bullet_unused_eager_loading }}
DISPLAY: ":99"
CI: "true"
SIMPLECOV: "true"
Expand Down
5 changes: 5 additions & 0 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,7 @@ PATH
decidim-comments (= 0.28.0.dev)
decidim-core (= 0.28.0.dev)
decidim-dev (0.28.0.dev)
bullet (~> 7.0)
byebug (~> 11.0)
capybara (~> 3.39)
decidim (= 0.28.0.dev)
Expand Down Expand Up @@ -282,6 +283,9 @@ GEM
brakeman (5.4.1)
browser (2.7.1)
builder (3.2.4)
bullet (7.0.7)
activesupport (>= 3.0.0)
uniform_notifier (~> 1.11)
byebug (11.1.3)
capybara (3.39.0)
addressable
Expand Down Expand Up @@ -773,6 +777,7 @@ GEM
concurrent-ruby (~> 1.0)
uber (0.1.0)
unicode-display_width (2.4.2)
uniform_notifier (1.16.0)
valid_email2 (4.0.6)
activemodel (>= 3.2)
mail (~> 2.5)
Expand Down
5 changes: 5 additions & 0 deletions config/i18n-tasks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,11 @@ ignore_unused:
- decidim.proposals.proposals.wizard_aside.back_from_step_2
- decidim.proposals.proposals.wizard_aside.back_from_step_3
- decidim.proposals.proposals.wizard_aside.back_from_step_4
- decidim.proposals.proposals.wizard_steps.current_step
- decidim.proposals.proposals.wizard_steps.step_1
- decidim.proposals.proposals.wizard_steps.step_2
- decidim.proposals.proposals.wizard_steps.step_3
- decidim.proposals.proposals.wizard_steps.step_4
- decidim.proposals.proposals.show.proposal_accepted_reason
- decidim.proposals.proposals.show.proposal_in_evaluation_reason
- decidim.proposals.proposals.show.proposal_rejected_reason
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,7 @@
<%= cell("decidim/accountability/project", result) %>

<section class="layout-main__section layout-main__buttons" data-buttons>
<button class="button button__sm button__transparent-secondary">
<%= t(:comment, scope: "decidim.components.accountability.actions") %>
<%= icon "chat-1-line", class: "fill-current flex-none" %>
</button>
<%= cell "decidim/comments_button", nil %>
<div class="ml-auto">
<%= cell "decidim/tags", result %>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

<% if current_component.has_subscopes? %>
<div class="filter-container">
<button id="dropdown-trigger" data-component="dropdown" data-target="dropdown-menu" data-auto-close="true">
<button id="dropdown-trigger-accountability" data-component="dropdown" data-target="dropdown-menu-accountability" data-auto-close="true" data-disabled-md="true">
<% items.each do |item| %>
<%= content_tag :span, class: "#{"is-active" if item[:active]}" do %>
<span class="sr-only"><%= item[:sr_text] %></span>
Expand All @@ -15,7 +15,7 @@
<%= icon "arrow-down-s-line", class: "w-8 h-8 flex-none text-secondary fill-current" %>
<%= icon "arrow-up-s-line", class: "w-8 h-8 flex-none text-secondary fill-current" %>
</button>
<ul id="dropdown-menu" data-scope-filters>
<ul id="dropdown-menu-accountability" data-scope-filters>
<% items.each do |item| %>
<li>
<%= link_to item[:url], class: "filter#{" is-active" if item[:active]}" do %>
Expand Down
Loading

0 comments on commit 720333b

Please sign in to comment.