alchemy_cms 6.0.0.pre.rc6 → 6.0.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (94) hide show
  1. checksums.yaml +4 -4
  2. data/.github/workflows/ci.yml +23 -8
  3. data/.github/workflows/stale.yml +21 -7
  4. data/.gitignore +0 -1
  5. data/.rspec +1 -0
  6. data/CHANGELOG.md +102 -0
  7. data/Gemfile +20 -5
  8. data/README.md +4 -3
  9. data/Rakefile +5 -1
  10. data/alchemy_cms.gemspec +3 -3
  11. data/app/assets/javascripts/alchemy/admin.js +0 -1
  12. data/app/assets/javascripts/alchemy/alchemy.link_dialog.js.coffee +2 -0
  13. data/app/assets/javascripts/alchemy/page_select.js +13 -8
  14. data/app/assets/javascripts/alchemy/templates/index.js +1 -0
  15. data/app/assets/javascripts/alchemy/templates/page.hbs +17 -7
  16. data/app/assets/javascripts/alchemy/templates/page_folder.hbs +3 -0
  17. data/app/assets/stylesheets/alchemy/archive.scss +9 -0
  18. data/app/assets/stylesheets/alchemy/elements.scss +4 -0
  19. data/app/assets/stylesheets/alchemy/page-select.scss +29 -4
  20. data/app/assets/stylesheets/alchemy/sitemap.scss +2 -6
  21. data/app/controllers/alchemy/admin/elements_controller.rb +20 -17
  22. data/app/controllers/alchemy/admin/pages_controller.rb +24 -19
  23. data/app/controllers/alchemy/api/base_controller.rb +4 -3
  24. data/app/controllers/alchemy/api/contents_controller.rb +1 -5
  25. data/app/controllers/alchemy/api/elements_controller.rb +2 -6
  26. data/app/controllers/alchemy/api/nodes_controller.rb +1 -0
  27. data/app/controllers/alchemy/api/pages_controller.rb +16 -10
  28. data/app/controllers/alchemy/base_controller.rb +7 -0
  29. data/app/controllers/alchemy/messages_controller.rb +0 -3
  30. data/app/controllers/alchemy/pages_controller.rb +0 -7
  31. data/app/helpers/alchemy/elements_helper.rb +17 -12
  32. data/app/models/alchemy/element.rb +13 -6
  33. data/app/models/alchemy/ingredient.rb +10 -1
  34. data/app/models/alchemy/ingredient_validator.rb +1 -1
  35. data/app/models/alchemy/language.rb +1 -1
  36. data/app/models/alchemy/page/page_elements.rb +2 -2
  37. data/app/models/alchemy/page/page_naming.rb +1 -1
  38. data/app/models/alchemy/page.rb +1 -1
  39. data/app/models/alchemy/picture/transformations.rb +2 -2
  40. data/app/models/alchemy/picture.rb +1 -1
  41. data/app/models/alchemy/picture_variant.rb +3 -1
  42. data/app/models/alchemy/site.rb +1 -1
  43. data/app/serializers/alchemy/page_serializer.rb +7 -1
  44. data/app/serializers/alchemy/page_tree_serializer.rb +3 -3
  45. data/app/views/alchemy/admin/clipboard/insert.js.erb +13 -0
  46. data/app/views/alchemy/admin/elements/_add_nested_element_form.html.erb +27 -0
  47. data/app/views/alchemy/admin/elements/_element.html.erb +1 -23
  48. data/app/views/alchemy/admin/elements/_form.html.erb +5 -1
  49. data/app/views/alchemy/admin/pages/_form.html.erb +19 -0
  50. data/app/views/alchemy/admin/pages/_new_page_form.html.erb +16 -5
  51. data/app/views/alchemy/admin/pages/_page.html.erb +111 -133
  52. data/app/views/alchemy/admin/pages/_sitemap.html.erb +2 -8
  53. data/app/views/alchemy/admin/pages/_toolbar.html.erb +0 -12
  54. data/app/views/alchemy/admin/pages/index.html.erb +1 -1
  55. data/app/views/alchemy/admin/pages/update.js.erb +7 -0
  56. data/app/views/alchemy/admin/partials/_routes.html.erb +12 -1
  57. data/app/views/alchemy/admin/resources/_form.html.erb +5 -0
  58. data/app/views/alchemy/essences/_essence_node_editor.html.erb +1 -1
  59. data/app/views/alchemy/essences/_essence_page_editor.html.erb +1 -1
  60. data/config/alchemy/config.yml +1 -0
  61. data/config/initializers/dragonfly.rb +2 -0
  62. data/config/locales/alchemy.en.yml +0 -3
  63. data/config/routes.rb +4 -2
  64. data/lib/alchemy/config.rb +5 -1
  65. data/lib/alchemy/controller_actions.rb +2 -1
  66. data/lib/alchemy/dragonfly/processors/thumbnail.rb +27 -0
  67. data/lib/alchemy/element_definition.rb +2 -3
  68. data/lib/alchemy/elements_finder.rb +1 -2
  69. data/lib/alchemy/engine.rb +12 -1
  70. data/lib/alchemy/essence.rb +1 -27
  71. data/lib/alchemy/page_layout.rb +5 -1
  72. data/lib/alchemy/permissions.rb +2 -3
  73. data/lib/alchemy/resource.rb +16 -1
  74. data/lib/alchemy/test_support/essence_shared_examples.rb +0 -12
  75. data/lib/alchemy/test_support/shared_ingredient_examples.rb +4 -2
  76. data/lib/alchemy/upgrader/tasks/ingredients_migrator.rb +1 -1
  77. data/lib/alchemy/version.rb +1 -1
  78. data/lib/alchemy.rb +2 -4
  79. data/lib/generators/alchemy/base.rb +7 -3
  80. data/lib/generators/alchemy/install/install_generator.rb +10 -2
  81. data/package/src/image_loader.js +4 -2
  82. data/package/src/node_tree.js +13 -6
  83. data/package/src/page_publication_fields.js +15 -14
  84. data/package/src/page_sorter.js +62 -0
  85. data/package/src/picture_editors.js +8 -8
  86. data/package/src/sitemap.js +51 -36
  87. data/package/src/utils/__tests__/ajax.spec.js +52 -16
  88. data/package/src/utils/ajax.js +12 -0
  89. data/package.json +1 -1
  90. metadata +43 -42
  91. data/app/assets/javascripts/alchemy/alchemy.page_sorter.js +0 -24
  92. data/app/views/alchemy/admin/pages/fold.js.erb +0 -2
  93. data/app/views/alchemy/admin/pages/sort.html.erb +0 -19
  94. data/vendor/assets/javascripts/jquery_plugins/jquery.ui.nestedSortable.js +0 -434
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: b2c4b9cbf469cb88a351047757a38e9ab434cd67006b0390170e22dd5b64d0a8
4
- data.tar.gz: 48d6dec7c669c2f854ac0414e16801236cace3a6cef2eef5fb07fa4e509ef996
3
+ metadata.gz: 0ccd47bae7272d0d8cb44b6d9c63cd8b72df01f086eff929819164d267af6bf1
4
+ data.tar.gz: d18a5f8105f242cef352e0c57d6d21743aedfdd75cc373bbf4205fd3d2cac5f1
5
5
  SHA512:
6
- metadata.gz: 9b290944338b8ca490e0472fa886c8f4b09d47bd957a7d45c014ab328c81a9545cc74196a69eda2969dcf2e5fb0af3bad4bfc9d5079e45c645a51d41582b4137
7
- data.tar.gz: 67c3a355c1df19256609680c562d0ae0c2bd76811daee6ea930b1425e85e3ff2087313e3a2d5d203523320f0da20d643d79b11badd1700912930e3209dfb2ddd
6
+ metadata.gz: 81b2e1e18d80a8cce6316286e91063e9363ded99c991de526f0155d98f9954a3986487bec834205847f364c883ecb8959777a55fbe14fdfdb9409f32818376fa
7
+ data.tar.gz: 39086e8836ff34ec6eb7abf76403b2f6a0515e6d46e6f77f76fe81b480f6a9cba65ae1ba3e0af390f79d8234d42f5ab218fd50ea14643e3ac8d89594de8bb1a2
@@ -9,20 +9,35 @@ jobs:
9
9
  fail-fast: false
10
10
  matrix:
11
11
  rails:
12
- - '6.0'
13
- - '6.1'
12
+ - "6.0"
13
+ - "6.1"
14
+ - "7.0"
14
15
  ruby:
15
- - '2.6.8'
16
- - '2.7.4'
17
- - '3.0.2'
16
+ - "2.6"
17
+ - "2.7"
18
+ - "3.0"
19
+ - "3.1"
18
20
  database:
19
21
  - mysql
20
22
  - postgresql
23
+ exclude:
24
+ - rails: "6.0"
25
+ ruby: "3.1"
26
+ database: mysql
27
+ - rails: "6.0"
28
+ ruby: "3.1"
29
+ database: postgresql
30
+ - rails: "7.0"
31
+ ruby: "2.6"
32
+ database: mysql
33
+ - rails: "7.0"
34
+ ruby: "2.6"
35
+ database: postgresql
21
36
  env:
22
37
  DB: ${{ matrix.database }}
23
38
  DB_USER: alchemy_user
24
39
  DB_PASSWORD: password
25
- DB_HOST: '127.0.0.1'
40
+ DB_HOST: "127.0.0.1"
26
41
  RAILS_ENV: test
27
42
  RAILS_VERSION: ${{ matrix.rails }}
28
43
  services:
@@ -32,11 +47,11 @@ jobs:
32
47
  POSTGRES_USER: alchemy_user
33
48
  POSTGRES_PASSWORD: password
34
49
  POSTGRES_DB: alchemy_cms_dummy_test
35
- ports: ['5432:5432']
50
+ ports: ["5432:5432"]
36
51
  options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5
37
52
  mysql:
38
53
  image: mysql:latest
39
- ports: ['3306:3306']
54
+ ports: ["3306:3306"]
40
55
  env:
41
56
  MYSQL_USER: alchemy_user
42
57
  MYSQL_PASSWORD: password
@@ -2,16 +2,30 @@ name: Mark stale issues and pull requests
2
2
 
3
3
  on:
4
4
  schedule:
5
- - cron: "0 0 * * *"
5
+ - cron: "0 0 * * *"
6
6
 
7
7
  jobs:
8
8
  stale:
9
-
10
9
  runs-on: ubuntu-latest
11
10
 
12
11
  steps:
13
- - uses: actions/stale@v1
14
- with:
15
- repo-token: ${{ secrets.GITHUB_TOKEN }}
16
- stale-issue-message: 'This issue has not seen any activity in a long time. If the issue described still exists in recent versions of Alchemy, please open a new issue or preferably open a PR with a fix. Thanks for reporting.'
17
- stale-pr-message: 'This pull request has not seen any activiy in a long time. Probably because of missing tests or a necessary rebase. Please open a new PR to latest main if you want to continue working on this. Thanks for the contribution.'
12
+ - uses: actions/stale@v5
13
+ with:
14
+ repo-token: ${{ secrets.GITHUB_TOKEN }}
15
+ stale-issue-message: |
16
+ This issue has not seen any activity in a long time.
17
+ Please create a pull request with a fix or ask someone of the community if they can help.
18
+ This issue will be closed in 7 days if no further activity happens.
19
+ close-issue-message: |
20
+ This issue has not seen any activity in a long time.
21
+ If the issue described still exists in recent versions of Alchemy,
22
+ please open a new issue with. Thanks for reporting.
23
+ stale-pr-message: |
24
+ This pull request has not seen any activiy in a long time.
25
+ Probably because of missing tests or a necessary rebase.
26
+ This PR will be closed in 7 days if no further activity happens.
27
+ close-pr-message: |
28
+ This pull request has not seen any activiy in a long time.
29
+ Probably because of missing tests or a necessary rebase.
30
+ Please open a new PR to latest main if you want to continue working on this.
31
+ Thanks for the contribution.
data/.gitignore CHANGED
@@ -33,7 +33,6 @@ spec/dummy/uploads/
33
33
  .ruby-gemset
34
34
  .ruby-version
35
35
  .env
36
- .rspec
37
36
  node_modules
38
37
  yarn-error.log
39
38
  yarn-debug.log*
data/.rspec ADDED
@@ -0,0 +1 @@
1
+ --require spec_helper
data/CHANGELOG.md CHANGED
@@ -1,3 +1,59 @@
1
+ ## 6.0.1 (2022-04-26)
2
+
3
+ - Allow passing a different partial to `render_element` [#2322](https://github.com/AlchemyCMS/alchemy_cms/pull/2322) ([mamhoff](https://github.com/mamhoff))
4
+ - Allow render_elements to take a block [#2321](https://github.com/AlchemyCMS/alchemy_cms/pull/2321) ([mamhoff](https://github.com/mamhoff))
5
+ - Remove old unused root_page ivar [#2320](https://github.com/AlchemyCMS/alchemy_cms/pull/2320) ([tvdeyen](https://github.com/tvdeyen))
6
+ - Raise on non-existing locale [#2319](https://github.com/AlchemyCMS/alchemy_cms/pull/2319) ([mamhoff](https://github.com/mamhoff))
7
+ - chore: Remove unnecessary puts from spec [#2318](https://github.com/AlchemyCMS/alchemy_cms/pull/2318) ([tvdeyen](https://github.com/tvdeyen))
8
+ - Fix gif resizing [#2315](https://github.com/AlchemyCMS/alchemy_cms/pull/2315) ([kulturbande](https://github.com/kulturbande))
9
+ - Refactor: Use page version's element repository rather than a new one [#2312](https://github.com/AlchemyCMS/alchemy_cms/pull/2312) ([mamhoff](https://github.com/mamhoff))
10
+ - Deprecate Alchemy::Element.available [#2309](https://github.com/AlchemyCMS/alchemy_cms/pull/2309) ([mamhoff](https://github.com/mamhoff))
11
+ - Explicitly set "store" for MariaDB [#2308](https://github.com/AlchemyCMS/alchemy_cms/pull/2308) ([mamhoff](https://github.com/mamhoff))
12
+ - Set preview mode earlier [#2307](https://github.com/AlchemyCMS/alchemy_cms/pull/2307) ([mamhoff](https://github.com/mamhoff))
13
+ - Fix updating the public_on date on persisted pages [#2305](https://github.com/AlchemyCMS/alchemy_cms/pull/2305) ([mamhoff](https://github.com/mamhoff))
14
+ - Allow opting out of Turbolinks in non-Alchemy controllers [#2302](https://github.com/AlchemyCMS/alchemy_cms/pull/2302) ([dssjoblom](https://github.com/dssjoblom))
15
+ - Explicitly validate uniqueness without case sensitivity [#2300](https://github.com/AlchemyCMS/alchemy_cms/pull/2300) ([mamhoff](https://github.com/mamhoff))
16
+ - Fix frozen string error when mixing template engines [#2299](https://github.com/AlchemyCMS/alchemy_cms/pull/2299) ([gr8bit](https://github.com/gr8bit))
17
+ - Do not flatten gifs if converted to webp [#2293](https://github.com/AlchemyCMS/alchemy_cms/pull/2293) ([tvdeyen](https://github.com/tvdeyen))
18
+ - Allow pasting into parent element with only one nested element type [#2292](https://github.com/AlchemyCMS/alchemy_cms/pull/2292) ([dbwinger](https://github.com/dbwinger))
19
+ - Restrict Node select to the site/language of the page being edited [#2277](https://github.com/AlchemyCMS/alchemy_cms/pull/2277) ([dbwinger](https://github.com/dbwinger))
20
+ - Add Ruby 3.1 support [#2229](https://github.com/AlchemyCMS/alchemy_cms/pull/2229) ([tvdeyen](https://github.com/tvdeyen))
21
+
22
+ ## 6.0.0 (2022-04-11)
23
+
24
+ - [ruby - main] Allow ransack version 3.0.1 [#2287](https://github.com/AlchemyCMS/alchemy_cms/pull/2287) ([depfu](https://github.com/apps/depfu))
25
+ - Fix image loader [#2285](https://github.com/AlchemyCMS/alchemy_cms/pull/2285) ([tvdeyen](https://github.com/tvdeyen))
26
+ - Don't delete locals in render_element so they can be used by all elements in render_elements [#2283](https://github.com/AlchemyCMS/alchemy_cms/pull/2283) ([dbwinger](https://github.com/dbwinger))
27
+ - Don't hardcode URLs in Javascript [#2282](https://github.com/AlchemyCMS/alchemy_cms/pull/2282) ([dssjoblom](https://github.com/dssjoblom))
28
+ - [ruby - main] Allow ransack 3.0.0 [#2278](https://github.com/AlchemyCMS/alchemy_cms/pull/2278) ([depfu](https://github.com/apps/depfu))
29
+ - Show site and language name on page select in Link dialog [#2276](https://github.com/AlchemyCMS/alchemy_cms/pull/2276) ([dbwinger](https://github.com/dbwinger))
30
+ - Allow webp as image file format [#2274](https://github.com/AlchemyCMS/alchemy_cms/pull/2274) ([tvdeyen](https://github.com/tvdeyen))
31
+ - Rails 7 Support [#2225](https://github.com/AlchemyCMS/alchemy_cms/pull/2225) ([tvdeyen](https://github.com/tvdeyen))
32
+ - Support AR enums in resource models [#2210](https://github.com/AlchemyCMS/alchemy_cms/pull/2210) ([robinboening](https://github.com/robinboening))
33
+
34
+ ## 6.0.0-rc7 (2022-03-28)
35
+
36
+ - fix(Sitemap): Use response data [#2272](https://github.com/AlchemyCMS/alchemy_cms/pull/2272) ([tvdeyen](https://github.com/tvdeyen))
37
+ - Revert "Ajax: Send method override" [#2271](https://github.com/AlchemyCMS/alchemy_cms/pull/2271) ([tvdeyen](https://github.com/tvdeyen))
38
+ - ImageLoader: Add error handling [#2270](https://github.com/AlchemyCMS/alchemy_cms/pull/2270) ([tvdeyen](https://github.com/tvdeyen))
39
+ - Check presence of page_public checkbox [#2269](https://github.com/AlchemyCMS/alchemy_cms/pull/2269) ([afdev82](https://github.com/afdev82))
40
+ - Use lodash-es instead of lodash [#2268](https://github.com/AlchemyCMS/alchemy_cms/pull/2268) ([afdev82](https://github.com/afdev82))
41
+ - CI: Update stale workflow [#2267](https://github.com/AlchemyCMS/alchemy_cms/pull/2267) ([tvdeyen](https://github.com/tvdeyen))
42
+ - Allow to skip db:create during install task [#2266](https://github.com/AlchemyCMS/alchemy_cms/pull/2266) ([tvdeyen](https://github.com/tvdeyen))
43
+ - CI: Fix mysql builds [#2263](https://github.com/AlchemyCMS/alchemy_cms/pull/2263) ([tvdeyen](https://github.com/tvdeyen))
44
+ - Fix new Sitemap [#2262](https://github.com/AlchemyCMS/alchemy_cms/pull/2262) ([tvdeyen](https://github.com/tvdeyen))
45
+ - [ruby - main] Allow ransack version 2.6.0 [#2259](https://github.com/AlchemyCMS/alchemy_cms/pull/2259) ([depfu](https://github.com/apps/depfu))
46
+ - Allow all pages in API again [#2258](https://github.com/AlchemyCMS/alchemy_cms/pull/2258) ([tvdeyen](https://github.com/tvdeyen))
47
+ - Fix setting default value of ingredients [#2257](https://github.com/AlchemyCMS/alchemy_cms/pull/2257) ([tvdeyen](https://github.com/tvdeyen))
48
+ - Eager load in PageTree serializer [#2256](https://github.com/AlchemyCMS/alchemy_cms/pull/2256) ([tvdeyen](https://github.com/tvdeyen))
49
+ - Revert "Merge pull request #2203 from tvdeyen/switch-to-cuprite" [#2255](https://github.com/AlchemyCMS/alchemy_cms/pull/2255) ([tvdeyen](https://github.com/tvdeyen))
50
+ - [js] New version of flatpickr (4.6.10) broke the build [#2254](https://github.com/AlchemyCMS/alchemy_cms/pull/2254) ([depfu](https://github.com/apps/depfu))
51
+ - New sortable page tree [#2252](https://github.com/AlchemyCMS/alchemy_cms/pull/2252) ([tvdeyen](https://github.com/tvdeyen))
52
+ - Use minor versions for ruby version matrix [#2251](https://github.com/AlchemyCMS/alchemy_cms/pull/2251) ([tvdeyen](https://github.com/tvdeyen))
53
+ - Precompile packs during test setup [#2250](https://github.com/AlchemyCMS/alchemy_cms/pull/2250) ([tvdeyen](https://github.com/tvdeyen))
54
+ - Allow parent page change [#2246](https://github.com/AlchemyCMS/alchemy_cms/pull/2246) ([tvdeyen](https://github.com/tvdeyen))
55
+ - Send language_id to Api::PagesController#index so Pages can be restricted to the language of the page [#2245](https://github.com/AlchemyCMS/alchemy_cms/pull/2245) ([dbwinger](https://github.com/dbwinger))
56
+
1
57
  ## 6.0.0-rc6 (2022-03-05)
2
58
 
3
59
  - Rework sitemap JS [#2249](https://github.com/AlchemyCMS/alchemy_cms/pull/2249) ([tvdeyen](https://github.com/tvdeyen))
@@ -189,6 +245,52 @@
189
245
  - Fix delete element confirm dialog [#2023](https://github.com/AlchemyCMS/alchemy_cms/pull/2023) ([tvdeyen](https://github.com/tvdeyen))
190
246
  - Build for Ruby 3 [#1990](https://github.com/AlchemyCMS/alchemy_cms/pull/1990) ([tvdeyen](https://github.com/tvdeyen))
191
247
 
248
+ ## 5.2.7 (2022-03-01)
249
+
250
+ - Fix copying page with descendants to a different language ([dbwinger](https://github.com/dbwinger))
251
+ - Handle copying/pasting global pages ([dbwinger](https://github.com/dbwinger))
252
+
253
+ ## 5.2.6 (2022-02-28)
254
+
255
+ - Add crop_resize Dragonfly processor ([tvdeyen](https://github.com/tvdeyen))
256
+
257
+ ## 5.2.5 (2021-11-24)
258
+
259
+ - Adjust tinymce skin assets urls again ([tvdeyen](https://github.com/tvdeyen))
260
+
261
+ ## 5.2.4 (2021-11-17)
262
+
263
+ - Set stampable user_class_name without root identifier ([tvdeyen](https://github.com/tvdeyen))
264
+ - Use relative path for tinymce font-face ([tvdeyen](https://github.com/tvdeyen))
265
+
266
+ ## 5.2.3 (2021-10-26)
267
+
268
+ - Make sure to install correct npm package ([tvdeyen](https://github.com/tvdeyen))
269
+
270
+ ## 5.2.2 (2021-09-15)
271
+
272
+ - Return only pages from current site in api [#2169](https://github.com/AlchemyCMS/alchemy_cms/pull/2169) ([afdev82](https://github.com/afdev82))
273
+ - Improve cache key defaults for menus #2138 [#2160](https://github.com/AlchemyCMS/alchemy_cms/pull/2160) ([oneiros](https://github.com/oneiros))
274
+ - generate picture thumbnails only for pictures with convertible format [#2130](https://github.com/AlchemyCMS/alchemy_cms/pull/2130) ([afdev82](https://github.com/afdev82))
275
+ - Backport #2114 to v5.2 [#2116](https://github.com/AlchemyCMS/alchemy_cms/pull/2116) ([afdev82](https://github.com/afdev82))
276
+ - Add webpacker tasks to Alchemy upgrader [#2115](https://github.com/AlchemyCMS/alchemy_cms/pull/2115) ([dbwinger](https://github.com/dbwinger))
277
+
278
+ ## 5.2.1 (2021-05-13)
279
+
280
+ - Fix alchemy:generate:thumbnails task [#2092](https://github.com/AlchemyCMS/alchemy_cms/pull/2092) ([afdev82](https://github.com/afdev82))
281
+ - Do not attempt to generate thumbs for svg files. [#2090](https://github.com/AlchemyCMS/alchemy_cms/pull/2090) ([oneiros](https://github.com/oneiros))
282
+
283
+ ## 5.2.0 (2021-05-06)
284
+
285
+ - Backport #2049 to 5.2 [#2086](https://github.com/AlchemyCMS/alchemy_cms/pull/2086) ([rickythefox](https://github.com/rickythefox))
286
+ - hotfix and deprecate page_active? helper [#2073](https://github.com/AlchemyCMS/alchemy_cms/pull/2073) ([robinboening](https://github.com/robinboening))
287
+
288
+ ## 5.2.0.rc1 (2021-02-17)
289
+
290
+ ### Changes
291
+
292
+ - Change Factory loading mechanism to FactoryBots supported mechanism [#2030](https://github.com/AlchemyCMS/alchemy_cms/pull/2030) ([mamhoff](https://github.com/mamhoff))
293
+
192
294
  ## 5.2.0.b1 (2021-02-11)
193
295
 
194
296
  ### Features
data/Gemfile CHANGED
@@ -3,8 +3,16 @@ source "https://rubygems.org"
3
3
 
4
4
  gemspec
5
5
 
6
- rails_version = ENV.fetch("RAILS_VERSION", 6.1).to_f
7
- gem "rails", "~> #{rails_version}.0"
6
+ rails_version = ENV.fetch("RAILS_VERSION", 7.0).to_f
7
+ # Necessary until a new 6.1.5 version has been released
8
+ # https://github.com/rails/rails/pull/44691
9
+ if rails_version.to_s.match?(/6.1/)
10
+ gem "rails", git: "https://github.com/rails/rails", branch: "6-1-stable"
11
+ elsif rails_version.to_s.match?(/7.0/)
12
+ gem "rails", git: "https://github.com/rails/rails", branch: "7-0-stable"
13
+ else
14
+ gem "rails", "~> #{rails_version}.0"
15
+ end
8
16
 
9
17
  if ENV["DB"].nil? || ENV["DB"] == "sqlite"
10
18
  gem "sqlite3", "~> 1.4.1"
@@ -41,7 +49,14 @@ group :development, :test do
41
49
  end
42
50
  end
43
51
 
44
- # Necessary for system tests in Rails 6.0
45
- if ENV["RAILS_VERSION"] == "6.0"
46
- gem "selenium-webdriver"
52
+ # Ruby 3.1 split out the net-smtp gem
53
+ # Necessary until https://github.com/mikel/mail/pull/1439
54
+ # got merged and released.
55
+ if Gem.ruby_version >= Gem::Version.new("3.1.0")
56
+ if rails_version.to_s.match?(/6.1/)
57
+ # Rails 6.1 needs this as well
58
+ gem "net-pop", "~> 0.1.0", require: false
59
+ gem "net-imap", "~> 0.2.0", require: false
60
+ end
61
+ gem "net-smtp", "~> 0.3.0", require: false
47
62
  end
data/README.md CHANGED
@@ -18,7 +18,7 @@ Alchemy is an open source CMS engine written in Ruby on Rails.
18
18
 
19
19
  Read more about Alchemy on the [website](https://alchemy-cms.com) and in the [guidelines](https://guides.alchemy-cms.com).
20
20
 
21
- **CAUTION: This main branch is a development branch that *can* contain bugs. For productive environments you should use the [current Ruby gem version](https://rubygems.org/gems/alchemy_cms), or the [latest stable branch (5.2-stable)](https://github.com/AlchemyCMS/alchemy_cms/tree/5.2-stable).**
21
+ **CAUTION: This main branch is a development branch that *can* contain bugs. For productive environments you should use the [current Ruby gem version](https://rubygems.org/gems/alchemy_cms), or the [latest stable branch (6.0-stable)](https://github.com/AlchemyCMS/alchemy_cms/tree/6.0-stable).**
22
22
 
23
23
 
24
24
  ## ✅ Features
@@ -27,6 +27,7 @@ Read more about Alchemy on the [website](https://alchemy-cms.com) and in the [gu
27
27
  - A rich RESTful API
28
28
  - Intuitive admin interface with live preview
29
29
  - Multi language and multi domain
30
+ - Page versioning
30
31
  - SEO friendly urls
31
32
  - User Access Control
32
33
  - Build in contact form mailer
@@ -51,9 +52,9 @@ or visit the existing demo at https://alchemy-demo.herokuapp.com
51
52
 
52
53
  ## 🚂 Rails Version
53
54
 
54
- **This version of AlchemyCMS runs with Rails 6.0**
55
+ **This version of AlchemyCMS runs with Rails 7.0, 6.1 and 6.0**
55
56
 
56
- * For a Rails 5.2 compatible version use the [`5.2-stable` branch](https://github.com/AlchemyCMS/alchemy_cms/tree/5.2-stable).
57
+ * For a Rails 5.2 compatible version use the [`5.3-stable` branch](https://github.com/AlchemyCMS/alchemy_cms/tree/5.3-stable).
57
58
  * For a Rails 5.0 or 5.1 compatible version use the [`4.5-stable` branch](https://github.com/AlchemyCMS/alchemy_cms/tree/4.5-stable).
58
59
  * For a Rails 4.2 compatible version use the [`3.6-stable` branch](https://github.com/AlchemyCMS/alchemy_cms/tree/3.6-stable).
59
60
  * For a Rails 4.0/4.1 compatible version use the [`3.1-stable` branch](https://github.com/AlchemyCMS/alchemy_cms/tree/3.1-stable).
data/Rakefile CHANGED
@@ -41,12 +41,16 @@ namespace :alchemy do
41
41
  task :prepare do
42
42
  system(
43
43
  <<~BASH
44
+ yarn install && \
45
+ yarn link && \
44
46
  cd spec/dummy && \
45
47
  export RAILS_ENV=test && \
46
48
  bin/rake db:create && \
47
49
  bin/rake db:environment:set && \
48
50
  bin/rake db:migrate:reset && \
49
- bin/rails g alchemy:install --skip --skip-demo-files --auto-accept && \
51
+ bin/rails g alchemy:install --skip --skip-demo-files --auto-accept --skip-db-create && \
52
+ yarn link @alchemy_cms/admin && \
53
+ RAILS_ENV=test bin/webpack && \
50
54
  cd -
51
55
  BASH
52
56
  ) || fail
data/alchemy_cms.gemspec CHANGED
@@ -29,7 +29,7 @@ Gem::Specification.new do |gem|
29
29
  activesupport
30
30
  railties
31
31
  ].each do |rails_gem|
32
- gem.add_runtime_dependency rails_gem, [">= 6.0", "< 6.2"]
32
+ gem.add_runtime_dependency rails_gem, [">= 6.0", "< 7.1"]
33
33
  end
34
34
 
35
35
  gem.add_runtime_dependency "active_model_serializers", ["~> 0.10.0"]
@@ -46,7 +46,7 @@ Gem::Specification.new do |gem|
46
46
  gem.add_runtime_dependency "kaminari", ["~> 1.1"]
47
47
  gem.add_runtime_dependency "originator", ["~> 3.1"]
48
48
  gem.add_runtime_dependency "non-stupid-digest-assets", ["~> 1.0.8"]
49
- gem.add_runtime_dependency "ransack", [">= 1.8", "<= 2.5.0"] # 2.4.2 dropped Ruby 2.5 support in a patch level release
49
+ gem.add_runtime_dependency "ransack", [">= 1.8", "< 4.0"]
50
50
  gem.add_runtime_dependency "request_store", ["~> 1.2"]
51
51
  gem.add_runtime_dependency "responders", [">= 2.0", "< 4.0"]
52
52
  gem.add_runtime_dependency "sassc-rails", ["~> 2.1"]
@@ -57,13 +57,13 @@ Gem::Specification.new do |gem|
57
57
 
58
58
  gem.add_development_dependency "capybara", ["~> 3.0"]
59
59
  gem.add_development_dependency "capybara-screenshot", ["~> 1.0"]
60
- gem.add_development_dependency "cuprite", ["~> 0.13"]
61
60
  gem.add_development_dependency "factory_bot_rails", ["~> 6.0"]
62
61
  gem.add_development_dependency "puma", ["~> 5.0"]
63
62
  gem.add_development_dependency "rails-controller-testing", ["~> 1.0"]
64
63
  gem.add_development_dependency "rspec-activemodel-mocks", ["~> 1.0"]
65
64
  gem.add_development_dependency "rspec-rails", [">= 4.0.0.beta2"]
66
65
  gem.add_development_dependency "simplecov", ["~> 0.20"]
66
+ gem.add_development_dependency "webdrivers", ["~> 5.0"]
67
67
  gem.add_development_dependency "webmock", ["~> 3.3"]
68
68
  gem.add_development_dependency "shoulda-matchers", ["~> 5.0"]
69
69
  gem.add_development_dependency "timecop", ["~> 0.9"]
@@ -35,7 +35,6 @@
35
35
  //= require alchemy/alchemy.link_dialog
36
36
  //= require alchemy/alchemy.list_filter
37
37
  //= require alchemy/alchemy.initializer
38
- //= require alchemy/alchemy.page_sorter
39
38
  //= require alchemy/alchemy.uploader
40
39
  //= require alchemy/alchemy.preview_window
41
40
  //= require alchemy/alchemy.spinner
@@ -87,6 +87,8 @@ class window.Alchemy.LinkDialog extends Alchemy.Dialog
87
87
  name: page.name
88
88
  url_path: page.url_path
89
89
  page_id: page.id
90
+ language: page.language
91
+ site: page.site
90
92
  more: meta.page * meta.per_page < meta.total_count
91
93
  initSelection: ($element, callback) =>
92
94
  urlname = $element.val()
@@ -1,9 +1,11 @@
1
- $.fn.alchemyPageSelect = function(options) {
1
+ $.fn.alchemyPageSelect = function (options) {
2
2
  var pageTemplate = HandlebarsTemplates.page
3
3
 
4
4
  return this.select2({
5
5
  placeholder: options.placeholder,
6
- allowClear: true,
6
+ allowClear: options.hasOwnProperty("allowClear")
7
+ ? options.allowClear
8
+ : true,
7
9
  minimumInputLength: 3,
8
10
  initSelection: function (_$el, callback) {
9
11
  if (options.initialSelection) {
@@ -12,13 +14,16 @@ $.fn.alchemyPageSelect = function(options) {
12
14
  },
13
15
  ajax: {
14
16
  url: options.url,
15
- datatype: 'json',
17
+ datatype: "json",
16
18
  quietMillis: 300,
17
19
  data: function (term, page) {
18
20
  return {
19
- q: $.extend({
20
- name_cont: term
21
- }, options.query_params),
21
+ q: $.extend(
22
+ {
23
+ name_cont: term
24
+ },
25
+ options.query_params
26
+ ),
22
27
  page: page
23
28
  }
24
29
  },
@@ -34,8 +39,8 @@ $.fn.alchemyPageSelect = function(options) {
34
39
  formatSelection: function (page) {
35
40
  return page.text || page.name
36
41
  },
37
- formatResult: function(page) {
38
- return pageTemplate({page: page})
42
+ formatResult: function (page) {
43
+ return pageTemplate({ page: page })
39
44
  }
40
45
  })
41
46
  }
@@ -2,3 +2,4 @@
2
2
  //= require alchemy/templates/page
3
3
  //= require alchemy/templates/node_folder
4
4
  //= require alchemy/templates/node
5
+ //= require alchemy/templates/page_folder
@@ -1,9 +1,19 @@
1
1
  <div class="page-select--page">
2
- <i class="icon far fa-file fa-lg"></i>
3
- <span class="page-select--page-name">
4
- {{ page.name }}
5
- </span>
6
- <span class="page-select--page-urlname">
7
- {{ page.url_path }}
8
- </span>
2
+ <div class="page-select--top">
3
+ <i class="icon far fa-file fa-lg"></i>
4
+ <span class="page-select--page-name">
5
+ {{ page.name }}
6
+ </span>
7
+ <span class="page-select--page-urlname">
8
+ {{ page.url_path }}
9
+ </span>
10
+ </div>
11
+ <div class="page-select--bottom">
12
+ <span class="page-select--site-name">
13
+ {{ page.site.name }}
14
+ </span>
15
+ <span class="page-select--language-code">
16
+ {{ page.language.name }}
17
+ </span>
18
+ </div>
9
19
  </div>
@@ -0,0 +1,3 @@
1
+ <a class="page_folder" data-page-id="{{ page.id }}">
2
+ <i class="far fa-{{#if page.folded }}plus{{else}}minus{{/if}}-square fa-fw"></i>
3
+ </a>
@@ -48,6 +48,10 @@ div#image_assign_filter_and_image_sizing {
48
48
  background-color: $thumbnail-background-color;
49
49
  width: 100%;
50
50
  height: 120px;
51
+
52
+ &:hover {
53
+ text-decoration: none;
54
+ }
51
55
  }
52
56
 
53
57
  .picture_thumbnail {
@@ -61,6 +65,11 @@ div#image_assign_filter_and_image_sizing {
61
65
  width: 100%;
62
66
  height: 100%;
63
67
  object-fit: contain;
68
+
69
+ &[src$=".svg"] {
70
+ width: auto;
71
+ height: auto;
72
+ }
64
73
  }
65
74
 
66
75
  .picture_name {
@@ -545,6 +545,10 @@
545
545
  font-size: 4em;
546
546
  color: $medium-gray;
547
547
  vertical-align: top;
548
+
549
+ &.error {
550
+ font-size: 1.2em;
551
+ }
548
552
  }
549
553
 
550
554
  .essence_picture_css_class {
@@ -8,24 +8,49 @@
8
8
 
9
9
  .page-select--page {
10
10
  display: flex;
11
- align-items: center;
11
+ flex-direction: column;
12
12
 
13
13
  .icon {
14
14
  margin: 0 8px 0 4px;
15
15
 
16
16
  .select2-highlighted & {
17
- color: $white
17
+ color: $white;
18
18
  }
19
19
  }
20
20
  }
21
21
 
22
+ .page-select--top,
23
+ .page-select--bottom {
24
+ display: flex;
25
+ flex-direction: row;
26
+ align-items: center;
27
+ }
28
+
29
+ .page-select--bottom {
30
+ font-size: $small-font-size;
31
+ padding-left: 6 * $default-padding;
32
+ }
33
+
34
+ .page-select--language-code {
35
+ display: inline-block;
36
+ background-color: $medium-gray;
37
+ margin-left: auto;
38
+ border-radius: $default-border-radius;
39
+ padding: $default-padding / 2 $default-padding;
40
+
41
+ .select2-highlighted & {
42
+ color: $select-hover-bg-color;
43
+ background-color: white;
44
+ }
45
+ }
46
+
22
47
  .page-select--page-urlname {
23
48
  margin-left: auto;
24
- padding: $default-padding 2*$default-padding;
49
+ padding: $default-padding 2 * $default-padding;
25
50
  color: $dark-gray;
26
51
  font-size: $small-font-size;
27
52
 
28
53
  .select2-highlighted & {
29
- color: $white
54
+ color: $white;
30
55
  }
31
56
  }
@@ -142,12 +142,8 @@ $sitemap-url-xlarge-width: 350px;
142
142
  #sitemap {
143
143
  padding: 0 0 104px 0;
144
144
 
145
- &.sorting {
146
- padding-top: 100px;
147
-
148
- .page_icon {
149
- cursor: move;
150
- }
145
+ .handle {
146
+ cursor: move;
151
147
  }
152
148
 
153
149
  .page_folder {
@@ -12,6 +12,7 @@ module Alchemy
12
12
  elements = @page_version.elements.order(:position).includes(*element_includes)
13
13
  @elements = elements.not_nested.unfixed
14
14
  @fixed_elements = elements.not_nested.fixed
15
+ load_clipboard_items
15
16
  end
16
17
 
17
18
  def new
@@ -20,8 +21,7 @@ module Alchemy
20
21
  @parent_element = Element.find_by(id: params[:parent_element_id])
21
22
  @elements = @page.available_elements_within_current_scope(@parent_element)
22
23
  @element = @page_version.elements.build
23
- @clipboard = get_clipboard("elements")
24
- @clipboard_items = Element.all_from_clipboard_for_page(@clipboard, @page)
24
+ load_clipboard_items
25
25
  end
26
26
 
27
27
  # Creates a element as discribed in config/alchemy/elements.yml on page via AJAX.
@@ -44,8 +44,7 @@ module Alchemy
44
44
  else
45
45
  @element.page_version = @page_version
46
46
  @elements = @page.available_element_definitions
47
- @clipboard = get_clipboard("elements")
48
- @clipboard_items = Element.all_from_clipboard_for_page(@clipboard, @page)
47
+ load_clipboard_items
49
48
  render :new
50
49
  end
51
50
  end
@@ -106,18 +105,14 @@ module Alchemy
106
105
  def element_includes
107
106
  [
108
107
  {
109
- contents: {
110
- essence: :ingredient_association,
111
- },
108
+ contents: :essence,
112
109
  ingredients: :related_object,
113
110
  },
114
111
  :tags,
115
112
  {
116
113
  all_nested_elements: [
117
114
  {
118
- contents: {
119
- essence: :ingredient_association,
120
- },
115
+ contents: :essence,
121
116
  ingredients: :related_object,
122
117
  },
123
118
  :tags,
@@ -130,19 +125,27 @@ module Alchemy
130
125
  @element = Element.find(params[:id])
131
126
  end
132
127
 
128
+ def load_clipboard_items
129
+ @clipboard = get_clipboard("elements")
130
+ @clipboard_items = Element.all_from_clipboard_for_page(@clipboard, @page)
131
+ end
132
+
133
133
  def element_from_clipboard
134
134
  @element_from_clipboard ||= begin
135
- @clipboard = get_clipboard("elements")
136
- @clipboard.detect { |item| item["id"].to_i == params[:paste_from_clipboard].to_i }
137
- end
135
+ @clipboard = get_clipboard("elements")
136
+ @clipboard.detect { |item| item["id"].to_i == params[:paste_from_clipboard].to_i }
137
+ end
138
138
  end
139
139
 
140
140
  def paste_element_from_clipboard
141
141
  @source_element = Element.find(element_from_clipboard["id"])
142
- element = Element.copy(@source_element, {
143
- parent_element_id: create_element_params[:parent_element_id],
144
- page_version_id: @page_version.id,
145
- })
142
+ element = Element.copy(
143
+ @source_element,
144
+ {
145
+ parent_element_id: create_element_params[:parent_element_id],
146
+ page_version_id: @page_version.id,
147
+ }
148
+ )
146
149
  if element_from_clipboard["action"] == "cut"
147
150
  @cut_element_id = @source_element.id
148
151
  @clipboard.delete_if { |item| item["id"] == @source_element.id.to_s }