decidim-verifications 0.30.3 → 0.31.0.rc1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
 - data/README.md +5 -5
 - data/app/commands/decidim/verifications/csv_census/admin/create_census_data.rb +5 -4
 - data/app/commands/decidim/verifications/csv_census/admin/create_census_record.rb +23 -0
 - data/app/commands/decidim/verifications/csv_census/admin/update_census_record.rb +15 -0
 - data/app/controllers/concerns/decidim/verifications/admin/filterable.rb +26 -0
 - data/app/controllers/decidim/verifications/authorizations_controller.rb +1 -2
 - data/app/controllers/decidim/verifications/csv_census/admin/census_controller.rb +58 -14
 - data/app/controllers/decidim/verifications/csv_census/admin/census_records_controller.rb +63 -0
 - data/app/controllers/decidim/verifications/id_documents/admin/config_controller.rb +1 -1
 - data/app/controllers/decidim/verifications/id_documents/admin/confirmations_controller.rb +1 -1
 - data/app/controllers/decidim/verifications/id_documents/admin/offline_confirmations_controller.rb +1 -1
 - data/app/controllers/decidim/verifications/id_documents/authorizations_controller.rb +2 -2
 - data/app/controllers/decidim/verifications/postal_letter/authorizations_controller.rb +2 -2
 - data/app/controllers/decidim/verifications/sms/authorizations_controller.rb +2 -2
 - data/app/forms/decidim/verifications/csv_census/admin/census_data_form.rb +29 -3
 - data/app/forms/decidim/verifications/csv_census/admin/census_form.rb +29 -0
 - data/app/forms/decidim/verifications/sms/mobile_phone_form.rb +2 -2
 - data/app/jobs/decidim/verifications/csv_census/process_census_data_job.rb +49 -0
 - data/app/models/decidim/verifications/csv_census/data.rb +13 -1
 - data/app/models/decidim/verifications/csv_datum.rb +21 -0
 - data/app/packs/entrypoints/decidim_verifications.js +3 -0
 - data/app/packs/src/csv_census.js +47 -0
 - data/app/presenters/decidim/verifications/admin_log/csv_datum_presenter.rb +45 -0
 - data/app/services/decidim/authorization_handler.rb +1 -1
 - data/app/views/decidim/verifications/authorizations/new.html.erb +1 -1
 - data/app/views/decidim/verifications/authorizations/onboarding_pending.html.erb +1 -1
 - data/app/views/decidim/verifications/csv_census/admin/census/_csv_census_drawer.html.erb +5 -0
 - data/app/views/decidim/verifications/csv_census/admin/census/index.html.erb +73 -51
 - data/app/views/decidim/verifications/csv_census/admin/census/new_import.html.erb +27 -0
 - data/app/views/decidim/verifications/csv_census/admin/census_records/_form.html.erb +9 -0
 - data/app/views/decidim/verifications/csv_census/admin/census_records/edit_record.html.erb +14 -0
 - data/app/views/decidim/verifications/csv_census/admin/census_records/new_record.html.erb +14 -0
 - data/app/views/decidim/verifications/postal_letter/admin/pending_authorizations/index.html.erb +33 -17
 - data/config/assets.rb +2 -2
 - data/config/locales/ar.yml +0 -5
 - data/config/locales/bg.yml +0 -12
 - data/config/locales/ca-IT.yml +62 -17
 - data/config/locales/ca.yml +62 -17
 - data/config/locales/cs.yml +42 -16
 - data/config/locales/de.yml +61 -17
 - data/config/locales/el.yml +0 -5
 - data/config/locales/en.yml +62 -17
 - data/config/locales/es-MX.yml +62 -17
 - data/config/locales/es-PY.yml +62 -17
 - data/config/locales/es.yml +62 -17
 - data/config/locales/eu.yml +66 -21
 - data/config/locales/fi-plain.yml +62 -17
 - data/config/locales/fi.yml +62 -17
 - data/config/locales/fr-CA.yml +5 -12
 - data/config/locales/fr.yml +5 -12
 - data/config/locales/gl.yml +0 -5
 - data/config/locales/hu.yml +0 -12
 - data/config/locales/id-ID.yml +0 -5
 - data/config/locales/it.yml +0 -5
 - data/config/locales/ja.yml +62 -17
 - data/config/locales/lt.yml +0 -12
 - data/config/locales/lv.yml +0 -5
 - data/config/locales/nl.yml +0 -5
 - data/config/locales/no.yml +0 -5
 - data/config/locales/pl.yml +0 -12
 - data/config/locales/pt-BR.yml +0 -5
 - data/config/locales/pt.yml +0 -5
 - data/config/locales/ro-RO.yml +40 -8
 - data/config/locales/sk.yml +0 -5
 - data/config/locales/sv.yml +61 -17
 - data/config/locales/tr-TR.yml +0 -5
 - data/config/locales/zh-CN.yml +0 -5
 - data/config/locales/zh-TW.yml +0 -12
 - data/lib/decidim/verifications/adapter.rb +3 -3
 - data/lib/decidim/verifications/csv_census/admin_engine.rb +10 -2
 - data/lib/decidim/verifications/engine.rb +1 -1
 - data/lib/decidim/verifications/version.rb +1 -1
 - data/lib/decidim/verifications/workflows.rb +3 -58
 - data/lib/decidim/verifications.rb +1 -1
 - data/lib/tasks/revoke.rake +16 -0
 - metadata +22 -10
 - data/app/jobs/decidim/verifications/csv_census/remove_duplicates_job.rb +0 -30
 - data/lib/decidim/verifications/registry.rb +0 -43
 
    
        data/config/locales/zh-CN.yml
    CHANGED
    
    | 
         @@ -81,15 +81,10 @@ zh-CN: 
     | 
|
| 
       81 
81 
     | 
    
         
             
                    start_exploring: 开始探索中
         
     | 
| 
       82 
82 
     | 
    
         
             
                  csv_census:
         
     | 
| 
       83 
83 
     | 
    
         
             
                    admin:
         
     | 
| 
       84 
     | 
    
         
            -
                      destroy:
         
     | 
| 
       85 
     | 
    
         
            -
                        title: 删除所有普查数据
         
     | 
| 
       86 
84 
     | 
    
         
             
                      index:
         
     | 
| 
       87 
     | 
    
         
            -
                        empty: 没有普查数据。使用下面的表单导入CSV文件。
         
     | 
| 
       88 
85 
     | 
    
         
             
                        title: 目前的普查数据
         
     | 
| 
       89 
86 
     | 
    
         
             
                      instructions:
         
     | 
| 
       90 
87 
     | 
    
         
             
                        body: 要做到这一点,您必须输入系统管理并将csv_census授权添加到组织
         
     | 
| 
       91 
     | 
    
         
            -
                      new:
         
     | 
| 
       92 
     | 
    
         
            -
                        file: "带有电子邮件数据的.csv 文件"
         
     | 
| 
       93 
88 
     | 
    
         
             
                    authorizations:
         
     | 
| 
       94 
89 
     | 
    
         
             
                      new:
         
     | 
| 
       95 
90 
     | 
    
         
             
                        error: 我们无法验证您的帐户或您不在组织的普查中。
         
     | 
    
        data/config/locales/zh-TW.yml
    CHANGED
    
    | 
         @@ -119,23 +119,11 @@ zh-TW: 
     | 
|
| 
       119 
119 
     | 
    
         
             
                    start_exploring: 開始探索
         
     | 
| 
       120 
120 
     | 
    
         
             
                  csv_census:
         
     | 
| 
       121 
121 
     | 
    
         
             
                    admin:
         
     | 
| 
       122 
     | 
    
         
            -
                      census:
         
     | 
| 
       123 
     | 
    
         
            -
                        create:
         
     | 
| 
       124 
     | 
    
         
            -
                          success: 成功匯入 %{count} 項目(%{errors} 錯誤).
         
     | 
| 
       125 
     | 
    
         
            -
                        destroy_all:
         
     | 
| 
       126 
     | 
    
         
            -
                          success: 所有戶籍數據都已刪除.
         
     | 
| 
       127 
     | 
    
         
            -
                      destroy:
         
     | 
| 
       128 
     | 
    
         
            -
                        confirm: 刪除所有戶籍資料將無法還原,您確定要繼續嗎?
         
     | 
| 
       129 
     | 
    
         
            -
                        title: 刪除所有戶籍資料
         
     | 
| 
       130 
122 
     | 
    
         
             
                      index:
         
     | 
| 
       131 
     | 
    
         
            -
                        data: 總共載入了 %{count} 筆記錄。最後上傳日期為 %{due_date}。
         
     | 
| 
       132 
     | 
    
         
            -
                        empty: 目前沒有戶籍資料。使用下面的表格,使用 CSV 檔案進行匯入。
         
     | 
| 
       133 
123 
     | 
    
         
             
                        title: 目前戶籍資料
         
     | 
| 
       134 
124 
     | 
    
         
             
                      instructions:
         
     | 
| 
       135 
125 
     | 
    
         
             
                        body: 您需要進入系統管理,並向組織添加 csv_census 授權以進行操作。
         
     | 
| 
       136 
126 
     | 
    
         
             
                        title: 您需要為此組織啟用 CSV 戶籍調查。
         
     | 
| 
       137 
     | 
    
         
            -
                      new:
         
     | 
| 
       138 
     | 
    
         
            -
                        file: "帶有電子郵件數據的.csv 文件"
         
     | 
| 
       139 
127 
     | 
    
         
             
                    authorizations:
         
     | 
| 
       140 
128 
     | 
    
         
             
                      new:
         
     | 
| 
       141 
129 
     | 
    
         
             
                        error: 我們無法驗證您的帳戶或您不在該組織的人口普查中。
         
     | 
| 
         @@ -3,7 +3,7 @@ 
     | 
|
| 
       3 
3 
     | 
    
         
             
            module Decidim
         
     | 
| 
       4 
4 
     | 
    
         
             
              module Verifications
         
     | 
| 
       5 
5 
     | 
    
         
             
                class InvalidVerificationRoute < StandardError
         
     | 
| 
       6 
     | 
    
         
            -
                  def  
     | 
| 
      
 6 
     | 
    
         
            +
                  def new(route:)
         
     | 
| 
       7 
7 
     | 
    
         
             
                    msg = <<~MSG
         
     | 
| 
       8 
8 
     | 
    
         
             
                      You specified a direct handler but you are trying to use `#{route}`
         
     | 
| 
       9 
9 
     | 
    
         
             
                      which is only available for multi-step authorization workflows. Change
         
     | 
| 
         @@ -15,7 +15,7 @@ module Decidim 
     | 
|
| 
       15 
15 
     | 
    
         
             
                end
         
     | 
| 
       16 
16 
     | 
    
         | 
| 
       17 
17 
     | 
    
         
             
                class MissingVerificationRoute < StandardError
         
     | 
| 
       18 
     | 
    
         
            -
                  def  
     | 
| 
      
 18 
     | 
    
         
            +
                  def new(handler:, route:, action:)
         
     | 
| 
       19 
19 
     | 
    
         
             
                    msg = <<~MSG
         
     | 
| 
       20 
20 
     | 
    
         
             
                      The authorization handler `#{handler}` does not define the route
         
     | 
| 
       21 
21 
     | 
    
         
             
                      `#{route}`. If you want to enable `#{action}` for `#{handler}`, change
         
     | 
| 
         @@ -27,7 +27,7 @@ module Decidim 
     | 
|
| 
       27 
27 
     | 
    
         
             
                end
         
     | 
| 
       28 
28 
     | 
    
         | 
| 
       29 
29 
     | 
    
         
             
                class MissingEngine < StandardError
         
     | 
| 
       30 
     | 
    
         
            -
                  def  
     | 
| 
      
 30 
     | 
    
         
            +
                  def new(handler:, engine:)
         
     | 
| 
       31 
31 
     | 
    
         
             
                    msg = <<~MSG
         
     | 
| 
       32 
32 
     | 
    
         
             
                      The authorization handler `#{handler}` does not define the `#{engine}`
         
     | 
| 
       33 
33 
     | 
    
         
             
                      engine. Please define the engine in the workflow configuration.
         
     | 
| 
         @@ -10,11 +10,19 @@ module Decidim 
     | 
|
| 
       10 
10 
     | 
    
         
             
                    paths["lib/tasks"] = nil
         
     | 
| 
       11 
11 
     | 
    
         | 
| 
       12 
12 
     | 
    
         
             
                    routes do
         
     | 
| 
       13 
     | 
    
         
            -
                      resources : 
     | 
| 
      
 13 
     | 
    
         
            +
                      resources :census_logs, only: [:index, :destroy], controller: "census" do
         
     | 
| 
      
 14 
     | 
    
         
            +
                        member do
         
     | 
| 
      
 15 
     | 
    
         
            +
                          get :edit_record, controller: "census_records"
         
     | 
| 
      
 16 
     | 
    
         
            +
                          patch :update_record, controller: "census_records"
         
     | 
| 
      
 17 
     | 
    
         
            +
                        end
         
     | 
| 
       14 
18 
     | 
    
         
             
                        collection do
         
     | 
| 
       15 
     | 
    
         
            -
                           
     | 
| 
      
 19 
     | 
    
         
            +
                          get :new_import
         
     | 
| 
      
 20 
     | 
    
         
            +
                          post :create_import
         
     | 
| 
      
 21 
     | 
    
         
            +
                          get :new_record, controller: "census_records"
         
     | 
| 
      
 22 
     | 
    
         
            +
                          post :create_record, controller: "census_records"
         
     | 
| 
       16 
23 
     | 
    
         
             
                        end
         
     | 
| 
       17 
24 
     | 
    
         
             
                      end
         
     | 
| 
      
 25 
     | 
    
         
            +
             
     | 
| 
       18 
26 
     | 
    
         
             
                      root to: "census#index"
         
     | 
| 
       19 
27 
     | 
    
         
             
                    end
         
     | 
| 
       20 
28 
     | 
    
         
             
                  end
         
     | 
| 
         @@ -56,7 +56,7 @@ module Decidim 
     | 
|
| 
       56 
56 
     | 
    
         
             
                    Cell::ViewModel.view_paths << File.expand_path("#{Decidim::Verifications::Engine.root}/app/cells")
         
     | 
| 
       57 
57 
     | 
    
         
             
                  end
         
     | 
| 
       58 
58 
     | 
    
         | 
| 
       59 
     | 
    
         
            -
                  initializer "decidim_verifications. 
     | 
| 
      
 59 
     | 
    
         
            +
                  initializer "decidim_verifications.shakapacker.assets_path" do
         
     | 
| 
       60 
60 
     | 
    
         
             
                    Decidim.register_assets_path File.expand_path("app/packs", root)
         
     | 
| 
       61 
61 
     | 
    
         
             
                  end
         
     | 
| 
       62 
62 
     | 
    
         | 
| 
         @@ -3,65 +3,10 @@ 
     | 
|
| 
       3 
3 
     | 
    
         
             
            module Decidim
         
     | 
| 
       4 
4 
     | 
    
         
             
              module Verifications
         
     | 
| 
       5 
5 
     | 
    
         
             
                autoload :Adapter, "decidim/verifications/adapter"
         
     | 
| 
       6 
     | 
    
         
            -
                autoload : 
     | 
| 
      
 6 
     | 
    
         
            +
                autoload :WorkflowManifest, "decidim/verifications/workflow_manifest"
         
     | 
| 
       7 
7 
     | 
    
         | 
| 
       8 
     | 
    
         
            -
                 
     | 
| 
       9 
     | 
    
         
            -
                # Provides direct access to the verification registry
         
     | 
| 
       10 
     | 
    
         
            -
                #
         
     | 
| 
       11 
     | 
    
         
            -
                class << self
         
     | 
| 
       12 
     | 
    
         
            -
                  delegate :clear_workflows, to: :registry
         
     | 
| 
      
 8 
     | 
    
         
            +
                include Decidim::HasWorkflows
         
     | 
| 
       13 
9 
     | 
    
         | 
| 
       14 
     | 
    
         
            -
             
     | 
| 
       15 
     | 
    
         
            -
                  # Restores registered verification workflows to the array being passed in
         
     | 
| 
       16 
     | 
    
         
            -
                  #
         
     | 
| 
       17 
     | 
    
         
            -
                  # Useful for testing.
         
     | 
| 
       18 
     | 
    
         
            -
                  #
         
     | 
| 
       19 
     | 
    
         
            -
                  def reset_workflows(*)
         
     | 
| 
       20 
     | 
    
         
            -
                    registry.reset_workflows(*)
         
     | 
| 
       21 
     | 
    
         
            -
                  end
         
     | 
| 
       22 
     | 
    
         
            -
             
     | 
| 
       23 
     | 
    
         
            -
                  #
         
     | 
| 
       24 
     | 
    
         
            -
                  # Registers a new verification workflow using the workflow manifest API
         
     | 
| 
       25 
     | 
    
         
            -
                  #
         
     | 
| 
       26 
     | 
    
         
            -
                  def register_workflow(name, &)
         
     | 
| 
       27 
     | 
    
         
            -
                    registry.register_workflow(name, &)
         
     | 
| 
       28 
     | 
    
         
            -
                  end
         
     | 
| 
       29 
     | 
    
         
            -
             
     | 
| 
       30 
     | 
    
         
            -
                  #
         
     | 
| 
       31 
     | 
    
         
            -
                  # Unregisters a verification workflow using the workflow manifest API
         
     | 
| 
       32 
     | 
    
         
            -
                  #
         
     | 
| 
       33 
     | 
    
         
            -
                  def unregister_workflow(name)
         
     | 
| 
       34 
     | 
    
         
            -
                    manifest = find_workflow_manifest(name)
         
     | 
| 
       35 
     | 
    
         
            -
             
     | 
| 
       36 
     | 
    
         
            -
                    registry.unregister_workflow(manifest)
         
     | 
| 
       37 
     | 
    
         
            -
                  end
         
     | 
| 
       38 
     | 
    
         
            -
             
     | 
| 
       39 
     | 
    
         
            -
                  #
         
     | 
| 
       40 
     | 
    
         
            -
                  # Finds a verification workflow by name
         
     | 
| 
       41 
     | 
    
         
            -
                  #
         
     | 
| 
       42 
     | 
    
         
            -
                  def find_workflow_manifest(name)
         
     | 
| 
       43 
     | 
    
         
            -
                    workflows.find { |workflow| workflow.name == name.to_s }
         
     | 
| 
       44 
     | 
    
         
            -
                  end
         
     | 
| 
       45 
     | 
    
         
            -
             
     | 
| 
       46 
     | 
    
         
            -
                  #
         
     | 
| 
       47 
     | 
    
         
            -
                  # Collection of registered verification workflows
         
     | 
| 
       48 
     | 
    
         
            -
                  #
         
     | 
| 
       49 
     | 
    
         
            -
                  def workflows
         
     | 
| 
       50 
     | 
    
         
            -
                    registry.workflow_collection
         
     | 
| 
       51 
     | 
    
         
            -
                  end
         
     | 
| 
       52 
     | 
    
         
            -
             
     | 
| 
       53 
     | 
    
         
            -
                  #
         
     | 
| 
       54 
     | 
    
         
            -
                  # Collection of registered verification workflows having an admin engine
         
     | 
| 
       55 
     | 
    
         
            -
                  #
         
     | 
| 
       56 
     | 
    
         
            -
                  def admin_workflows
         
     | 
| 
       57 
     | 
    
         
            -
                    workflows.select(&:admin_engine)
         
     | 
| 
       58 
     | 
    
         
            -
                  end
         
     | 
| 
       59 
     | 
    
         
            -
             
     | 
| 
       60 
     | 
    
         
            -
                  private
         
     | 
| 
       61 
     | 
    
         
            -
             
     | 
| 
       62 
     | 
    
         
            -
                  def registry
         
     | 
| 
       63 
     | 
    
         
            -
                    @registry ||= Registry.new
         
     | 
| 
       64 
     | 
    
         
            -
                  end
         
     | 
| 
       65 
     | 
    
         
            -
                end
         
     | 
| 
      
 10 
     | 
    
         
            +
                def self.workflow_manifest_class = WorkflowManifest
         
     | 
| 
       66 
11 
     | 
    
         
             
              end
         
     | 
| 
       67 
12 
     | 
    
         
             
            end
         
     | 
| 
         @@ -29,7 +29,7 @@ module Decidim 
     | 
|
| 
       29 
29 
     | 
    
         
             
              module Verifications
         
     | 
| 
       30 
30 
     | 
    
         
             
                include ActiveSupport::Configurable
         
     | 
| 
       31 
31 
     | 
    
         
             
                config_accessor :document_types do
         
     | 
| 
       32 
     | 
    
         
            -
                   
     | 
| 
      
 32 
     | 
    
         
            +
                  Decidim::Env.new("VERIFICATIONS_DOCUMENT_TYPES", "identification_number,passport").to_array
         
     | 
| 
       33 
33 
     | 
    
         
             
                end
         
     | 
| 
       34 
34 
     | 
    
         
             
              end
         
     | 
| 
       35 
35 
     | 
    
         
             
            end
         
     | 
| 
         @@ -0,0 +1,16 @@ 
     | 
|
| 
      
 1 
     | 
    
         
            +
            # frozen_string_literal: true
         
     | 
| 
      
 2 
     | 
    
         
            +
             
     | 
| 
      
 3 
     | 
    
         
            +
            namespace :decidim do
         
     | 
| 
      
 4 
     | 
    
         
            +
              namespace :verifications do
         
     | 
| 
      
 5 
     | 
    
         
            +
                namespace :revoke do
         
     | 
| 
      
 6 
     | 
    
         
            +
                  Decidim.authorization_engines.pluck(:name).each do |authorization|
         
     | 
| 
      
 7 
     | 
    
         
            +
                    desc "Revokes authorizations for the #{authorization} workflow"
         
     | 
| 
      
 8 
     | 
    
         
            +
                    task authorization, [] => :environment do
         
     | 
| 
      
 9 
     | 
    
         
            +
                      logger.info("=== Revoking authorizations for the #{authorization} workflow")
         
     | 
| 
      
 10 
     | 
    
         
            +
                      Decidim::Authorization.where(name: authorization).destroy_all
         
     | 
| 
      
 11 
     | 
    
         
            +
                      logger.info("===== Done")
         
     | 
| 
      
 12 
     | 
    
         
            +
                    end
         
     | 
| 
      
 13 
     | 
    
         
            +
                  end
         
     | 
| 
      
 14 
     | 
    
         
            +
                end
         
     | 
| 
      
 15 
     | 
    
         
            +
              end
         
     | 
| 
      
 16 
     | 
    
         
            +
            end
         
     | 
    
        metadata
    CHANGED
    
    | 
         @@ -1,14 +1,14 @@ 
     | 
|
| 
       1 
1 
     | 
    
         
             
            --- !ruby/object:Gem::Specification
         
     | 
| 
       2 
2 
     | 
    
         
             
            name: decidim-verifications
         
     | 
| 
       3 
3 
     | 
    
         
             
            version: !ruby/object:Gem::Version
         
     | 
| 
       4 
     | 
    
         
            -
              version: 0. 
     | 
| 
      
 4 
     | 
    
         
            +
              version: 0.31.0.rc1
         
     | 
| 
       5 
5 
     | 
    
         
             
            platform: ruby
         
     | 
| 
       6 
6 
     | 
    
         
             
            authors:
         
     | 
| 
       7 
7 
     | 
    
         
             
            - David Rodriguez
         
     | 
| 
       8 
8 
     | 
    
         
             
            autorequire:
         
     | 
| 
       9 
9 
     | 
    
         
             
            bindir: bin
         
     | 
| 
       10 
10 
     | 
    
         
             
            cert_chain: []
         
     | 
| 
       11 
     | 
    
         
            -
            date: 2025- 
     | 
| 
      
 11 
     | 
    
         
            +
            date: 2025-09-25 00:00:00.000000000 Z
         
     | 
| 
       12 
12 
     | 
    
         
             
            dependencies:
         
     | 
| 
       13 
13 
     | 
    
         
             
            - !ruby/object:Gem::Dependency
         
     | 
| 
       14 
14 
     | 
    
         
             
              name: decidim-core
         
     | 
| 
         @@ -16,42 +16,42 @@ dependencies: 
     | 
|
| 
       16 
16 
     | 
    
         
             
                requirements:
         
     | 
| 
       17 
17 
     | 
    
         
             
                - - '='
         
     | 
| 
       18 
18 
     | 
    
         
             
                  - !ruby/object:Gem::Version
         
     | 
| 
       19 
     | 
    
         
            -
                    version: 0. 
     | 
| 
      
 19 
     | 
    
         
            +
                    version: 0.31.0.rc1
         
     | 
| 
       20 
20 
     | 
    
         
             
              type: :runtime
         
     | 
| 
       21 
21 
     | 
    
         
             
              prerelease: false
         
     | 
| 
       22 
22 
     | 
    
         
             
              version_requirements: !ruby/object:Gem::Requirement
         
     | 
| 
       23 
23 
     | 
    
         
             
                requirements:
         
     | 
| 
       24 
24 
     | 
    
         
             
                - - '='
         
     | 
| 
       25 
25 
     | 
    
         
             
                  - !ruby/object:Gem::Version
         
     | 
| 
       26 
     | 
    
         
            -
                    version: 0. 
     | 
| 
      
 26 
     | 
    
         
            +
                    version: 0.31.0.rc1
         
     | 
| 
       27 
27 
     | 
    
         
             
            - !ruby/object:Gem::Dependency
         
     | 
| 
       28 
28 
     | 
    
         
             
              name: decidim-admin
         
     | 
| 
       29 
29 
     | 
    
         
             
              requirement: !ruby/object:Gem::Requirement
         
     | 
| 
       30 
30 
     | 
    
         
             
                requirements:
         
     | 
| 
       31 
31 
     | 
    
         
             
                - - '='
         
     | 
| 
       32 
32 
     | 
    
         
             
                  - !ruby/object:Gem::Version
         
     | 
| 
       33 
     | 
    
         
            -
                    version: 0. 
     | 
| 
      
 33 
     | 
    
         
            +
                    version: 0.31.0.rc1
         
     | 
| 
       34 
34 
     | 
    
         
             
              type: :development
         
     | 
| 
       35 
35 
     | 
    
         
             
              prerelease: false
         
     | 
| 
       36 
36 
     | 
    
         
             
              version_requirements: !ruby/object:Gem::Requirement
         
     | 
| 
       37 
37 
     | 
    
         
             
                requirements:
         
     | 
| 
       38 
38 
     | 
    
         
             
                - - '='
         
     | 
| 
       39 
39 
     | 
    
         
             
                  - !ruby/object:Gem::Version
         
     | 
| 
       40 
     | 
    
         
            -
                    version: 0. 
     | 
| 
      
 40 
     | 
    
         
            +
                    version: 0.31.0.rc1
         
     | 
| 
       41 
41 
     | 
    
         
             
            - !ruby/object:Gem::Dependency
         
     | 
| 
       42 
42 
     | 
    
         
             
              name: decidim-dev
         
     | 
| 
       43 
43 
     | 
    
         
             
              requirement: !ruby/object:Gem::Requirement
         
     | 
| 
       44 
44 
     | 
    
         
             
                requirements:
         
     | 
| 
       45 
45 
     | 
    
         
             
                - - '='
         
     | 
| 
       46 
46 
     | 
    
         
             
                  - !ruby/object:Gem::Version
         
     | 
| 
       47 
     | 
    
         
            -
                    version: 0. 
     | 
| 
      
 47 
     | 
    
         
            +
                    version: 0.31.0.rc1
         
     | 
| 
       48 
48 
     | 
    
         
             
              type: :development
         
     | 
| 
       49 
49 
     | 
    
         
             
              prerelease: false
         
     | 
| 
       50 
50 
     | 
    
         
             
              version_requirements: !ruby/object:Gem::Requirement
         
     | 
| 
       51 
51 
     | 
    
         
             
                requirements:
         
     | 
| 
       52 
52 
     | 
    
         
             
                - - '='
         
     | 
| 
       53 
53 
     | 
    
         
             
                  - !ruby/object:Gem::Version
         
     | 
| 
       54 
     | 
    
         
            -
                    version: 0. 
     | 
| 
      
 54 
     | 
    
         
            +
                    version: 0.31.0.rc1
         
     | 
| 
       55 
55 
     | 
    
         
             
            description: Several verification methods for your decidim instance
         
     | 
| 
       56 
56 
     | 
    
         
             
            email:
         
     | 
| 
       57 
57 
     | 
    
         
             
            - deivid.rodriguez@riseup.net
         
     | 
| 
         @@ -68,6 +68,8 @@ files: 
     | 
|
| 
       68 
68 
     | 
    
         
             
            - app/commands/decidim/verifications/authorize_user.rb
         
     | 
| 
       69 
69 
     | 
    
         
             
            - app/commands/decidim/verifications/confirm_user_authorization.rb
         
     | 
| 
       70 
70 
     | 
    
         
             
            - app/commands/decidim/verifications/csv_census/admin/create_census_data.rb
         
     | 
| 
      
 71 
     | 
    
         
            +
            - app/commands/decidim/verifications/csv_census/admin/create_census_record.rb
         
     | 
| 
      
 72 
     | 
    
         
            +
            - app/commands/decidim/verifications/csv_census/admin/update_census_record.rb
         
     | 
| 
       71 
73 
     | 
    
         
             
            - app/commands/decidim/verifications/csv_census/confirm_census_authorization.rb
         
     | 
| 
       72 
74 
     | 
    
         
             
            - app/commands/decidim/verifications/destroy_user_authorization.rb
         
     | 
| 
       73 
75 
     | 
    
         
             
            - app/commands/decidim/verifications/id_documents/admin/confirm_user_offline_authorization.rb
         
     | 
| 
         @@ -77,11 +79,13 @@ files: 
     | 
|
| 
       77 
79 
     | 
    
         
             
            - app/commands/decidim/verifications/revoke_by_condition_authorizations.rb
         
     | 
| 
       78 
80 
     | 
    
         
             
            - app/commands/decidim/verifications/revoke_by_name_authorizations.rb
         
     | 
| 
       79 
81 
     | 
    
         
             
            - app/controllers/concerns/decidim/admin/workflows_breadcrumb.rb
         
     | 
| 
      
 82 
     | 
    
         
            +
            - app/controllers/concerns/decidim/verifications/admin/filterable.rb
         
     | 
| 
       80 
83 
     | 
    
         
             
            - app/controllers/concerns/decidim/verifications/renewable.rb
         
     | 
| 
       81 
84 
     | 
    
         
             
            - app/controllers/decidim/verifications/admin/verifications_controller.rb
         
     | 
| 
       82 
85 
     | 
    
         
             
            - app/controllers/decidim/verifications/application_controller.rb
         
     | 
| 
       83 
86 
     | 
    
         
             
            - app/controllers/decidim/verifications/authorizations_controller.rb
         
     | 
| 
       84 
87 
     | 
    
         
             
            - app/controllers/decidim/verifications/csv_census/admin/census_controller.rb
         
     | 
| 
      
 88 
     | 
    
         
            +
            - app/controllers/decidim/verifications/csv_census/admin/census_records_controller.rb
         
     | 
| 
       85 
89 
     | 
    
         
             
            - app/controllers/decidim/verifications/csv_census/authorizations_controller.rb
         
     | 
| 
       86 
90 
     | 
    
         
             
            - app/controllers/decidim/verifications/id_documents/admin/config_controller.rb
         
     | 
| 
       87 
91 
     | 
    
         
             
            - app/controllers/decidim/verifications/id_documents/admin/confirmations_controller.rb
         
     | 
| 
         @@ -96,6 +100,7 @@ files: 
     | 
|
| 
       96 
100 
     | 
    
         
             
            - app/events/decidim/verifications/managed_user_error_event.rb
         
     | 
| 
       97 
101 
     | 
    
         
             
            - app/forms/decidim/verifications/admin/revocations_before_date_form.rb
         
     | 
| 
       98 
102 
     | 
    
         
             
            - app/forms/decidim/verifications/csv_census/admin/census_data_form.rb
         
     | 
| 
      
 103 
     | 
    
         
            +
            - app/forms/decidim/verifications/csv_census/admin/census_form.rb
         
     | 
| 
       99 
104 
     | 
    
         
             
            - app/forms/decidim/verifications/csv_census/census_form.rb
         
     | 
| 
       100 
105 
     | 
    
         
             
            - app/forms/decidim/verifications/id_documents/admin/config_form.rb
         
     | 
| 
       101 
106 
     | 
    
         
             
            - app/forms/decidim/verifications/id_documents/admin/offline_confirmation_form.rb
         
     | 
| 
         @@ -109,14 +114,16 @@ files: 
     | 
|
| 
       109 
114 
     | 
    
         
             
            - app/forms/decidim/verifications/sms/mobile_phone_form.rb
         
     | 
| 
       110 
115 
     | 
    
         
             
            - app/helpers/decidim/verifications/application_helper.rb
         
     | 
| 
       111 
116 
     | 
    
         
             
            - app/jobs/decidim/verifications/csv_census/application_job.rb
         
     | 
| 
       112 
     | 
    
         
            -
            - app/jobs/decidim/verifications/csv_census/ 
     | 
| 
      
 117 
     | 
    
         
            +
            - app/jobs/decidim/verifications/csv_census/process_census_data_job.rb
         
     | 
| 
       113 
118 
     | 
    
         
             
            - app/models/decidim/verifications/application_record.rb
         
     | 
| 
       114 
119 
     | 
    
         
             
            - app/models/decidim/verifications/conflict.rb
         
     | 
| 
       115 
120 
     | 
    
         
             
            - app/models/decidim/verifications/csv_census/data.rb
         
     | 
| 
       116 
121 
     | 
    
         
             
            - app/models/decidim/verifications/csv_census/status.rb
         
     | 
| 
       117 
122 
     | 
    
         
             
            - app/models/decidim/verifications/csv_datum.rb
         
     | 
| 
       118 
123 
     | 
    
         
             
            - app/packs/entrypoints/decidim_verifications.js
         
     | 
| 
      
 124 
     | 
    
         
            +
            - app/packs/src/csv_census.js
         
     | 
| 
       119 
125 
     | 
    
         
             
            - app/packs/stylesheets/verifications.scss
         
     | 
| 
      
 126 
     | 
    
         
            +
            - app/presenters/decidim/verifications/admin_log/csv_datum_presenter.rb
         
     | 
| 
       120 
127 
     | 
    
         
             
            - app/presenters/decidim/verifications/id_documents/authorization_presenter.rb
         
     | 
| 
       121 
128 
     | 
    
         
             
            - app/presenters/decidim/verifications/postal_letter/authorization_presenter.rb
         
     | 
| 
       122 
129 
     | 
    
         
             
            - app/queries/decidim/verifications/authorizations.rb
         
     | 
| 
         @@ -129,8 +136,13 @@ files: 
     | 
|
| 
       129 
136 
     | 
    
         
             
            - app/views/decidim/verifications/authorizations/new.html.erb
         
     | 
| 
       130 
137 
     | 
    
         
             
            - app/views/decidim/verifications/authorizations/onboarding_pending.html.erb
         
     | 
| 
       131 
138 
     | 
    
         
             
            - app/views/decidim/verifications/authorizations/renew_modal.html.erb
         
     | 
| 
      
 139 
     | 
    
         
            +
            - app/views/decidim/verifications/csv_census/admin/census/_csv_census_drawer.html.erb
         
     | 
| 
       132 
140 
     | 
    
         
             
            - app/views/decidim/verifications/csv_census/admin/census/index.html.erb
         
     | 
| 
       133 
141 
     | 
    
         
             
            - app/views/decidim/verifications/csv_census/admin/census/instructions.html.erb
         
     | 
| 
      
 142 
     | 
    
         
            +
            - app/views/decidim/verifications/csv_census/admin/census/new_import.html.erb
         
     | 
| 
      
 143 
     | 
    
         
            +
            - app/views/decidim/verifications/csv_census/admin/census_records/_form.html.erb
         
     | 
| 
      
 144 
     | 
    
         
            +
            - app/views/decidim/verifications/csv_census/admin/census_records/edit_record.html.erb
         
     | 
| 
      
 145 
     | 
    
         
            +
            - app/views/decidim/verifications/csv_census/admin/census_records/new_record.html.erb
         
     | 
| 
       134 
146 
     | 
    
         
             
            - app/views/decidim/verifications/id_documents/admin/config/edit.html.erb
         
     | 
| 
       135 
147 
     | 
    
         
             
            - app/views/decidim/verifications/id_documents/admin/confirmations/new.html.erb
         
     | 
| 
       136 
148 
     | 
    
         
             
            - app/views/decidim/verifications/id_documents/admin/offline_confirmations/new.html.erb
         
     | 
| 
         @@ -253,7 +265,6 @@ files: 
     | 
|
| 
       253 
265 
     | 
    
         
             
            - lib/decidim/verifications/postal_letter/admin_engine.rb
         
     | 
| 
       254 
266 
     | 
    
         
             
            - lib/decidim/verifications/postal_letter/engine.rb
         
     | 
| 
       255 
267 
     | 
    
         
             
            - lib/decidim/verifications/postal_letter/workflow.rb
         
     | 
| 
       256 
     | 
    
         
            -
            - lib/decidim/verifications/registry.rb
         
     | 
| 
       257 
268 
     | 
    
         
             
            - lib/decidim/verifications/sms.rb
         
     | 
| 
       258 
269 
     | 
    
         
             
            - lib/decidim/verifications/sms/engine.rb
         
     | 
| 
       259 
270 
     | 
    
         
             
            - lib/decidim/verifications/sms/example_gateway.rb
         
     | 
| 
         @@ -261,6 +272,7 @@ files: 
     | 
|
| 
       261 
272 
     | 
    
         
             
            - lib/decidim/verifications/version.rb
         
     | 
| 
       262 
273 
     | 
    
         
             
            - lib/decidim/verifications/workflow_manifest.rb
         
     | 
| 
       263 
274 
     | 
    
         
             
            - lib/decidim/verifications/workflows.rb
         
     | 
| 
      
 275 
     | 
    
         
            +
            - lib/tasks/revoke.rake
         
     | 
| 
       264 
276 
     | 
    
         
             
            homepage: https://decidim.org
         
     | 
| 
       265 
277 
     | 
    
         
             
            licenses:
         
     | 
| 
       266 
278 
     | 
    
         
             
            - AGPL-3.0-or-later
         
     | 
| 
         @@ -1,30 +0,0 @@ 
     | 
|
| 
       1 
     | 
    
         
            -
            # frozen_string_literal: true
         
     | 
| 
       2 
     | 
    
         
            -
             
     | 
| 
       3 
     | 
    
         
            -
            module Decidim
         
     | 
| 
       4 
     | 
    
         
            -
              module Verifications
         
     | 
| 
       5 
     | 
    
         
            -
                module CsvCensus
         
     | 
| 
       6 
     | 
    
         
            -
                  class RemoveDuplicatesJob < ApplicationJob
         
     | 
| 
       7 
     | 
    
         
            -
                    queue_as :default
         
     | 
| 
       8 
     | 
    
         
            -
             
     | 
| 
       9 
     | 
    
         
            -
                    def perform(organization)
         
     | 
| 
       10 
     | 
    
         
            -
                      duplicated_census(organization).pluck(:email).each do |email|
         
     | 
| 
       11 
     | 
    
         
            -
                        CsvDatum.inside(organization)
         
     | 
| 
       12 
     | 
    
         
            -
                                .where(email:)
         
     | 
| 
       13 
     | 
    
         
            -
                                .order(id: :desc)
         
     | 
| 
       14 
     | 
    
         
            -
                                .all(1..-1)
         
     | 
| 
       15 
     | 
    
         
            -
                                .each(&:delete)
         
     | 
| 
       16 
     | 
    
         
            -
                      end
         
     | 
| 
       17 
     | 
    
         
            -
                    end
         
     | 
| 
       18 
     | 
    
         
            -
             
     | 
| 
       19 
     | 
    
         
            -
                    private
         
     | 
| 
       20 
     | 
    
         
            -
             
     | 
| 
       21 
     | 
    
         
            -
                    def duplicated_census(organization)
         
     | 
| 
       22 
     | 
    
         
            -
                      CsvDatum.inside(organization)
         
     | 
| 
       23 
     | 
    
         
            -
                              .select(:email)
         
     | 
| 
       24 
     | 
    
         
            -
                              .group(:email)
         
     | 
| 
       25 
     | 
    
         
            -
                              .having("count(email)>1")
         
     | 
| 
       26 
     | 
    
         
            -
                    end
         
     | 
| 
       27 
     | 
    
         
            -
                  end
         
     | 
| 
       28 
     | 
    
         
            -
                end
         
     | 
| 
       29 
     | 
    
         
            -
              end
         
     | 
| 
       30 
     | 
    
         
            -
            end
         
     | 
| 
         @@ -1,43 +0,0 @@ 
     | 
|
| 
       1 
     | 
    
         
            -
            # frozen_string_literal: true
         
     | 
| 
       2 
     | 
    
         
            -
             
     | 
| 
       3 
     | 
    
         
            -
            require "decidim/verifications/workflow_manifest"
         
     | 
| 
       4 
     | 
    
         
            -
             
     | 
| 
       5 
     | 
    
         
            -
            module Decidim
         
     | 
| 
       6 
     | 
    
         
            -
              module Verifications
         
     | 
| 
       7 
     | 
    
         
            -
                #
         
     | 
| 
       8 
     | 
    
         
            -
                # Takes care of holding and accessing verification methods.
         
     | 
| 
       9 
     | 
    
         
            -
                #
         
     | 
| 
       10 
     | 
    
         
            -
                class Registry
         
     | 
| 
       11 
     | 
    
         
            -
                  def register_workflow(name)
         
     | 
| 
       12 
     | 
    
         
            -
                    manifest = WorkflowManifest.new(name: name.to_s)
         
     | 
| 
       13 
     | 
    
         
            -
                    yield(manifest)
         
     | 
| 
       14 
     | 
    
         
            -
                    add_workflow(manifest)
         
     | 
| 
       15 
     | 
    
         
            -
                  end
         
     | 
| 
       16 
     | 
    
         
            -
             
     | 
| 
       17 
     | 
    
         
            -
                  def unregister_workflow(manifest)
         
     | 
| 
       18 
     | 
    
         
            -
                    workflow_collection.delete(manifest)
         
     | 
| 
       19 
     | 
    
         
            -
                  end
         
     | 
| 
       20 
     | 
    
         
            -
             
     | 
| 
       21 
     | 
    
         
            -
                  def add_workflow(manifest)
         
     | 
| 
       22 
     | 
    
         
            -
                    manifest.validate!
         
     | 
| 
       23 
     | 
    
         
            -
                    workflow_collection.add(manifest)
         
     | 
| 
       24 
     | 
    
         
            -
                  end
         
     | 
| 
       25 
     | 
    
         
            -
             
     | 
| 
       26 
     | 
    
         
            -
                  def clear_workflows
         
     | 
| 
       27 
     | 
    
         
            -
                    workflow_collection.clear
         
     | 
| 
       28 
     | 
    
         
            -
                  end
         
     | 
| 
       29 
     | 
    
         
            -
             
     | 
| 
       30 
     | 
    
         
            -
                  def reset_workflows(*manifests)
         
     | 
| 
       31 
     | 
    
         
            -
                    clear_workflows
         
     | 
| 
       32 
     | 
    
         
            -
             
     | 
| 
       33 
     | 
    
         
            -
                    manifests.each do |manifest|
         
     | 
| 
       34 
     | 
    
         
            -
                      add_workflow(manifest)
         
     | 
| 
       35 
     | 
    
         
            -
                    end
         
     | 
| 
       36 
     | 
    
         
            -
                  end
         
     | 
| 
       37 
     | 
    
         
            -
             
     | 
| 
       38 
     | 
    
         
            -
                  def workflow_collection
         
     | 
| 
       39 
     | 
    
         
            -
                    @workflow_collection ||= Set.new
         
     | 
| 
       40 
     | 
    
         
            -
                  end
         
     | 
| 
       41 
     | 
    
         
            -
                end
         
     | 
| 
       42 
     | 
    
         
            -
              end
         
     | 
| 
       43 
     | 
    
         
            -
            end
         
     |