Commit Graph

11202 Commits

Author SHA1 Message Date
Raimond Garcia
eb435930db Merge pull request #2888 from wairbut-m2c/backport/test-suite-maintenance
[Backport] Test suite maintenance
2018-09-17 19:06:07 +02:00
Raimond Garcia
0b7eb35b22 Merge pull request #2896 from javierm/backport-refactor-translatable-shared-code
[Backport] Refactor code shared by admin-translatable resources
2018-09-17 18:26:55 +02:00
Raimond Garcia
b6602348e2 Merge pull request #2852 from tiagozini/fix-issue-2848
Fix bug in facebook share link
2018-09-17 18:23:29 +02:00
Raimond Garcia
12755b6446 Merge pull request #2900 from consul/smtp-configuration
Add placeholder configuration for SMTP
2018-09-14 18:13:41 +02:00
Papaya Labs
357b3406ed Hide Featured section on Home Page if there are no cards 2018-09-13 15:33:24 -05:00
voodoorai2000
2892d0e1d5 Add placeholder configuration for SMTP 2018-09-13 20:38:42 +02:00
Javi Martín
f2bebca6be Bring back and fix deleted test
It was removed in 755be96 because some tags were allowed, but we can
just update it to check it doesn't remove those tags.
2018-09-12 12:35:28 +02:00
Javi Martín
9cfa07ff1d Remove unrelated schema changes 2018-09-12 12:35:28 +02:00
Javi Martín
f917f5eed9 Filter image tags everywhere except in custom pages
Allowing image tags everywhere makes us vulnerable to CSRF attacks.
2018-09-12 12:35:28 +02:00
Javi Martín
5faeefab2c Show the image button only if editing admin pages
That's the only place where we need to attach images so far.
2018-09-12 12:35:28 +02:00
Javi Martín
43e83889ff Simplify CKEditor authorization
We can use the `config.authorize_with` option, so we don't need to copy
the controller in order to load and authorize resource.

Besides, only administrators can upload images, so we don't need to
track the image's user id.
2018-09-12 12:35:28 +02:00
Javi Martín
7347874f4b Remove inaccurate comment
It was automatically added by `rails g ckeditor:install`.
2018-09-12 12:35:28 +02:00
Javi Martín
531750cf6f Restore commented lines
Not sure if they were supposed to be removed. For now I'll assume they
were commented accidentally.
2018-09-12 12:35:28 +02:00
Javi Martín
71ce7acc10 Restore deleted CKEditor config
Just so we can navigate throught git history faster:

* Introduced in 345e34d to avoid precompiling all CKEditor assets.
* Modified in 54c82a5 to avoid compiling assets during tests.
* Overwritten by `rails g ckeditor:install` in c0d6c0b.
2018-09-12 12:35:28 +02:00
Javi Martín
27155dd7d7 Fix typo 2018-09-12 12:35:28 +02:00
Javi Martín
9705360d98 Enable only a few headings in CKEditor
Allowing every format is way more than what we initially intended.

I've only added h2 and h3 because h1 is set somewhere else in the page
(like the title), and h4, h5 and h6 are usually not necessary.
2018-09-12 12:35:28 +02:00
Javi Martín
b6855b7140 Restore allowedContent line
We're not sure why it was removed, and we're using server-side
sanitizers to remove dangerous HTML.
2018-09-12 12:35:28 +02:00
Javi Martín
471061f475 Allow only admins to attach CKEditor images
Right now allowing regular users to attach images would make us
vulnerable to CSRF attacks.
2018-09-12 12:35:28 +02:00
Javi Martín
116bdebc96 Don't add CKEditor attachments to version control 2018-09-12 12:35:28 +02:00
Raúl Fuentes
bf0472fd58 Fix test
now the <a> tag is permited, also the list of allowed tags is in
the configuration of ckeditor4
2018-09-12 12:35:28 +02:00
Raúl Fuentes
d574657b77 Fixes for the review made by @javierm
this commit will be merged with the others when the chages
are accepted
2018-09-12 12:35:28 +02:00
Raúl Fuentes
88f0f14eab Modify the configuration of ckeditor 4
add links, headers and images
2018-09-12 12:35:28 +02:00
Raúl Fuentes
8e68f4bbd0 Update abilities for ckeditor4 images
Add the image controller to use the obsolete load_and_authorize_resource
and authorize_resource methods in the gem
2018-09-12 12:35:28 +02:00
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