Commit Graph

16282 Commits

Author SHA1 Message Date
Javi Martín
f9b858a31b Merge pull request #4457 from consul/coveralls
Integrate Coveralls with Github Actions
2021-04-06 18:07:33 +02:00
Javi Martín
63ca6e7b68 Merge pull request #4460 from consul/failure_screeshots
Upload screenshots of failures with GitHub Actions
2021-04-06 17:27:16 +02:00
Javi Martín
8eccc5dca1 Merge pull request #4449 from consul/dependabot/bundler/kramdown-2.3.1
Bump kramdown from 2.3.0 to 2.3.1
2021-04-06 14:38:47 +02:00
Javi Martín
827bc74831 Merge pull request #4440 from consul/sdg-resize-images
Resize SDG goal images
2021-04-03 16:19:04 +02:00
Javi Martín
8868792761 Merge pull request #4401 from consul/budgets_dev_seeds
Publish budgets created in dev seeds
2021-04-03 15:57:53 +02:00
Javi Martín
74089d1feb Add "Go back" link in admin verifications
It isn't very intuitive that this link points to the stats page, but
since it's the only page linking to it and there's no link pointing to
it in the admin navigation, I guess it's better than offering no clue at
all of the current whereabouts.
2021-04-02 20:56:09 +02:00
Javi Martín
5831f190ba Fix "Go back" link in stat graphs
The link appeared twice when visiting stats for a budget's supporting
phase.
2021-04-02 20:56:09 +02:00
Javi Martín
45693e084b Integrate coveralls with github actions
Somehow I thought it worked automatically, but we had to provide the
token.

The configuration is based on Coveralls instructions to run parallel
builds [1].

Alternatively we could use the Coveralls GitHub Action [2] which
slightly simplifies the workflow configuration and removes the
dependency of the coveralls gem. However, it also adds a dependency on
simplecov-lcov and requires configuring it to renerate LCOV files on
each run, so the benefits of using it are not that big.

[1] https://docs.coveralls.io/parallel-build-webhook
[2] https://github.com/coverallsapp/github-action/
2021-04-02 20:33:23 +02:00
Javi Martín
a504921eca Upload screenshots of failures with GitHub Actions 2021-04-02 20:30:20 +02:00
Javi Martín
8711fda270 Merge pull request #4452 from consul/exception_tests
Add missing feature flag to all budget controllers
2021-03-31 19:36:58 +02:00
Javi Martín
b5bc3117ac Add feature flags on budget controllers
Although we had this feature flag in most places, we forgot to add it in
some of the controllers.
2021-03-31 14:53:14 +02:00
Javi Martín
9981202c45 Add missing feature flag detection specs 2021-03-31 14:42:20 +02:00
Javi Martín
02981324ab Move exception tests to controller specs
System tests are used to test the application from the user's point of
view. To test for specific exceptions, particularly regarding
authorization permissions, controller tests fit better.

Another option would be to test the page displayed shows a certain text,
like "Internal server error". I'm choosing controller tests because
they're faster and we're basically testing the same scenario many times
and we've already got a test checking what happens when users access a
page raising an exception.
2021-03-31 14:42:20 +02:00
Javi Martín
abd6a1971f Move redirection test to controller specs
We make the test faster and avoid a strange issue with `current_path` in
JavaScript tests.

We should probably have done this in commit ec1874325.
2021-03-31 14:42:20 +02:00
Javi Martín
81295abd8c Move custom page 404 test to controller specs
So it's similar to the other custom page 404 tests.

Note we're explicitely marking the page as a draft so it's more obvious
what's going on in the test.
2021-03-31 14:42:20 +02:00
Javi Martín
489e012e1b Test 500 Internal server error page in system spec
We were testing what happens when users disable features in the admin
panel, so it makes sense to test what happens from the user's point of
view when trying to access a disabled feature: they see a page with the
test "Internal server error".

Whether we should responde with 500 Internal server error page or a 404
Not Found is up to debate; personally I find the latter more
appropriate.

Code based on the article "Changing Rails consider_all_requests_local in
RSpec fails" [1].

[1] http://atodorov.org/blog/2016/04/27/changing-rails-consider_all_requests_local-in-rspec-fails/
2021-03-31 14:42:20 +02:00
Javi Martín
5ef6c9c2b5 Simplify controller tests requiring admin login
Similar to what we did in commit 3da4ee00b for system tests.
2021-03-31 14:42:20 +02:00
Javi Martín
24caa749e7 Merge pull request #4451 from consul/dates_in_specs
Improve filling in dates in specs
2021-03-31 14:20:27 +02:00
Javi Martín
487f41cd84 Merge pull request #4450 from consul/notification_relative_urls
Fix admin notification with relative URLs
2021-03-31 14:15:30 +02:00
Javi Martín
0c95ababdf Use dates to fill in admin date input fields
Tests are easier to read now. Besides, since we changed the inputs in
the admin section so they don't use jQuery but an HTML date field,
formatting with %d/%m/%Y might not work depending on the browser's
locale.
2021-03-31 14:09:13 +02:00
Javi Martín
24a66f16f2 Close datepicker in tests after filling in dates
Some tests were failing depending on the window resolution due to the
datepicker making it impossible to click the "Filter" button. They were
also failing if using `clear: :backspace` to fill in those fields.

So we're focusing on a different field in order to hide the datepicker
and click the "Filter" button.
2021-03-31 14:09:13 +02:00
Javi Martín
863f70044b Fix test trying to set a wrong date
The line `fill_in "advanced_search_date_max", with: "wrong date"`
doesn't work because the jQuery UI datepicker prevents users from
entering that value.
2021-03-31 14:09:13 +02:00
Javi Martín
52e0d45ff7 Fix filling in dates in advanced search tests
We were filling in dates with times, which is not what users would do.
2021-03-31 14:09:13 +02:00
Javi Martín
d7563be8b3 Fix admin notification with relative URLs
The test was passing because it was using the rack driver, but on real
browsers it wasn't generating the expected URL.
2021-03-31 14:03:26 +02:00
Javi Martín
f33d2cc3b1 Merge pull request #4445 from consul/toggle_buttons
Allow toggling elements with the keyboard
2021-03-31 13:52:41 +02:00
Javi Martín
6ea9383743 Allow toggling elements with the keyboard
Using `<a>` tags with no `href` means these elements cannot be activated
by keyboard users, so we're replacing them with buttons.

In the future we probably want to add more consistency so all toggle
buttons use the same code. We might also add styles depending on the
`aria-expanded` property.
2021-03-31 13:38:38 +02:00
taitus
bfbbda00e3 Add new mixin to render buttons as links 2021-03-31 13:21:10 +02:00
dependabot[bot]
77c9bc5aef Bump kramdown from 2.3.0 to 2.3.1
Bumps [kramdown](https://github.com/gettalong/kramdown) from 2.3.0 to 2.3.1.
- [Release notes](https://github.com/gettalong/kramdown/releases)
- [Changelog](https://github.com/gettalong/kramdown/blob/master/doc/news.page)
- [Commits](https://github.com/gettalong/kramdown/commits)

Signed-off-by: dependabot[bot] <support@github.com>
2021-03-29 16:40:17 +00:00
Javi Martín
f1fcdc62da Merge pull request #4444 from consul/mimemagic
Bump mimemagic to version 0.3.8
2021-03-25 19:01:32 +01:00
taitus
e34f8fcbf2 Bump mimemagic to version 0.3.8 2021-03-25 18:43:38 +01:00
taitus
3796ccc874 Allow search User through email with whitespaces 2021-03-25 10:41:27 +01:00
taitus
15b39f1231 Resize all sdg goal images to 200x200
The objective of this change is to reduce the size of the images to improve the
experience in slow connections, poor coverage situations or data limits so common in
mobile devices.
2021-03-24 16:46:30 +01:00
taitus
4eda906a93 Move current goal images to origal folder
We keep the original images (with a larger size) in case we want to resize them to
another size in the future.
2021-03-24 16:42:20 +01:00
Javi Martín
e371ad1f80 Merge pull request #4404 from consul/budget_styles
Change budgets section styles
2021-03-24 16:08:39 +01:00
decabeza
aabf8493f8 Use brand colors on budgets section 2021-03-24 15:50:26 +01:00
Alberto
048ca61207 Improve styles for budgets voting phase 2021-03-24 15:50:25 +01:00
Alberto
f79edf6ba4 Improve message to submit ballot 2021-03-24 15:48:24 +01:00
Alberto
10eb7f47c8 Use underscores on HTML IDs 2021-03-24 15:48:24 +01:00
Alberto
896fee6e99 Improve icon to remove investment from ballot
Note we're absolutely positioning the link instead of the icon; that way
keyboard users will be able to focus on the icon. Until now, users would
focus on an empty link.

For the same reason, we couldn't use `click_link` with Capybara, since
it would fail to click an empty link. Now we can.

Co-authored-by: Javi Martín <javim@elretirao.net>
2021-03-24 15:48:24 +01:00
Javi Martín
8be7abe5fd Remove obsolete CSS selectors
The `investment-project` and `investment-project-show` classes aren't
used since commit d0b8fef6b.
2021-03-24 15:48:24 +01:00
Javi Martín
fb8c476fb2 Extract component for ballot investment
Using component inheritance we can remove duplication and share the same
view.
2021-03-24 15:48:24 +01:00
decabeza
72a24128a6 Improve upload image and documents buttons 2021-03-24 15:48:24 +01:00
Javi Martín
4bb12c573f Fix invisible text selection on brand text
When an element had a text using the brand color and was a child of an
element with a brand background, the selection was invisible.
2021-03-24 15:48:24 +01:00
Javi Martín
f124828cd8 Fix invisible text selection on brand backgrounds
Since we were defining the selection to have the same text color and
background color as the element they were in, it resulted in the
selection being invisible.

It wasn't that noticeable because we were using this color combination
mainly in links and buttons, and selecting their text is not as common.
But we plan to use the `$brand` color on budget headers as well, and
this issue is more obvious there.

Browsers like Chrome weren't that affected because they automatically
make the selection semi-transparent and so the selected text still had a
slightly different color. In order to prevent this effect when the
selection is white, we're using a 0.99 opacity (in this case Chrome
ignores numbers higher that 0.998).
2021-03-24 15:48:24 +01:00
Javi Martín
e2d540d203 Extract code to define brand background
Setting the color to `$white` or `#fff` while setting the background to
`$brand` is a pattern we were using in many places. Since we're going to
edit it in order to fix the `::selection` behavior, we're defining the
pattern in one place.
2021-03-24 15:48:24 +01:00
Javi Martín
8ec7f0efc0 Remove obsolete styles
These styles are not used since commit db7d57b14.
2021-03-24 15:48:24 +01:00
Javi Martín
c08aa6ade5 Split SCSS mixins in several files
One file was OK when we only had a couple of mixins, but recently we've
been adding quite a few.

We can now avoid a SCSS Lint warning by excluding just the file with the
affected mixin.
2021-03-24 15:48:24 +01:00
Javi Martín
25c55bfd62 Merge pull request #4439 from consul/bump_mimemagic
Bump mimemagic to version 0.3.6
2021-03-24 15:44:04 +01:00
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