Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Backport 'Fix admin language selector' to v0.28 #12855

Conversation

andreslucena
Copy link
Member

🎩 What? Why?

Backport #12709 to v0.28

♥️ Thank you!

@andreslucena andreslucena added backport Pull Requests that are a backport for a fixed bug javascript Pull requests that update Javascript code module: admin type: fix PRs that implement a fix for a bug labels May 17, 2024
github-actions[bot]
github-actions bot previously approved these changes May 17, 2024
alecslupu
alecslupu previously approved these changes May 17, 2024
Copy link
Contributor

@alecslupu alecslupu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

* Fix admin language selector

* Add spec

* Update decidim-admin/spec/system/admin_manages_more_locales_spec.rb

Co-authored-by: Andrés Pereira de Lucena <andreslucena@users.noreply.github.com>

---------

Co-authored-by: Andrés Pereira de Lucena <andreslucena@users.noreply.github.com>
@andreslucena andreslucena force-pushed the backport/0.28/fix-admin-language-selector-12709 branch from 4f3de20 to b8fd252 Compare May 22, 2024 13:59
@andreslucena
Copy link
Member Author

@alecslupu as I mentioned in our last meeting, I'm not sure what it may be happening here.

This is the typical case of "It Works In My Machine" :trollface: - like if I run the specs in this branch with a new test_app (so it's compatible with v0.28), I have this:

$ git status
On branch backport/0.28/fix-admin-language-selector-12709
nothing to commit, working tree clean
$ bin/rspec decidim-admin/spec/system/admin_manages_more_locales_spec.rb

Randomized with seed 21528

Admin language selector
[DECIDIM] ChromeDriver Workaround is being active: Setting window size to 1920x1080.
  with less than 5 fields
    displays Finnish fields
    displays Romanian fields
  with more than 5 fields
    displays Finnish fields
    displays Romanian fields

Top 4 slowest examples (13.42 seconds, 24.6% of total time):
  Admin language selector with less than 5 fields displays Finnish fields
    4.64 seconds ./spec/system/admin_manages_more_locales_spec.rb:45
  Admin language selector with more than 5 fields displays Finnish fields
    3.87 seconds ./spec/system/admin_manages_more_locales_spec.rb:68
  Admin language selector with more than 5 fields displays Romanian fields
    3.86 seconds ./spec/system/admin_manages_more_locales_spec.rb:62
  Admin language selector with less than 5 fields displays Romanian fields
    1.04 seconds ./spec/system/admin_manages_more_locales_spec.rb:37

Finished in 54.57 seconds (files took 3.85 seconds to load)
4 examples, 0 failures

Randomized with seed 21528

And if I create a development_app compatible with v0.28 and configure more locales in the app and in the organization, then I can't see the original bug here:

Screenshot of the locale selector with the textarea changed

So, I'm a bit lost what may be happening in the pipeline. I tried merging against latest commits from v0.28 but that doesn't seem to do anything neither:

$ git pull origin release/0.28-stable
From github.com:decidim/decidim
 * branch                  release/0.28-stable -> FETCH_HEAD
Current branch backport/0.28/fix-admin-language-selector-12709 is up to date.

So, if you can give this a look to see what I'm missing, I'd appreciate it.

@alecslupu alecslupu dismissed stale reviews from github-actions and themself via fbea426 May 28, 2024 06:23
@alecslupu
Copy link
Contributor

@andreslucena we have a tricky one ... You opened this PR, and i have fixed it ... so we both have code here... Could you finish the review, since this fix was developed by me in the first place ?

Copy link
Member Author

@andreslucena andreslucena left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 👍🏽 ✅

(I can´t explicitly approve this as "Pull requests authors can´t approve their own pull request")

@andreslucena
Copy link
Member Author

Great fix @alecslupu

I still not fully understand why this is passing in develop. Probably rails versions differences in how it manages I18n, right?

Merging with the codecov expected failure.

@andreslucena andreslucena merged commit 357c3e0 into release/0.28-stable May 29, 2024
79 of 80 checks passed
@andreslucena andreslucena deleted the backport/0.28/fix-admin-language-selector-12709 branch May 29, 2024 06:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport Pull Requests that are a backport for a fixed bug javascript Pull requests that update Javascript code module: admin type: fix PRs that implement a fix for a bug
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

None yet

2 participants