Commit Graph

9896 Commits

Author SHA1 Message Date
Javi Martín
3c48059f07 Log failed data migrations
In theory, it should never happen, but that's why exceptions exist.
2018-10-23 16:29:13 +02:00
Javi Martín
be25e5fc45 Use migrate_data option for globalize
This way the task to migrate the data doesn't have to be run manually if
these migrations weren't already executed.
2018-10-23 16:29:13 +02:00
Javi Martín
a84a0f2b7d Migrate custom pages data to their locale 2018-10-23 16:29:13 +02:00
Javi Martín
ef7be4fc55 Add task to migrate data to translation tables
We forgot to do it when we created the translation tables, and so now we
need to make sure we don't overwrite existing translations.
2018-10-23 16:29:13 +02:00
Javier Martín
7646b9f166 Merge pull request #2982 from consul/backport-simplify_custom_legislation_process
Ease customization in processes controller
2018-10-22 14:45:03 +02:00
Alberto
7009a21891 Merge pull request #2983 from consul/ui-design
UI design
2018-10-19 13:01:43 +02:00
decabeza
dc5c26856b Removes unnecessary style to orbit slide 2018-10-18 19:40:25 +02:00
decabeza
8964888711 Removes condition to allow images and data equalizer on proposals
The proposal image only can be present if feature :allow_images is enabled, so there is no need to include both conditions. The data-equalizer also is unnecessary because the :thumb image already has an fix height.
2018-10-18 18:40:58 +02:00
decabeza
0c34e66478 Removes styles to fix logo size on devise views 2018-10-18 18:17:22 +02:00
decabeza
7e828d7e94 Removes unnecessary styles for admin budgets groups 2018-10-18 18:16:11 +02:00
decabeza
8535380402 Fixes color of datepicker calendar 2018-10-18 18:15:12 +02:00
decabeza
7a92df8de5 Updates is-active class for view mode 2018-10-18 18:14:39 +02:00
Javi Martín
9352585e14 Ease customization in processes controller
By extracting a method just for the allowed parameters, forks can
customize this method by reopening the class.
2018-10-18 16:52:40 +02:00
Alberto
3878946c9e Merge pull request #2823 from consul/remove-guides
Removes guide feature
2018-10-18 13:19:33 +02:00
Raimond Garcia
e2e9d8ed60 Merge pull request #2973 from consul/i18n_defensive_spec
[Backport] Fix pluralization spec when using different default locale
2018-10-17 20:26:26 +02:00
Javier Martín
e117218d68 Merge pull request #2977 from consul/backport-reenable_ckeditor_images
Bring back CKEditor images button
2018-10-17 20:21:18 +02:00
Javi Martín
6f96265a0b Bring back CKEditor images button
It was accidentally deleted in commit 914bfa6.

Note the following spec passes on my machine if we add a `sleep 0.1`
call in the `:wait_readable` part of ruby's `Net::Protocol#rbuf_fill`.
Otherwise, it hangs forever after clicking the `.fileupload-file` div,
which closes its window. It might be solved when upgrading rails,
capybara, selenium or chromedriver.

scenario "Allows images in CKEditor", :js do
  visit edit_admin_site_customization_page_path(custom_page)

  within(".ckeditor") do
    within_frame(0) { expect(page).not_to have_css("img") }

    expect(page).to have_css(".cke_toolbar .cke_button__image_icon")
    find(".cke_toolbar .cke_button__image_icon").click
  end

  within_window(window_opened_by { click_link "Browse Server" }) do
    attach_file :file,
                Rails.root.join('spec/fixtures/files/clippy.jpg'),
                visible: false
    find(".fileupload-file").click
  end

  click_link "OK"

  within(".ckeditor") do
    within_frame(0) { expect(page).to have_css("img") }
  end
end
2018-10-17 19:39:37 +02:00
Javier Martín
4f831b9e1d Merge pull request #2976 from consul/backport-1603-fix_flaky_legislation_questions_spec
Fix flaky spec: Admin legislation questions Update Valid legislation question
2018-10-17 19:18:54 +02:00
Javi Martín
893f29a27a Fix flaky legislation question spec
The test was failing sometimes because of the sequence:

within('#side_menu') do
  click_link "Collaborative Legislation"
end

click_link "All"
expect(page).to have_content 'An example legislation process'
click_link 'An example legislation process'

Right after clicking the "Collaborative Legislation" link, the link 'An
example legislation process' is already available. So sometimes Capybara
might click the links "All" and 'An example legislation process' at more
or less the same time, causing the second link not to be correctly
clicked.

Making sure the "All" link doesn't exist anymore we guarantee Capybara
will wait for the previous AJAX request to finish before clicking the
next link.

Note the test to "Create Valid legislation question" is almost identical
but it doesn't fail because it doesn't use Capybara's JavaScript driver.
2018-10-17 15:54:59 +02:00
decabeza
dbf41421ed Removes guide feature 2018-10-17 14:58:29 +02:00
Raimond Garcia
74925a7022 Merge pull request #2964 from consul/i18n_all_language_names
Add all available languages
2018-10-17 13:34:26 +02:00
voodoorai2000
3976b2f4f2 Fix pluralization spec when using different default locale
This spec was failing due to using :es as the default_locale in application.rb[1], but using :en as the default_locale in the test environment[2]

The fallback rules where getting a little confused and not including the default locale, for the test environment, in the fallback rules

With this commit we are making sure that rule is created, as it would in a production environment that uses the default_locale in application.rb

[1] https://github.com/AyuntamientoMadrid/consul/blob/master/config/application.rb#L22

[2] https://github.com/AyuntamientoMadrid/consul/blob/master/spec/rails_helper.rb#L15
2018-10-17 13:26:47 +02:00
voodoorai2000
8eb399150e Remove fallback rules for locales not yet added 2018-10-17 12:47:35 +02:00
voodoorai2000
e771440d18 Remove duplicate language names 2018-10-17 12:47:35 +02:00
voodoorai2000
3b8bb5038d Add fallback i18n locales
All other languages will fallback to the default locale

Rails also, seems to pick up dialect fallbacks, for locales with this format: es-CO, es-PE, etc, which will fallback to "es", so that is great 😌
2018-10-17 12:47:35 +02:00
voodoorai2000
f2fe230a15 Add all available locales
Only addding those with significant number of translations
2018-10-17 12:47:35 +02:00
voodoorai2000
d8fa322763 Remove obsolete language name translations 2018-10-17 12:47:35 +02:00
voodoorai2000
7fb6f6a7a6 Add all language names 2018-10-17 12:47:35 +02:00
Raimond Garcia
2f5fc5d863 Merge pull request #2963 from consul/locale_names
Fix locale folder names
2018-10-17 12:46:28 +02:00
Raimond Garcia
8864168e3c Merge pull request #2962 from consul/flaky_i18n
Fix flaky spec for translations
2018-10-17 12:45:51 +02:00
Javier Martín
5f8311845b Merge pull request #2967 from consul/backport-1609-fix_skip_flaky_specs
Fix flaky spec: Admin feature flags Enable a disabled feature
2018-10-11 17:46:59 +02:00
Javi Martín
5ae7a5512d Skip spec before doing any requests
Skipping a spec in the middle of it, particularly after doing some
requests, caused Capybara to keep using the same driver in the following
spec.

Since the current spec uses the JavaScript driver, the next test would
also use the JavaScript driver, causing apparently random failures if
that test was supposed to use the Rack driver.
2018-10-11 17:14:53 +02:00
Alberto
83869725cd Merge pull request #2966 from kreopelle/image-doc-settings
Change spelling for constant to TITLE_LENGTH_RANGE
2018-10-11 10:59:59 +02:00
kreopelle
14a1eeb44f Change spelling for constant to TITLE_LENGTH_RANGE, instead of TITLE_LEGHT_RANGE 2018-10-10 21:02:55 -04:00
Alberto
c4f692303a Merge pull request #2960 from consul/rake-help-page
Adds enable help page task
2018-10-10 14:33:46 +02:00
voodoorai2000
cd22c440bf Fix locale folder names
There seems to be some differences between the folder name and the locale name used in the files themselves.

For example: the folder might have been called "de-DE", for German, but the files use one "de"

And thus translations where not being displayed

Using the locale key in the files and modifying the folder name if neccesary, let's see what happens in the next Crowdin pull, might need to review more thoroughly why this is happening (maybe due to custom settings in Crowdin)
2018-10-10 13:35:27 +02:00
Raimond Garcia
4765f7a9f7 Merge pull request #2961 from consul/crowdin_sync
Update translations from Crowdin
2018-10-10 13:22:09 +02:00
voodoorai2000
0bbc5c1246 Fix date translations
These translation keys are used to set the order in which a date object will be displayed[1]

They should not be translated, just reordered if it makes more sense of a given language

If the expected values are not found an exception is raised: ".date.order only accepts :year, :month and :day"

They should probably be somewhere else so that Crowdin translators don't feel the need to translate it. But that is a battle for another day 😌 for now simply fixing them

[1] https://guides.rubyonrails.org/i18n.html#action-view-helper-methods
2018-10-10 13:04:34 +02:00
voodoorai2000
f640a0a92c Update Crowdin translations 2018-10-10 13:04:34 +02:00
voodoorai2000
ccd342bb51 Fix flaky spec for translations
This spec was causing a side effect on another spec[2], making it fail 😌

I think it was because no translation had been called yet, in the failing spec, and so the the i18n backend translations had not been initialized, and was always returning empty translations for any locale. This might have been due to tampering with translations in the this newly introduced spec.

By forcing translations to load after this new spec, the other spec passes again

[2] https://github.com/AyuntamientoMadrid/consul/blob/master/spec/features/localization_spec.rb#L20
2018-10-10 12:47:40 +02:00
Raimond Garcia
710e5ae965 Merge pull request #2949 from consul/i18n-language-names
Display language name or language key
2018-10-10 11:45:04 +02:00
voodoorai2000
59b35156b1 Fix flaky spec
`I18n.available_locales=` does a little magic[1] and was causing some flakieness along the way, as the `:wl` locale persisted in future specs

Thanks for the heads up @javierm 👌

[1] https://www.rubydoc.info/github/svenfuchs/i18n/I18n%2FConfig:available_locales=
2018-10-09 22:15:05 +02:00
voodoorai2000
6f978b9f4e Fix portuguese specs 2018-10-09 18:32:59 +02:00
decabeza
16acb2a65f Adds enable help page task 2018-10-09 13:01:43 +02:00
Raimond Garcia
3e6b87df04 Merge pull request #2906 from consul/dependabot/bundler/i18n-tasks-0.9.25
Bump i18n-tasks from 0.9.20 to 0.9.25
2018-10-05 18:23:19 +02:00
Raimond Garcia
6a769d9484 Merge pull request #2926 from consul/dependabot/bundler/rubocop-rspec-1.26.0
Bump rubocop-rspec from 1.24.0 to 1.26.0
2018-10-05 18:22:33 +02:00
Raimond Garcia
4084b1c59f Merge pull request #2927 from consul/dependabot/bundler/delayed_job_active_record-4.1.3
Bump delayed_job_active_record from 4.1.2 to 4.1.3
2018-10-05 18:22:09 +02:00
Raimond Garcia
64997329fe Merge pull request #2928 from consul/dependabot/bundler/browser-2.5.3
Bump browser from 2.5.2 to 2.5.3
2018-10-05 18:21:42 +02:00
Raimond Garcia
3fc9e52099 Merge pull request #2929 from consul/dependabot/bundler/jquery-rails-4.3.3
Bump jquery-rails from 4.3.1 to 4.3.3
2018-10-05 18:21:23 +02:00
voodoorai2000
ad51109149 Remove duplicate language translation 2018-10-05 18:08:48 +02:00