decidim 0.23.5 → 0.24.2
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of decidim might be problematic. Click here for more details.
- checksums.yaml +4 -4
- data/Rakefile +1 -0
- data/docs/README.adoc +74 -0
- data/docs/antora.yml +7 -0
- data/docs/modules/configure/pages/environment_variables.adoc +69 -0
- data/docs/modules/configure/pages/index.adoc +16 -0
- data/docs/modules/configure/pages/initializer.adoc +376 -0
- data/docs/modules/customize/assets/images/header-snippet.png +0 -0
- data/docs/modules/customize/assets/images/menu.png +0 -0
- data/docs/modules/customize/assets/images/organization-colors.png +0 -0
- data/docs/modules/customize/pages/authorizations.adoc +22 -0
- data/docs/{customization/code.md → modules/customize/pages/code.adoc} +12 -9
- data/docs/{customization/gemfile.md → modules/customize/pages/gemfile.adoc} +5 -4
- data/docs/modules/customize/pages/images.adoc +7 -0
- data/docs/modules/customize/pages/javascript.adoc +59 -0
- data/docs/modules/customize/pages/menu.adoc +25 -0
- data/docs/modules/customize/pages/oauth.adoc +33 -0
- data/docs/modules/customize/pages/styles.adoc +64 -0
- data/docs/modules/customize/pages/texts.adoc +30 -0
- data/docs/modules/customize/pages/users_registration_mode.adoc +17 -0
- data/docs/{customization/views.md → modules/customize/pages/views.adoc} +13 -13
- data/docs/modules/develop/assets/images/barcelona.png +0 -0
- data/docs/modules/develop/assets/images/helsinki.png +0 -0
- data/docs/modules/develop/assets/images/indices.png +0 -0
- data/docs/{advanced/api.md → modules/develop/pages/api.adoc} +2 -2
- data/docs/{advanced/authorship.md → modules/develop/pages/authorable.adoc} +5 -5
- data/docs/modules/develop/pages/c4_component.adoc +91 -0
- data/docs/modules/develop/pages/c4_container.adoc +42 -0
- data/docs/modules/develop/pages/c4_context.adoc +35 -0
- data/docs/{advanced/components.md → modules/develop/pages/components.adoc} +47 -10
- data/docs/{advanced/content_blocks.md → modules/develop/pages/content_blocks.adoc} +16 -13
- data/docs/{advanced/content_processors.md → modules/develop/pages/content_processors.adoc} +25 -19
- data/docs/modules/develop/pages/data-picker.adoc +85 -0
- data/docs/modules/develop/pages/deploy.adoc +15 -0
- data/docs/modules/develop/pages/docker.adoc +12 -0
- data/docs/{advanced/embeddable.md → modules/develop/pages/embeddable.adoc} +6 -6
- data/docs/{advanced/endorsable.md → modules/develop/pages/endorsable.adoc} +31 -25
- data/docs/{advanced/fixing_locales.md → modules/develop/pages/fixing_locales.adoc} +36 -23
- data/docs/{advanced/followers.md → modules/develop/pages/followable.adoc} +9 -8
- data/docs/modules/develop/pages/guide.adoc +16 -0
- data/docs/modules/develop/pages/guide_architecture.adoc +17 -0
- data/docs/modules/develop/pages/guide_changelog.adoc +8 -0
- data/docs/modules/develop/pages/guide_commands.adoc +86 -0
- data/docs/modules/develop/pages/guide_development_app.adoc +44 -0
- data/docs/modules/develop/pages/guide_development_with_custom_seed_data.adoc +31 -0
- data/docs/modules/develop/pages/guide_development_with_localhost_ssl.adoc +63 -0
- data/docs/modules/develop/pages/guide_example_apps.adoc +59 -0
- data/docs/modules/develop/pages/guide_git_conventions.adoc +75 -0
- data/docs/modules/develop/pages/guide_github_projects.adoc +42 -0
- data/docs/modules/develop/pages/guide_semver.adoc +7 -0
- data/docs/{advanced/how_to_fix_metrics.md → modules/develop/pages/how_to_fix_metrics.adoc} +76 -59
- data/docs/modules/develop/pages/machine_translations.adoc +42 -0
- data/docs/modules/develop/pages/managing_translations_i18n.adoc +24 -0
- data/docs/modules/develop/pages/maps.adoc +499 -0
- data/docs/modules/develop/pages/metrics.adoc +119 -0
- data/docs/{advanced/modules.md → modules/develop/pages/modules.adoc} +16 -6
- data/docs/{advanced/newsletter_templates.md → modules/develop/pages/newsletter_templates.adoc} +12 -10
- data/docs/{advanced/notifications.md → modules/develop/pages/notifications.adoc} +40 -38
- data/docs/{advanced/open-data.md → modules/develop/pages/open-data.adoc} +4 -3
- data/docs/modules/develop/pages/permissions.adoc +92 -0
- data/docs/{advanced/profiling.md → modules/develop/pages/profiling.adoc} +15 -12
- data/docs/modules/develop/pages/releases.adoc +148 -0
- data/docs/modules/develop/pages/reportable.adoc +31 -0
- data/docs/modules/develop/pages/security.adoc +33 -0
- data/docs/{advanced/share_tokens.md → modules/develop/pages/share_tokens.adoc} +18 -14
- data/docs/{advanced/templates.md → modules/develop/pages/templates.adoc} +14 -12
- data/docs/{advanced/testing.md → modules/develop/pages/testing.adoc} +21 -20
- data/docs/{advanced/activity_log.md → modules/develop/pages/traceable.adoc} +31 -26
- data/docs/modules/develop/pages/turbolinks.adoc +7 -0
- data/docs/{advanced/view_hooks.md → modules/develop/pages/view_hooks.adoc} +29 -23
- data/docs/modules/develop/pages/view_models_aka_cells.adoc +105 -0
- data/docs/modules/install/pages/checklist.adoc +39 -0
- data/docs/modules/install/pages/index.adoc +148 -0
- data/docs/{manual-installation.md → modules/install/pages/manual.adoc} +54 -42
- data/docs/modules/install/pages/update.adoc +95 -0
- data/docs/{services/activejob.md → modules/services/pages/activejob.adoc} +3 -3
- data/docs/modules/services/pages/elections_bulletin_board.adoc +52 -0
- data/docs/{services/etherpad.md → modules/services/pages/etherpad.adoc} +15 -12
- data/docs/modules/services/pages/maps.adoc +311 -0
- data/docs/modules/services/pages/smtp.adoc +10 -0
- data/docs/modules/services/pages/social_providers.adoc +122 -0
- data/lib/decidim/gem_manager.rb +5 -5
- data/lib/decidim/version.rb +1 -1
- metadata +135 -98
- data/README.md +0 -157
- data/docs/advanced/add_authorizable_action.md +0 -63
- data/docs/advanced/adding_fixtures_aka_dummy_content.md +0 -9
- data/docs/advanced/data-picker.md +0 -83
- data/docs/advanced/deploy.md +0 -9
- data/docs/advanced/how_to_create_a_module.md +0 -9
- data/docs/advanced/machine_translation_service.md +0 -12
- data/docs/advanced/managing_translations_i18n.md +0 -24
- data/docs/advanced/metrics.md +0 -114
- data/docs/advanced/permissions.md +0 -23
- data/docs/advanced/releases.md +0 -114
- data/docs/advanced/tradeoffs.md +0 -14
- data/docs/advanced/view_models_aka_cells.md +0 -99
- data/docs/checklist.md +0 -55
- data/docs/customization/authorizations.md +0 -5
- data/docs/customization/images.md +0 -7
- data/docs/customization/javascript.md +0 -9
- data/docs/customization/machine_translations.md +0 -30
- data/docs/customization/maps.md +0 -610
- data/docs/customization/oauth.md +0 -50
- data/docs/customization/styles.md +0 -11
- data/docs/customization/texts.md +0 -27
- data/docs/customization/users_registration_mode.md +0 -17
- data/docs/development_guide.md +0 -166
- data/docs/getting_started.md +0 -191
- data/docs/possible_flows_for_proposal.png +0 -0
- data/docs/services/analytics.md +0 -23
- data/docs/services/elections_bulletin_board.md +0 -38
- data/docs/services/maps.md +0 -362
- data/docs/services/social_providers.md +0 -98
@@ -0,0 +1,12 @@
|
|
1
|
+
= Decidim on Docker
|
2
|
+
|
3
|
+
There's an https://github.com/orgs/decidim/packages/container/package/decidim[image available for a default Decidim app], with core modules. It gets updated with each new version release.
|
4
|
+
|
5
|
+
The https://github.com/decidim/docker/blob/master/Dockerfile-deploy[Dockerfile] and https://github.com/decidim/docker/blob/master/docker-compose.yml[a basic docker-compose.yml file] are both available on the https://github.com/decidim/docker[decidim/docker repo], in case you'd like to use them as starting points for your own customized images and deployments.
|
6
|
+
|
7
|
+
Note that the usual requirements for Docker and Rails deployments apply here:
|
8
|
+
|
9
|
+
. A https://docs.docker.com/storage/[persistent volume] is required for file uploads, logs and any changing, persisted data. Docker images are stateless by design, so they can be easily updated, restarted and replicated.
|
10
|
+
. Rails file uploads are handled by https://guides.rubyonrails.org/active_storage_overview.html[Rails' Active Storage]. Their guide will have the ins and outs of configuring file storage on Rails, including delegating it to file storage in the cloud, for example.
|
11
|
+
|
12
|
+
For a more elaborate example of docker compose usage, including setting volumes and SSL, among other things, please see https://github.com/AjuntamentDeSabadell/decidim-sabadell/blob/master/docker-compose.yml[the docker-compose.yml for the Decidim instance deployed for the city of Sabadell], in Catalunya.
|
@@ -1,15 +1,15 @@
|
|
1
|
-
|
1
|
+
= Embeddable
|
2
2
|
|
3
3
|
`Decidim` allows you to share a information box related to some spaces as:
|
4
4
|
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
5
|
+
* *Assemblies*
|
6
|
+
* *Conferences*
|
7
|
+
* *Initiatives*
|
8
|
+
* *Participatory processes*
|
9
9
|
|
10
10
|
or even `Meetings` component in an easy way with the `embeddable` option that offers the platform.
|
11
11
|
|
12
|
-
|
12
|
+
== How to
|
13
13
|
|
14
14
|
All that you have to do, is to enter into whathever space/component you want to share info to, and look for down right part of the page to find embeddable share option.
|
15
15
|
|
@@ -1,6 +1,6 @@
|
|
1
|
-
|
1
|
+
= Endorsable
|
2
2
|
|
3
|
-
|
3
|
+
== Things can be endorsable
|
4
4
|
|
5
5
|
`Endorsable` is a feature to allow participants to promote (reivindicate, etc.) resources in the platform to their followers.
|
6
6
|
|
@@ -8,12 +8,13 @@ When endorsing an element the endorsements counter for this element is increased
|
|
8
8
|
|
9
9
|
Participants can endorse with their own identity or with the identify of the `user_groups` they belong to. Each endorsing identity on its own will increment the endorsements counter by one.
|
10
10
|
|
11
|
-
|
11
|
+
== Data model
|
12
12
|
|
13
13
|
A `decidim_endorsements` table registers each endorsement that each identity gives to each element. This is, one endorsable has many endorsements, and each endorsement belongs to one endorsable.
|
14
14
|
For performance, an endorsable has a counter cache of endorsements.
|
15
15
|
|
16
|
-
|
16
|
+
[source,ascii]
|
17
|
+
----
|
17
18
|
+----------------------+
|
18
19
|
| Decidim::Endorsable |
|
19
20
|
| ((Proposal,...)) | +-------------+
|
@@ -25,47 +26,49 @@ For performance, an endorsable has a counter cache of endorsements.
|
|
25
26
|
| user_group | | +------------------+
|
26
27
|
+--------------------+ +--+Decidim::UserGroup|
|
27
28
|
+------------------+
|
28
|
-
|
29
|
+
----
|
29
30
|
|
30
31
|
Thus, each endorsable must have the endorsements counter cache column.
|
31
32
|
This is an example migration to add the endorsements counter cache column to a resource:
|
32
33
|
|
33
|
-
|
34
|
+
[source,ruby]
|
35
|
+
----
|
34
36
|
class AddEndorsementsCounterCacheToProposals < ActiveRecord::Migration[5.2]
|
35
37
|
def change
|
36
38
|
add_column :decidim_proposals_proposals, :endorsements_count, :integer, null: false, default: 0
|
37
39
|
end
|
38
40
|
end
|
41
|
+
----
|
39
42
|
|
40
|
-
|
41
|
-
|
42
|
-
## Administration Panel
|
43
|
+
== Administration Panel
|
43
44
|
|
44
45
|
It is a good practice to give the opportunity to the admin to switch Endorsements on and off.
|
45
46
|
|
46
47
|
There are two switches that are normally defined in the manifest of the element in the following way (usually this would be at component.rb in a Decidim engine):
|
47
48
|
|
48
|
-
|
49
|
+
[source,ruby]
|
50
|
+
----
|
49
51
|
settings.attribute :endorsements_enabled, type: :boolean, default: true
|
50
52
|
settings.attribute :endorsements_blocked, type: :boolean
|
51
|
-
|
53
|
+
----
|
52
54
|
|
53
|
-
|
54
|
-
|
55
|
+
* `endorsements_enabled`: when enabled endorsement functionality appears in the public views, when disabled, this functionality is hidden.
|
56
|
+
* `endorsements_blocked`: when blocked, the counter of endorsements is visible but no more endorsements can be added or withdrawn, the button is hidden.
|
55
57
|
|
56
|
-
|
58
|
+
== Permissions
|
57
59
|
|
58
60
|
In some cases, it may be interesting to require the user to be verified in order to be able to endorse. To do so, add the endorse action to the component manifest:
|
59
61
|
|
60
|
-
|
62
|
+
[source,ruby]
|
63
|
+
----
|
61
64
|
component.actions = %w(endorse vote create withdraw amend)
|
62
|
-
|
65
|
+
----
|
63
66
|
|
64
67
|
Given that some settings have been defined in the Administration Panel, for the user to have permissions to endorse endorsements should be enabled and not blocked.
|
65
68
|
|
66
|
-
|
69
|
+
== Public view
|
67
70
|
|
68
|
-
|
71
|
+
=== The "Endorse" buttons cell
|
69
72
|
|
70
73
|
It normally appears in the resource detail view (show). At the action card, in right-side of the view.
|
71
74
|
It allows users to endorse with any of their identities, the personal one, and/or their user_groups', if any.
|
@@ -73,13 +76,15 @@ It also shows the current number of endorsements for this resource.
|
|
73
76
|
|
74
77
|
To render this button, `decidim-core` offers the `decidim/endorsement_buttons` cell. It is strongly recommended to use this cell to make new resources endorsable.
|
75
78
|
|
76
|
-
|
79
|
+
[source,ruby]
|
80
|
+
----
|
77
81
|
cell("decidim/endorsement_buttons", resource)
|
78
|
-
|
82
|
+
----
|
79
83
|
|
80
84
|
This cell, renders the endorsements counter and the endorsement button by default. But it has the possibility to be invoked to render elements sepparately.
|
81
85
|
|
82
|
-
|
86
|
+
[source,ruby]
|
87
|
+
----
|
83
88
|
# By default the `show` method is invoked as usual
|
84
89
|
# Renders `render_endorsements_count` and `render_endorsements_button` in a block.
|
85
90
|
cell("decidim/endorsement_buttons", resource)
|
@@ -99,15 +104,16 @@ endorsement_buttons_cell(resource).render_endorsements_count
|
|
99
104
|
|
100
105
|
# Renders a button to perform the endorse action, but only with the personal identity of the user. It does not take into account if the user belongs to any user group.
|
101
106
|
endorsement_buttons_cell(resource).render_user_identity_endorse_button
|
102
|
-
|
107
|
+
----
|
103
108
|
|
104
|
-
|
109
|
+
=== The list of endorsers
|
105
110
|
|
106
111
|
The `Decidim::EndorsersListCell` renders the list of endorsers of a resource. It is usually rendered in the show of the resource, just upside the comments.
|
107
112
|
|
108
|
-
|
113
|
+
[source,ruby]
|
114
|
+
----
|
109
115
|
# to render the list of endorsers, the cell requires the endorsable resource, and the current user
|
110
116
|
cell "decidim/endorsers_list", resource
|
111
117
|
# or using the helper
|
112
118
|
endorsers_list_cell(resource)
|
113
|
-
|
119
|
+
----
|
@@ -1,68 +1,80 @@
|
|
1
|
-
|
1
|
+
= Fixing locales
|
2
2
|
|
3
3
|
Sometimes in production environments you are force to change the locales available for an organization.
|
4
4
|
|
5
5
|
However, this may be delicate, specially if you need to remove them.
|
6
6
|
|
7
|
-
|
7
|
+
== Change the available languages of an organization
|
8
8
|
|
9
|
-
When you create an organization, you choose the available languages for it (through the `/system/` url).
|
9
|
+
When you create an organization, you choose the available languages for it (through the `/system/` url).
|
10
|
+
However, when trying to edit it, the language selector is not available anymore.
|
11
|
+
Here is a way to update that locales manually:
|
10
12
|
|
11
13
|
First, make sure that your initializer file has all the locales you want:
|
12
14
|
|
13
15
|
Edit the file `config/initializers/decidim.rb` and be sure to include all the necessary locales:
|
14
16
|
|
15
|
-
|
17
|
+
[source,ruby]
|
18
|
+
----
|
16
19
|
...
|
17
20
|
# Change these lines to set your preferred locales
|
18
21
|
config.default_locale = :en
|
19
22
|
config.available_locales = [:en, :ca, :es, :fr, :pt]
|
20
23
|
..
|
21
|
-
|
24
|
+
----
|
22
25
|
|
23
26
|
Then you need to access the rails console and update the organization locales manually.
|
24
27
|
|
25
|
-
Access to your rails console and select your organization.
|
28
|
+
Access to your rails console and select your organization.
|
29
|
+
If you have only one organization you can just run the command:
|
26
30
|
|
27
|
-
|
31
|
+
[source,ruby]
|
32
|
+
----
|
28
33
|
o=Decidim::Organization.first
|
29
|
-
|
34
|
+
----
|
30
35
|
|
31
36
|
Check your current locales:
|
32
37
|
|
33
|
-
|
38
|
+
[source,ruby]
|
39
|
+
----
|
34
40
|
o.available_locales
|
35
41
|
=> ["en", "ca", "es"]
|
36
|
-
|
42
|
+
----
|
37
43
|
|
38
44
|
Then add or remove locales and save the organization.
|
39
45
|
|
40
|
-
|
46
|
+
[source,ruby]
|
47
|
+
----
|
41
48
|
o.available_locales += ["fr", "pt"]
|
42
49
|
=> ["en", "ca", "es", "pt", "fr"]
|
43
50
|
o.save!
|
44
|
-
|
51
|
+
----
|
45
52
|
|
46
53
|
If you want to change the default locale:
|
47
54
|
|
48
|
-
|
55
|
+
[source,ruby]
|
56
|
+
----
|
49
57
|
o.default_locale = "fr"
|
50
58
|
o.save!
|
51
|
-
|
59
|
+
----
|
52
60
|
|
53
|
-
|
61
|
+
____
|
62
|
+
If you need to remove locales from an organization read the next section!
|
63
|
+
____
|
54
64
|
|
55
|
-
|
65
|
+
== Fixing errors in locales
|
56
66
|
|
57
|
-
In certain cases (ie.
|
67
|
+
In certain cases (ie.
|
68
|
+
when removing locales from an organization) some operations in Decidim may lead to errors 500 in the browser.
|
58
69
|
|
59
70
|
In order to solve that you can make use of these rake tasks:
|
60
71
|
|
61
|
-
|
72
|
+
=== Synchronize Locales
|
62
73
|
|
63
|
-
|
74
|
+
[source,bash]
|
75
|
+
----
|
64
76
|
bundle exec rake decidim:locales:sync_all
|
65
|
-
|
77
|
+
----
|
66
78
|
|
67
79
|
Run this task if you have changed `available_locales` or `default_locale` in `config/initializers/decidim.rb` and you think that some organization have values not supported by the Decidim installation.
|
68
80
|
|
@@ -73,7 +85,7 @@ Examples:
|
|
73
85
|
|
74
86
|
It is safe to run this task as it respects organizations with less languages than the supported.
|
75
87
|
|
76
|
-
|
88
|
+
=== Repair the search index
|
77
89
|
|
78
90
|
In order to provide a global search in Decidim, many content is indexed in a search table, each locale separately.
|
79
91
|
This means that, if you remove languages, some content can be orphan as the original resource do not exist anymore.
|
@@ -81,8 +93,9 @@ This leads to server 500 errors.
|
|
81
93
|
|
82
94
|
To repair the search index you can run the rake task:
|
83
95
|
|
84
|
-
|
96
|
+
[source,bash]
|
97
|
+
----
|
85
98
|
bundle exec rake decidim:locales:rebuild_search
|
86
|
-
|
99
|
+
----
|
87
100
|
|
88
101
|
Be aware that this might take a long time as it will remove and recreate the whole search index for all organizations.
|
@@ -1,23 +1,25 @@
|
|
1
|
-
|
1
|
+
= Followers
|
2
2
|
|
3
|
-
|
3
|
+
== Create followers from comment authors
|
4
4
|
|
5
5
|
Run the following script to make all comment authors follow the commented resource:
|
6
6
|
|
7
|
-
|
7
|
+
[source,ruby]
|
8
|
+
----
|
8
9
|
Decidim::Comments::Comment.includes(:author, :root_commentable).find_each do |comment|
|
9
10
|
begin
|
10
11
|
Decidim::Follow.create!(followable: comment.root_commentable, user: comment.author)
|
11
12
|
rescue
|
12
13
|
end
|
13
14
|
end; p 1
|
14
|
-
|
15
|
+
----
|
15
16
|
|
16
|
-
|
17
|
+
== Create followers from resource authors
|
17
18
|
|
18
19
|
Run the following script to make all resource authors follow the resource:
|
19
20
|
|
20
|
-
|
21
|
+
[source,ruby]
|
22
|
+
----
|
21
23
|
Decidim.component_manifests.each do |component_manifest|
|
22
24
|
component_manifest.resource_manifests.each do |resource_manifest|
|
23
25
|
klass = resource_manifest.model_class_name.constantize
|
@@ -31,5 +33,4 @@ Decidim.component_manifests.each do |component_manifest|
|
|
31
33
|
end
|
32
34
|
end
|
33
35
|
end; p 1
|
34
|
-
|
35
|
-
|
36
|
+
----
|
@@ -0,0 +1,16 @@
|
|
1
|
+
= Developing Decidim
|
2
|
+
|
3
|
+
* xref:develop:guide_architecture.adoc[Architecture]
|
4
|
+
* xref:develop:guide_changelog.adoc[Changelog]
|
5
|
+
* xref:develop:guide_commands.adoc[Commands]
|
6
|
+
* xref:develop:guide_development_app.adoc[Development App]
|
7
|
+
* xref:develop:guide_example_apps.adoc[Example Applications]
|
8
|
+
* xref:develop:guide_git_conventions.adoc[Git conventions]
|
9
|
+
* xref:develop:guide_github_projects.adoc[GitHub Projects Workflow]
|
10
|
+
* xref:develop:guide_semver.adoc[Semantic Versioning]
|
11
|
+
|
12
|
+
== Good to know
|
13
|
+
|
14
|
+
* There is an application with current designs at: https://decidim-design.herokuapp.com/
|
15
|
+
* We follow https://12factor.net/[12factor recommendations]
|
16
|
+
* For testing, refer to the xref:develop:testing.adoc[testing] guide.
|
@@ -0,0 +1,17 @@
|
|
1
|
+
= Architecture
|
2
|
+
|
3
|
+
For better understanding Decidim, here you have some diagrams based in the https://c4model.com[C4 model].
|
4
|
+
|
5
|
+
TIP: You can read better these images by doing a right click and selecting "View image"
|
6
|
+
|
7
|
+
== System Context diagram
|
8
|
+
|
9
|
+
include::./c4_context.adoc[]
|
10
|
+
|
11
|
+
== Container diagram
|
12
|
+
|
13
|
+
include::./c4_container.adoc[]
|
14
|
+
|
15
|
+
== Component diagram
|
16
|
+
|
17
|
+
include::./c4_component.adoc[]
|
@@ -0,0 +1,8 @@
|
|
1
|
+
= Changelog
|
2
|
+
|
3
|
+
For keeping track of changes we like the rules of https://keepachangelog.com/en/1.0.0/[Keep A Changelog].
|
4
|
+
|
5
|
+
In the past we kept a file for all the development of a given version but that was difficult to maintain, as we had conflicts all the time. See the full discussion in https://github.com/decidim/decidim/issues/5908[#5908]. We decided that:
|
6
|
+
|
7
|
+
* We will not ask CHANGELOG for all the changes make on this repository. We will ask for CHANGELOG instructions only for special changes that really need some actions on part of developers/implementers or something to comunicate on the releases notes
|
8
|
+
* The CHANGELOG will be manually made as part of the release process with the tooling from git (`git log v0.20.0..v0.20.1 --grep " (#[0-9]\+)" --oneline`) or https://github.com/decidim/decidim/compare/v0.20.0...v0.20.1[github]
|
@@ -0,0 +1,86 @@
|
|
1
|
+
= Commands
|
2
|
+
|
3
|
+
Here are some useful commands and tools for working in this project:
|
4
|
+
|
5
|
+
== erb-lint
|
6
|
+
|
7
|
+
We use erblint gem to ensure homogeneous formatting of erb files.
|
8
|
+
|
9
|
+
[source,console]
|
10
|
+
----
|
11
|
+
bundle exec erblint --lint-all --autocorrect
|
12
|
+
# shortest
|
13
|
+
bundle exec erblint --lint-all -a
|
14
|
+
# even shortest
|
15
|
+
bundle exec erblint -la -a
|
16
|
+
----
|
17
|
+
|
18
|
+
== I18n
|
19
|
+
|
20
|
+
We use i18n-tasks gem to keep translations ordered and without missing/unused keys.
|
21
|
+
|
22
|
+
To fix the order of the keys, run:
|
23
|
+
|
24
|
+
[source,console]
|
25
|
+
----
|
26
|
+
# from the root of the project
|
27
|
+
bundle exec i18n-tasks normalize --locales en
|
28
|
+
----
|
29
|
+
|
30
|
+
To list unused i18n keys, run:
|
31
|
+
|
32
|
+
[source,console]
|
33
|
+
----
|
34
|
+
bundle exec i18n-tasks unused --locales en
|
35
|
+
----
|
36
|
+
|
37
|
+
== JavaScript linter
|
38
|
+
|
39
|
+
https://eslint.org/docs/user-guide/command-line-interface[eslint] and https://palantir.github.io/tslint/[tslint] are used to ensure homogeneous formatting of JavaScript code.
|
40
|
+
|
41
|
+
To lint and try to fix linting errors, run:
|
42
|
+
|
43
|
+
[source,console]
|
44
|
+
----
|
45
|
+
npm run lint --fix
|
46
|
+
----
|
47
|
+
|
48
|
+
== Stylelinter
|
49
|
+
|
50
|
+
https://stylelint.io/[stylelint] is a CSS linter and fixer that helps to avoid errors and enforce consistent conventions in the stylesheets. Is an npm package, install it using:
|
51
|
+
|
52
|
+
[source,console]
|
53
|
+
----
|
54
|
+
npm install -g stylelint
|
55
|
+
----
|
56
|
+
|
57
|
+
Linting a `.scss` file:
|
58
|
+
|
59
|
+
[source,console]
|
60
|
+
----
|
61
|
+
stylelint [path-to-file]
|
62
|
+
----
|
63
|
+
|
64
|
+
With `--fix` option https://stylelint.io/user-guide/cli/#autofixing-errors[stylelint] will fix as many errors as possible. The fixes are made to the actual source files. All unfixed errors will be reported.
|
65
|
+
|
66
|
+
[source,console]
|
67
|
+
----
|
68
|
+
stylelint [path-to-file] --fix
|
69
|
+
----
|
70
|
+
|
71
|
+
== Rubocop
|
72
|
+
|
73
|
+
RuboCop is a code analyzer tool we use at Decidim to enforce our code formatting guidelines.
|
74
|
+
|
75
|
+
[source,console]
|
76
|
+
----
|
77
|
+
# Run Rubocop
|
78
|
+
bundle exec rubocop
|
79
|
+
# Run Rubocop and automatically correct offenses
|
80
|
+
bundle exec rubocop -a
|
81
|
+
----
|
82
|
+
|
83
|
+
== Markdown linter
|
84
|
+
|
85
|
+
This project uses https://github.com/markdownlint/markdownlint[markdownlint] to check markdown files and flag style issues.
|
86
|
+
|