Skip to content

Commit

Permalink
Add verification tweaks (decidim-ice#334)
Browse files Browse the repository at this point in the history
* add force verfication option

* add text help. public logic

* add specs

* update awesome decidim ver

* add specs

* fix checksums

* add pending verifications

* add test cases

* fix proposal private body edit

* update text
  • Loading branch information
microstudi authored Oct 21, 2024
1 parent cff51e5 commit a8d21e4
Show file tree
Hide file tree
Showing 31 changed files with 964 additions and 1,064 deletions.
2 changes: 1 addition & 1 deletion Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ source "https://rubygems.org"

ruby RUBY_VERSION

DECIDIM_VERSION = "0.28.2"
DECIDIM_VERSION = "0.28.4"

gem "decidim", DECIDIM_VERSION
# this causes failures if not enabled (check if still necessary in the future)
Expand Down
187 changes: 94 additions & 93 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -141,55 +141,54 @@ GEM
date_validator (0.12.0)
activemodel (>= 3)
activesupport (>= 3)
decidim (0.28.2)
decidim-accountability (= 0.28.2)
decidim-admin (= 0.28.2)
decidim-api (= 0.28.2)
decidim-assemblies (= 0.28.2)
decidim-blogs (= 0.28.2)
decidim-budgets (= 0.28.2)
decidim-comments (= 0.28.2)
decidim-core (= 0.28.2)
decidim-debates (= 0.28.2)
decidim-forms (= 0.28.2)
decidim-generators (= 0.28.2)
decidim-meetings (= 0.28.2)
decidim-pages (= 0.28.2)
decidim-participatory_processes (= 0.28.2)
decidim-proposals (= 0.28.2)
decidim-sortitions (= 0.28.2)
decidim-surveys (= 0.28.2)
decidim-system (= 0.28.2)
decidim-templates (= 0.28.2)
decidim-verifications (= 0.28.2)
decidim-accountability (0.28.2)
decidim-comments (= 0.28.2)
decidim-core (= 0.28.2)
decidim-admin (0.28.2)
decidim (0.28.4)
decidim-accountability (= 0.28.4)
decidim-admin (= 0.28.4)
decidim-api (= 0.28.4)
decidim-assemblies (= 0.28.4)
decidim-blogs (= 0.28.4)
decidim-budgets (= 0.28.4)
decidim-comments (= 0.28.4)
decidim-core (= 0.28.4)
decidim-debates (= 0.28.4)
decidim-forms (= 0.28.4)
decidim-generators (= 0.28.4)
decidim-meetings (= 0.28.4)
decidim-pages (= 0.28.4)
decidim-participatory_processes (= 0.28.4)
decidim-proposals (= 0.28.4)
decidim-sortitions (= 0.28.4)
decidim-surveys (= 0.28.4)
decidim-system (= 0.28.4)
decidim-verifications (= 0.28.4)
decidim-accountability (0.28.4)
decidim-comments (= 0.28.4)
decidim-core (= 0.28.4)
decidim-admin (0.28.4)
active_link_to (~> 1.0)
decidim-core (= 0.28.2)
decidim-core (= 0.28.4)
devise (~> 4.7)
devise-i18n (~> 1.2)
devise_invitable (~> 2.0, >= 2.0.9)
decidim-api (0.28.2)
decidim-api (0.28.4)
commonmarker (~> 0.23.0, >= 0.23.9)
decidim-core (= 0.28.2)
decidim-core (= 0.28.4)
graphql (~> 2.0.0)
graphql-docs (~> 3.0.1)
rack-cors (~> 1.0)
decidim-assemblies (0.28.2)
decidim-core (= 0.28.2)
decidim-blogs (0.28.2)
decidim-admin (= 0.28.2)
decidim-comments (= 0.28.2)
decidim-core (= 0.28.2)
decidim-budgets (0.28.2)
decidim-comments (= 0.28.2)
decidim-core (= 0.28.2)
decidim-comments (0.28.2)
decidim-core (= 0.28.2)
decidim-assemblies (0.28.4)
decidim-core (= 0.28.4)
decidim-blogs (0.28.4)
decidim-admin (= 0.28.4)
decidim-comments (= 0.28.4)
decidim-core (= 0.28.4)
decidim-budgets (0.28.4)
decidim-comments (= 0.28.4)
decidim-core (= 0.28.4)
decidim-comments (0.28.4)
decidim-core (= 0.28.4)
redcarpet (~> 3.5, >= 3.5.1)
decidim-core (0.28.2)
decidim-core (0.28.4)
active_link_to (~> 1.0)
acts_as_list (~> 1.0)
batch-loader (~> 1.2)
Expand Down Expand Up @@ -234,19 +233,18 @@ GEM
request_store (~> 1.5.0)
rubyXL (~> 3.4)
rubyzip (~> 2.0)
seven_zip_ruby (~> 1.3)
shakapacker (~> 7.1.0)
valid_email2 (~> 4.0)
web-push (~> 3.0)
wisper (~> 2.0)
decidim-debates (0.28.2)
decidim-comments (= 0.28.2)
decidim-core (= 0.28.2)
decidim-dev (0.28.2)
decidim-debates (0.28.4)
decidim-comments (= 0.28.4)
decidim-core (= 0.28.4)
decidim-dev (0.28.4)
bullet (~> 7.0)
byebug (~> 11.0)
capybara (~> 3.39)
decidim (= 0.28.2)
decidim (= 0.28.4)
erb_lint (~> 0.4.0)
factory_bot_rails (~> 6.2)
faker (~> 3.2)
Expand All @@ -268,47 +266,49 @@ GEM
selenium-webdriver (~> 4.9)
simplecov (~> 0.22.0)
simplecov-cobertura (~> 2.1.0)
spring (~> 2.0)
spring-watcher-listen (~> 2.0)
w3c_rspec_validators (~> 0.3.0)
webmock (~> 3.18)
wisper-rspec (~> 1.0)
decidim-forms (0.28.2)
decidim-core (= 0.28.2)
decidim-forms (0.28.4)
decidim-core (= 0.28.4)
wicked_pdf (~> 2.1)
wkhtmltopdf-binary (~> 0.12)
decidim-generators (0.28.2)
decidim-core (= 0.28.2)
decidim-meetings (0.28.2)
decidim-core (= 0.28.2)
decidim-forms (= 0.28.2)
decidim-generators (0.28.4)
decidim-core (= 0.28.4)
decidim-meetings (0.28.4)
decidim-core (= 0.28.4)
decidim-forms (= 0.28.4)
icalendar (~> 2.5)
decidim-pages (0.28.2)
decidim-core (= 0.28.2)
decidim-participatory_processes (0.28.2)
decidim-core (= 0.28.2)
decidim-proposals (0.28.2)
decidim-comments (= 0.28.2)
decidim-core (= 0.28.2)
decidim-pages (0.28.4)
decidim-core (= 0.28.4)
decidim-participatory_processes (0.28.4)
decidim-core (= 0.28.4)
decidim-proposals (0.28.4)
decidim-comments (= 0.28.4)
decidim-core (= 0.28.4)
doc2text (~> 0.4.6)
redcarpet (~> 3.5, >= 3.5.1)
decidim-sortitions (0.28.2)
decidim-admin (= 0.28.2)
decidim-comments (= 0.28.2)
decidim-core (= 0.28.2)
decidim-proposals (= 0.28.2)
decidim-surveys (0.28.2)
decidim-core (= 0.28.2)
decidim-forms (= 0.28.2)
decidim-system (0.28.2)
decidim-sortitions (0.28.4)
decidim-admin (= 0.28.4)
decidim-comments (= 0.28.4)
decidim-core (= 0.28.4)
decidim-proposals (= 0.28.4)
decidim-surveys (0.28.4)
decidim-core (= 0.28.4)
decidim-forms (= 0.28.4)
decidim-system (0.28.4)
active_link_to (~> 1.0)
decidim-core (= 0.28.2)
decidim-core (= 0.28.4)
devise (~> 4.7)
devise-i18n (~> 1.2)
devise_invitable (~> 2.0, >= 2.0.9)
decidim-templates (0.28.2)
decidim-core (= 0.28.2)
decidim-forms (= 0.28.2)
decidim-verifications (0.28.2)
decidim-core (= 0.28.2)
decidim-templates (0.28.4)
decidim-core (= 0.28.4)
decidim-forms (= 0.28.4)
decidim-verifications (0.28.4)
decidim-core (= 0.28.4)
declarative-builder (0.1.0)
declarative-option (< 0.2.0)
declarative-option (0.1.0)
Expand Down Expand Up @@ -353,7 +353,7 @@ GEM
excon (0.111.0)
extended-markdown-filter (0.7.0)
html-pipeline (~> 2.9)
factory_bot (6.4.6)
factory_bot (6.5.0)
activesupport (>= 5.0.0)
factory_bot_rails (6.4.3)
factory_bot (~> 6.4)
Expand Down Expand Up @@ -400,7 +400,7 @@ GEM
sass (~> 3.4)
hashdiff (1.1.1)
hashie (5.0.0)
highline (3.1.0)
highline (3.1.1)
reline
html-pipeline (2.14.3)
activesupport (>= 2)
Expand All @@ -418,8 +418,9 @@ GEM
rails-i18n
rainbow (>= 2.2.2, < 4.0)
terminal-table (>= 1.5.1)
icalendar (2.10.2)
icalendar (2.10.3)
ice_cube (~> 0.16)
ostruct
ice_cube (0.17.0)
image_processing (1.13.0)
mini_magick (>= 4.9.5, < 5)
Expand Down Expand Up @@ -528,13 +529,14 @@ GEM
rack
openssl (3.2.0)
orm_adapter (0.5.0)
ostruct (0.6.0)
paper_trail (12.3.0)
activerecord (>= 5.2)
request_store (~> 1.1)
parallel (1.25.1)
parallel_tests (4.7.1)
parallel
parser (3.3.4.0)
parser (3.3.5.0)
ast (~> 2.4.1)
racc
pg (1.4.6)
Expand Down Expand Up @@ -615,7 +617,7 @@ GEM
redcarpet (3.6.0)
redis (4.8.1)
regexp_parser (2.9.2)
reline (0.5.9)
reline (0.5.10)
io-console (~> 0.5)
request_store (1.5.1)
rack (>= 1.4)
Expand All @@ -631,18 +633,18 @@ GEM
rspec-cells (0.3.9)
cells (>= 4.0.0, < 6.0.0)
rspec-rails (>= 3.0.0, < 6.2.0)
rspec-core (3.13.0)
rspec-core (3.13.1)
rspec-support (~> 3.13.0)
rspec-expectations (3.13.1)
rspec-expectations (3.13.3)
diff-lcs (>= 1.2.0, < 2.0)
rspec-support (~> 3.13.0)
rspec-html-matchers (0.10.0)
nokogiri (~> 1)
rspec (>= 3.0.0.a)
rspec-mocks (3.13.1)
rspec-mocks (3.13.2)
diff-lcs (>= 1.2.0, < 2.0)
rspec-support (~> 3.13.0)
rspec-rails (6.1.3)
rspec-rails (6.1.5)
actionpack (>= 6.1)
activesupport (>= 6.1)
railties (>= 6.1)
Expand Down Expand Up @@ -694,14 +696,13 @@ GEM
rb-inotify (~> 0.9, >= 0.9.7)
sassc (2.4.0)
ffi (~> 1.9)
selenium-webdriver (4.23.0)
selenium-webdriver (4.25.0)
base64 (~> 0.2)
logger (~> 1.4)
rexml (~> 3.2, >= 3.2.5)
rubyzip (>= 1.2.2, < 3.0)
websocket (~> 1.0)
semantic_range (3.0.0)
seven_zip_ruby (1.3.0)
shakapacker (7.1.0)
activesupport (>= 5.2)
rack-proxy (>= 0.6.1)
Expand All @@ -714,7 +715,7 @@ GEM
simplecov-cobertura (2.1.0)
rexml
simplecov (~> 0.19)
simplecov-html (0.12.3)
simplecov-html (0.13.1)
simplecov_json_formatter (0.1.4)
smart_properties (1.17.0)
snaky_hash (2.0.1)
Expand Down Expand Up @@ -743,7 +744,7 @@ GEM
tzinfo (2.0.6)
concurrent-ruby (~> 1.0)
uber (0.1.0)
unicode-display_width (2.5.0)
unicode-display_width (2.6.0)
uniform_notifier (1.16.0)
uri (0.13.0)
valid_email2 (4.0.6)
Expand All @@ -768,7 +769,7 @@ GEM
web-push (3.0.1)
jwt (~> 2.0)
openssl (~> 3.0)
webmock (3.23.1)
webmock (3.24.0)
addressable (>= 2.8.0)
crack (>= 0.3.2)
hashdiff (>= 0.4.0, < 2.0.0)
Expand All @@ -780,7 +781,7 @@ GEM
activesupport
wisper (2.0.1)
wisper-rspec (1.1.0)
wkhtmltopdf-binary (0.12.6.7)
wkhtmltopdf-binary (0.12.6.8)
xpath (3.2.0)
nokogiri (~> 1.8)
zeitwerk (2.6.17)
Expand All @@ -792,10 +793,10 @@ DEPENDENCIES
bootsnap (~> 1.4)
brakeman (~> 5.4)
byebug (~> 11.0)
decidim (= 0.28.2)
decidim (= 0.28.4)
decidim-decidim_awesome!
decidim-dev (= 0.28.2)
decidim-templates (= 0.28.2)
decidim-dev (= 0.28.4)
decidim-templates (= 0.28.4)
letter_opener_web (~> 2.0)
listen (~> 3.1)
net-imap (~> 0.2.3)
Expand Down
19 changes: 19 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -385,6 +385,25 @@ If your organization spans across multiple timezones, you can enable this featur

![User time zone select](examples/user_timezone.png)

#### 20. Mandatory verifications

This feature allows admins to enforce mandatory verifications for users before they can access the platform. Admins can configure which verifications are required.

Admins can manage these settings in the Awesome admin panel under the "Verifications" section.

![Forced verifications admin side](examples/forced_verifications_admin.png)
![Forced verifications public side](examples/forced_verifications_public.png)

Note that some pages are allowed, you can even configure which controller are allowed by creating an initializer ("required_authorizations" and "authorizations" are always allowed):

```ruby
# config/initializers/decidim_awesome.rb

Decidim::DecidimAwesome.configure do |config|
# default controllers are "account" and "pages"
config.force_authorization_allowed_controller_names = %w(account pages homepage)
```

#### To be continued...

We're not done! Please check the [issues](/decidim-ice/decidim-module-decidim_awesome/issues) (and participate) to see what's on our mind
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@ module CreateProposalOverride
alias_method :decidim_original_create_proposal, :create_proposal

def create_proposal
created_proposal = decidim_original_create_proposal
decidim_original_create_proposal
# Update the proposal with the private body, to
# avoid tracebility on private fields.
created_proposal.update_private_body!(form.private_body) if form.private_body.present?
@proposal.update_private_body!(form.private_body) if form.private_body.present?
end
end
end
Expand Down
Loading

0 comments on commit a8d21e4

Please sign in to comment.