Commit Graph

14280 Commits

Author SHA1 Message Date
taitus
4068ef29ee Fix hidden budget investments restore feature
Add recursive restore option to restore all soft deleted relations.
2019-06-27 09:19:37 +02:00
Senén Rodero Rodríguez
7c137faf53 Fix broken spec
Use existing I18n translations in broken spec.
2019-06-27 09:19:37 +02:00
taitus
95f848f021 Fix specs after rebase with translations branch
- Fix spec spec/features/management/proposals_spec.rb:24 adding single quotes.
- Remove spec related with 'proposal improvement info link' as master branch.
- Fix proposal rake task (now proposals have translations). We put the 'validate: false' to keep the existing html tags in the  proposal's description. Without the sanitizable module deleting them.
2019-06-27 09:19:37 +02:00
Senén Rodero Rodríguez
4236a3a388 Move label translations to activerecord.yml files
Moved only :es and :en translations from general.yml to activerecord.yml
and use them in related forms.
2019-06-27 09:19:37 +02:00
Senén Rodero Rodríguez
5dc0f7f054 Add :except and :only options to translatable_params method
Allow to choose among resource model translatable attributes.
2019-06-27 09:19:37 +02:00
Senén Rodero Rodríguez
8103a16031 Add proposals translations to dev_seeds
Update proposal development seeds with translations for all avaialble
locales.
2019-06-27 09:19:37 +02:00
Senén Rodero Rodríguez
f70adbe23a Move label translations to activerecord.yml 2019-06-27 09:19:37 +02:00
Senén Rodero Rodríguez
78055555cf Add debates translations to dev_seeds
Update debates development seeds with translations for all avaialble
locales.
2019-06-27 09:19:37 +02:00
Senén Rodero Rodríguez
2079706845 Enable soft deletion of Proposal::Translations 2019-06-27 09:19:37 +02:00
Senén Rodero Rodríguez
fb4d4c6c5a Fix hidden proposals restore feature
Add recursive restore option to restore all soft deleted relations.
2019-06-27 09:19:37 +02:00
Senén Rodero Rodríguez
f572d5b579 Add translations to proposal pg_search_scope
Some Proposal attributes are now translatable so we need to include all
existing translations on pg_search scope.
2019-06-27 09:19:37 +02:00
Senén Rodero Rodríguez
0f4fcfb20e Fix proposals suggest feature
Now we need one suggest placeholder for each translation. This also
fixes invalid usage of id HTML attribute.
2019-06-27 09:19:37 +02:00
Senén Rodero Rodríguez
bd3bb72370 Add proposals translation interface
* Convert proposal form into translatable one.
 * Adapt translatable shared spec to define an owner when running at
   frontend feature specs.
 * Remove old attributes from strong parameters.
2019-06-27 09:19:37 +02:00
Senén Rodero Rodríguez
4ce006ec96 Enable soft deletion of Comment::Translations 2019-06-27 09:19:37 +02:00
Senén Rodero Rodríguez
16b3ec6e5f Rename deprecated attributes from comments
To avoid deprecation warning thrown by Globalize after gem update.
2019-06-27 09:19:37 +02:00
Senén Rodero Rodríguez
158af0217d Add comments translations
Co-Authored-By: Sebastia <sebastia.roig@gmail.com>
2019-06-27 09:19:37 +02:00
Senén Rodero Rodríguez
096a9f6bb8 Enable soft deletion of Debate::Translations 2019-06-27 09:19:36 +02:00
Senén Rodero Rodríguez
03375ae621 Fix debates restore feature
Add recursive restore option to restore all soft deleted relations.
2019-06-27 09:19:36 +02:00
Senén Rodero Rodríguez
ed750f6cce Move private method to a more reusable location
This method will be used by any translatable model that uses pg_search
feature so it's better to have it within globalizable model concern so
all translatable models can use it.
2019-06-27 09:19:36 +02:00
Senén Rodero Rodríguez
036a3d7636 Add translations to debate pg_search_scope
Some Debate attributes are now translatable so we need to include all
existing translations on pg_search scope.
2019-06-27 09:19:36 +02:00
Senén Rodero Rodríguez
6a6080e6b7 Fix debates suggest feature 2019-06-27 09:19:36 +02:00
Senén Rodero Rodríguez
51cda51155 Add debates translation interface
Also fix broken spec after removing translatable attributes from
strong_parameters definition. Now we need to send these attributes
as nested translations attributes.

Use activerecord.yml title attribute label so form helper could load it
from default location.
2019-06-27 09:19:36 +02:00
Senén Rodero Rodríguez
f77e7df33e Fix debate specs
After adding debate translatable fields to forms, they will be generated with nested translations names and ids so we can no longer
use standard id locator.

Using input label text to fill in fields works with both types of forms.
2019-06-27 09:19:36 +02:00
Senén Rodero Rodríguez
b67cd0fe40 Add sanitization shared spec to debate 2019-06-27 09:19:36 +02:00
Senén Rodero Rodríguez
e6c9027042 Rename deprecated fields from debates
To avoid deprecation warning thrown by globalize after gem update.
2019-06-27 09:19:36 +02:00
Senén Rodero Rodríguez
740c738fc5 Add debate translations 2019-06-27 09:19:36 +02:00
Senén Rodero Rodríguez
78c2f54c5d Fix proposal specs
After adding proposal translatable fields to forms, they will be generated with nested translations names and ids so we can no longer
use standard id locator.

Using input label text to fill in fields works with both types of forms.
2019-06-27 09:19:36 +02:00
Senén Rodero Rodríguez
dd310f7507 Add sanitization shared spec to proposal 2019-06-27 09:19:36 +02:00
Senén Rodero Rodríguez
e6b3b85e48 Rename proposal deprecated fields
After adding new translations to proposal we no longer need this
attributes in proposals database table, but we keep them with a
deprecated name until next release where we drop them completely.

Also related column indexes where dropped.
2019-06-27 09:19:36 +02:00
Senén Rodero Rodríguez
02be0c61f9 Add proposal translations
Adapt retire form to include needed translations and move validations
from controller to model.

Also change sanitizable concern to sanitize not marked for destruction
translations.
2019-06-27 09:19:36 +02:00
taitus
5343448c5a Remove deprecated attributes from Budget::Phase
Some fields from Budget::Phase are translatable and we no longer need them. This commit will remove the annoying deprecation warning thrown by Globalize gem after gem version update.
2019-06-27 09:19:36 +02:00
taitus
3b81bf67d1 Remove deprecated attributes from Budget::Heading
Some fields from Budget::Heading are translatable and we no longer need them. This commit will remove the annoying deprecation warning thrown by Globalize gem after gem version update.
2019-06-27 09:19:36 +02:00
taitus
952f03bb58 Remove deprecated attributes from Budget::Group
Some fields from Budget::Group are translatable and we no longer need them. This commit will remove the annoying deprecation warning thrown by Globalize gem after gem version update.
2019-06-27 09:19:36 +02:00
taitus
b5e17eac07 Remove deprecated attributes from Budgets
Some fields from Budget are translatable and we no longer need them. This commit will remove the annoying deprecation warning thrown by Globalize gem after gem version update.
2019-06-27 09:19:36 +02:00
taitus
b503eeac66 Fix spec models/widget/feed_spec.rb:61 as branch master. 2019-06-27 09:19:36 +02:00
Senén Rodero Rodríguez
ce7be5f2d6 Change the way to retrieve notifiable body
Using 'try' method to get notifiable is not working with translations
anymore. It was returning 'nil' always even when body translation is
populated.
2019-06-27 09:19:36 +02:00
Senén Rodero Rodríguez
e847aa22f7 Remove deprecated attributes from Widget::Card
Some fields from Widget::Card are translatable and we no longer need
them. This commit will remove the annoying deprecation warning thrown
by Globalize gem after gem version update.
2019-06-27 09:19:36 +02:00
Senén Rodero Rodríguez
6e49a09a21 Remove deprecated attributes from SiteCustomization::Page
Some fields from SiteCustomization::page are translatable and we no
longer need them. This commit will remove the annoying deprecation
warning thrown by Globalize gem after gem version update.
2019-06-27 09:19:36 +02:00
Senén Rodero Rodríguez
9f1ca4941f Remove deprecated attibutes from Legislation::Question::Option
Some fields from Legislation::Question::Option are translatable and we
no longer need them. This commit will remove the annoying deprecation
warning thrown by Globalize gem after gem version update.
2019-06-27 09:19:36 +02:00
Senén Rodero Rodríguez
8b33a48e0e Remove deprecated attributes from Legislation::Question
Some fields from Legislation::Question are translatable and we no
longer need them. This commit will remove the annoying deprecation
warning thrown by Globalize gem after gem version update.
2019-06-27 09:19:36 +02:00
Senén Rodero Rodríguez
957959e11d Remove deprecated attributes from Legislation::Process
Some fields from Legislation::Process are translatable and we no longer
need them. This commit will remove the annoying deprecation warning
thrown by Globalize gem after gem version update.
2019-06-27 09:19:36 +02:00
Senén Rodero Rodríguez
e28a1a4a8e Remove deprecated attributes from Legislation::Draft::Version
Some fields from LegislationDraftVersion are translatable and we no
longer need them. This commit will remove the annoying deprecation
warning thrown by Globalize gem after gem version update.
2019-06-27 09:19:36 +02:00
Senén Rodero Rodríguez
400a5719df Remove deprecated attributes from Milestone
Some fields from Milestone are translatable and we no longer need them.
This commit will remove the annoying deprecation warning thrown by
Globalize gem after gem version update.
2019-06-27 09:19:36 +02:00
Senén Rodero Rodríguez
43d7d24e3c Remove deprecated attributes from AdminNotification
Some fields from AdminNotification are translatable and we no longer
need them. This commit will remove the annoying deprecation warning
thrown by Globalize gem after gem version update.
2019-06-27 09:19:36 +02:00
Senén Rodero Rodríguez
2b23e9603d Remove deprecated attributes from Poll::Question::Answer
Some fields from Poll::Question::Answer are translatable and we no
longer need them. This commit will remove the annoying deprecation
warning thrown by Globalize gem after gem version update.
2019-06-27 09:19:36 +02:00
Senén Rodero Rodríguez
3406983672 Remove deprecated attributes from Poll:Question
Some fields from Poll::Question are translatable and we no longer need
them. This commit will remove the annoying deprecation warning thrown
by Globalize gem after gem version update.
2019-06-27 09:19:36 +02:00
Senén Rodero Rodríguez
2575f863bc Remove deprecated attributes from Poll
Some fields from Poll are translatable and we no longer need them. This
commit will remove the annoying deprecation warning thrown by Globalize
gem after gem version update.
2019-06-27 09:19:36 +02:00
Senén Rodero Rodríguez
2b4fce1598 Remove deprecated attributes from Banner
Some attributes from Banner are translatable and we no longer need to
have them at database table. This will remove the annoying deprecation
warning thrown by Globalize gem after gem version update.
2019-06-27 09:19:36 +02:00
Senén Rodero Rodríguez
96d1666899 Initialize graphql after application initialization
Proposal, Debate and Comment "globalize_accessors" class method were
loaded before application available locales initialization because of
graphql initializer. This will cause unexpected translation errors at
any translatable classes declared at graphql api definition (api.yml).

Doing GraphQL initialization after application initialization should
solve this issue.
2019-06-27 09:19:36 +02:00
taitus
0ffb52257f Fix specs budget_investments_spec.b:99 2019-06-27 09:19:36 +02:00