decidim-cleaner 0.0.1 → 1.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/commands/decidim/cleaner/admin/update_organization_cleaner.rb +1 -1
- data/app/jobs/decidim/cleaner/clean_admin_logs_job.rb +1 -1
- data/app/jobs/decidim/cleaner/clean_inactive_users_job.rb +11 -8
- data/app/mailers/decidim/cleaner/inactive_users_mailer.rb +2 -2
- data/config/i18n-tasks.yml +8 -3
- data/config/locales/en.yml +11 -6
- data/config/locales/fr.yml +15 -8
- data/db/migrate/20230106105014_add_delete_admin_logs_to_organization.rb +1 -1
- data/db/migrate/20230110150032_add_delete_inactive_users_to_organization.rb +1 -1
- data/lib/decidim/cleaner/admin_engine.rb +4 -4
- data/lib/decidim/cleaner/engine.rb +0 -4
- data/lib/decidim/cleaner/test/factories.rb +1 -1
- data/lib/decidim/cleaner/version.rb +3 -1
- data/lib/decidim/cleaner.rb +0 -1
- data/lib/tasks/decidim_cleaner_tasks.rake +2 -0
- metadata +7 -15
- data/app/controllers/decidim/cleaner/application_controller.rb +0 -13
- data/app/helpers/decidim/cleaner/application_helper.rb +0 -10
- data/app/models/decidim/cleaner/application_record.rb +0 -10
- data/app/packs/entrypoints/decidim_cleaner.js +0 -2
- data/app/packs/images/decidim/cleaner/icon.svg +0 -1
- data/app/packs/stylesheets/decidim/cleaner/cleaner.scss +0 -1
- data/config/assets.rb +0 -9
- data/lib/decidim/cleaner/component.rb +0 -40
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d719f430907247b84a0cc288639ab222c6120d27e6dc407d6b04f5547fe82a2e
|
4
|
+
data.tar.gz: f176026b4e7218680433e383c266587ce6fa47ea360ac42972452bc4e4446b73
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 148df6e0913bb0965c4660449f332a647bac902d1ce35c902880ac7e11b4ce07515bef36b7b92d238e2259ba6dc9f4a4d9f956e24e070bcd4ddb4205f8146048
|
7
|
+
data.tar.gz: '073996a639f9961296aea2a95329e400441524e5a088f04fcfa6bf130d81be7658fc29ed4a66d3e5fbbf4b34c38e77f067c48eb0ad03782df06c9eab1bc42823'
|
@@ -5,7 +5,7 @@ module Decidim
|
|
5
5
|
module Admin
|
6
6
|
# A command with all the business logic for updating the current
|
7
7
|
# organization cleaner.
|
8
|
-
class UpdateOrganizationCleaner <
|
8
|
+
class UpdateOrganizationCleaner < Decidim::Command
|
9
9
|
# Public: Initializes the command.
|
10
10
|
#
|
11
11
|
# organization - The Organization that will be updated.
|
@@ -9,7 +9,7 @@ module Decidim
|
|
9
9
|
Decidim::Organization.find_each do |organization|
|
10
10
|
next unless organization.delete_admin_logs?
|
11
11
|
|
12
|
-
Decidim::ActionLog.where(organization:
|
12
|
+
Decidim::ActionLog.where(organization:).where("created_at < ?", Time.zone.now - (organization.delete_admin_logs_after || 365).days).delete_all
|
13
13
|
end
|
14
14
|
end
|
15
15
|
end
|
@@ -9,28 +9,31 @@ module Decidim
|
|
9
9
|
Decidim::Organization.find_each do |organization|
|
10
10
|
next unless organization.delete_inactive_users?
|
11
11
|
|
12
|
-
send_warning(Decidim::User.where(organization:
|
12
|
+
send_warning(Decidim::User.where(organization:)
|
13
13
|
.where("last_sign_in_at < ?", Time.zone.now - (organization.delete_inactive_users_email_after || 365).days)
|
14
14
|
.where("last_sign_in_at > ?", Time.zone.now - (organization.delete_inactive_users_email_after || 365).days - 1.day))
|
15
|
-
delete_user_and_send_email(Decidim::User
|
16
|
-
.where(organization: organization)
|
17
|
-
.where("last_sign_in_at < ?", Time.zone.now - (organization.delete_inactive_users_after || 390).days))
|
15
|
+
delete_user_and_send_email(Decidim::User.where(organization:).where("last_sign_in_at < ?", Time.zone.now - (organization.delete_inactive_users_after || 390).days))
|
18
16
|
end
|
19
17
|
end
|
20
18
|
|
21
19
|
def send_warning(users)
|
22
|
-
users.
|
20
|
+
users.find_each do |user|
|
21
|
+
next if user.deleted?
|
22
|
+
|
23
23
|
InactiveUsersMailer.warning_inactive(user).deliver_now
|
24
24
|
Rails.logger.info "Inactive warning sent to #{user.email}"
|
25
25
|
end
|
26
26
|
end
|
27
27
|
|
28
28
|
def delete_user_and_send_email(users)
|
29
|
-
users.
|
29
|
+
users.find_each do |user|
|
30
|
+
next if user.deleted?
|
31
|
+
|
30
32
|
InactiveUsersMailer.warning_deletion(user).deliver_now
|
31
33
|
Rails.logger.info "Deletion warning sent to #{user.email}"
|
32
|
-
|
33
|
-
|
34
|
+
|
35
|
+
Decidim::DestroyAccount.call(user, Decidim::DeleteAccountForm.from_params({ delete_reason: I18n.t("decidim.cleaner.delete_reason") }))
|
36
|
+
Rails.logger.info "User with id #{user.id} destroyed"
|
34
37
|
end
|
35
38
|
end
|
36
39
|
end
|
@@ -13,7 +13,7 @@ module Decidim
|
|
13
13
|
"decidim.cleaner.inactive_users_mailer.warning_inactive.subject",
|
14
14
|
organization_name: @organization.name
|
15
15
|
)
|
16
|
-
mail(to: user.email, subject:
|
16
|
+
mail(to: user.email, subject:)
|
17
17
|
end
|
18
18
|
end
|
19
19
|
|
@@ -25,7 +25,7 @@ module Decidim
|
|
25
25
|
"decidim.cleaner.inactive_users_mailer.warning_deletion.subject",
|
26
26
|
organization_name: @organization.name
|
27
27
|
)
|
28
|
-
mail(to: user.email, subject:
|
28
|
+
mail(to: user.email, subject:)
|
29
29
|
end
|
30
30
|
end
|
31
31
|
end
|
data/config/i18n-tasks.yml
CHANGED
@@ -1,10 +1,15 @@
|
|
1
1
|
---
|
2
2
|
|
3
3
|
base_locale: en
|
4
|
-
locales: [en]
|
4
|
+
locales: [en, fr]
|
5
5
|
|
6
6
|
ignore_unused:
|
7
|
-
-
|
7
|
+
- activemodel.attributes.organization.delete_admin_logs
|
8
|
+
- activemodel.attributes.organization.delete_admin_logs_after
|
9
|
+
- activemodel.attributes.organization.delete_inactive_users
|
10
|
+
- activemodel.attributes.organization.delete_inactive_users_after
|
11
|
+
- activemodel.attributes.organization.delete_inactive_users_email_after
|
12
|
+
- decidim.admin.menu.clean
|
8
13
|
|
9
14
|
ignore_missing:
|
10
|
-
|
15
|
+
|
data/config/locales/en.yml
CHANGED
@@ -7,11 +7,16 @@ en:
|
|
7
7
|
delete_admin_logs_after: Delete admin logs after (days, default 365)
|
8
8
|
delete_inactive_users: Enable inactive users deletion
|
9
9
|
delete_inactive_users_after: Delete inactive users after (days, default 390)
|
10
|
-
delete_inactive_users_email_after: Send email to inactive users before deletion
|
10
|
+
delete_inactive_users_email_after: Send email to inactive users before deletion
|
11
|
+
(days, default 365)
|
11
12
|
decidim:
|
12
13
|
admin:
|
13
14
|
menu:
|
14
15
|
clean: Data cleaner
|
16
|
+
organization:
|
17
|
+
update:
|
18
|
+
error: There was a problem updating this organization.
|
19
|
+
success: Organization updated successfully.
|
15
20
|
cleaner:
|
16
21
|
admin:
|
17
22
|
organization_cleaner:
|
@@ -20,19 +25,19 @@ en:
|
|
20
25
|
form:
|
21
26
|
admin_log_cleaner_title: Admin log
|
22
27
|
inactive_users_cleaner_title: Inactive users
|
28
|
+
delete_reason: User deleted because of inactivity
|
23
29
|
inactive_users_mailer:
|
24
30
|
warning_deletion:
|
25
|
-
body_1: You are inactive since %{days} days on <a href="%{organization_url}">
|
31
|
+
body_1: You are inactive since %{days} days on <a href="%{organization_url}">
|
32
|
+
%{organization_name} </a>.
|
26
33
|
body_2: As a result, your account has been deleted.
|
27
34
|
greetings: Greetings,<br/>%{organization_name}<br/><a href="%{organization_url}">%{organization_url}</a>
|
28
35
|
hello: Hello
|
29
36
|
subject: Your account has been deleted
|
30
37
|
warning_inactive:
|
31
38
|
body_1: You are inactive since %{days} days on %{organization_name}.
|
32
|
-
body_2: <a href="%{organization_url}">If no reaction within %{remaining_days}
|
39
|
+
body_2: <a href="%{organization_url}">If no reaction within %{remaining_days}
|
40
|
+
days </a>, your account will be deleted.
|
33
41
|
greetings: Greetings,<br/>%{organization_name}<br/><a href="%{organization_url}">%{organization_url}</a>
|
34
42
|
hello: Hello
|
35
43
|
subject: Your account is inactive
|
36
|
-
components:
|
37
|
-
cleaner:
|
38
|
-
name: Cleaner
|
data/config/locales/fr.yml
CHANGED
@@ -4,14 +4,21 @@ fr:
|
|
4
4
|
attributes:
|
5
5
|
organization:
|
6
6
|
delete_admin_logs: Activer la suppression de l'historique d'administration
|
7
|
-
delete_admin_logs_after: Supprimer l'historique d'administration après (jours,
|
7
|
+
delete_admin_logs_after: Supprimer l'historique d'administration après (jours,
|
8
|
+
par défaut 365)
|
8
9
|
delete_inactive_users: Activer la suppression des utilisateurs inactifs
|
9
|
-
delete_inactive_users_after: Supprimer les utilisateurs inactifs après (jours,
|
10
|
-
|
10
|
+
delete_inactive_users_after: Supprimer les utilisateurs inactifs après (jours,
|
11
|
+
par défaut 390)
|
12
|
+
delete_inactive_users_email_after: Envoyer un courriel aux utilisateurs inactifs
|
13
|
+
avant la suppression (jours, par défaut 365)
|
11
14
|
decidim:
|
12
15
|
admin:
|
13
16
|
menu:
|
14
17
|
clean: Nettoyeur de données
|
18
|
+
organization:
|
19
|
+
update:
|
20
|
+
error: Une erreur est survenue lors de la mise à jour de l'organisation
|
21
|
+
success: L'organisation a été mise à jour avec succès
|
15
22
|
cleaner:
|
16
23
|
admin:
|
17
24
|
organization_cleaner:
|
@@ -20,19 +27,19 @@ fr:
|
|
20
27
|
form:
|
21
28
|
admin_log_cleaner_title: Historique d'administration
|
22
29
|
inactive_users_cleaner_title: Utilisateurs inactifs
|
30
|
+
delete_reason: Utilisateur supprimé pour inactivité
|
23
31
|
inactive_users_mailer:
|
24
32
|
warning_deletion:
|
25
|
-
body_1: Vous êtes inactif depuis %{days} jours sur <a href="%{organization_url}">
|
33
|
+
body_1: Vous êtes inactif depuis %{days} jours sur <a href="%{organization_url}">
|
34
|
+
%{organization_name} </a>.
|
26
35
|
body_2: Par conséquent, votre compte a été supprimé.
|
27
36
|
greetings: Cordialement,<br/>%{organization_name}<br/><a href="%{organization_url}">%{organization_url}</a>
|
28
37
|
hello: Bonjour
|
29
38
|
subject: Votre compte a été supprimé
|
30
39
|
warning_inactive:
|
31
40
|
body_1: Vous êtes inactif depuis %{days} jours sur %{organization_name}.
|
32
|
-
body_2: <a href="%{organization_url}">Si aucune réaction dans les %{remaining_days}
|
41
|
+
body_2: <a href="%{organization_url}">Si aucune réaction dans les %{remaining_days}
|
42
|
+
jours</a>, votre compte sera supprimé.
|
33
43
|
greetings: Cordialement,<br/>%{organization_name}<br/><a href="%{organization_url}">%{organization_url}</a>
|
34
44
|
hello: Bonjour
|
35
45
|
subject: Votre compte est inactif
|
36
|
-
components:
|
37
|
-
cleaner:
|
38
|
-
name: Nettoyeur
|
@@ -1,6 +1,6 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
class AddDeleteAdminLogsToOrganization < ActiveRecord::Migration[6.
|
3
|
+
class AddDeleteAdminLogsToOrganization < ActiveRecord::Migration[6.1]
|
4
4
|
def change
|
5
5
|
add_column :decidim_organizations, :delete_admin_logs, :boolean, default: false, null: false
|
6
6
|
add_column :decidim_organizations, :delete_admin_logs_after, :integer
|
@@ -1,6 +1,6 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
class AddDeleteInactiveUsersToOrganization < ActiveRecord::Migration[6.
|
3
|
+
class AddDeleteInactiveUsersToOrganization < ActiveRecord::Migration[6.1]
|
4
4
|
def change
|
5
5
|
add_column :decidim_organizations, :delete_inactive_users, :boolean, default: false, null: false
|
6
6
|
add_column :decidim_organizations, :delete_inactive_users_email_after, :integer
|
@@ -9,6 +9,10 @@ module Decidim
|
|
9
9
|
paths["db/migrate"] = nil
|
10
10
|
paths["lib/tasks"] = nil
|
11
11
|
|
12
|
+
def load_seed
|
13
|
+
nil
|
14
|
+
end
|
15
|
+
|
12
16
|
initializer "decidim_admin.admin_settings_menu" do
|
13
17
|
Decidim.menu :admin_settings_menu do |menu|
|
14
18
|
menu.add_item :clean_organization,
|
@@ -19,10 +23,6 @@ module Decidim
|
|
19
23
|
active: is_active_link?(decidim_admin.edit_organization_cleaner_path)
|
20
24
|
end
|
21
25
|
end
|
22
|
-
|
23
|
-
def load_seed
|
24
|
-
nil
|
25
|
-
end
|
26
26
|
end
|
27
27
|
end
|
28
28
|
end
|
@@ -8,10 +8,6 @@ module Decidim
|
|
8
8
|
# This is the engine that runs on the public interface of cleaner.
|
9
9
|
class Engine < ::Rails::Engine
|
10
10
|
isolate_namespace Decidim::Cleaner
|
11
|
-
|
12
|
-
initializer "Cleaner.webpacker.assets_path" do
|
13
|
-
Decidim.register_assets_path File.expand_path("app/packs", root)
|
14
|
-
end
|
15
11
|
end
|
16
12
|
end
|
17
13
|
end
|
@@ -5,7 +5,7 @@ require "decidim/core/test/factories"
|
|
5
5
|
FactoryBot.define do
|
6
6
|
factory :cleaner_component, parent: :component do
|
7
7
|
name { Decidim::Components::Namer.new(participatory_space.organization.available_locales, :cleaner).i18n_name }
|
8
|
-
manifest_name
|
8
|
+
manifest_name :cleaner
|
9
9
|
participatory_space { create(:participatory_process, :with_steps) }
|
10
10
|
end
|
11
11
|
end
|
@@ -1,10 +1,11 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
+
# :nocov:
|
3
4
|
module Decidim
|
4
5
|
# This holds the decidim-meetings version.
|
5
6
|
module Cleaner
|
6
7
|
def self.version
|
7
|
-
"0.0
|
8
|
+
"1.0.0"
|
8
9
|
end
|
9
10
|
|
10
11
|
def self.decidim_version
|
@@ -12,3 +13,4 @@ module Decidim
|
|
12
13
|
end
|
13
14
|
end
|
14
15
|
end
|
16
|
+
# :nocov:
|
data/lib/decidim/cleaner.rb
CHANGED
@@ -1,5 +1,6 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
+
# :nocov:
|
3
4
|
namespace :decidim_cleaner do
|
4
5
|
desc "Warns and deletes inactive users"
|
5
6
|
task clean_inactive_users: :environment do
|
@@ -11,3 +12,4 @@ namespace :decidim_cleaner do
|
|
11
12
|
Decidim::Cleaner::CleanAdminLogsJob.perform_now
|
12
13
|
end
|
13
14
|
end
|
15
|
+
# :nocov:
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: decidim-cleaner
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0
|
4
|
+
version: 1.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Quentinchampenois
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-
|
11
|
+
date: 2023-03-03 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: decidim-core
|
@@ -37,22 +37,15 @@ files:
|
|
37
37
|
- app/commands/decidim/cleaner/admin/update_organization_cleaner.rb
|
38
38
|
- app/controllers/decidim/cleaner/admin/application_controller.rb
|
39
39
|
- app/controllers/decidim/cleaner/admin/organization_cleaner_controller.rb
|
40
|
-
- app/controllers/decidim/cleaner/application_controller.rb
|
41
40
|
- app/forms/decidim/cleaner/admin/organization_cleaner_form.rb
|
42
|
-
- app/helpers/decidim/cleaner/application_helper.rb
|
43
41
|
- app/jobs/decidim/cleaner/clean_admin_logs_job.rb
|
44
42
|
- app/jobs/decidim/cleaner/clean_inactive_users_job.rb
|
45
43
|
- app/mailers/decidim/cleaner/inactive_users_mailer.rb
|
46
|
-
- app/models/decidim/cleaner/application_record.rb
|
47
|
-
- app/packs/entrypoints/decidim_cleaner.js
|
48
|
-
- app/packs/images/decidim/cleaner/icon.svg
|
49
|
-
- app/packs/stylesheets/decidim/cleaner/cleaner.scss
|
50
44
|
- app/permissions/decidim/cleaner/admin/permissions.rb
|
51
45
|
- app/views/decidim/cleaner/admin/organization_cleaner/_form.html.erb
|
52
46
|
- app/views/decidim/cleaner/admin/organization_cleaner/edit.html.erb
|
53
47
|
- app/views/decidim/cleaner/inactive_users_mailer/warning_deletion.html.erb
|
54
48
|
- app/views/decidim/cleaner/inactive_users_mailer/warning_inactive.html.erb
|
55
|
-
- config/assets.rb
|
56
49
|
- config/i18n-tasks.yml
|
57
50
|
- config/locales/en.yml
|
58
51
|
- config/locales/fr.yml
|
@@ -62,7 +55,6 @@ files:
|
|
62
55
|
- lib/decidim/cleaner.rb
|
63
56
|
- lib/decidim/cleaner/admin.rb
|
64
57
|
- lib/decidim/cleaner/admin_engine.rb
|
65
|
-
- lib/decidim/cleaner/component.rb
|
66
58
|
- lib/decidim/cleaner/engine.rb
|
67
59
|
- lib/decidim/cleaner/test/factories.rb
|
68
60
|
- lib/decidim/cleaner/version.rb
|
@@ -76,7 +68,7 @@ metadata:
|
|
76
68
|
funding_uri: https://opencollective.com/decidim
|
77
69
|
homepage_uri: https://decidim.org
|
78
70
|
source_code_uri: https://github.com/decidim/decidim
|
79
|
-
post_install_message:
|
71
|
+
post_install_message:
|
80
72
|
rdoc_options: []
|
81
73
|
require_paths:
|
82
74
|
- lib
|
@@ -84,15 +76,15 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
84
76
|
requirements:
|
85
77
|
- - ">="
|
86
78
|
- !ruby/object:Gem::Version
|
87
|
-
version:
|
79
|
+
version: '3.1'
|
88
80
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
89
81
|
requirements:
|
90
82
|
- - ">="
|
91
83
|
- !ruby/object:Gem::Version
|
92
84
|
version: '0'
|
93
85
|
requirements: []
|
94
|
-
rubygems_version: 3.3.
|
95
|
-
signing_key:
|
86
|
+
rubygems_version: 3.3.5
|
87
|
+
signing_key:
|
96
88
|
specification_version: 4
|
97
89
|
summary: A decidim cleaner module
|
98
90
|
test_files: []
|
@@ -1,13 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
module Decidim
|
4
|
-
module Cleaner
|
5
|
-
# This controller is the abstract class from which all other controllers of
|
6
|
-
# this engine inherit.
|
7
|
-
#
|
8
|
-
# Note that it inherits from `Decidim::Components::BaseController`, which
|
9
|
-
# override its layout and provide all kinds of useful methods.
|
10
|
-
class ApplicationController < Decidim::Components::BaseController
|
11
|
-
end
|
12
|
-
end
|
13
|
-
end
|
@@ -1 +0,0 @@
|
|
1
|
-
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 35 35"><path d="M17.5 35A17.5 17.5 0 1 1 35 17.5 17.52 17.52 0 0 1 17.5 35zm0-33.06A15.56 15.56 0 1 0 33.06 17.5 15.57 15.57 0 0 0 17.5 1.94zm9.5 13.7H8a1 1 0 0 1 0-1.94h19a1 1 0 0 1 0 1.94zm0 3.68H8a1 1 0 0 1 0-1.94h19a1 1 0 0 1 0 1.94zM22.26 23H8a1 1 0 0 1 0-1.94h14.26a1 1 0 0 1 0 1.94z"/></svg>
|
@@ -1 +0,0 @@
|
|
1
|
-
/* css for decidim_cleaner */
|
data/config/assets.rb
DELETED
@@ -1,9 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
base_path = File.expand_path("..", __dir__)
|
4
|
-
|
5
|
-
Decidim::Webpacker.register_path("#{base_path}/app/packs")
|
6
|
-
Decidim::Webpacker.register_entrypoints(
|
7
|
-
decidim_cleaner: "#{base_path}/app/packs/entrypoints/decidim_cleaner.js"
|
8
|
-
)
|
9
|
-
Decidim::Webpacker.register_stylesheet_import("stylesheets/decidim/cleaner/cleaner")
|
@@ -1,40 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
require "decidim/components/namer"
|
4
|
-
|
5
|
-
Decidim.register_component(:cleaner) do |component|
|
6
|
-
component.engine = Decidim::Cleaner::Engine
|
7
|
-
component.admin_engine = Decidim::Cleaner::AdminEngine
|
8
|
-
component.icon = "decidim/cleaner/icon.svg"
|
9
|
-
|
10
|
-
# component.on(:before_destroy) do |instance|
|
11
|
-
# # Code executed before removing the component
|
12
|
-
# end
|
13
|
-
|
14
|
-
# These actions permissions can be configured in the admin panel
|
15
|
-
# component.actions = %w()
|
16
|
-
|
17
|
-
# component.settings(:global) do |settings|
|
18
|
-
# # Add your global settings
|
19
|
-
# # Available types: :integer, :boolean
|
20
|
-
# # settings.attribute :vote_limit, type: :integer, default: 0
|
21
|
-
# end
|
22
|
-
|
23
|
-
# component.settings(:step) do |settings|
|
24
|
-
# # Add your settings per step
|
25
|
-
# end
|
26
|
-
|
27
|
-
# component.register_resource(:some_resource) do |resource|
|
28
|
-
# # Register a optional resource that can be references from other resources.
|
29
|
-
# resource.model_class_name = "Decidim::Cleaner::SomeResource"
|
30
|
-
# resource.template = "decidim/cleaner/some_resources/linked_some_resources"
|
31
|
-
# end
|
32
|
-
|
33
|
-
# component.register_stat :some_stat do |context, start_at, end_at|
|
34
|
-
# # Register some stat number to the application
|
35
|
-
# end
|
36
|
-
|
37
|
-
# component.seeds do |participatory_space|
|
38
|
-
# # Add some seeds for this component
|
39
|
-
# end
|
40
|
-
end
|