Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

ckhung5
Copy link

@ckhung5 ckhung5 commented May 7, 2020

What? Why?

There are some noise about assets not found related to jquery-ui-rails gem.

Relates to #5201 but doesn't solve it.

This change will solve the noise for unable to find ui-bg_flat_75_ffffff_40x100.png. This is a bug in the gem itself and they introduce a depend_on as mentioned in jquery-ui-rails/jquery-ui-rails#59 and jquery-ui-rails/jquery-ui-rails#60.

So we only just need to update jquery-ui-rails to version 4.1.1

What should we test?

Steps to reproduce the bug here: #5380 (comment)

We should also do a sanity check on admin datepickers and dropdowns with search fields.

Release notes

Update jquery-ui-rails version to 4.1.1 to introduce some depend_on assets in the gem as there are currently some assets errors in the application.

Changelog Category: Fixed

@mkllnk
Copy link
Member

mkllnk commented May 7, 2020

How did you verify that the gem update fixes the bug if you couldn't re-produce it?

I think you would need to pre-compile assets on your local machine and change the code to not compile them on-the-fly in development to re-produce this error. You'll find the options in config/environments.

At least I can re-produce this in staging:

  • Log in as enterprise user.
  • Go to Admin -> Orders.
  • Click on a date field and observer the network tab in the developer console.

Screenshot from 2020-05-07 14-24-14

That 404 error needs to be gone.

@ckhung5
Copy link
Author

ckhung5 commented May 7, 2020

How did you verify that the gem update fixes the bug if you couldn't re-produce it?

I think you would need to pre-compile assets on your local machine and change the code to not compile them on-the-fly in development to re-produce this error. You'll find the options in config/environments.

At least I can re-produce this in staging:

  • Log in as enterprise user.
  • Go to Admin -> Orders.
  • Click on a date field and observer the network tab in the developer console.

Screenshot from 2020-05-07 14-24-14

That 404 error needs to be gone.

Cool. Thank you for showing how to reproduce the error. I will check it out at my side :)

@Matt-Yorkley
Copy link
Contributor

Matt-Yorkley commented May 7, 2020

At least I can re-produce this in staging

Looks like we have some easy steps for a tester to verify πŸ‘

I've updated the testing notes in the PR description.

Copy link
Contributor

@luisramos0 luisramos0 left a comment

Choose a reason for hiding this comment

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

πŸ‘

I made a mistake in #4839 I should have told dependabot to "ignore this major" but I said "ignore this dependency" so dependabot didnt try this minor upgrade.
Poor @dependabot doesnt understand when humans make mistakes when talking to it :-)
Anyway, I have reopened 4839 to see if I can get dependabot to try by itself to upgrade to 4.2.0 or even 5.0.5, they may work even if 6.0.1 didnt.

Meanwhile we can go ahead with this PR πŸ‘

railties (>= 3.0, < 5.0)
thor (>= 0.14, < 2.0)
jquery-ui-rails (4.0.5)
jquery-ui-rails (4.1.2)
Copy link
Contributor

Choose a reason for hiding this comment

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

the upgrade is actually to 4.1.2 right?
I guess the gemfile can have 4.1.2 instead of 4.1.1?

Copy link
Author

Choose a reason for hiding this comment

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

@luisramos0 Yes. It looks like it is using 4.1.2 even it is told to upgrade to 4.1.1 . I can change this .

@ckhung5
Copy link
Author

ckhung5 commented May 8, 2020

I tried testing it locally. I manage to tweek the development.rb for not auto compile assets but it broke the angular part where the loading icon keeps loading, there is angular error in chrome console and the haml file does not load correctly.

Screen Shot 2020-05-08 at 11 54 40 am

How are the haml files being compile?

@ckhung5
Copy link
Author

ckhung5 commented May 8, 2020

Seems like I screw up the precompile assets. I cleared them out and re-compile again. This time, there is no error and I used the same way that @mkllnk said.

Screen Shot 2020-05-08 at 12 24 11 pm even in Master branch.

I not too sure what to do to re-produce in my local :(

@mkllnk
Copy link
Member

mkllnk commented May 8, 2020

Did you delete your compiled assets and re-compile them before testing with master? Otherwise it will probably find the asset that was compiled (copied) in your fixed branch.

Anyway, it's a good upgrade anyway so we'll test this in staging.

@ckhung5
Copy link
Author

ckhung5 commented May 8, 2020

@mkllnk Yes.. I did clean the compiled assets and re-compile it.

@filipefurtad0
Copy link
Contributor

filipefurtad0 commented May 13, 2020

Hi @ckhung5,

I followed @mkllnk's test procedure, and checked the 404 error on requesting the file:
ui-bg_flat_75_ffffff_40x100-8a71ce304ee5d4e3ffc09efecc9b28e8.png

Before the PR:
image

the 404 error, is visible, but:

after the PR:
image

the erro 404 r is still visible. The request for the file /assets/spinning-circles.svg seems to be gone, after the PR.

I found no issues on a basic sanity check, but from the pics above, I am not entirely sure the PR solves the issue... Thoughts?

@luisramos0
Copy link
Contributor

@filipefurtad0 this PR is just upgrading a dependency so, if, from your perspective, nothing is worse than before, we should merge. If the issue is not solved we can keep the issue open.

@filipefurtad0
Copy link
Contributor

Hi @luisramos0,
thanks for your feedback.

The testing notes led to the comment from @mkllnk #5380 (comment) above, which states "That 404 error needs to be gone.", hence my doubts here.

But I did not find loss in functionality, so I think this is good for merging.
Thanks again!

@ckhung5
Copy link
Author

ckhung5 commented May 14, 2020

Hi @filipefurtad0 .

Pardon me for asking. Do you do a docker-compose build if you are using docker or bundle install if you are using bundle exec rails server ?

It is very odd that I can't reproduce the error.

@Matt-Yorkley
Copy link
Contributor

@ckhung5 Testing happens on our staging servers. They are similar to the production environment and don't use Docker...

@mkllnk mkllnk merged commit 6c409d6 into openfoodfoundation:master May 15, 2020
@ckhung5 ckhung5 deleted the 5201-fix-missing-jquery-ui branch May 15, 2020 01:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants