Commit Graph

13882 Commits

Author SHA1 Message Date
Senén Rodero Rodríguez
d3422acbb7 Add validation to check translations amount on updates
In order to not allow users to remove all persited
translations from any resource. A few exceptions were
added:

* Does not apply to globalizable models without
   translatable attributes required
* Make a copy of main model error on current translations to be more realistic
2019-07-02 17:15:16 +02:00
Senén Rodero Rodríguez
12d20b481d Fix error during rebase 2019-07-01 16:40:24 +02:00
taitus
58962186cd Add tracking as backend path 2019-07-01 15:03:48 +02:00
taitus
a5a62b7471 Add Tracking to backend_translations_enabled? 2019-07-01 15:03:48 +02:00
Senén Rodero Rodríguez
b86c0d3c30 Delete unused file
This file was used at previous version of translation
interface.
2019-07-01 15:03:48 +02:00
Senén Rodero Rodríguez
97eab7445d Move translations from admin.yml to general.yml
After extract translation interface partials from admin
folder translations should be placed in general.yml file
inside shared context.
2019-07-01 15:03:48 +02:00
Senén Rodero Rodríguez
7f754e5c8f Add row wrapper to form 2019-07-01 15:03:48 +02:00
Senén Rodero Rodríguez
10939fddb1 Add missing translation and fix indentation 2019-07-01 15:03:48 +02:00
Senén Rodero Rodríguez
b2d8851bcc Add the option to disable languages managment to cover special cases
We understand languages management as the ability to add new languages
or remove existing ones. When no option is passed it will allow language
manipulation by default.

There are 3 special places where we want block languages management:
- admin legislation processes homepage
- admin legislation processes milestones summary
- proposals retired form

Co-Authored-By: Sebastia <sebastia.roig@gmail.com>
2019-07-01 15:03:48 +02:00
taitus
0602a38742 Fix Style: Display Titles without highlight 2019-07-01 15:03:48 +02:00
taitus
f3022b2cec Align admin widget cards form fields with new translations interface 2019-07-01 15:03:48 +02:00
taitus
220a5fc684 Align admin site customization pages form fields with new translations interface 2019-07-01 15:03:48 +02:00
taitus
12089282c8 Align admin progress bars form fields with new translations interface
Add new js method to recover selected language to disable correctly default language fields.
2019-07-01 15:03:48 +02:00
taitus
c1a72e7169 Align admin polls questions answers form fields with new translations interface 2019-07-01 15:03:48 +02:00
taitus
9f98435789 Align admin polls questions form fields with new translations interface 2019-07-01 15:03:48 +02:00
taitus
bca9364c64 Align admin polls form fields with new translations interface 2019-07-01 14:49:44 +02:00
taitus
000c6c5911 Align admin active polls form fields with new translations interface 2019-07-01 14:49:44 +02:00
taitus
a700ea2fce Align admin milestones form fields with new translations interface 2019-07-01 14:49:44 +02:00
taitus
c9eaeffaf2 Align admin legislation questions form fields with new translations interface 2019-07-01 14:49:44 +02:00
taitus
27a3ff28d3 Align admin legislation processes form fields with new translations interface 2019-07-01 14:49:44 +02:00
taitus
1d4bde46d6 Align admin legislation milestones summary form fields with new translations interface 2019-07-01 14:49:44 +02:00
taitus
9695b0c720 Align admin legislation homepages form fields with new translations interface 2019-07-01 14:49:44 +02:00
taitus
a7dcc61ab4 Align admin legislation draft version form fields with new translations interface 2019-07-01 14:49:44 +02:00
taitus
944e502605 Align admin budget form fields with new translations interface 2019-07-01 14:49:44 +02:00
taitus
44ee8aa0c0 Align admin budget_headings form fields with new translations interface 2019-07-01 14:49:44 +02:00
taitus
fb39e6c09e Align admin budget_groups form fields with new translations interface 2019-07-01 14:49:44 +02:00
taitus
6c0f9165c7 Align admin budget_phases form fields with new translations interface 2019-07-01 14:49:44 +02:00
taitus
cd5095cf68 Align admin_notifications form fields with new translations interface 2019-07-01 14:49:44 +02:00
taitus
07577a050c Cover special translation interface behavior at admin information texts
When not yet exists I18nContentTranslation languages,
SiteCustomization::InformationText section render I18n.locale by
default. This was causing that `languages in use` description and
default selected language were incorrectly initialized.
2019-07-01 14:49:44 +02:00
Senén Rodero Rodríguez
0bbc6be141 Add specs to check how visibility of translations interface behaves
Co-Authored-By: Sebastia <sebastia.roig@gmail.com>
2019-07-01 14:49:44 +02:00
Senén Rodero Rodríguez
c0b4bb67eb Adapt shared specs to new translations interface 2019-07-01 14:49:44 +02:00
Senén Rodero Rodríguez
faed5857c3 Adapt specs to new translation interface
As translatable translations already exists in these specs it has more
sense to me to use select_language intead of adding an already existing
language. Anyway both versions behaves the same and specs pass.
2019-07-01 14:49:43 +02:00
Senén Rodero Rodríguez
f7417d6479 Adapt specs to new translations interface markup 2019-07-01 14:49:43 +02:00
Senén Rodero Rodríguez
721710be79 Fix script to manage visibility of progress bar translations
After markup changes we need to update DOM selector used to hide/show
translations.
2019-07-01 14:49:43 +02:00
Senén Rodero Rodríguez
5ada975448 Adapt globalize helper methods to new translation interface markup 2019-07-01 14:49:43 +02:00
Senén Rodero Rodríguez
05562c190f Adapt translations CS to new translation interface markup
Now we are using different html markup to render new translation interface
in a responsiveness way so we had to adapt CS to cover new behavior.
2019-07-01 14:49:43 +02:00
Senén Rodero Rodríguez
4d15815843 Add reusable methods to common actions translations module
Because we do this same expectation from a lot of specs.
2019-07-01 14:49:43 +02:00
Senén Rodero Rodríguez
9fd77d4042 Add languages in use description
New interface now shows a description to ensure the user
knows how many languages are currently in use.
2019-07-01 14:49:43 +02:00
Senén Rodero Rodríguez
db70594fca Add column class to keep proper alignment of forms
When translations interface is enabled we also want to keep
proper alignment between translatable and not translatable fields.

Co-Authored-By: alessandro <agileontheweb@gmail.com>
2019-07-01 14:49:43 +02:00
Senén Rodero Rodríguez
3ef8ef8c9c Add class to set padding-top to any element 2019-07-01 14:49:43 +02:00
Senén Rodero Rodríguez
a6e8fecc16 Highlight translation interface and translatable form fields
Only when translations interface is enabled.

Co-Authored-By: alessandro <agileontheweb@gmail.com>
2019-07-01 14:49:43 +02:00
Senén Rodero Rodríguez
6183f14d9d Move translations interface after heading selector
Co-Authored-By: alessandro <agileontheweb@gmail.com>
2019-07-01 14:49:43 +02:00
Senén Rodero Rodríguez
146c09adb7 Update references to new translation interface 2019-07-01 14:49:43 +02:00
Senén Rodero Rodríguez
140c37fcc0 Render translation interface only when feature setting is active 2019-07-01 14:49:43 +02:00
Senén Rodero Rodríguez
01bb0b9c6b Move translation interface to views root shared folder
As we are going to call this partial from any application view it will
have more sense to place it at `app/views/shared`.
2019-07-01 14:49:43 +02:00
voodoorai2000
83b43c6bc6 Fix milestone translatable specs
Milestones do not have an author so we can not update that attribute.

Adding this conditional fixes this spec: ./spec/features/admin/budget_investment_milestones_spec.rb[1:1:1:10]
2019-06-27 10:07:38 +02:00
voodoorai2000
251326ea9a Revert removal of translated attributes from default tables
We removed these columns from their original tables as Globalize raises a warning when making queries on the corresponding translated columns.

Since then we have decided to migrate from Globalize to Mobility, which does not raise these warnings.

We are still concerned about possible inconsistencies in the database due to maintaining these columns. However until we clear the problems out with the Mobility support team we are bringing them back.
2019-06-27 09:21:19 +02:00
voodoorai2000
875ae1f487 Add spec for translated budget poll name
This spec fails if we remove the attribute `name` from `poll_params` in
the `Admin::Poll::PollsController`, which we would usually remove
because it's a translatable attribute.
2019-06-27 09:21:19 +02:00
voodoorai2000
53b4c12439 Use correct interpolation variable
This view[1] has changed and now uses `handle` instead of `org`. The Dutch translations, used in this view, had not been updated yet and when used in specs[2] it was raising a variable interpolation error.

[1] https://github.com/consul/consul/blob/master/app/views/budgets/investments/_investment_show.html.erb#L197

[2] rspec ./spec/features/budgets/investments_spec.rb[1:2:5:1:2]
2019-06-27 09:21:19 +02:00
voodoorai2000
338fecc7c7 Use retired trait in specs
This fixes a validation error being raised in these specs, as we were
missing some attributes that are required. Using the factory trait the
missing attributes are correctly filled out.
2019-06-27 09:21:19 +02:00