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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: ae470640145da2a76875e361c8e1a5bb99838ff72894c9fc8f66dd266226004c
4
- data.tar.gz: bc6fe3ffe900a9e8a1430ca25a82815c32d67f3b0979df55fe9af4bd25d3e223
3
+ metadata.gz: a09a571a376bcd6cb00837db448910908016cb70433ae458194f24a8c340e2e6
4
+ data.tar.gz: 6400276e35ea7dd6334fa5a8fce8d8305d55e0c895641d9731f5afc19ccb27e1
5
5
  SHA512:
6
- metadata.gz: aa4d16bdde948794cc92965ffa9ec94cfbed5fdcf102c6300d941dbd6f8b80a73b69ced428cd884d37f40c582eab88d283b18299893f97cb8a69ff34a839ebbd
7
- data.tar.gz: 53572e64a66d4aadd161f9d4f5c3d0d84ad4d9590d4310ef0c13334b205677ce447d45e4c7d4fbcb462c344d603e515152258b377d828dd829d2ac75bb786eea
6
+ metadata.gz: 9f6f335ae368765be2e98937a02060c096f0a56e40d4c8ef55fb3a248dc8e94e70f83bedc7c8e1001768faa4d37f1c52817ae20e5941a59f0688cd4b62bc0b41
7
+ data.tar.gz: dfa94ee8175455fe1ca978e86c3cdf3ba38ea76330a3a6a4f309bf9cfa75253559a90931b431c931f1b02643e3fa54dd5ca9d9bb646775e52c2b3a9e94499eea
@@ -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 rake rubocop
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
@@ -27,6 +27,9 @@ Style/StringLiteralsInInterpolation:
27
27
  Enabled: true
28
28
  EnforcedStyle: double_quotes
29
29
 
30
+ Style/TrailingCommaInArrayLiteral:
31
+ Enabled: false
32
+
30
33
  Style/TrailingCommaInHashLiteral:
31
34
  Enabled: false
32
35
 
@@ -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
@@ -2,6 +2,6 @@
2
2
 
3
3
  module ActiveAdmin
4
4
  module MenuTree
5
- VERSION = "0.2.1"
5
+ VERSION = "0.2.3"
6
6
  end
7
7
  end
@@ -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 |options|
48
- menu.add(**options)
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.1
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: 2022-02-14 00:00:00.000000000 Z
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.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.