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

Bring some basic js functions and dependencies from spree_backend #4614

Merged
merged 15 commits into from
Feb 4, 2020

Conversation

luisramos0
Copy link
Contributor

@luisramos0 luisramos0 commented Dec 19, 2019

What? Why?

Continues #4595

In this PR we bring from spree_backend the following code:

  • admin.js.erb (becomes admin/spree/base.js in ofn now)
  • we merge existing override show_flash_error with original from spree in admin.js
  • require spree.js for some basic helper functions in spree_core like Spree.url
  • to align checkboxes jquery.vAlign
  • to make the main spinner work: spin, progress.coffee and progress css
  • to make the main menu work: jquery.horizontalNav
  • to make select2 work: admin/spree-select2 and plugins/select2.css
  • to improve right side menu and the list of payment gateways in the edit order pages: equalize

What should we test?

We need to validate the following behaviors:

  • producer properties are sortable, edit an enterprise that is a producer and edit/sort it's properties (known issue here: you have to press update to see a new empty input field appear to add a second property)
  • date pickers still work - searching for orders for example
  • tooltips are still working, for example, editing a enterprise group user, there should be a what's this tag with a tooltip.
  • to align checkboxes jquery.vAlign, in the orders search page, checkbox "completed orders" is aligned with the top of the input box on its left, like this:
    Screenshot 2019-12-29 at 10 51 42
  • I am not sure what exactly jquery.horizontalNav is doing but lets keep it and make sure the main menu in the backoffice looks good in different browsers and windows sizes
  • verify select2 inputs work in orders search page for example, verify filter status and distributors
  • verify that the right side menu and the list of payment gateways in the edit order pages are aligned

Release notes

Changelog Category: Changed
Bring some basic js functions from spree_backend to make OFN independent of Spree.

@luisramos0 luisramos0 self-assigned this Dec 19, 2019
@luisramos0 luisramos0 changed the title Base admin js Bring some basic js functions and dependencies from spree_backend Dec 19, 2019
Copy link
Contributor

@Matt-Yorkley Matt-Yorkley left a comment

Choose a reason for hiding this comment

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

I look forward to the day we can 🔥 all of this code...

🙂

@luisramos0 luisramos0 force-pushed the base_admin_js branch 4 times, most recently from 72b3fda to 21a6354 Compare December 20, 2019 23:01
Copy link
Member

@mkllnk mkllnk left a comment

Choose a reason for hiding this comment

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

This looks good but an additional spec is failing. That spec fails on my local machine as well. But on my local machine it also fails on master. 🤷‍♀️

@luisramos0
Copy link
Contributor Author

There was a problem with the assets compilation and now with the build. I'll get this ready for testing tomorrow.

@luisramos0
Copy link
Contributor Author

This is deploying correctly now. Ready for testing.

@luisramos0 luisramos0 force-pushed the base_admin_js branch 2 times, most recently from b7600bb to 7fd439d Compare February 4, 2020 09:38
@lin-d-hop lin-d-hop added pr-staged-uk staging.openfoodnetwork.org.uk feedback-needed and removed pr-staged-uk staging.openfoodnetwork.org.uk labels Feb 4, 2020
@lin-d-hop
Copy link
Contributor

lin-d-hop commented Feb 4, 2020

producer properties - tested editing, reordering, also checked on products.
date pickers work - checked in searching orders and defining OCs.
tooltips are working - checked throughout enterprise settings.
orders search page checkbox - aligns as per description above
main menu in the backoffice - looks good in Chrome, Firefox and mobile
Spinner - not really sure how to test this.... seemed to work fine.
Filters in order search page work
All Edit Order pages align and appear correctly in Chrome and Firefox.

I think this is good to go.

However while testing the page has become conflicted ping @luisramos0

Fingers crossed that I don't need to retest after these conflicts are fixed.

These events can only be added to OFN when spree_backend is removed otherwise the evetns will be registered twice
…ow because it is already called in spree_backend

This can be reverted when spree_backend is removed
@luisramos0
Copy link
Contributor Author

great, thanks a lot for testing.
conflicts are minor. I am merging.

@luisramos0 luisramos0 merged commit d8374e9 into openfoodfoundation:master Feb 4, 2020
@luisramos0 luisramos0 deleted the base_admin_js branch February 4, 2020 14:48
@luisramos0 luisramos0 mentioned this pull request Feb 6, 2020
18 tasks
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