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

Replace select2-rails with vendored select2 #1774

Merged
merged 5 commits into from
Mar 23, 2017

Conversation

jhawthorn
Copy link
Contributor

@jhawthorn jhawthorn commented Mar 14, 2017

We favour using vendored assets in the admin to allow developers to use different versions of the same library in storefronts.

This is especially desirable for select2, because we are using the 3.5 version, which has some significant API changes from the current 4.0 version. If we upgrade to 4.0, storefronts should be able to keep using 3.5 if they want.

This has the side effect of cleaning up our solidus_backend_manifest.js

Select2 3.5.2 changed the way the hidden select element is hidden.
Instead of just being offscreen it is now actually hidden (display:
none). This affects how capybara treats the original select element.
In order to use select2 within sprockets we need to use image-url in the
CSS in order to reference the fingerprinted asset URLs.

sed -i "s/url('\\([^']*\\)')/image-url('solidus_admin\\/\\1')/g" select2.css

Also adds a select2_locales/index.js to make it easy to precompile all
locales.
Removes the select2-rails gem in favour of using the vendored version.
Copy link
Contributor

@cbrunsdon cbrunsdon left a comment

Choose a reason for hiding this comment

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

Looks reasonable to me, thanks

Copy link
Member

@tvdeyen tvdeyen left a comment

Choose a reason for hiding this comment

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

Awesome 👍

@jhawthorn jhawthorn merged commit 32e18af into solidusio:master Mar 23, 2017
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.

3 participants