Commit Graph

16284 Commits

Author SHA1 Message Date
Javi Martín
decc7351f6 Bump mimemagic to version 0.3.6
Mimemagic 0.3.5 and earlier have been yanked due to a licensing issue.
2021-03-24 15:16:00 +01:00
Javi Martín
bb38ce9d1f Merge pull request #4438 from consul/secret_key_base
Comment secret key base on production environments
2021-03-23 19:14:32 +01:00
Javi Martín
3529ee777a Merge pull request #4433 from consul/gitlab_ci
Add experimental Gitlab CI integration
2021-03-23 14:09:42 +01:00
Javi Martín
de746b4004 Add experimental Gitlab CI integration
Based on the configuration recommended by Knapsack PRO [1] and Pronto
[2].

So far there are a few issues:

* Bundled gems don't seem to be cached
* The Ruby version can't be read from .ruby-version and needs to be set
  manually
* Tests are slower than when run on Github Actions or Travis CI
* There seem to be many flaky tests, maybe because tests are slower
  (this might actually help us fixing flaky bugs or performance
  bottlenecks)

An advantage of Gitlab CI is we can access the screenshots taken when a
system test fails.

[1] https://docs.knapsackpro.com/2019/how-to-run-parallel-jobs-for-rspec-tests-on-gitlab-ci-pipeline-and-speed-up-ruby-javascript-testing
[2] https://github.com/prontolabs/pronto/#gitlab-integration
2021-03-23 13:02:41 +01:00
Javi Martín
c161d7b5f6 Comment secret key base on production enviroments
Although our installer automatically generates a secret key base, we
want to avoid any chance of installations who don't use the installer
having an empty secret key base or using the default secret key base we
provide to use on development and test environments.
2021-03-22 20:33:18 +01:00
Javi Martín
7c39eed0ee Merge pull request #4432 from consul/knapsack_forks
Avoid timeouts in Knapsack PRO
2021-03-22 19:23:53 +01:00
Jakub Krzus
ca047b9a52 welcome_not_verified translations in seed are being generated 2021-03-22 17:52:39 +00:00
Jakub Krzus
a50b14a354 welcome_level_two_verified translations in seed are being generated 2021-03-22 17:52:22 +00:00
Jakub Krzus
465725aa90 welcome_level_three_verified translations in seed are being generated 2021-03-22 17:50:05 +00:00
Jakub Krzus
44bec30bf8 privacy translations in seed are being generated 2021-03-22 17:50:05 +00:00
Jakub Krzus
c690635b6c conditions translations in seed are being generated 2021-03-22 17:50:05 +00:00
Jakub Krzus
0c0a97a906 accessibility translations in seed are being generated 2021-03-22 17:50:05 +00:00
Jakub Krzus
2781fbac96 faq translations in seed are being generated 2021-03-22 17:49:36 +00:00
Javi Martín
5bbf1f6857 Merge pull request #4435 from consul/dependabot_config
Remove dependabot config file
2021-03-20 22:48:43 +01:00
Javi Martín
a8d6b9b330 Disable dependabot
Due to a bug in dependabot (see issue 2198 in the
`dependabot/dependabot-core` repository), Dependabot would open pull
requests on every fork, which would be inconvenient.

So we're disabling the updates until this issue is fixed; since we
currently have almost 50 open pull requests, it shouldn't affect us that
much.
2021-03-20 22:36:49 +01:00
Javi Martín
ad638b6a0f Merge pull request #4412 from consul/dependabot/bundler/rails-5.2.4.5
Bump rails from 5.2.4.4 to 5.2.4.5
2021-03-20 20:14:14 +01:00
Javi Martín
cefa015b71 Merge pull request #4312 from consul/dependabot/bundler/redcarpet-3.5.1
[Security] Bump redcarpet from 3.5.0 to 3.5.1
2021-03-20 20:09:20 +01:00
dependabot[bot]
83f23b3ef1 Bump rails from 5.2.4.4 to 5.2.4.5
Bumps [rails](https://github.com/rails/rails) from 5.2.4.4 to 5.2.4.5.
- [Release notes](https://github.com/rails/rails/releases)
- [Commits](https://github.com/rails/rails/compare/v5.2.4.4...v5.2.4.5)

Signed-off-by: dependabot[bot] <support@github.com>
2021-03-20 20:02:02 +01:00
dependabot-preview[bot]
ebdd889a5d [Security] Bump redcarpet from 3.5.0 to 3.5.1
Bumps [redcarpet](https://github.com/vmg/redcarpet) from 3.5.0 to 3.5.1. **This update includes a security fix.**
- [Release notes](https://github.com/vmg/redcarpet/releases)
- [Changelog](https://github.com/vmg/redcarpet/blob/master/CHANGELOG.md)
- [Commits](https://github.com/vmg/redcarpet/compare/v3.5.0...v3.5.1)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2021-03-20 18:56:01 +00:00
Javi Martín
416b474122 Avoid timeouts in knapsack PRO
The way it's recommended since knapsack_pro version 2.3.0 [1].

[1] https://github.com/KnapsackPro/knapsack_pro-ruby/blob/master/CHANGELOG.md#230
2021-03-20 19:20:46 +01:00
Javi Martín
bb75c03ae0 Remove unneeded line loading knapsack pro tasks
This line isn't needed since knapsack_pro version 0.46.0 [1].

[1] https://github.com/KnapsackPro/knapsack_pro-ruby/blob/master/CHANGELOG.md#0460
2021-03-20 19:11:57 +01:00
Javi Martín
c1cdcf25ba Merge pull request #4257 from consul/dependabot/bundler/pg_search-2.3.5
Bump pg_search from 2.3.4 to 2.3.5
2021-03-20 19:11:03 +01:00
dependabot-preview[bot]
bd39e3ce4a Bump pg_search from 2.3.4 to 2.3.5
Bumps [pg_search](https://github.com/Casecommons/pg_search) from 2.3.4 to 2.3.5.
- [Release notes](https://github.com/Casecommons/pg_search/releases)
- [Changelog](https://github.com/Casecommons/pg_search/blob/master/CHANGELOG.md)
- [Commits](https://github.com/Casecommons/pg_search/compare/v2.3.4...v2.3.5)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2021-03-20 15:36:11 +00:00
Javi Martín
3fcdfddf0d Merge pull request #4406 from consul/dependabot/add-v2-config-file
Create Dependabot config file
2021-03-20 16:07:36 +01:00
dependabot-preview[bot]
f6bddcb32b Create Dependabot config file 2021-03-20 14:52:16 +00:00
Javi Martín
5194fae65f Merge pull request #4392 from consul/dependabot/bundler/nokogiri-1.11.2
[Security] Bump nokogiri from 1.10.10 to 1.11.2
2021-03-20 15:29:47 +01:00
dependabot-preview[bot]
fc87a111d2 [Security] Bump nokogiri from 1.10.10 to 1.11.2
Bumps [nokogiri](https://github.com/sparklemotion/nokogiri) from 1.10.10 to 1.11.2. **This update includes security fixes.**
- [Release notes](https://github.com/sparklemotion/nokogiri/releases)
- [Changelog](https://github.com/sparklemotion/nokogiri/blob/main/CHANGELOG.md)
- [Commits](https://github.com/sparklemotion/nokogiri/compare/v1.10.10...v1.11.2)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2021-03-20 01:32:41 +00:00
Javi Martín
06f07758f1 Merge pull request #4397 from consul/unify_budgets
Unify budget landing pages
2021-03-19 18:17:51 +01:00
Javi Martín
644557a094 Remove redundant code to set ballot referer
We were setting it twice: once inside the action and once after the
action.
2021-03-19 15:08:33 +01:00
Javi Martín
2552330fe0 Fix "go back" link in ballot page
Since the `@ballot_referer` variable was only set in the lines
controller, it didn't work when we accessed the ballot page without
adding a line.

Note it still doesn't work if we access the ballot page directly by
entering the URL in the browser's address bar.
2021-03-19 15:08:33 +01:00
Javi Martín
135e154fe3 Fix "go back" link in budget group and investments
Even if we usually only access these pages for the current budget, that
might not always be the case, and now that we've unified budget landing
pages, there's no point in them pointing to the index anymore.
2021-03-19 15:08:33 +01:00
decabeza
05e3584430 Adjust groups and headings styles 2021-03-19 15:08:33 +01:00
decabeza
f3c7b59658 Fix heading tag hierarchy on budgets index 2021-03-18 15:03:22 +01:00
Julian Herrero
7e3dd47d5a Unify budget landing pages
There was a big difference between the current budget and a specific
budget landing page. This didn't really make too much sense. Also, it
was not possible to know how a draft participatory budget will look
before it was published.

By unifying those two views now they will look quite similar and it
will be possible for administrators to preview any draft budget and to
know how the budget will look like before actually publishing it.
2021-03-18 15:03:21 +01:00
Javi Martín
6cfb862553 Remove unneeded turbolinks: false link parameter
It was added because a test failed without turbolinks. However, writing
the test so it doesn't update the database at the same time the browser
is doing a request also solves the problem and makes the test more
robust.
2021-03-18 14:06:47 +01:00
Julian Herrero
f936c992e2 Extract footer for budgets to a component 2021-03-18 14:06:46 +01:00
decabeza
bbb4e04c7c Extract budget investment's info to a component 2021-03-18 13:59:09 +01:00
Javi Martín
4c23f639be Use heading name as link text
Using the name instead of using the name and the price is IMHO more
consistent with the rest of the application, particularly for screen
reader users. Writing texts clicking those links is also easier.

I think the main reason why we used the price as part of the link was so
the clickable area was bigger. We can accomplish the same result with
CSS.
2021-03-18 13:59:09 +01:00
Javi Martín
f1b707f549 Simplify styling headings with the same height
Using flex we don't have to rely on JavaScript to equalize the item.
Besides, we've had problems with JavaScript in the past.

We're also adjusting the width of the elements; previously, even though
we defined a width of 16.666% for each element, only five elements would
be on the same row. It happenend because these elements were styled with
inline-block and the generated HTML contained a newline character
between <li> tags, meaning a space character was introduced between
elements. The width of the mentioned space character wasn't being taken
into account when calculating the width.

Using flex, there's no space character between items and we have to
define the margin between them. We're taking this margin into account
when calculating the width.
2021-03-18 13:59:09 +01:00
Julian Herrero
16c582f282 Extract component for budget groups and headings 2021-03-18 13:59:09 +01:00
Javi Martín
45135bb87e Merge pull request #4396 from consul/investment_filters
Add filters on budget investments index page
2021-03-17 18:05:11 +01:00
decabeza
8e814557bc Remove heading name on unfeasible list
The heading name is already present on the main heading of the page.
2021-03-17 13:44:02 +01:00
Javi Martín
3509b99ce4 Use different filters on different budget phases
We use the same criteria we use when deciding the default filter.
2021-03-17 13:44:02 +01:00
decabeza
04605d5d5b Add filters on budget investments index page
Now it's easier to change the investments filter. Previously we had to
go back to the budget index page, change the filter there, and then
select one heading.

Now the links to change the current filter in the budget index page
aren't needed anymore.
2021-03-17 13:44:01 +01:00
taitus
485d3f8dea Allow display the budgets created in dev seeds
Since this PR (Refactor participatory budgets in draft mode #4369) budgets
have a new field "published" to manage whether they  are displayed or not. We
update this field in dev_seeds to be able to display budgets on the public page
budgets.
2021-03-17 08:51:58 +01:00
Javi Martín
f5c1cfbf8c Fix group investments filters links
They were pointing to the budget page instead of the budget group page,
which made navigation weird.
2021-03-15 18:14:46 +01:00
Javi Martín
12da0f5293 Remove unused partial
It isn't used since commit 5f7269a07 and it wouldn't work if we used it
because we don't use `params[:unfeasible]` anymore.
2021-03-15 17:42:15 +01:00
Javi Martín
c322b2c4a2 Remove unused investments filter
We weren't using the "Feasible" filter anywhere in the
application, and it's hard for users to know the difference between
"Feasible" and "Not unfeasible".
2021-03-15 15:19:18 +01:00
Julian Herrero
5d38e4702f Adjust default budget filter
Apart from 'balloting', there are more phases between
'publishing_prices' and 'finished'. So, it doesn't make sense that the
filter 'selected' is only applied to those two. With this change the
filter will be applied as follow:

'not_unfeasible' for phases:
- informing
- accepting
- reviewing
- selecting
- valuating

selected for phases:
- publishing_prices
- balloting
- reviewing_ballots

winners for phases:
- finished
2021-03-15 15:19:18 +01:00
Javi Martín
6bd20ef5ff Extract concern to handle investments filters
We were defining the same filters in three different controllers. We
were also adding a method in the ApplicationController which only made
sense in the same three controllers.
2021-03-15 13:31:28 +01:00