AlchemyCMS / alchemy_cms

Alchemy is the Open Source Rails CMS framework for the component based web that can be used as classic server side rendered or headless CMS.
https://www.alchemy-cms.com
BSD 3-Clause "New" or "Revised" License
818 stars 312 forks source link

Locally initialize SortableElements #2815

Closed tvdeyen closed 3 months ago

tvdeyen commented 3 months ago

What is this pull request for?

We have two places where we need to initialize SortableJS for elements.

1) The ElementsWindow and its top level elements 2) The nested elements inside of each element-editor

Instead of using the global Alchemy object to initialize them we can import the file locally and init it where it needs to be. This makes it possible to remove another global call from the create.js.erb file.

Checklist

codecov[bot] commented 3 months ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 95.92%. Comparing base (20ff6ed) to head (1e5766c).

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #2815 +/- ## ======================================= Coverage 95.92% 95.92% ======================================= Files 225 225 Lines 6129 6129 ======================================= Hits 5879 5879 Misses 250 250 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.