alchemy-solidus 6.2.0 → 6.3.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 83134d605ab6eddb6cebeec22500f75a586bba99cafeb265d5ed87eb59ce46ad
4
- data.tar.gz: 7adfa3ac35bf9173eae869797cddba713eb26876229f2cf65ce5d705b017088c
3
+ metadata.gz: 628affa5df0d55f3bf40f0609d3fcb7a13117211fe191ad18a65ff2b9fe8d089
4
+ data.tar.gz: f887fabd4f2eeeb5f4e9225d0e3cbec5ef4af1ea120dd987c02789bc3c92dca3
5
5
  SHA512:
6
- metadata.gz: 16163761f5f000d13d0485c54b9d1332f2117678e4d631764d1d9198ac0cd2b8f2050813923ca9903bc0b95249289a0296e7bdd0d27caf7f50d38b1068715d99
7
- data.tar.gz: e49d6db23f3cd0f366f3497ee312e7bac59fde8f03ea6df12d708d78475caff6b87d1ee2348333c18f7e6683d1d7fee4ba950b9152ed96cc740b41175db917a4
6
+ metadata.gz: 2d1a2eb2d4e0a8113bc0b46d32f397b1d8e943ce5716a93df7b8b99c92210a3bb52a2128e760d0db840295c4eabb5cfdf96a03d0e2e9ad26ffde56b9ec8f3f9a
7
+ data.tar.gz: e6db47cc5296f2c5b64d1f03d2601193e072a9f2bac2582e9eea87785ba015edc283013edd31473b85ca9641673eee949f9431cd0d31b55c9e75deeb004ac50d
data/Rakefile CHANGED
@@ -16,7 +16,7 @@ require "active_support/core_ext/string"
16
16
 
17
17
  desc "Setup test app"
18
18
  task :test_setup do
19
- solidus_version = ENV.fetch("SOLIDUS_VERSION", "4.0")
19
+ solidus_version = ENV.fetch("SOLIDUS_VERSION", "4.2")
20
20
  solidus_32_install_options =
21
21
  "--payment-method none --frontend none --no-with-authentication"
22
22
  solidus_33_install_options =
@@ -1,3 +1,71 @@
1
1
  if defined?(Alchemy::Devise::Engine)
2
2
  Spree.user_class = "Alchemy::User"
3
3
  end
4
+
5
+ Rails.application.config.after_initialize do
6
+ Spree::Backend::Config.configure do |config|
7
+ alchemy_menu_item = if Spree.solidus_gem_version >= Gem::Version.new("4.2.0")
8
+ config.class::MenuItem.new(
9
+ label: :cms,
10
+ icon: config.admin_updated_navbar ? "ri-pages-line" : "copy",
11
+ condition: -> { can?(:index, :alchemy_admin_dashboard) },
12
+ url: -> { Alchemy::Engine.routes.url_helpers.admin_dashboard_path },
13
+ children: [
14
+ config.class::MenuItem.new(
15
+ label: :pages,
16
+ condition: -> { can?(:index, :alchemy_admin_pages) },
17
+ url: -> { Alchemy::Engine.routes.url_helpers.admin_pages_path },
18
+ match_path: "/pages"
19
+ ),
20
+ config.class::MenuItem.new(
21
+ label: :languages,
22
+ condition: -> { can?(:index, :alchemy_admin_sites) },
23
+ url: -> { Alchemy::Engine.routes.url_helpers.admin_sites_path },
24
+ match_path: "/languages"
25
+ ),
26
+ (if defined?(Alchemy::Devise::Engine)
27
+ config.class::MenuItem.new(
28
+ label: :users,
29
+ condition: -> { can?(:index, :alchemy_admin_users) },
30
+ url: -> { Alchemy::Engine.routes.url_helpers.admin_users_path },
31
+ match_path: "/users"
32
+ )
33
+ end),
34
+ config.class::MenuItem.new(
35
+ label: :tags,
36
+ condition: -> { can?(:index, :alchemy_admin_tags) },
37
+ url: -> { Alchemy::Engine.routes.url_helpers.admin_tags_path }
38
+ ),
39
+ config.class::MenuItem.new(
40
+ label: :pictures,
41
+ condition: -> { can?(:index, :alchemy_admin_pictures) },
42
+ url: -> { Alchemy::Engine.routes.url_helpers.admin_pictures_path }
43
+ ),
44
+ config.class::MenuItem.new(
45
+ label: :attachments,
46
+ condition: -> { can?(:index, :alchemy_admin_attachments) },
47
+ url: -> { Alchemy::Engine.routes.url_helpers.admin_attachments_path }
48
+ )
49
+ ].compact
50
+ )
51
+ else
52
+ config.class::MenuItem.new(
53
+ [:pages, :sites, :languages, :tags, :users, :pictures, :attachments],
54
+ "copy",
55
+ label: :cms,
56
+ condition: -> { can?(:index, :alchemy_admin_dashboard) },
57
+ partial: "spree/admin/shared/alchemy_sub_menu",
58
+ url: "/admin/pages",
59
+ match_path: "/pages"
60
+ )
61
+ end
62
+ settings = config.menu_items.detect { |item| item.label == :settings }
63
+ config.menu_items.index(settings).tap do |index|
64
+ config.menu_items.insert(index, alchemy_menu_item)
65
+ end
66
+ end
67
+
68
+ if Spree::Backend::Config.menu_items.many? { |menu_item| menu_item.label == :cms }
69
+ Alchemy::Deprecation.warn("You configured the Alchemy menu items in your app's initializers. We can do that for you now! Please remove the menu item with the label `:cms`.")
70
+ end
71
+ end
@@ -1,5 +1,5 @@
1
1
  module Alchemy
2
2
  module Solidus
3
- VERSION = "6.2.0"
3
+ VERSION = "6.3.1"
4
4
  end
5
5
  end
@@ -1,12 +1,5 @@
1
1
  require "rails/generators"
2
- require "alchemy/version"
3
-
4
- if Alchemy.gem_version >= Gem::Version.new("5.0.0.a")
5
- require "generators/alchemy/install/install_generator"
6
- else
7
- require "rails/generators/alchemy/install/install_generator"
8
- end
9
-
2
+ require "generators/alchemy/install/install_generator"
10
3
  require "generators/spree/custom_user/custom_user_generator"
11
4
  require "solidus_support"
12
5
 
@@ -90,27 +83,6 @@ module Alchemy
90
83
  end
91
84
  end
92
85
 
93
- def inject_admin_tab
94
- inject_into_file "config/initializers/spree.rb",
95
- {
96
- after:
97
- "Spree::Backend::Config.configure do |config|\n"
98
- } do
99
- <<~ADMIN_TAB
100
- \ # AlchemyCMS admin tabs
101
- \ config.menu_items << config.class::MenuItem.new(
102
- \ [:pages, :sites, :languages, :tags, :users, :pictures, :attachments],
103
- \ 'copy',
104
- \ label: :cms,
105
- \ condition: -> { can?(:index, :alchemy_admin_dashboard) },
106
- \ partial: 'spree/admin/shared/alchemy_sub_menu',
107
- \ url: '/admin/pages',
108
- \ match_path: '/pages'
109
- \ )
110
- ADMIN_TAB
111
- end
112
- end
113
-
114
86
  def create_admin_user
115
87
  if alchemy_devise_present? && !options[:skip_alchemy_user_generator] &&
116
88
  Alchemy::User.count.zero?
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: alchemy-solidus
3
3
  version: !ruby/object:Gem::Version
4
- version: 6.2.0
4
+ version: 6.3.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Thomas von Deyen
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-09-18 00:00:00.000000000 Z
11
+ date: 2023-11-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: alchemy_cms