Commit Graph

20144 Commits

Author SHA1 Message Date
Javi Martín
5a9b378a29 Merge pull request #4885 from consul/allow_symbols_in_annotation_ranges
Allow symbols in YAML columns
2022-08-23 14:19:34 +02:00
Javi Martín
f2613aa5ae Allow symbols in YAML columns
Without this change, we were getting errors when manually creating an
annotation using symbols in the ranges hash (that is, `ranges: [{ start:
"/p[1] }]` instead of `ranges: [{ "start" => "/p[1] }]`.

Using symbols isn't really supported and it might cause strange issues
with code like: `@draft_version.annotations.find_by(range_start: ...)`.
However, this might be an extreme case and using symbols might work
properly most of the time (if not all the time), and we've been using
them in our demo for years.

So I'm not writing a test for this case because I'm not sure we should
support it, but I'm still allowing symbols so we don't get exceptions in
cases where everything might be working fine. Rails already adds Symbol
by default to column permitted classes [1], so it's safe to enable it.

[1] https://github.com/rails/rails/pull/45584/commits/c2b96e3e8
2022-08-23 12:09:06 +02:00
Sebastia
c33aa1d62c Merge pull request #4839 from consul/comments_count_investment
Add comments count on budget investments
2022-08-22 18:52:06 +02:00
Senén Rodero
82d6d8c027 Merge pull request #4906 from consul/update_ubuntu_image
Use the latest Ubuntu image to run tests and coveralls
2022-08-22 18:04:01 +02:00
Senén Rodero Rodríguez
33d288f230 Use the latest available Ubuntu image to run tests
It is the Ubuntu 20.04 version at the time of writing.

Github Actions has deprecated the 18.04 we were using.
2022-08-22 17:10:33 +02:00
Javi Martín
e6cf37d31d Merge pull request #4876 from consul/hide_comments
Close comments when the allegations phase is closed
2022-08-19 18:30:28 +02:00
decabeza
5b97e85dd7 Hide comments when allegations phase is closed
Co-Authored-By: Julian Nicolas Herrero <microweb10@gmail.com>
Co-Authored-By: Javi Martín <javim@elretirao.net>
2022-08-19 18:12:49 +02:00
Javi Martín
711e6c16eb Load annotations through the draft version
We were ignoring the draft version param when loading an annotation,
which could result in a strange situation where we load an annotation
and a draft version different than the one it belongs to.

Thanks to this change, we can simplify the code a little bit. IMHO the
`comments` and `new_comment` routes should have been added on member
instead of on collection, which would further simplify the code. I'm
leaving the routes untouched just in case changing the URL has side
effects on existing installations.
2022-08-19 17:40:50 +02:00
Javi Martín
f8fdb77a8a Merge pull request #4864 from consul/unsubscribe_emails
Add helpers for mailer footer styles
2022-08-19 17:18:35 +02:00
taitus
9f90125fa7 Add attribute anchor to link
Anchor needs to be added to the link to redirect directly to the comments section.
2022-08-19 15:40:51 +02:00
taitus
af00dd94db Unify the order in which we display information
In the rest of the similar sections of the application we show the date first
and then the information of the comments.
2022-08-19 15:40:51 +02:00
taitus
34d9d95cf0 Add missing file extension for investment detail partial
Change the file extension from .erb to .html.erb so that it is the same as
the other files.
2022-08-19 15:40:51 +02:00
taitus
2865ee286f Add comments count component
Remove all the translations that are left over after having unified them
in the component.
2022-08-19 15:40:51 +02:00
taitus
aec317e5e6 Unify annotations comment icon to new structure
Apply new structure in the section that shows the comments icon together
with the number of comments so that it is easier to unify them into one
component.

Please note that we updated the comment-number class to comments-count
in order to simplify the css in the new component in the next commit.
2022-08-19 15:40:50 +02:00
taitus
e6f2c5474d Unify comment icon on legislation summaries
This was the only place in the application where the comments icon was
included without the span with the class "icon-comments".

We unified with the rest of the application and removed the
"comments-count" class which is no longer needed.
2022-08-19 14:25:58 +02:00
taitus
0ca17c6fae Unify comment icon on legislation questions
Remove unnecessary span class "debate-comments".

We take advantage of this commit to also unify the format of the date
that appears next to the comments with the rest of the application. The
format that we removed is being used on the same page in the
"Participation phases" tab (I guess that was the reason for putting it
the same) but I think it makes more sense to use the date format that is
used in this kind section in the rest of the application.
2022-08-19 14:25:34 +02:00
taitus
3deba3b189 Unify comment icon on legislation annotation index
Apply new structure in the section that shows the comments icon together
with the number of comments so that it is easier to unify them into one
component.

In this case we make only the text clickable and not the icon as in the
rest of the application. We're keeping the color and text-decoration so
it looks the same way it has looked until now, but we might change it
in the future.
2022-08-19 14:25:34 +02:00
taitus
a32e249919 Remove &nbsp; after icon-comments
At some other time we will try to remove all the &nbsp;

For now we start with what we added after the comments icon.
2022-08-19 14:25:30 +02:00
Javi Martín
6f060d46d0 Merge pull request #4833 from consul/admin_images
Add more images to admin site customization
2022-08-17 14:12:25 +02:00
decabeza
10cd182774 Add more images to admin site customization 2022-08-17 13:51:13 +02:00
Javi Martín
11bed74678 Extract constant to configure valid mime types
This way it'll be possible to overwrite the valid mime types in a custom
model.
2022-08-17 12:56:55 +02:00
Javi Martín
00ea1bf719 Fix customization of budget_execution_no_image
We forgot to change the line rendering the image in commits 3574bf867c
and 810bdae37a, and so the custom image was being ignored.

Note that, in the test, we're stubbing a constant instead of adding a
new image. The main reason is that, if we add a new image, forks would
have to change the image when they change the `VALID_IMAGES` constant;
otherwise the tests would fail.
2022-08-17 12:53:00 +02:00
decabeza
f63609a798 Add helpers for mailer footer styles 2022-08-04 17:16:05 +02:00
Javi Martín
f388e1f288 Merge pull request #4855 from turrisxyz/Pinned-Dependencies-GitHub
chore: Set permissions for GitHub actions
2022-08-03 22:15:27 +02:00
Javi Martín
f0ab7bcfcc Move executions image partial to a component
This way it'll be easier to write tests for it. We also get rid of
another helper file :).
2022-08-03 17:01:57 +02:00
Javi Martín
4d674bf643 Remove duplication in dashboard layout head
Apparently the dashboard branch wasn't updated after we extracted a
common head for all layouts in commit 6e4f697ce, so when said branch was
merged we reintroduced the duplication. Furthermore, we forgot to add to
the dashboard layout the changes we were applying to the common head
partial.
2022-08-03 17:01:21 +02:00
decabeza
52e65ba031 Add comments count on budget investments 2022-08-02 13:40:48 +02:00
Javi Martín
567182fcf2 Merge pull request #4877 from consul/remove_jquery_1.11
Use jQuery 3.5.1 in Annotator
2022-08-01 18:50:54 +02:00
Javi Martín
fa1ce54d85 Use jQuery 3.5.1 in Annotator
The Annotator library included all the dependencies it had at the moment
it was released, and so it was using jQuery 1.11.2 instead of the
version we use in the rest of the application.

Since including jQuery 1.11.2 raises a few warnings, we're removing it
so Annotator uses the same version of jQuery that is used in the rest of
the application.

We expected we needed to change some code in order to make it compatible
with jQuery 3.x. So far, everything seems to work fine, but we might
face errors in the future due to this change.
2022-08-01 15:48:23 +02:00
Javi Martín
eb39e8e365 Merge pull request #4883 from consul/bump_rails_to_5.2.8.1
Bump rails from 5.2.7.1 to 5.2.8.1
2022-08-01 15:35:44 +02:00
Javi Martín
241dd53411 Bump rails from 5.2.7.1 to 5.2.8.1
This release introduces an incompatibility in order to fix a security
issue when using YAML for serialization. We use YAML to serialize the
`ranges` column in the `legislation_annotations` table, so we have to
allow the `ActiveSupport::HashWithIndifferentAccess` class in order to
properly read this column.

Ideally we'd use a JSONB column for the ranges (like we do in other
places), but that would require migrating existing data.

Bumps [rails](https://github.com/rails/rails) from 5.2.7.1 to 5.2.8.1.
- [Release notes](https://github.com/rails/rails/releases)
- [Commits](https://github.com/rails/rails/compare/v5.2.7.1...v5.2.8.1)

---
updated-dependencies:
- dependency-name: rails
...
2022-07-26 22:58:43 +02:00
Javi Martín
cbafb97fd7 Merge pull request #4879 from consul/dependabot/bundler/tzinfo-1.2.10
Bump tzinfo from 1.2.9 to 1.2.10
2022-07-26 22:21:39 +02:00
dependabot[bot]
706beb05fa Bump tzinfo from 1.2.9 to 1.2.10
Bumps [tzinfo](https://github.com/tzinfo/tzinfo) from 1.2.9 to 1.2.10.
- [Release notes](https://github.com/tzinfo/tzinfo/releases)
- [Changelog](https://github.com/tzinfo/tzinfo/blob/master/CHANGES.md)
- [Commits](https://github.com/tzinfo/tzinfo/compare/v1.2.9...v1.2.10)

---
updated-dependencies:
- dependency-name: tzinfo
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-07-26 21:48:56 +02:00
Senén Rodero
36404e1686 Merge pull request #4873 from consul/help_page_bug
Remove Processes link on help page when legislation is disabled
2022-07-21 07:26:10 +02:00
Senén Rodero Rodríguez
0ccfac76ad Remove Processes link on help page when legislation is disabled 2022-07-20 20:44:25 +02:00
Javi Martín
8a1b5d5a62 Merge pull request #4875 from consul/unify_environments
Simplify staging/preproduction environment files
2022-07-20 13:31:41 +02:00
Javi Martín
dbc988f3e4 Unify production and staging environment files
We changed the structure of the production environment file in commit
eb36b7e2e, but forgot to do so for staging and preproduction.

We're also changing the comments in the production environment file so
they use double quotes, like we do everywhere else.

After these changes, the staging and production environments are mostly
identical, and we could simply require the production environment
configuration in the `staging.rb` file. We aren't doing so because we've
just done changes affecting the preproduction environment and, since
Consul installations might have customized these files, it might be hard
for them to deal with all these changes at once.
2022-07-19 23:13:42 +02:00
Javi Martín
e7b271fb47 Remove obsolete comment in environment files
We removed the assets initializer in commit 91cd1ce1b.
2022-07-19 23:13:35 +02:00
Javi Martín
7b91adb16f Use the same config for staging and preproduction
We were already doing so by duplicating the code; now we're doing it
explicitly.

This is going to help because we're going to do a few changes in the
environment files, and this way we don't have to do everything twice.

Note that, after we're finished with these changes, the staging and
production environments will be mostly identical and we could simply
require the production environment configuration in the `staging.rb`
file. We aren't doing so because some Consul installations might have
customized these files and it'd be hard for them to deal with all these
changes at once. So, for now, they'll only have to deal with the
possible differences between their staging and preproduction
environments.

Changes to the preproduction environment that won't be applied to the
staging environment can be added like this:

require Rails.root.join("config", "environments", "staging")

Rails.application.configure do
  config.log_level = :warn
end
2022-07-19 23:13:08 +02:00
Sebastia
299ca4cee6 Merge pull request #4852 from consul/release_1.5.0
Release version 1.5.0
2022-07-11 15:01:48 +02:00
taitus
5a2c875115 Release version 1.5.0 2022-07-11 14:43:28 +02:00
Senén Rodero
b8b7056e81 Merge pull request #4866 from consul/i18n_crowdin
Update translations from Crowdin
2022-07-08 10:14:04 +02:00
Javi Martín
a996fbe1d4 Merge pull request #4870 from consul/auto_assign
Assign pull request author automatically
2022-07-07 15:17:30 +02:00
Javi Martín
4ef4a5c0dd Merge pull request #4868 from consul/kanban_repo
Don't run kanban assignment on forks
2022-07-07 14:59:27 +02:00
Javi Martín
4c25b20891 Assign pull request author automatically
We've been doing manually for too long ;).

The reason why we're assigning the author is it makes it easy to filter
pull requests by assignee on our kanban; it isn't so easy (actually,
might be impossible) to filter by author.
2022-07-07 14:43:04 +02:00
Javi Martín
b86c4ec100 Use a better name for the kanban workflow
The word "assign" was ambiguous, because it could have meant we were
assigning the author.

We were also displaying the same name twice.
2022-07-07 14:28:02 +02:00
Javi Martín
5b31e2ab08 Merge pull request #4867 from consul/dependabot/bundler/rails-html-sanitizer-1.4.3
Bump rails-html-sanitizer from 1.3.0 to 1.4.3
2022-07-06 20:29:37 +02:00
dependabot[bot]
4054751bb0 Bump rails-html-sanitizer from 1.3.0 to 1.4.3
Bumps [rails-html-sanitizer](https://github.com/rails/rails-html-sanitizer) from 1.3.0 to 1.4.3.
- [Release notes](https://github.com/rails/rails-html-sanitizer/releases)
- [Changelog](https://github.com/rails/rails-html-sanitizer/blob/master/CHANGELOG.md)
- [Commits](https://github.com/rails/rails-html-sanitizer/compare/v1.3.0...v1.4.3)

---
updated-dependencies:
- dependency-name: rails-html-sanitizer
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-07-06 20:08:09 +02:00
Javi Martín
187e6ee1d6 Don't run kanban assignment on forks
Without this condition, the kanban assignment would be run on every
CONSUL fork and that would result in unpredictable results since they
would try to write on our kanban, and they don't have permission to do
so.

Note that, much to my dismay :D, the code only works if we use single
quotes in the name of the repository owner; it doesn't work if we use
double quotes.
2022-07-06 16:33:54 +02:00
Javi Martín
50857639f9 Merge pull request #4853 from consul/assign_project
Add kanban automation for new pull requests
2022-07-06 15:35:25 +02:00