activeadmin-menu_tree 0.2.1 → 0.2.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/workflows/main.yml +6 -6
- data/.rubocop.yml +3 -0
- data/lib/activeadmin/menu_tree/config.rb +2 -1
- data/lib/activeadmin/menu_tree/version.rb +1 -1
- data/lib/activeadmin/menu_tree.rb +2 -2
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a09a571a376bcd6cb00837db448910908016cb70433ae458194f24a8c340e2e6
|
4
|
+
data.tar.gz: 6400276e35ea7dd6334fa5a8fce8d8305d55e0c895641d9731f5afc19ccb27e1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9f6f335ae368765be2e98937a02060c096f0a56e40d4c8ef55fb3a248dc8e94e70f83bedc7c8e1001768faa4d37f1c52817ae20e5941a59f0688cd4b62bc0b41
|
7
|
+
data.tar.gz: dfa94ee8175455fe1ca978e86c3cdf3ba38ea76330a3a6a4f309bf9cfa75253559a90931b431c931f1b02643e3fa54dd5ca9d9bb646775e52c2b3a9e94499eea
|
data/.github/workflows/main.yml
CHANGED
@@ -18,13 +18,13 @@ jobs:
|
|
18
18
|
- name: Set up Ruby
|
19
19
|
uses: ruby/setup-ruby@v1
|
20
20
|
with:
|
21
|
-
ruby-version: 3.1
|
21
|
+
ruby-version: "3.1"
|
22
22
|
- name: Install bundler
|
23
23
|
run: gem install bundler
|
24
24
|
- name: Setup
|
25
25
|
run: bin/setup
|
26
26
|
- name: Rubocop
|
27
|
-
run: bundle exec
|
27
|
+
run: bundle exec rubocop --fail-level W
|
28
28
|
# steep:
|
29
29
|
# runs-on: ubuntu-latest
|
30
30
|
# steps:
|
@@ -32,7 +32,7 @@ jobs:
|
|
32
32
|
# - name: Set up Ruby
|
33
33
|
# uses: ruby/setup-ruby@v1
|
34
34
|
# with:
|
35
|
-
# ruby-version: 3.1
|
35
|
+
# ruby-version: "3.1"
|
36
36
|
# - name: Install bundler
|
37
37
|
# run: gem install bundler
|
38
38
|
# - name: Setup
|
@@ -44,9 +44,9 @@ jobs:
|
|
44
44
|
strategy:
|
45
45
|
matrix:
|
46
46
|
ruby:
|
47
|
-
- 2.7
|
48
|
-
- 3.0
|
49
|
-
- 3.1
|
47
|
+
- "2.7"
|
48
|
+
- "3.0"
|
49
|
+
- "3.1"
|
50
50
|
steps:
|
51
51
|
- uses: actions/checkout@v2
|
52
52
|
- name: Set up Ruby
|
data/.rubocop.yml
CHANGED
@@ -13,6 +13,7 @@ module ActiveAdmin::MenuTree
|
|
13
13
|
def menu_tree=(new_value)
|
14
14
|
raise ActiveAdmin::MenuTree::Error, "Invalid config" unless new_value.is_a? Array
|
15
15
|
|
16
|
+
ActiveAdmin::MenuTree.log_debug("menu_tree=: #{new_value.inspect}")
|
16
17
|
@menu_tree = new_value.map(&:deep_symbolize_keys)
|
17
18
|
@menu_options = flatten_options(@menu_tree)
|
18
19
|
end
|
@@ -36,11 +37,11 @@ module ActiveAdmin::MenuTree
|
|
36
37
|
|
37
38
|
def format_options(item, index:, parent: nil)
|
38
39
|
# TODO: validate option
|
40
|
+
options = item.except(:children)
|
39
41
|
if item.key?(:name)
|
40
42
|
ActiveAdmin::MenuTree.warn_deprecated("Use `id` key, instead of `name`.")
|
41
43
|
options[:id] ||= item[:name]
|
42
44
|
end
|
43
|
-
options = item.except(:children)
|
44
45
|
options[:priority] = index * 10
|
45
46
|
options[:parent] = parent if parent.present?
|
46
47
|
options
|
@@ -44,8 +44,8 @@ module ActiveAdmin
|
|
44
44
|
ActiveAdmin::MenuTree.log_debug("menu_options: #{menu_options.inspect}")
|
45
45
|
aa_config.namespace :admin do |admin|
|
46
46
|
admin.build_menu do |menu|
|
47
|
-
menu_options.each do |
|
48
|
-
menu.add(**
|
47
|
+
menu_options.each do |option|
|
48
|
+
menu.add(**option.dup)
|
49
49
|
end
|
50
50
|
end
|
51
51
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: activeadmin-menu_tree
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- shuuuuuny
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2023-01-05 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activeadmin
|
@@ -94,7 +94,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
94
94
|
- !ruby/object:Gem::Version
|
95
95
|
version: '0'
|
96
96
|
requirements: []
|
97
|
-
rubygems_version: 3.3.
|
97
|
+
rubygems_version: 3.3.26
|
98
98
|
signing_key:
|
99
99
|
specification_version: 4
|
100
100
|
summary: Allows ActiveAdmin menus to be managed in tree format.
|