Commit Graph

11379 Commits

Author SHA1 Message Date
Raúl Fuentes
424535c1ae Add models needed to include images on ckeditor4 2018-09-12 12:35:28 +02:00
Javi Martín
29b9f172f6 Fix test for Portuguese
It fails because we try to follow a link without a Portuguese
translation. In Madrid they use Spanish as fallback, but in consul we
use English as fallback, and so the text in the link is different in
those repos.

A proper solution would be to update the Portuguese locales. However,
since this test is going to be removed in our next backport, I'm just
doing a quick patch.
2018-09-12 10:52:00 +02:00
Marko Lovic
700a60e4d7 Remove :es => :en Globalize fallback
This fallback was added with the following explanation:

  The application default_locale is :es, while most seed data
  is created in English. This means that translatable resources
  might only have English translations. This change is so that,
  when the locale is set to Spanish, the English translations
  are shown instead of empty content.

Instead, we are going to make sure that all seed content for
translatable resources is available in both English and Spanish.
2018-09-11 18:48:28 +02:00
Marko Lovic
d2dd5f2a58 Test Translatable logic with a locale with non-underscored name
In the past there have been issues with the `pt-BR` locale because
it has a hyphen `-` and a uppercase letters.

I am adding the test only to spec/features/translations_spec.rb (which
tests Milestones) for now. We might want to also add it to the other
translatable resource specs in the future (banners, etc.).
2018-09-11 18:48:23 +02:00
Marko Lovic
f2b903e869 Add :es => :en locale fallback for translatable resources
The application default_locale is :es, while most seed data
is created in English. This means that translatable resources
might only have English translations. This change is so that,
when the locale is set to Spanish, the English translations
are shown instead of empty content.
2018-09-11 18:48:19 +02:00
Marko Lovic
c7fcdd9b0e Use standard locale names for Globalize
It turns out it is not necessary to downcase and underscore
locale names to use the globalize-accessor gem. The gem
will automatically underscore the locale name when defining and
calling the accessor methods.
2018-09-11 18:48:14 +02:00
Marko Lovic
6fe7dc22bc Fix translatable field labels to not include locale
Label for field :title should be "Title", not "Title en"
2018-09-11 18:48:09 +02:00
Marko Lovic
ca5f8719a8 Fix helper to merge style option correctly 2018-09-11 18:48:05 +02:00
Marko Lovic
1fb1437886 Fix merging_translatable_field_options helper 2018-09-11 18:48:01 +02:00
Marko Lovic
5ad3bf03cd Nest TranslatableFormBuilder in helper module
To avoid having multiple top-level classes per file
2018-09-11 18:47:57 +02:00
Marko Lovic
e26500179a Add missing blank line between methods 2018-09-11 18:47:52 +02:00
Marko Lovic
38e6c394e7 Change string manipulation to use interpolation for readability 2018-09-11 18:47:48 +02:00
Marko Lovic
b9f3ea2a33 Change variable name to reflect possibility of being array 2018-09-11 18:47:43 +02:00
Marko Lovic
a1567058b6 Fix type of field for Milestone form 2018-09-11 18:47:38 +02:00
Marko Lovic
7b0aa1e104 Extract merge_translatable_field_options helper method 2018-09-11 18:47:34 +02:00
Marko Lovic
61e3b3b406 Incorporate label into translatabel field
Suggested by @javierm so that we can take advantage of certain browser
features that rely on a <label> tag being associated with an <input> tag.
2018-09-11 18:47:28 +02:00
Marko Lovic
3f277c5cdf Avoid duplicating list of locales 2018-09-11 18:46:58 +02:00
Marko Lovic
2cb3e4b111 Extract translatable field logic to FormBuilder 2018-09-11 18:46:50 +02:00
dependabot[bot]
6433e36c31 Bump scss_lint from 0.54.0 to 0.55.0
Bumps [scss_lint](https://github.com/brigade/scss-lint) from 0.54.0 to 0.55.0.
- [Release notes](https://github.com/brigade/scss-lint/releases)
- [Changelog](https://github.com/brigade/scss-lint/blob/master/CHANGELOG.md)
- [Commits](https://github.com/brigade/scss-lint/compare/v0.54.0...v0.55.0)

Signed-off-by: dependabot[bot] <support@dependabot.com>
2018-09-11 05:41:27 +00:00
dependabot[bot]
902e0eac6c Bump unicorn from 5.4.0 to 5.4.1
Bumps [unicorn](https://bogomips.org/unicorn/) from 5.4.0 to 5.4.1.

Signed-off-by: dependabot[bot] <support@dependabot.com>
2018-09-11 05:40:25 +00:00
dependabot[bot]
e9d84b7c95 Bump mdl from 0.4.0 to 0.5.0
Bumps [mdl](https://github.com/mivok/markdownlint) from 0.4.0 to 0.5.0.
- [Release notes](https://github.com/mivok/markdownlint/releases)
- [Changelog](https://github.com/markdownlint/markdownlint/blob/master/CHANGELOG.md)
- [Commits](https://github.com/mivok/markdownlint/compare/v0.4.0...v0.5.0)

Signed-off-by: dependabot[bot] <support@dependabot.com>
2018-09-11 05:38:36 +00:00
Angel Perez
1e1cb660e2 Add missing CommonActions#fill_in_signup_form method
This method allows to fill in CONSUL's signup form without interacting
with other UI elements, useful when using testing locales other than English

Backported from Decide Madrid
2018-09-10 16:05:55 -04:00
Raimond Garcia
dd1691ba8f Merge pull request #2886 from javierm/backport-change-translatable-implementation
[Backport] Change Translatable implementation to accommodate new requirements
2018-09-10 20:10:31 +02:00
Angel Perez
7b95f4c320 Correct typos on nested documentable/imageable 2018-09-10 11:45:48 -04:00
Angel Perez
d86103db5a Disable unnecessary JS usage on comments/topics specs 2018-09-10 11:45:41 -04:00
Angel Perez
19b0c410da Remove JS driver usage for legislation/processes#update scenarios 2018-09-10 11:45:29 -04:00
Angel Perez
84b616256f Fix spec to properly check emails are sent based on current locale 2018-09-10 11:45:13 -04:00
Angel Perez
08755524ef Replace I18n calls with explicit text expectations 2018-09-10 11:44:00 -04:00
Angel Perez
601391954a Refactor tests to interact directly with the UI rather than with the DOM 2018-09-10 11:41:37 -04:00
Angel Perez
fa9da9d573 Usage of let on emails specs to DRY scenarios 2018-09-10 11:41:25 -04:00
Angel Perez
bdda397bf1 Use new RSpec stub syntax to fix deprecation warnings 2018-09-10 11:41:20 -04:00
Angel Perez
ffe421ae69 Replace .all.each with .find_each on admin specs 2018-09-10 11:40:24 -04:00
Angel Perez
b6fe7ca9a7 Replace .all.each with .find_each when seeding the DB 2018-09-10 11:39:38 -04:00
Angel Perez
303b96553a Replace .all.each with .find_each when rendering cards 2018-09-10 11:38:32 -04:00
Angel Perez
24adf4bc49 Improve Rake tasks performance replacing .all.each with .find_each 2018-09-10 11:38:19 -04:00
Marko Lovic
96b798865a Refactor Translatable#translation_params to improve readability
Code by Javier Martín
2018-09-10 17:34:28 +02:00
Marko Lovic
9fdc8a8a35 Avoid checking DB records in feature spec 2018-09-10 17:34:02 +02:00
Marko Lovic
54d0068134 Remove unused code
This method has never been used as far as I've
been able to tell from the git history.
2018-09-10 17:33:50 +02:00
Marko Lovic
3c4f221e04 Change Translatable interface 2018-09-10 17:32:49 +02:00
Marko Lovic
4603a30f95 Change Translatable impl to keep track of enabled locales 2018-09-10 17:18:01 +02:00
Marko Lovic
cb716e07d7 Extract translation helper from translatable form views
So that individual form partials don't depend on the implementation
of how translations are deleted.
2018-09-10 17:17:47 +02:00
Marko Lovic
3aa53449c8 Fix Translatable when field values are changed to blank
If we ignore all params that are blank, there is no way to
"remove" an attribute (i.e. change its value to blank)

On the other hand, we don't want to create new translations
where all fields are empty, so the new code keeps only the
blank fields which belong to existing translations.
2018-09-10 17:16:42 +02:00
Raimond Garcia
4f2ed27f8c Merge pull request #2865 from consul/backport_1585-make_banners_translatable
[Backport] Make banners translatable
2018-09-10 16:41:33 +02:00
dependabot[bot]
216672977a Bump capistrano-rails from 1.3.1 to 1.4.0
Bumps [capistrano-rails](https://github.com/capistrano/rails) from 1.3.1 to 1.4.0.
- [Release notes](https://github.com/capistrano/rails/releases)
- [Changelog](https://github.com/capistrano/rails/blob/master/CHANGELOG.md)
- [Commits](https://github.com/capistrano/rails/compare/v1.3.1...v1.4.0)

Signed-off-by: dependabot[bot] <support@dependabot.com>
2018-09-10 06:43:02 +00:00
dependabot[bot]
1fff25c713 Bump autoprefixer-rails from 8.2.0 to 9.1.4
Bumps [autoprefixer-rails](https://github.com/ai/autoprefixer-rails) from 8.2.0 to 9.1.4.
- [Release notes](https://github.com/ai/autoprefixer-rails/releases)
- [Changelog](https://github.com/ai/autoprefixer-rails/blob/master/CHANGELOG.md)
- [Commits](https://github.com/ai/autoprefixer-rails/compare/8.2.0...9.1.4)

Signed-off-by: dependabot[bot] <support@dependabot.com>
2018-09-10 06:40:11 +00:00
Raimond Garcia
9182e3a4e7 Merge pull request #2818 from wairbut-m2c/rollback-chromedriver-version
Rollback chromedriver version in Docker image
2018-09-07 20:59:03 +02:00
Raimond Garcia
059b445601 Merge pull request #2880 from aitbw/style/rubocop-offenses
Fix Rubocop warnings for Admin controllers
2018-09-07 20:30:08 +02:00
Angel Perez
9029acd440 Fix Rubocop warnings for Admin controllers [ci skip] 2018-09-07 13:59:07 -04:00
Raimond Garcia
778b10d181 Merge pull request #2835 from wairbut-m2c/backport/fix-proposals-menu
Fix navigation menu under Legislation::Proposal show view
2018-09-07 18:44:31 +02:00
Raimond Garcia
94d361a57a Merge pull request #2837 from PierreMesure/update-coffee-rails-to-4-2-2
Upgrade gem coffee-rails to version 4.2.2
2018-09-07 18:42:19 +02:00