decidim 0.30.1 → 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.
Files changed (86) hide show
  1. checksums.yaml +4 -4
  2. data/Rakefile +5 -9
  3. data/decidim-core/lib/decidim/{webpacker → shakapacker}/configuration.rb +4 -4
  4. data/decidim-core/lib/decidim/{webpacker → shakapacker}/runner.rb +3 -3
  5. data/decidim-core/lib/decidim/shakapacker/shakapacker.rb +8 -0
  6. data/decidim-core/lib/decidim/{webpacker → shakapacker}/shakapacker.yml +3 -1
  7. data/decidim-core/lib/decidim/{webpacker → shakapacker}/webpack/custom.js +1 -1
  8. data/decidim.gemspec +1 -1
  9. data/docs/antora.yml +1 -1
  10. data/docs/modules/configure/pages/environment_variables.adoc +184 -35
  11. data/docs/modules/configure/pages/index.adoc +2 -3
  12. data/docs/modules/configure/pages/initializer.adoc +45 -31
  13. data/docs/modules/configure/pages/system.adoc +3 -3
  14. data/docs/modules/customize/assets/images/social-share-modal-default.png +0 -0
  15. data/docs/modules/customize/pages/admin_filters.adoc +2 -2
  16. data/docs/modules/customize/pages/content_security_policy.adoc +1 -1
  17. data/docs/modules/customize/pages/images.adoc +1 -1
  18. data/docs/modules/customize/pages/index.adoc +1 -0
  19. data/docs/modules/customize/pages/javascript.adoc +5 -18
  20. data/docs/modules/customize/pages/localization.adoc +75 -0
  21. data/docs/modules/customize/pages/oauth.adoc +12 -0
  22. data/docs/modules/customize/pages/social_shares.adoc +0 -3
  23. data/docs/modules/customize/pages/styles.adoc +3 -16
  24. data/docs/modules/develop/assets/attachments/grafana/metadecidim-csv.json +1106 -0
  25. data/docs/modules/develop/assets/attachments/grafana/metadecidim-graphql.json +632 -0
  26. data/docs/modules/develop/assets/images/grafana/create_account_confirm.png +0 -0
  27. data/docs/modules/develop/assets/images/grafana/create_account_form.png +0 -0
  28. data/docs/modules/develop/assets/images/grafana/create_account_setup.png +0 -0
  29. data/docs/modules/develop/assets/images/grafana/dashboard_example_csv.png +0 -0
  30. data/docs/modules/develop/assets/images/grafana/dashboard_example_graphql.png +0 -0
  31. data/docs/modules/develop/assets/images/grafana/dashboard_import.png +0 -0
  32. data/docs/modules/develop/assets/images/grafana/dashboard_import_csv.png +0 -0
  33. data/docs/modules/develop/assets/images/grafana/dashboards.png +0 -0
  34. data/docs/modules/develop/assets/images/grafana/homepage.png +0 -0
  35. data/docs/modules/develop/pages/api.adoc +12 -2
  36. data/docs/modules/develop/pages/classes/models.adoc +2 -2
  37. data/docs/modules/develop/pages/commentable.adoc +9 -11
  38. data/docs/modules/develop/pages/components.adoc +10 -10
  39. data/docs/modules/develop/pages/elections.adoc +101 -0
  40. data/docs/modules/develop/pages/fixing_locales.adoc +7 -12
  41. data/docs/modules/develop/pages/grafana.adoc +100 -0
  42. data/docs/modules/develop/pages/likeable.adoc +106 -0
  43. data/docs/modules/develop/pages/machine_translations.adoc +6 -2
  44. data/docs/modules/develop/pages/maintainers/releases.adoc +40 -202
  45. data/docs/modules/develop/pages/maps.adoc +8 -8
  46. data/docs/modules/develop/pages/modules.adoc +1 -1
  47. data/docs/modules/develop/pages/notifications.adoc +27 -56
  48. data/docs/modules/develop/pages/permissions.adoc +19 -19
  49. data/docs/modules/develop/pages/share_tokens.adoc +2 -2
  50. data/docs/modules/develop/pages/taxonomies.adoc +1 -15
  51. data/docs/modules/install/pages/checklist.adoc +2 -1
  52. data/docs/modules/install/pages/index.adoc +7 -12
  53. data/docs/modules/install/pages/manual.adoc +27 -35
  54. data/docs/modules/install/pages/update.adoc +0 -2
  55. data/docs/modules/install/partials/version_matrix.adoc +4 -2
  56. data/docs/modules/services/pages/activestorage.adoc +4 -3
  57. data/docs/modules/services/pages/aitools.adoc +0 -2
  58. data/docs/modules/services/pages/etherpad.adoc +5 -20
  59. data/docs/modules/services/pages/machine_translation.adoc +38 -0
  60. data/docs/modules/services/pages/maps.adoc +8 -66
  61. data/docs/modules/services/pages/pdf.adoc +33 -0
  62. data/docs/modules/services/pages/sms.adoc +6 -7
  63. data/docs/modules/services/pages/social_providers.adoc +1 -1
  64. data/docs/modules/services/pages/timestamp.adoc +47 -0
  65. data/lib/decidim/version.rb +1 -1
  66. data/package-lock.json +2413 -2624
  67. data/package.json +3 -2
  68. data/packages/browserslist-config/package.json +1 -1
  69. data/packages/core/package.json +2 -3
  70. data/packages/dev/package.json +2 -2
  71. data/packages/eslint-config/package.json +1 -1
  72. data/packages/prettier-config/package.json +1 -1
  73. data/packages/stylelint-config/package.json +1 -1
  74. data/packages/webpacker/package.json +3 -2
  75. data/packages/webpacker/src/loaders/decidim-sass-loader.js +18 -11
  76. metadata +68 -54
  77. data/docs/modules/develop/pages/endorsable.adoc +0 -110
  78. data/docs/modules/develop/pages/guide_migrate_webpacker_app.adoc +0 -257
  79. data/docs/modules/develop/pages/guide_migrate_webpacker_module.adoc +0 -132
  80. data/docs/modules/develop/pages/metrics.adoc +0 -123
  81. data/docs/modules/develop/pages/troubleshooting_metrics.adoc +0 -255
  82. /data/decidim-core/lib/decidim/{webpacker → shakapacker}/esbuild.config.js +0 -0
  83. /data/decidim-core/lib/decidim/{webpacker → shakapacker}/postcss.config.js +0 -0
  84. /data/decidim-core/lib/decidim/{webpacker → shakapacker}/tsconfig.json +0 -0
  85. /data/decidim-core/lib/decidim/{webpacker → shakapacker}/webpack/.modernizrrc +0 -0
  86. /data/decidim-core/lib/decidim/{webpacker → shakapacker}/webpack/webpack.config.js +0 -0
@@ -2,187 +2,6 @@
2
2
 
3
3
  In order to release new version you need to be owner of all the gems at RubyGems, ask one of the owners to add you before releasing. Try `gem owner decidim` to find out the owners of the gem. It is worth making sure you are owner of all gems.
4
4
 
5
- Remember to follow the Gitflow branching workflow.
6
-
7
- == Create the stable branch for the release
8
-
9
- . Merge all the https://github.com/decidim/decidim/pulls?q=is%3Apr+is%3Aopen+author%3Adecidim-bot+sort%3Aupdated-desc+base%3Adevelop[Crowdin pull requests created by the user `decidim-bot`], specially the one that is going to be marged against `develop` that should be returned by the provided example search.
10
- . Go to develop with `git checkout develop`
11
- . Create the release branch `git checkout -b release/x.y-stable && git push origin release/x.y-stable`.
12
- . Add the release branch to Crowdin so that any pending translations will generate a PR to this branch. This needs to be done with the generic user `decidim` in the GitHub's Crowdin integration, as this is the user that initially configured the installation and other admins in the Crowdin organization cannot change it. See instructions for this on the "Create the stable branch in Crowdin". Note that after the branch is configured at Crowdin, it takes some time for the synchronization to happen, so be prepared to wait a couple of hours.
13
-
14
- Mark `develop` as the reference to the next release:
15
-
16
- . Go back to develop with `git checkout develop`
17
- . Turn develop into the `dev` branch for the next release:
18
- .. Update `.decidim-version` to the new `dev` development version: `x.y.z.dev`, where `x.y.z` is the new semver number for the next version
19
- .. Run `bin/rake update_versions`, this will update all references to the new version.
20
- .. Run `bin/rake patch_generators`, this will update the Gemfile for the generators to the new version.
21
- .. Run `bin/rake bundle`, this will update all the `Gemfile.lock` files
22
- .. Run `bin/rake webpack`, this will update the JavaScript bundle.
23
- . Update `SECURITY.md` and change the supported version to the new version.
24
- . Update the `CHANGELOG.md`.
25
- At the top you should have an `Unreleased` header and under that the content `Nothing.`. The CHANGELOG is automatically generated for the release branches so do not worry about its actual contents at the `develop` branch.
26
- After that, the header with the current version and link with the same beforementioned sections and a `Previous versions` header at the bottom that links to the previous minor release stable branch.
27
-
28
- [source,markdown]
29
- ----
30
- # Changelog
31
-
32
- ## [Unreleased](https://github.com/decidim/decidim/tree/HEAD)
33
-
34
- Nothing.
35
-
36
- ...
37
-
38
- ## Previous versions
39
-
40
- Please check [0.XX-stable](https://github.com/decidim/decidim/blob/release/0.XX-stable/CHANGELOG.md) for previous changes.
41
- ----
42
-
43
- . Update the `RELEASE_NOTES.md`
44
- You can use the following template for the new `RELEASE_NOTES.md`:
45
-
46
- [source,markdown]
47
- ----
48
- # Release Notes
49
-
50
- ## 1. Upgrade notes
51
-
52
- As usual, we recommend that you have a full backup, of the database, application code and static files.
53
-
54
- To update, follow these steps:
55
-
56
- ### 1.1. Update your Gemfile
57
-
58
- ```ruby
59
- gem "decidim", github: "decidim/decidim"
60
- gem "decidim-dev", github: "decidim/decidim"
61
- ```
62
-
63
- ### 1.2. Run these commands
64
-
65
- ```console
66
- bundle update decidim
67
- bin/rails decidim:upgrade
68
- bin/rails db:migrate
69
- ```
70
-
71
- ### 1.3. Follow the steps and commands detailed in these notes
72
-
73
- ## 2. General notes
74
-
75
- ## 3. One time actions
76
-
77
- These are one time actions that need to be done after the code is updated in the production database.
78
-
79
- ### 3.1. [[TITLE OF THE ACTION]]
80
-
81
- You can read more about this change on PR [\#XXXX](https://github.com/decidim/decidim/pull/XXXX).
82
-
83
- ## 4. Scheduled tasks
84
-
85
- Implementers need to configure these changes it in your scheduler task system in the production server. We give the examples
86
- with `crontab`, although alternatively you could use `whenever` gem or the scheduled jobs of your hosting provider.
87
-
88
- ### 4.1. [[TITLE OF THE TASK]]
89
-
90
- ```bash
91
- 4 0 * * * cd /home/user/decidim_application && RAILS_ENV=production bundle exec rails decidim:TASK
92
- ```
93
-
94
- You can read more about this change on PR [\#XXXX](https://github.com/decidim/decidim/pull/XXXX).
95
-
96
- ## 5. Changes in APIs
97
-
98
- ### 5.1. [[TITLE OF THE CHANGE]]
99
-
100
- In order to [[REASONING (e.g. improve the maintenance of the code base)]] we have changed...
101
-
102
- If you have used code as such:
103
-
104
- ```ruby
105
- # Explain the usage of the API as it was in the previous version
106
- result = 1 + 1 if before
107
- ```
108
-
109
- You need to change it to:
110
-
111
- ```ruby
112
- # Explain the usage of the API as it is in the new version
113
- result = 1 + 1 if after
114
- ```
115
- ----
116
-
117
- . Push the changes `git add . && git commit -m "Bump develop to next release version" && git push origin develop`
118
-
119
- == Create the stable branch in Crowdin
120
-
121
- . You will need to first create the version branch in Crowdin
122
- .. Sign in as manager in Crowdin.
123
- .. Go to the https://translate.decidim.org/project/decidim/content/files[Content tab in the Decidim project]
124
- .. Click on the dropdown of the "New folder" button (top right) and select "New Version Branch"
125
- .. On the modal, add the name of the branch. As it does not allow the slash character in the name ("/") you will need to change it to a dot ("."). So, for instance, "release/0.20-stable" would become "release.0.20-stable". See other releases if in doubt, it should be consistent.
126
- .. After creating the version branch, edit it and change the "Title as it appears to translators" to the name with the slash ("release/0.20-stable")
127
- . Then you will be able to setup the GitHub integration in Crowdin
128
- .. Sign in as user "Decidim" in Crowdin. NOTE: this user is the only one that can do this.
129
- .. Go to the https://translate.decidim.org/project/decidim/apps[Integrations tab in the Decidim project]
130
- .. Click on GitHub
131
- .. Click on the "Edit" button
132
- .. In the "Select Branches for Translation", search the branch. Click on it.
133
- .. Change the "Service Branch Name" to be consistent with the other branches. So, for instance, "release/0.20-stable" would become "chore/l10n/release/0.20-stable".
134
- .. Click on "Save"
135
- .. After a couple of hours, if there are any changes in Crowdin that would involve this branch, you will see the correspondent "Decidim bot" Pull Request in GitHub.
136
-
137
- == Producing the CHANGELOG.md
138
-
139
- Look for the "Bump develop to next release version" commit sha1.
140
- You can do it either visually with `gitk .decidim-version` or by blaming `git blame .decidim-version`.
141
-
142
- Here you have different options to see what happened from one revision to another:
143
-
144
- [source,bash]
145
- ----
146
- git log v0.20.0..v0.20.1 --grep " (#[0-9]\+)" --oneline
147
- git log <SHA>..HEAD --grep " (#[0-9]\+)" --oneline
148
- ----
149
-
150
- Once you have checked the list of changes, it is time to actually generating the changelog.
151
-
152
- [source,bash]
153
- ----
154
- bin/changelog_generator
155
- ----
156
-
157
- In order to generate the changelog, you need to know the SHA hash of the first commit that was not part of the previous release. You can check the commit hash by inspecting the commit log of the `.decidim-version` file as follows when in the correct release branch:
158
-
159
- [source,bash]
160
- ----
161
- git log -1 --format=oneline .decidim-version
162
- ----
163
-
164
- Alternatively, you can find the first commit after the point of time that the two release branches have separated from each other as follows:
165
-
166
- [source,bash]
167
- ----
168
- git log --reverse --pretty=format:"%H" $(git merge-base release/0.XX-stable release/0.YY-stable)..release/0.YY-stable | head -1
169
- ----
170
-
171
- In the above command, replace `0.XX` with the previous release and `0.YY` with the current release you are generating the change log for. This command works only for major releases, not for patch or bugfix releases.
172
-
173
- Running it as is, or passing it the `--help` flag, will render the help section for the script. In order to actually run the script, follow the instructions:
174
-
175
- [source,bash]
176
- ----
177
- bin/changelog_generator <GITHUB_TOKEN> <SHA>
178
- ----
179
-
180
- This command will create a `temporary_changelog.md` in the root of the project, so you can inspect this file and generated changelog.
181
-
182
- If you have some elements in the `Unsorted` section of the output, you can review the PRs individually, fix the title and the tags and rerun the script. Those PRs with the tags fixed will be automatically sorted. Labelling the PRs as they are opened or merged is encouraged to save some time when producing the changelog.
183
-
184
- You can copy-paste the contents of the temporary changelog file to the relevant sections of the Changelog file.
185
-
186
5
  == Release Candidates
187
6
 
188
7
  Release Candidates are the same as beta versions.
@@ -191,17 +10,19 @@ They should be ready to go to production, but publicly released just before in o
191
10
  If this is a *Release Candidate version* release, the steps to follow are:
192
11
 
193
12
  . Merge all the https://github.com/decidim/decidim/pulls?q=is%3Apr+is%3Aopen+author%3Adecidim-bot+sort%3Aupdated-desc[Crowdin pull requests created by the user `decidim-bot`], specially the one that is going to be marged against the release branch `release/x.y-stable` that should be returned by the provided example search (pick the correct pull request for the release from the results).
194
- . Checkout the release stable branch `git checkout release/x.y-stable`.
195
- . Update `.decidim-version` to the new version `x.y.z.rc1`
196
- . Run `bin/rake update_versions`, this will update all references to the new version.
197
- . Run `bin/rake patch_generators`, this will update the Gemfile for the generators to the new version.
198
- . Run `bin/rake bundle`, this will update all the `Gemfile.lock` files
199
- . Run `bin/rake webpack`, this will update the JavaScript bundle.
200
- . Run `bin/rspec`, this will check things like if all the officially supported languages translations are OK.
201
- . Commit all the changes: `git add . && git commit -m "Bump to rcXX version" && git push origin release/x.y-stable`.
202
- . Wait for the tests to finish and check that everything is passing before releasing the version.
203
- NOTE: When you bump the version, the generator tests will fail because the gems and NPM packages have not been actually published yet (as in sent to rubygems/npm). You may see errors such as `No matching version found for @decidim/browserslist-config@~0.xx.y` in the CI logs. This should be fine as long as you have ensured that the generators tests passed in the previous commit.
204
- . Run `git pull && bin/rake release_all`, this will create all the tags, push the commits and tags and release the gems to RubyGems.
13
+ . Go to develop with `git checkout develop`
14
+ . Install the last version of the `decidim-maintainers_toolbox` gem, and run the releaser command. Mind that for this to work you need locally the gh CLI from GitHub.
15
+ [source,bash]
16
+ ----
17
+ gem install decidim-maintainers_toolbox
18
+ decidim-releaser --github-token=(gh auth token) --version-type=rc
19
+ ----
20
+ . This will create the stable branch and also create two Pull Requests:
21
+ .. One for changing the development version on the `develop` branch (with title "Bump develop to next release version (x.y.z)")
22
+ .. Another for creating the the new release in the stable branch with title `Bump to vx.y.z version`. Wait for the tests to finish and check that everything is passing before releasing the version.
23
+ During this process you will have the instructions on how to follow with the process in the command line. One of the tasks is updating Crowdin, you can read more about this in the "Create the stable branch in Crowdin" section of this page.
24
+ . Review, accept and merge the Pull Request.
25
+ . Run `git pull && bin/rake release_all`, this will create all the tags, push the commits and tags and release the gems to RubyGems. Be ready for the One Time Password fill for each of the gems.
205
26
 
206
27
  Usually, at this point, the release branch is deployed to Metadecidim during, at least, one week to validate the stability of the version.
207
28
 
@@ -278,17 +99,16 @@ The process is very similar from releasing a new Decidim version:
278
99
  . Merge all the https://github.com/decidim/decidim/pulls?q=is%3Apr+is%3Aopen+author%3Adecidim-bot+sort%3Aupdated-desc[Crowdin pull requests created by the user `decidim-bot`], specially the one that is going to be marged against the release branch `release/x.y-stable` that should be returned by the provided example search (pick the correct pull request for the release from the results).
279
100
  . Make sure that there are no more PRs to backport. Learn more about xref:develop:backports.adoc[Backports].
280
101
  . Checkout the branch you want to release: `git checkout -b release/x.y-stable`
281
- . Update `.decidim-version` to the new version number.
282
- . Run `bin/rake update_versions`, this will update all references to the new version.
283
- . Run `bin/rake patch_generators`, this will update the Gemfile for the generators to the new version.
284
- . Run `bin/rake bundle`, this will update all the `Gemfile.lock` files
285
- . Run `bin/rake webpack`, this will update the JavaScript bundle.
286
- . Update the `CHANGELOG.md`.
287
- Add the header with the current version and link like `+## [0.20.0](https://github.com/decidim/decidim/tree/v0.20.0)+` and the headers generated by the changelog generator.
288
- . Commit all the changes: `git add . && git commit -m "Prepare VERSION release"`
289
- . Wait for the tests to finish and check that everything is passing before releasing the version.
102
+ . Install the last version of the `decidim-maintainers_toolbox` gem, and run the releaser command. Mind that for this to work you need locally the gh CLI from GitHub.
103
+ [source,bash]
104
+ ----
105
+ gem install decidim-maintainers_toolbox
106
+ decidim-releaser --github-token=(gh auth token) --version-type=patch
107
+ ----
108
+ . This will create a Pull Request for the new release with title `Bump to vx.y.z version`. Wait for the tests to finish and check that everything is passing before releasing the version.
290
109
  NOTE: When you bump the version, the generator tests will fail because the gems and NPM packages have not been actually published yet (as in sent to rubygems/npm). You may see errors such as `No matching version found for @decidim/browserslist-config@~0.xx.y` in the CI logs. This should be fine as long as you have ensured that the generators tests passed in the previous commit.
291
- . Run `git pull && bin/rake release_all`, this will create all the tags, push the commits and tags and release the gems to RubyGems.
110
+ . Review, accept and merge the Pull Request.
111
+ . Run `git pull && bin/rake release_all`, this will create all the tags, push the commits and tags and release the gems to RubyGems. Be ready for the One Time Password fill for each of the gems.
292
112
  . Once all the gems are published:
293
113
  .. Re-run the failed generators tests at the release branch.
294
114
  .. Create a new release at this repository, just go to the https://github.com/decidim/decidim/releases[releases page] and create a new one.
@@ -297,3 +117,21 @@ NOTE: When you bump the version, the generator tests will fail because the gems
297
117
  == Docker images for each release
298
118
 
299
119
  Each release triggers a https://github.com/decidim/decidim/blob/develop/.github/workflows/on_release.yml[GitHub workflow] that rebuilds and publishes the https://github.com/decidim/docker[decidim/docker images] to https://github.com/orgs/decidim/packages[GitHub Container Registry] and https://hub.docker.com/repository/docker/decidim/decidim[Docker Hub].
120
+
121
+ == Create the stable branch in Crowdin
122
+
123
+ . You will need to first create the version branch in Crowdin
124
+ .. Sign in as manager in Crowdin.
125
+ .. Go to the https://translate.decidim.org/project/decidim/content/files[Content tab in the Decidim project]
126
+ .. Click on the dropdown of the "New folder" button (top right) and select "New Version Branch"
127
+ .. On the modal, add the name of the branch. As it does not allow the slash character in the name ("/") you will need to change it to a dot ("."). So, for instance, "release/0.20-stable" would become "release.0.20-stable". See other releases if in doubt, it should be consistent.
128
+ .. After creating the version branch, edit it and change the "Title as it appears to translators" to the name with the slash ("release/0.20-stable")
129
+ . Then you will be able to setup the GitHub integration in Crowdin
130
+ .. Sign in as user "Decidim" in Crowdin. NOTE: this user is the only one that can do this.
131
+ .. Go to the https://translate.decidim.org/project/decidim/apps[Integrations tab in the Decidim project]
132
+ .. Click on GitHub
133
+ .. Click on the "Edit" button
134
+ .. In the "Select Branches for Translation", search the branch. Click on it.
135
+ .. Change the "Service Branch Name" to be consistent with the other branches. So, for instance, "release/0.20-stable" would become "chore/l10n/release/0.20-stable".
136
+ .. Click on "Save"
137
+ .. After a couple of hours, if there are any changes in Crowdin that would involve this branch, you will see the correspondent "Decidim bot" Pull Request in GitHub.
@@ -95,7 +95,7 @@ In order to provide configuration options for the Geocoder gem's lookup, you can
95
95
  ----
96
96
  config.maps = {
97
97
  provider: :your_provider,
98
- api_key: Rails.application.secrets.maps[:api_key],
98
+ api_key: ENV["MAPS_API_KEY"],
99
99
  geocoding: { extra_option: "value", another_option: "value" }
100
100
  }
101
101
  ----
@@ -106,7 +106,7 @@ This would equal to configuring the Geocoder gem with the following code:
106
106
  ----
107
107
  Geocoder.configure(
108
108
  your_provider: {
109
- api_key: Rails.application.secrets.maps[:api_key],
109
+ api_key: ENV["MAPS_API_KEY"],
110
110
  extra_option: "value",
111
111
  another_option: "value"
112
112
  }
@@ -152,8 +152,8 @@ In order to provide configuration options for the geocoding autocompletion, you
152
152
  [source,ruby]
153
153
  ----
154
154
  config.maps = {
155
- provider: :your_provider,
156
- api_key: Rails.application.secrets.maps[:api_key],
155
+ provider: ENV["MAPS_PROVIDER"],
156
+ api_key: ENV["MAPS_API_KEY"],
157
157
  autocomplete: {
158
158
  url: "https://photon.example.org/api/"
159
159
  }
@@ -353,7 +353,7 @@ In order to provide configuration options for the dynamic maps, you can pass the
353
353
  ----
354
354
  config.maps = {
355
355
  provider: :your_provider,
356
- api_key: Rails.application.secrets.maps[:api_key],
356
+ api_key: ENV["MAPS_API_KEY"],
357
357
  dynamic: {
358
358
  tile_layer: {
359
359
  url: "https://tiles.example.org/{z}/{x}/{y}.png?key={apiKey}&{foo}&style={style}",
@@ -376,7 +376,7 @@ This will cause the following options to be available for the builder instance b
376
376
  tile_layer: {
377
377
  url: "https://tiles.example.org/{z}/{x}/{y}.png?key={apiKey}&{foo}&style={style}",
378
378
  configuration: {
379
- api_key: Rails.application.secrets.maps[:api_key],
379
+ api_key: ENV["MAPS_API_KEY"],
380
380
  foo: "bar=baz",
381
381
  style: "bright",
382
382
  attribution: %{
@@ -450,7 +450,7 @@ In order to provide configuration options for the static maps, you can pass them
450
450
  ----
451
451
  config.maps = {
452
452
  provider: :your_provider,
453
- api_key: Rails.application.secrets.maps[:api_key],
453
+ api_key: ENV["MAPS_API_KEY"],
454
454
  static: {
455
455
  url: "https://staticmap.example.org/",
456
456
  foo: "bar",
@@ -485,7 +485,7 @@ If you want to use the dynamic map replacements for the static map images, do no
485
485
  ----
486
486
  config.maps = {
487
487
  provider: :your_provider,
488
- api_key: Rails.application.secrets.maps[:api_key]
488
+ api_key: ENV["MAPS_API_KEY"]
489
489
  # static: { ... } # LEAVE THIS OUT
490
490
  }
491
491
  ----
@@ -102,7 +102,7 @@ the https://github.com/decidim/decidim/network/dependents[dependency graph]. See
102
102
  . Generate logs on Admin panel if admins can operate on it
103
103
  . GraphQL API
104
104
  . Download your data
105
- . Endorsable
105
+ . Likeable
106
106
  . Followable
107
107
  . Embeddable
108
108
  . Notifications
@@ -114,43 +114,43 @@ It is possible to render actions into the notifications area. These actions are
114
114
 
115
115
  In order to add actions to your notification, you need to implement the methods `action_cell`, `action_data` in your event class. The `action_cell` method should return the name of the cell that will be rendered in the notification area. The `action_data` method should return the data that will be passed to the cell.
116
116
 
117
- Currently, there is only one action cell available, `Decidim::Notifications::Actions::ButtonCell`. This cell renders a list of buttons with the text and URL provided in the `action_data`. See the code for the `Decidim::InvitedToGroupEvent` to render actions that allow users to accept or reject a membership invitation to a group:
117
+ Currently, there is only one action cell available, `Decidim::Notifications::Actions::ButtonCell`. This cell renders a list of buttons with the text and URL provided in the `action_data`. See the code for the `Decidim::Proposals::CoauthorInvitedEvent` to render actions that allow users to accept or reject a proposal coauthorship invitation:
118
118
 
119
119
  [source,ruby]
120
120
  ----
121
- # decidim-core/app/events/decidim/invited_to_group_event.rb
121
+ # decidim-proposals/app/events/decidim/proposals/coauthor_invited_event.rb
122
122
 
123
- def membership_id
124
- extra["membership_id"]
123
+ def user_is_coauthor?
124
+ resource.authors.include?(user)
125
125
  end
126
126
 
127
- def invitation
128
- @invitation ||= UserGroupMembership.find_by(user:, id: membership_id, role: "invited")
127
+ def invite_path
128
+ @invite_path ||= EngineRouter.main_proxy(component).proposal_invite_coauthor_path(proposal_id: resource, id: user.id)
129
129
  end
130
130
 
131
131
  def action_cell
132
- "decidim/notification_actions/buttons" if invitation
132
+ "decidim/notification_actions/buttons" unless user_is_coauthor?
133
133
  end
134
134
 
135
135
  def action_data
136
136
  [
137
137
  {
138
- url: url_helpers.group_invite_path(user_group_nickname, membership_id, format: :json),
138
+ i18n_label: "decidim.events.proposals.coauthor_invited.actions.accept",
139
+ url: invite_path,
139
140
  icon: "check-line",
140
- method: "patch",
141
- i18n_label: "decidim.group_invites.accept_invitation"
141
+ method: "patch"
142
142
  },
143
143
  {
144
- url: url_helpers.group_invite_path(user_group_nickname, membership_id, format: :json),
144
+ i18n_label: "decidim.events.proposals.coauthor_invited.actions.decline",
145
+ url: invite_path,
145
146
  icon: "close-circle-line",
146
- method: "delete",
147
- i18n_label: "decidim.group_invites.reject_invitation"
147
+ method: "delete"
148
148
  }
149
149
  ]
150
150
  end
151
151
  ----
152
152
 
153
- The previous code will render a couple of buttons to accept/reject the invitation but only if the UserGroupMembership is not accepted yet.
153
+ The previous code will render a couple of buttons to accept/reject the invitation but only if the user is not coauthor yet.
154
154
 
155
155
  Note that the cell returned is "decidim/notification_actions/buttons", if you want to use a custom cell, you should create it in your application and return it accordingly.
156
156
 
@@ -165,67 +165,38 @@ So, it is advisable for the controller handling the request to respond with a JS
165
165
  }
166
166
  ----
167
167
 
168
- Use standard HTTP status codes to indicate the result of the operation. For an example, see the implementation of the `Decidim::GroupInvitesController` that responds with a JSON object only when requests are made with the `:json` format:
168
+ Use standard HTTP status codes to indicate the result of the operation. For an example, see the implementation of the `Decidim::Proposals::InviteCoauthorsController` that responds with a JSON object only when requests are made with the `:json` format:
169
169
 
170
170
  [source,ruby]
171
171
  ----
172
- # decidim-core/app/controllers/decidim/group_invites_controller.rb
172
+ # decidim-proposals/app/controllers/decidim/proposals/invite_coauthors_controller.rb
173
173
 
174
+ # coauthor accepts invitation
174
175
  def update
175
- enforce_permission_to :accept, :user_group_invitations
176
- AcceptGroupInvitation.call(inviting_user_group, current_user) do
176
+ enforce_permission_to :accept, :proposal_coauthor_invites, { proposal:, coauthor: }
177
+
178
+ AcceptCoauthorship.call(proposal, current_user) do
177
179
  on(:ok) do
178
- respond_to do |format|
179
- format.json do
180
- render json: { message: t("group_invites.accept.success", scope: "decidim") }
181
- end
182
- format.all do
183
- flash[:notice] = t("group_invites.accept.success", scope: "decidim")
184
- redirect_to profile_groups_path(current_user.nickname)
185
- end
186
- end
180
+ render json: { message: I18n.t("update.success", scope: "decidim.proposals.invite_coauthors") }
187
181
  end
188
182
 
189
183
  on(:invalid) do
190
- respond_to do |format|
191
- format.json do
192
- render json: { message: t("group_invites.accept.error", scope: "decidim") }, status: :unprocessable_entity
193
- end
194
- format.all do
195
- flash[:alert] = t("group_invites.accept.error", scope: "decidim")
196
- redirect_to profile_groups_path(current_user.nickname)
197
- end
198
- end
184
+ render json: { message: I18n.t("update.error", scope: "decidim.proposals.invite_coauthors") }, status: :unprocessable_entity
199
185
  end
200
186
  end
201
187
  end
202
188
 
189
+ # coauthor declines invitation
203
190
  def destroy
204
- enforce_permission_to :reject, :user_group_invitations
191
+ enforce_permission_to :decline, :proposal_coauthor_invites, { proposal:, coauthor: }
205
192
 
206
- RejectGroupInvitation.call(inviting_user_group, current_user) do
193
+ RejectCoauthorship.call(proposal, current_user) do
207
194
  on(:ok) do
208
- respond_to do |format|
209
- format.json do
210
- render json: { message: t("group_invites.reject.success", scope: "decidim") }
211
- end
212
- format.all do
213
- flash[:notice] = t("group_invites.reject.success", scope: "decidim")
214
- redirect_to profile_groups_path(current_user.nickname)
215
- end
216
- end
195
+ render json: { message: I18n.t("destroy.success", scope: "decidim.proposals.invite_coauthors") }
217
196
  end
218
197
 
219
198
  on(:invalid) do
220
- respond_to do |format|
221
- format.json do
222
- render json: { message: t("group_invites.reject.error", scope: "decidim") }, status: :unprocessable_entity
223
- end
224
- format.all do
225
- flash[:alert] = t("group_invites.reject.error", scope: "decidim")
226
- redirect_to profile_groups_path(current_user.nickname)
227
- end
228
- end
199
+ render json: { message: I18n.t("destroy.error", scope: "decidim.proposals.invite_coauthors") }, status: :unprocessable_entity
229
200
  end
230
201
  end
231
202
  end
@@ -26,62 +26,62 @@ Permission actions have a scope. It is usually either `:public` or `:admin`, and
26
26
 
27
27
  === Proposals example
28
28
 
29
- We are going to reproduce the steps to add an action (endorse) for a proposal step by step.
29
+ We are going to reproduce the steps to add an action (like) for a proposal step by step.
30
30
 
31
- ==== Configuring a new 'endorse' action
31
+ ==== Configuring a new 'like' action
32
32
 
33
33
  . Edit decidim-proposals/lib/decidim/proposals/component.rb
34
- . Add the new 'endorse' action into the `component.actions` array and save the file:
34
+ . Add the new 'like' action into the `component.actions` array and save the file:
35
35
 
36
36
  [source,ruby]
37
37
  ----
38
- component.actions = %w(endorse vote create)
38
+ component.actions = %w(like vote create)
39
39
  ----
40
40
 
41
- . Translate the action for the corresponding key: `en.decidim.components.proposals.actions.endorse = Endorse`
41
+ . Translate the action for the corresponding key: `en.decidim.components.proposals.actions.like = Like`
42
42
  . Edit `app/permissions/decidim/proposals/permissions.rb` and add the corresponding permission, using `authorized?` method to run the `authorization handler` logic.
43
- . In the endorse proposals controller, enforce that the user has permissions to perform the `endorse` action before actually doing it, using the `enforce_permission_to` method:
43
+ . In the like proposals controller, enforce that the user has permissions to perform the `like` action before actually doing it, using the `enforce_permission_to` method:
44
44
 
45
45
  [source,ruby]
46
46
  ----
47
- enforce_permission_to :endorse, :proposal, proposal: proposal
47
+ enforce_permission_to :like, :proposal, proposal: proposal
48
48
  ----
49
49
 
50
- . In the proposals templates, change regular links and buttons to endorse a proposal with calls to `action_authorized_link_to` and `action_authorized_button_to` helpers.
50
+ . In the proposals templates, change regular links and buttons to like a proposal with calls to `action_authorized_link_to` and `action_authorized_button_to` helpers.
51
51
  . Restart the server to pick up the changes.
52
52
 
53
- ==== Using the new 'endorse' action
53
+ ==== Using the new 'like' action
54
54
 
55
- . Now an admin user should be able to go to a participatory space with a `proposals` component panel and click on its `Permissions` link (the icon with a key). There, an `authorization handler` can be set for the `endorse` action.
55
+ . Now an admin user should be able to go to a participatory space with a `proposals` component panel and click on its `Permissions` link (the icon with a key). There, an `authorization handler` can be set for the `like` action.
56
56
  . Go to a Proposal detail in the front-end
57
- . Try to endorse the current proposal
58
- ** If the user has not granted the selected permission, the 'endorse' button should block the action and allow the user to grant the permission with the selected `authorization handler` logic.
59
- ** If the logger user has already granted the selected permission, the user should be able to perform the endorsement.
57
+ . Try to like the current proposal
58
+ ** If the user has not granted the selected permission, the 'like' button should block the action and allow the user to grant the permission with the selected `authorization handler` logic.
59
+ ** If the logger user has already granted the selected permission, the user should be able to perform the like.
60
60
 
61
61
  ==== Allow to configure the related permissions at resource level
62
62
 
63
63
  Permissions settings could also be set for an specific resources apart from the full component. Actions should also be related to the resource.
64
64
 
65
65
  . Edit decidim-proposals/lib/decidim/proposals/component.rb
66
- . Add the 'endorse' action into the `resource.actions` array for the `proposal` resource definition and save the file:
66
+ . Add the 'like' action into the `resource.actions` array for the `proposal` resource definition and save the file:
67
67
 
68
68
  [source,ruby]
69
69
  ----
70
- resource.actions = %w(endorse vote)
70
+ resource.actions = %w(like vote)
71
71
  ----
72
72
 
73
- . Only if this is the first resource action added, edit the proposals admin templates and use the `resource_permissions_link` helper to link the resource permissions page from each resource in the listing.
73
+ . Only if this is the first resource action added, edit the proposals admin templates and use the `dropdown_resource_permissions_link` helper to link the resource permissions page from each resource in the listing.
74
74
 
75
75
  [source,erb]
76
76
  ----
77
- <%= resource_permissions_link(proposal) %>
77
+ <%= dropdown_resource_permissions_link(proposal) %>
78
78
  ----
79
79
 
80
80
  . In the proposals permission class, pass an extra `resource` named parameter to the calls to the `authorized?` method.
81
81
 
82
82
  [source,ruby]
83
83
  ----
84
- authorized?(:endorse, resource: proposal)
84
+ authorized?(:like, resource: proposal)
85
85
  ----
86
86
 
87
87
  . In the proposals templates, also add the extra `resource` parameter to the `action_authorized_link_to` and `action_authorized_button_to` helpers.
@@ -89,4 +89,4 @@ authorized?(:endorse, resource: proposal)
89
89
 
90
90
  ==== Using permissions at resource level
91
91
 
92
- . Now an admin user should be able to go to a participatory space with a `proposals` component panel and click on its `Permissions` link (the icon with a key). There, an `authorization handler` can be set for the `endorse` action.
92
+ . Now an admin user should be able to go to a participatory space with a `proposals` component panel and click on its `Permissions` link (the icon with a key). There, an `authorization handler` can be set for the `like` action.
@@ -96,7 +96,7 @@ Decidim.menu :admin_assembly_menu do |menu|
96
96
  decidim_admin_assemblies.assembly_share_tokens_path(current_participatory_space),
97
97
  active: is_active_link?(decidim_admin_assemblies.assembly_share_tokens_path(current_participatory_space)),
98
98
  icon_name: "share-line",
99
- if: allowed_to?(:read, :share_tokens, current_participatory_space:)
99
+ if: allowed_to?(:read, :share_token, current_participatory_space:)
100
100
  ...
101
101
  end
102
102
  ----
@@ -128,7 +128,7 @@ For admin controllers:
128
128
 
129
129
  [source,ruby]
130
130
  ----
131
- allow! if permission_action.subject == :share_tokens
131
+ allow! if permission_action.subject == :share_token
132
132
  ----
133
133
 
134
134
  For frontend controllers:
@@ -231,20 +231,6 @@ bin/rails decidim:taxonomies:import_all_plans
231
231
 
232
232
  This command will look for all the plan files in the `tmp/taxonomies` directory
233
233
 
234
- ==== Updating metrics
235
-
236
- Internal metrics can be assigned to a category. However as this table can be very large, it is not included in the import process.
237
- To update the metrics, you can use the `decidim:taxonomies:update_metrics[tmp/taxonomies/example.com_result.json]` rake task. This task will convert the old categorization metrics to the new taxonomy metrics.
238
-
239
- You can also update all the metrics for all organizations at once by running the following command:
240
-
241
- [source,bash]
242
- ----
243
- bin/rails decidim:taxonomies:update_all_metrics
244
- ----
245
-
246
- This command will look for all the result files in the `tmp/taxonomies` directory.
247
-
248
234
  [NOTE]
249
235
  ----
250
236
  **IMPORTANT NOTES**
@@ -473,4 +459,4 @@ For instance, the `decidim_participatory_process_types` section could look like
473
459
  ]
474
460
  }
475
461
  }
476
- ----
462
+ ----
@@ -21,7 +21,8 @@ As a technopolitical project, Decidim needs several things to work. This is a no
21
21
  . Setup *backup* on your server. The most important things to save are the `public/uploads` and the database.
22
22
  . Decide and implement which kind of *xref:customize:authorizations.adoc[Authorization]* you are going to use.
23
23
  . Comply with our License (Affero GPL 3) and *publish your code* to http://github.com[GitHub] or wherever you want.
24
- . Review your *decidim initializer* on your application (config/initializers/decidim.rb).
24
+ . Review your environment variables on the deployment server.
25
+ . Review your *decidim initializer* contents (config/initializers/decidim.rb) - If the file exists.
25
26
  . Configure your xref:services:activejob.adoc[*ActiveJob*] background queue.
26
27
  . Configure your xref:services:activestorage.adoc[*ActiveStorage*] dynamic uploads.
27
28
  . If you want, configure your xref:services:social_providers.adoc[*social providers*] to enable login using external applications.