alchemy_cms 7.0.0.pre.b → 7.0.0.pre.c
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of alchemy_cms might be problematic. Click here for more details.
- checksums.yaml +4 -4
- data/.github/workflows/lint.yml +21 -1
- data/.github/workflows/{ci.yml → test.yml} +1 -1
- data/.gitignore +0 -5
- data/CHANGELOG.md +4 -0
- data/Gemfile +0 -1
- data/README.md +3 -3
- data/Rakefile +0 -19
- data/alchemy_cms.gemspec +2 -1
- data/app/assets/config/alchemy_manifest.js +1 -0
- data/app/assets/javascripts/alchemy/admin.js +0 -1
- data/app/assets/javascripts/alchemy/alchemy.dirty.js.coffee +1 -1
- data/app/assets/javascripts/alchemy/alchemy.initializer.js.coffee +5 -12
- data/app/assets/stylesheets/alchemy/base.scss +2 -2
- data/app/controllers/alchemy/base_controller.rb +0 -7
- data/{package/src → app/javascript/alchemy_admin}/node_tree.js +2 -2
- data/{package/src → app/javascript/alchemy_admin}/page_publication_fields.js +1 -1
- data/{package/src → app/javascript/alchemy_admin}/page_sorter.js +1 -1
- data/{package/src → app/javascript/alchemy_admin}/picture_editors.js +2 -2
- data/{package/src → app/javascript/alchemy_admin}/sitemap.js +4 -4
- data/app/javascript/alchemy_admin.js +34 -0
- data/app/views/alchemy/_menubar.html.erb +1 -1
- data/app/views/alchemy/admin/attachments/_replace_button.html.erb +1 -1
- data/app/views/alchemy/admin/attachments/destroy.js.erb +1 -1
- data/app/views/alchemy/admin/nodes/index.html.erb +4 -2
- data/app/views/alchemy/admin/pages/_page_layout_filter.html.erb +1 -1
- data/app/views/alchemy/admin/pages/edit.html.erb +3 -4
- data/app/views/alchemy/admin/pages/index.html.erb +1 -1
- data/app/views/alchemy/admin/pages/update.js.erb +2 -2
- data/app/views/alchemy/admin/resources/_filter_bar.html.erb +1 -1
- data/app/views/alchemy/admin/styleguide/index.html.erb +1 -1
- data/app/views/alchemy/admin/uploader/_button.html.erb +1 -1
- data/app/views/alchemy/base/permission_denied.js.erb +1 -1
- data/app/views/alchemy/base/redirect.js.erb +1 -1
- data/app/views/layouts/alchemy/admin.html.erb +4 -8
- data/bin/importmap +4 -0
- data/bin/setup +0 -9
- data/bin/start +1 -1
- data/config/brakeman.ignore +0 -46
- data/config/importmap.rb +8 -0
- data/lib/alchemy/engine.rb +14 -0
- data/lib/alchemy/upgrader/seven_point_zero.rb +13 -23
- data/lib/alchemy/upgrader.rb +0 -11
- data/lib/alchemy/version.rb +1 -1
- data/lib/alchemy.rb +5 -0
- data/lib/alchemy_cms.rb +2 -1
- data/lib/generators/alchemy/install/files/application.html.erb +2 -2
- data/lib/generators/alchemy/install/install_generator.rb +0 -24
- data/lib/tasks/alchemy/upgrade.rake +6 -12
- data/package.json +6 -26
- metadata +44 -27
- data/package/admin.js +0 -34
- data/package/dist/admin.js +0 -16
- data/package/dist/admin.js.map +0 -7
- data/package/src/__tests__/i18n.spec.js +0 -93
- data/package/src/utils/__tests__/ajax.spec.js +0 -168
- data/package/src/utils/__tests__/events.spec.js +0 -38
- /data/{package/src → app/javascript/alchemy_admin}/datepicker.js +0 -0
- /data/{package/src → app/javascript/alchemy_admin}/file_editors.js +0 -0
- /data/{package/src → app/javascript/alchemy_admin}/i18n.js +0 -0
- /data/{package/src → app/javascript/alchemy_admin}/image_cropper.js +0 -0
- /data/{package/src → app/javascript/alchemy_admin}/image_loader.js +0 -0
- /data/{package/src → app/javascript/alchemy_admin}/ingredient_anchor_link.js +0 -0
- /data/{package/src → app/javascript/alchemy_admin}/tinymce.js +0 -0
- /data/{package/src → app/javascript/alchemy_admin}/translations.js +0 -0
- /data/{package/src → app/javascript/alchemy_admin}/utils/ajax.js +0 -0
- /data/{package/src → app/javascript/alchemy_admin}/utils/events.js +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3d9b2124fdbd7438389b1120a0df30d6ce57a1f353a9ccdae2c59f634b7a60de
|
4
|
+
data.tar.gz: ae2985754c1cb922c8ab9c8b3e510ed13d5139c3b96102346b36710a18f2db5e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8a8965055910fe95085ec5c3ed24ca588d8ab6978463ab4445d762dc1cdcb440f7f6830eb13c09e63d8cbac8fef106f0423ee7689d3bc8f0194fd9e9d474c14a
|
7
|
+
data.tar.gz: f570c09d5423ef778c099c5467e7d0d21d0aab5e027581ad1644f3a3c261633a415b50a47605eed83c702d50d3962a16c6e37d8e2f63a319d2b4f43fbe6421a3
|
data/.github/workflows/lint.yml
CHANGED
@@ -3,7 +3,7 @@ name: Lint
|
|
3
3
|
on: [pull_request]
|
4
4
|
|
5
5
|
jobs:
|
6
|
-
|
6
|
+
Standard:
|
7
7
|
runs-on: ubuntu-latest
|
8
8
|
steps:
|
9
9
|
- name: Checkout code
|
@@ -15,3 +15,23 @@ jobs:
|
|
15
15
|
bundler-cache: true
|
16
16
|
- name: Lint Ruby files
|
17
17
|
run: bundle exec standardrb
|
18
|
+
Prettier:
|
19
|
+
runs-on: ubuntu-latest
|
20
|
+
steps:
|
21
|
+
- name: Checkout
|
22
|
+
uses: actions/checkout@v3
|
23
|
+
- name: Setup Node
|
24
|
+
uses: actions/setup-node@v3
|
25
|
+
with:
|
26
|
+
node-version: "18"
|
27
|
+
- name: Restore node_modules cache
|
28
|
+
uses: actions/cache@v3
|
29
|
+
with:
|
30
|
+
path: node_modules
|
31
|
+
key: ${{ runner.os }}-node-modules-${{ hashFiles('package.json') }}
|
32
|
+
restore-keys: |
|
33
|
+
${{ runner.os }}-node-modules
|
34
|
+
- name: Install dependencies
|
35
|
+
run: yarn install
|
36
|
+
- name: Lint code
|
37
|
+
run: yarn lint
|
data/.gitignore
CHANGED
@@ -9,15 +9,10 @@ pkg
|
|
9
9
|
tmp
|
10
10
|
log
|
11
11
|
.sass-cache
|
12
|
-
spec/dummy/app/assets/builds/*.js*
|
13
|
-
spec/dummy/app/javascript/
|
14
12
|
spec/dummy/config/alchemy/config.yml
|
15
13
|
spec/dummy/db/*.sqlite3*
|
16
|
-
spec/dummy/package.json
|
17
14
|
spec/dummy/postcss.config.js
|
18
15
|
spec/dummy/public/assets/
|
19
|
-
spec/dummy/public/packs/
|
20
|
-
spec/dummy/public/packs-test/
|
21
16
|
spec/dummy/uploads/
|
22
17
|
.rvmrc
|
23
18
|
/coverage/
|
data/CHANGELOG.md
CHANGED
@@ -2,6 +2,10 @@
|
|
2
2
|
|
3
3
|
## 7.0.0 (unreleased)
|
4
4
|
|
5
|
+
- Lint JS code with Prettier [#2503](https://github.com/AlchemyCMS/alchemy_cms/pull/2503) ([tvdeyen](https://github.com/tvdeyen))
|
6
|
+
- Use absolute imports in modules [#2502](https://github.com/AlchemyCMS/alchemy_cms/pull/2502) ([tvdeyen](https://github.com/tvdeyen))
|
7
|
+
- Replace turbolinks with turbo [#2499](https://github.com/AlchemyCMS/alchemy_cms/pull/2499) ([sascha-karnatz](https://github.com/sascha-karnatz))
|
8
|
+
- Use Importmaps for admin JS [#2498](https://github.com/AlchemyCMS/alchemy_cms/pull/2498) ([tvdeyen](https://github.com/tvdeyen))
|
5
9
|
- Fix TinyMCE loading behavior after page change [#2494](https://github.com/AlchemyCMS/alchemy_cms/pull/2494) ([sascha-karnatz](https://github.com/sascha-karnatz))
|
6
10
|
- [js] Update esbuild → 0.18.4 (unknown) [#2492](https://github.com/AlchemyCMS/alchemy_cms/pull/2492) ([depfu](https://github.com/apps/depfu))
|
7
11
|
- Add ransackable attributes to tags [#2487](https://github.com/AlchemyCMS/alchemy_cms/pull/2487) ([tvdeyen](https://github.com/tvdeyen))
|
data/Gemfile
CHANGED
@@ -20,7 +20,6 @@ group :development, :test do
|
|
20
20
|
# in our case the culprit is `handlebars-assets`. The changes between 2.7.0 and 2.8.0 are
|
21
21
|
# minimal, but breaking.
|
22
22
|
gem "execjs", "= 2.8.1"
|
23
|
-
gem "jsbundling-rails", "~> 1.1"
|
24
23
|
gem "rubocop", require: false
|
25
24
|
gem "standard", "~> 1.25", require: false
|
26
25
|
|
data/README.md
CHANGED
@@ -340,7 +340,7 @@ $ bin/start
|
|
340
340
|
|
341
341
|
### Bump version
|
342
342
|
|
343
|
-
Bump the version number in
|
343
|
+
Bump the version number in `lib/alchemy/version.rb`.
|
344
344
|
|
345
345
|
### Update the changelog
|
346
346
|
|
@@ -357,11 +357,11 @@ $ git commit -am "Bump version to vX.Y.Z"
|
|
357
357
|
|
358
358
|
### Release a new version
|
359
359
|
|
360
|
-
This task will publish
|
360
|
+
This task will publish the ruby gem.
|
361
361
|
It also tags the latest commit.
|
362
362
|
|
363
363
|
```bash
|
364
|
-
$ bundle exec rake
|
364
|
+
$ bundle exec rake release
|
365
365
|
```
|
366
366
|
|
367
367
|
## ❓Getting Help
|
data/Rakefile
CHANGED
@@ -41,17 +41,12 @@ namespace :alchemy do
|
|
41
41
|
task :prepare do
|
42
42
|
system(
|
43
43
|
<<~BASH
|
44
|
-
yarn install && \
|
45
|
-
yarn link && \
|
46
44
|
cd spec/dummy && \
|
47
45
|
export RAILS_ENV=test && \
|
48
46
|
bin/rake db:create && \
|
49
47
|
bin/rake db:environment:set && \
|
50
48
|
bin/rake db:migrate:reset && \
|
51
|
-
bin/rails javascript:install:esbuild && \
|
52
49
|
bin/rails g alchemy:install --skip --skip-demo-files --auto-accept --skip-db-create && \
|
53
|
-
yarn link @alchemy_cms/admin && \
|
54
|
-
bin/rails javascript:build && \
|
55
50
|
cd -
|
56
51
|
BASH
|
57
52
|
) || fail
|
@@ -81,18 +76,4 @@ namespace :alchemy do
|
|
81
76
|
File.delete(backup)
|
82
77
|
end
|
83
78
|
end
|
84
|
-
|
85
|
-
desc "Release a new Ruby gem and npm package in one command"
|
86
|
-
task :release do
|
87
|
-
require "json"
|
88
|
-
require_relative "lib/alchemy/version"
|
89
|
-
package = File.read("package.json")
|
90
|
-
unless JSON.parse(package)["version"] == Alchemy.version
|
91
|
-
abort "Ruby gem and npm package versions are out of sync! Please fix."
|
92
|
-
end
|
93
|
-
# Release the Ruby gem with bundler
|
94
|
-
Rake::Task["release"].invoke
|
95
|
-
# Publish npm package via CLI
|
96
|
-
system "npm publish"
|
97
|
-
end
|
98
79
|
end
|
data/alchemy_cms.gemspec
CHANGED
@@ -41,6 +41,7 @@ Gem::Specification.new do |gem|
|
|
41
41
|
gem.add_runtime_dependency "dragonfly_svg", ["~> 0.0.4"]
|
42
42
|
gem.add_runtime_dependency "gutentag", ["~> 2.2", ">= 2.2.1"]
|
43
43
|
gem.add_runtime_dependency "handlebars_assets", ["~> 0.23"]
|
44
|
+
gem.add_runtime_dependency "importmap-rails", ["~> 1.2", ">= 1.2.1"]
|
44
45
|
gem.add_runtime_dependency "jquery-rails", ["~> 4.0", ">= 4.0.4"]
|
45
46
|
gem.add_runtime_dependency "jquery-ui-rails", ["~> 6.0"]
|
46
47
|
gem.add_runtime_dependency "kaminari", ["~> 1.1"]
|
@@ -51,7 +52,7 @@ Gem::Specification.new do |gem|
|
|
51
52
|
gem.add_runtime_dependency "sassc-rails", ["~> 2.1"]
|
52
53
|
gem.add_runtime_dependency "simple_form", [">= 4.0", "< 6"]
|
53
54
|
gem.add_runtime_dependency "sprockets", [">= 3.0", "< 5"]
|
54
|
-
gem.add_runtime_dependency "
|
55
|
+
gem.add_runtime_dependency "turbo-rails", [">= 1.4"]
|
55
56
|
gem.add_runtime_dependency "view_component", ["~> 3.0"]
|
56
57
|
|
57
58
|
gem.add_development_dependency "capybara", ["~> 3.0"]
|
@@ -40,7 +40,7 @@ $.extend Alchemy,
|
|
40
40
|
$form.submit()
|
41
41
|
else if $(element).is("a")
|
42
42
|
callback = ->
|
43
|
-
|
43
|
+
Turbo.visit(element.pathname)
|
44
44
|
if Alchemy.isPageDirty()
|
45
45
|
Alchemy.openConfirmDialog Alchemy.t('page_dirty_notice'),
|
46
46
|
title: Alchemy.t('warning')
|
@@ -1,6 +1,6 @@
|
|
1
1
|
# Initialize all onload scripts at once.
|
2
2
|
#
|
3
|
-
# Called at jQuery ready event and
|
3
|
+
# Called at jQuery ready event and Turbo page change event.
|
4
4
|
#
|
5
5
|
Alchemy.Initializer = ->
|
6
6
|
|
@@ -26,13 +26,13 @@ Alchemy.Initializer = ->
|
|
26
26
|
$('select#change_locale').on 'change', (e) ->
|
27
27
|
url = window.location.pathname
|
28
28
|
delimiter = if url.match(/\?/) then '&' else '?'
|
29
|
-
|
29
|
+
Turbo.visit "#{url}#{delimiter}admin_locale=#{$(this).val()}"
|
30
30
|
|
31
31
|
# Site select handler
|
32
32
|
$('select#change_site').on 'change', (e) ->
|
33
33
|
url = window.location.pathname
|
34
34
|
delimiter = if url.match(/\?/) then '&' else '?'
|
35
|
-
|
35
|
+
Turbo.visit "#{url}#{delimiter}site_id=#{$(this).val()}"
|
36
36
|
|
37
37
|
# Submit forms of selects with `data-autosubmit="true"`
|
38
38
|
$('select[data-auto-submit="true"]').on 'change', (e) ->
|
@@ -46,18 +46,11 @@ Alchemy.Initializer = ->
|
|
46
46
|
tagName = (event.target || event.srcElement).tagName
|
47
47
|
key.isPressed('esc') || !(tagName == 'INPUT' || tagName == 'SELECT' || tagName == 'TEXTAREA')
|
48
48
|
|
49
|
-
|
50
|
-
Turbolinks.enableProgressBar() if Turbolinks.enableProgressBar
|
51
|
-
|
52
|
-
# Turbolinks DOM Ready.
|
53
|
-
# Handle both v2.5(page:change), and v.5.0 (turbolinks:load)
|
54
|
-
$(document).on 'page:change turbolinks:load', ->
|
49
|
+
$(document).on 'turbo:load', ->
|
55
50
|
Alchemy.Initializer()
|
56
51
|
return
|
57
52
|
|
58
|
-
|
59
|
-
# Handle both v2.5(page:receive), and v.5.0 (turbolinks:request-end)
|
60
|
-
$(document).on 'page:receive turbolinks:request-end', ->
|
53
|
+
$(document).on 'turbo:before-fetch-request', ->
|
61
54
|
# Ensure that all tinymce editors get removed before parsing a new page
|
62
55
|
Alchemy.Tinymce.removeFrom $('.has_tinymce')
|
63
56
|
return
|
@@ -9,13 +9,6 @@ module Alchemy
|
|
9
9
|
include Alchemy::ControllerActions
|
10
10
|
include Alchemy::Modules
|
11
11
|
|
12
|
-
# Include Turbolinks explicitly in case Alchemy is embedded into a
|
13
|
-
# larger application that doesn't work with Turbolinks. The app
|
14
|
-
# can then set config.turbolinks.auto_include = false so that
|
15
|
-
# Turbolinks is not included in the app controllers.
|
16
|
-
include Turbolinks::Controller
|
17
|
-
::ActionDispatch::Assertions.include ::Turbolinks::Assertions
|
18
|
-
|
19
12
|
protect_from_forgery
|
20
13
|
|
21
14
|
before_action :mailer_set_url_options
|
@@ -1,6 +1,6 @@
|
|
1
1
|
import Sortable from "sortablejs"
|
2
|
-
import { patch } from "
|
3
|
-
import { on } from "
|
2
|
+
import { patch } from "alchemy_admin/utils/ajax"
|
3
|
+
import { on } from "alchemy_admin/utils/events"
|
4
4
|
|
5
5
|
function displayNodeFolders() {
|
6
6
|
document.querySelectorAll("li.menu-item").forEach((el) => {
|
@@ -1,7 +1,7 @@
|
|
1
1
|
import debounce from "lodash-es/debounce"
|
2
2
|
import max from "lodash-es/max"
|
3
|
-
import { get } from "
|
4
|
-
import ImageLoader from "
|
3
|
+
import { get } from "alchemy_admin/utils/ajax"
|
4
|
+
import ImageLoader from "alchemy_admin/image_loader"
|
5
5
|
|
6
6
|
const UPDATE_DELAY = 125
|
7
7
|
const IMAGE_PLACEHOLDER = '<i class="icon far fa-image fa-fw"></i>'
|
@@ -1,8 +1,8 @@
|
|
1
1
|
// The admin sitemap Alchemy class
|
2
|
-
import PageSorter from "
|
3
|
-
import { on } from "
|
4
|
-
import { get, patch } from "
|
5
|
-
import { createSortables, displayPageFolders } from "
|
2
|
+
import PageSorter from "alchemy_admin/page_sorter"
|
3
|
+
import { on } from "alchemy_admin/utils/events"
|
4
|
+
import { get, patch } from "alchemy_admin/utils/ajax"
|
5
|
+
import { createSortables, displayPageFolders } from "alchemy_admin/page_sorter"
|
6
6
|
|
7
7
|
export default class Sitemap {
|
8
8
|
// Storing some objects.
|
@@ -0,0 +1,34 @@
|
|
1
|
+
import "@hotwired/turbo-rails"
|
2
|
+
|
3
|
+
import translate from "alchemy_admin/i18n"
|
4
|
+
import translationData from "alchemy_admin/translations"
|
5
|
+
import fileEditors from "alchemy_admin/file_editors"
|
6
|
+
import IngredientAnchorLink from "alchemy_admin/ingredient_anchor_link"
|
7
|
+
import pictureEditors from "alchemy_admin/picture_editors"
|
8
|
+
import ImageLoader from "alchemy_admin/image_loader"
|
9
|
+
import ImageCropper from "alchemy_admin/image_cropper"
|
10
|
+
import Datepicker from "alchemy_admin/datepicker"
|
11
|
+
import Sitemap from "alchemy_admin/sitemap"
|
12
|
+
import Tinymce from "alchemy_admin/tinymce"
|
13
|
+
import PagePublicationFields from "alchemy_admin/page_publication_fields"
|
14
|
+
|
15
|
+
// Global Alchemy object
|
16
|
+
if (typeof window.Alchemy === "undefined") {
|
17
|
+
window.Alchemy = {}
|
18
|
+
}
|
19
|
+
|
20
|
+
// Enhance the global Alchemy object with imported features
|
21
|
+
Object.assign(Alchemy, {
|
22
|
+
// Global utility method for translating a given string
|
23
|
+
t: translate,
|
24
|
+
translations: Object.assign(Alchemy.translations || {}, translationData),
|
25
|
+
fileEditors,
|
26
|
+
pictureEditors,
|
27
|
+
ImageLoader: ImageLoader.init,
|
28
|
+
ImageCropper,
|
29
|
+
IngredientAnchorLink,
|
30
|
+
Datepicker,
|
31
|
+
Sitemap,
|
32
|
+
Tinymce,
|
33
|
+
PagePublicationFields
|
34
|
+
})
|
@@ -1,5 +1,5 @@
|
|
1
1
|
<% if !@preview_mode && @page && can?(:edit_content, @page) %>
|
2
|
-
<div id="alchemy_menubar" style="display: none" data-
|
2
|
+
<div id="alchemy_menubar" style="display: none" data-turbo="false">
|
3
3
|
<ul>
|
4
4
|
<li><%= link_to Alchemy.t(:to_alchemy), alchemy.admin_dashboard_url %></li>
|
5
5
|
<li><%= link_to Alchemy.t(:edit_page), alchemy.edit_admin_page_url(@page) %></li>
|
@@ -17,7 +17,7 @@
|
|
17
17
|
selector: '#replace_<%= dom_id(object) %>',
|
18
18
|
file_types: '<%= file_types.join("|") %>',
|
19
19
|
complete: function() {
|
20
|
-
|
20
|
+
Turbo.visit('<%= redirect_url.html_safe %>');
|
21
21
|
}
|
22
22
|
};
|
23
23
|
Alchemy.Uploader(options);
|
@@ -1 +1 @@
|
|
1
|
-
|
1
|
+
Turbo.visit('<%= @url %>');
|
@@ -23,7 +23,7 @@
|
|
23
23
|
$("#page_layout").on("change", function(e) {
|
24
24
|
var url = "<%= alchemy.admin_pages_path(search_filter_params.except(:page_layout, :page).merge(view: "list")) %>";
|
25
25
|
delimiter = url.match(/\?/) ? "&" : "?";
|
26
|
-
|
26
|
+
Turbo.visit(url + delimiter + "page_layout=" + encodeURIComponent($(this).val()));
|
27
27
|
});
|
28
28
|
});
|
29
29
|
</script>
|
@@ -81,7 +81,7 @@
|
|
81
81
|
host: @page.site.host == "*" ? request.host : @page.site.host,
|
82
82
|
),
|
83
83
|
title: Alchemy.t("Visit page"),
|
84
|
-
data: {
|
84
|
+
data: { turbo: false },
|
85
85
|
target: "_blank",
|
86
86
|
class: 'icon_button' do %>
|
87
87
|
<%= render_icon('external-link-alt') %>
|
@@ -140,12 +140,11 @@
|
|
140
140
|
<% content_for :javascripts do %>
|
141
141
|
|
142
142
|
<% content_for :javascript_includes do %>
|
143
|
-
<meta name="
|
143
|
+
<meta name="turbo-cache-control" content="no-cache">
|
144
144
|
<% end %>
|
145
145
|
|
146
146
|
<script type="text/javascript" charset="utf-8">
|
147
|
-
|
148
|
-
$(function() {
|
147
|
+
$(document).one('turbo:load', function() {
|
149
148
|
$('#unlock_page_form, #publish_page_form').on('submit', function(event) {
|
150
149
|
var not_dirty = Alchemy.checkPageDirtyness(this);
|
151
150
|
if (!not_dirty) Alchemy.pleaseWaitOverlay(false);
|
@@ -31,11 +31,11 @@
|
|
31
31
|
Alchemy.growl("<%= j @notice %>");
|
32
32
|
Alchemy.closeCurrentDialog();
|
33
33
|
} else {
|
34
|
-
document.addEventListener('
|
34
|
+
document.addEventListener('turbo:load', function () {
|
35
35
|
Alchemy.growl("<%= j @notice %>");
|
36
36
|
}, { once: true })
|
37
37
|
Alchemy.closeCurrentDialog(function() {
|
38
|
-
|
38
|
+
Turbo.visit(location.toString(), { action: "replace" });
|
39
39
|
});
|
40
40
|
}
|
41
41
|
|
@@ -7,8 +7,8 @@
|
|
7
7
|
<link rel="shortcut icon" href="<%= asset_path('alchemy/favicon.ico') %>">
|
8
8
|
<%= csrf_meta_tag %>
|
9
9
|
<meta name="robots" content="noindex">
|
10
|
-
<%= stylesheet_link_tag('alchemy/admin/all', media: 'screen', 'data-
|
11
|
-
<%= stylesheet_link_tag('alchemy/print', media: 'print', 'data-
|
10
|
+
<%= stylesheet_link_tag('alchemy/admin/all', media: 'screen', 'data-turbo-track' => true) %>
|
11
|
+
<%= stylesheet_link_tag('alchemy/print', media: 'print', 'data-turbo-track' => true) %>
|
12
12
|
<%= yield :stylesheets %>
|
13
13
|
<script>
|
14
14
|
// Global Alchemy JavaScript object.
|
@@ -33,12 +33,8 @@
|
|
33
33
|
};
|
34
34
|
</script>
|
35
35
|
<%= render 'alchemy/admin/partials/routes' %>
|
36
|
-
<%= javascript_include_tag('alchemy/admin/all', 'data-
|
37
|
-
|
38
|
-
<%= javascript_pack_tag('alchemy/admin', 'data-turbolinks-track' => true) %>
|
39
|
-
<% else %>
|
40
|
-
<%= javascript_include_tag('alchemy_admin', 'data-turbolinks-track' => true) %>
|
41
|
-
<% end %>
|
36
|
+
<%= javascript_include_tag('alchemy/admin/all', 'data-turbo-track' => true) %>
|
37
|
+
<%= javascript_importmap_tags("alchemy_admin", importmap: Alchemy.importmap) %>
|
42
38
|
<%= yield :javascript_includes %>
|
43
39
|
</head>
|
44
40
|
<%= content_tag :body, id: 'alchemy', class: alchemy_body_class do %>
|
data/bin/importmap
ADDED
data/bin/setup
CHANGED
@@ -12,23 +12,14 @@ def system!(*args)
|
|
12
12
|
end
|
13
13
|
|
14
14
|
FileUtils.chdir GEM_ROOT do
|
15
|
-
puts "\n== Linking Admin JS package =="
|
16
|
-
system! "yarn link"
|
17
|
-
puts "== Installing dependencies =="
|
18
|
-
system! "yarn install"
|
19
15
|
system! "gem install bundler --conservative"
|
20
16
|
system("bundle check") || system!("bundle install")
|
21
17
|
end
|
22
18
|
|
23
19
|
FileUtils.chdir APP_ROOT do
|
24
20
|
puts "\n== Installing Alchemy into dummy app =="
|
25
|
-
system!("bin/rails javascript:install:esbuild")
|
26
21
|
system!("bin/rails g alchemy:install --skip --skip-demo-files --auto-accept")
|
27
22
|
|
28
|
-
puts "\n== Link Alchemy admin package =="
|
29
|
-
system! "yarn link @alchemy_cms/admin"
|
30
|
-
system! "yarn install"
|
31
|
-
|
32
23
|
puts "\n== Removing old logs and tempfiles =="
|
33
24
|
system! "bin/rails log:clear tmp:clear"
|
34
25
|
end
|
data/bin/start
CHANGED
data/config/brakeman.ignore
CHANGED
@@ -80,29 +80,6 @@
|
|
80
80
|
],
|
81
81
|
"note": ""
|
82
82
|
},
|
83
|
-
{
|
84
|
-
"warning_type": "Command Injection",
|
85
|
-
"warning_code": 14,
|
86
|
-
"fingerprint": "6addfcb9d23d2d6f699f2f3542169744ff749dc4d0a97f8ac783ab92593e1d84",
|
87
|
-
"check_name": "Execute",
|
88
|
-
"message": "Possible command injection",
|
89
|
-
"file": "lib/alchemy/upgrader.rb",
|
90
|
-
"line": 33,
|
91
|
-
"link": "https://brakemanscanner.org/docs/warning_types/command_injection/",
|
92
|
-
"code": "`yarn add @alchemy_cms/admin@~#{Alchemy.version}`",
|
93
|
-
"render_path": null,
|
94
|
-
"location": {
|
95
|
-
"type": "method",
|
96
|
-
"class": "Alchemy::Upgrader",
|
97
|
-
"method": "update_npm_package"
|
98
|
-
},
|
99
|
-
"user_input": "Alchemy.version",
|
100
|
-
"confidence": "Medium",
|
101
|
-
"cwe_id": [
|
102
|
-
77
|
103
|
-
],
|
104
|
-
"note": "The alchemy version is safe"
|
105
|
-
},
|
106
83
|
{
|
107
84
|
"warning_type": "Cross-Site Scripting",
|
108
85
|
"warning_code": 4,
|
@@ -227,29 +204,6 @@
|
|
227
204
|
],
|
228
205
|
"note": ""
|
229
206
|
},
|
230
|
-
{
|
231
|
-
"warning_type": "Command Injection",
|
232
|
-
"warning_code": 14,
|
233
|
-
"fingerprint": "98ca8e77026312eaa7eec15ce26bfe45aa8dd0fcd38e4cff104cb9dffbde1733",
|
234
|
-
"check_name": "Execute",
|
235
|
-
"message": "Possible command injection",
|
236
|
-
"file": "lib/alchemy/upgrader.rb",
|
237
|
-
"line": 31,
|
238
|
-
"link": "https://brakemanscanner.org/docs/warning_types/command_injection/",
|
239
|
-
"code": "`bin/importmap pin @alchemy_cms/admin@~#{Alchemy.version}`",
|
240
|
-
"render_path": null,
|
241
|
-
"location": {
|
242
|
-
"type": "method",
|
243
|
-
"class": "Alchemy::Upgrader",
|
244
|
-
"method": "update_npm_package"
|
245
|
-
},
|
246
|
-
"user_input": "Alchemy.version",
|
247
|
-
"confidence": "Medium",
|
248
|
-
"cwe_id": [
|
249
|
-
77
|
250
|
-
],
|
251
|
-
"note": ""
|
252
|
-
},
|
253
207
|
{
|
254
208
|
"warning_type": "File Access",
|
255
209
|
"warning_code": 16,
|
data/config/importmap.rb
ADDED
@@ -0,0 +1,8 @@
|
|
1
|
+
pin "flatpickr", to: "https://ga.jspm.io/npm:flatpickr@4.6.13/dist/esm/index.js", preload: true
|
2
|
+
pin "lodash-es/debounce", to: "https://ga.jspm.io/npm:lodash-es@4.17.21/debounce.js", preload: true
|
3
|
+
pin "lodash-es/max", to: "https://ga.jspm.io/npm:lodash-es@4.17.21/max.js", preload: true
|
4
|
+
pin "sortablejs", to: "https://ga.jspm.io/npm:sortablejs@1.15.0/modular/sortable.esm.js", preload: true
|
5
|
+
pin "@hotwired/turbo-rails", to: "turbo.min.js", preload: true
|
6
|
+
|
7
|
+
pin "alchemy_admin", to: "alchemy_admin.js", preload: true
|
8
|
+
pin_all_from File.expand_path("../app/javascript/alchemy_admin", __dir__), under: "alchemy_admin"
|