playbook_ui 13.7.0.pre.alpha.play845allkitsbytypes1234 → 13.7.0.pre.alpha.play978makehighchartsadevdependencypoc1223

Sign up to get free protection for your applications and to get access to all the features.
@@ -27,58 +27,33 @@ module Playbook
27
27
 
28
28
  # Deal with lists of kits, used in Playbook doc and Externally
29
29
  # rubocop:disable Style/StringConcatenation
30
- def pb_kits(type: "rails", limit_examples: false, dark_mode: false)
30
+ def pb_kits(type: "rails", limit_examples: false, dark_mode: false, method: get_kits)
31
31
  display_kits = []
32
- kits = get_kits(type)
32
+ kits = method
33
33
  kits.each do |kit|
34
- nav_array = nav_hash_array(kit)
35
- next unless nav_array.is_a?(Array)
36
-
37
- nav_array.each do |sub_kit|
38
- display_kits << render_pb_doc_kit(sub_kit, type, limit_examples, false, dark_mode)
34
+ if kit.is_a?(Hash)
35
+ nav_hash_array(kit).each do |sub_kit|
36
+ display_kits << render_pb_doc_kit(sub_kit, type, limit_examples, false, dark_mode)
37
+ end
38
+ else
39
+ display_kits << render_pb_doc_kit(kit, type, limit_examples, false, dark_mode)
39
40
  end
40
41
  end
41
42
  raw("<div class='pb--docItem'>" + display_kits.join("</div><div class='pb--docItem'>") + "</div>")
42
43
  end
43
44
  # rubocop:enable Style/StringConcatenation
44
45
 
45
- def get_kits(type = "rails")
46
+ # rubocop:disable Naming/AccessorMethodName
47
+ def get_kits
46
48
  menu = YAML.load_file(Playbook::Engine.root.join("dist/menu.yml"))
47
- menu["kits"][type]
49
+ menu["kits"]
48
50
  end
49
51
 
50
- def aggregate_kits
51
- menu = YAML.load_file(Playbook::Engine.root.join("dist/menu.yml"))
52
- all_kits = []
53
-
54
- # Loop over each type (rails, react, swift, etc.)
55
- menu["kits"].each do |_type, kits|
56
- kits.each do |kit|
57
- case kit
58
- when Hash
59
- kit_name = kit.keys.first
60
- existing_kit = all_kits.find { |k| k.is_a?(Hash) && k.keys.first == kit_name }
61
-
62
- if existing_kit
63
- existing_kit[kit_name] += kit[kit_name] unless kit[kit_name].nil?
64
- existing_kit[kit_name].uniq!
65
- existing_kit[kit_name].sort!
66
- else
67
- all_kits << { kit_name => kit[kit_name] }
68
- end
69
- when String
70
- all_kits << kit unless all_kits.include?(kit)
71
- end
72
- end
73
- end
74
-
75
- # Sort the top-level entries
76
- all_kits.sort_by! do |kit|
77
- kit.is_a?(Hash) ? kit.keys.first : kit
78
- end
79
-
80
- all_kits
52
+ def get_kits_pb_website
53
+ menu = YAML.load_file(Rails.root.join("config/menu.yml"))
54
+ menu["kits"]
81
55
  end
56
+ # rubocop:enable Naming/AccessorMethodName
82
57
 
83
58
  # rubocop:disable Style/OptionalBooleanParameter
84
59
  def render_pb_doc_kit(kit, type, limit_examples, code = true, dark_mode = false)
@@ -2,5 +2,5 @@
2
2
 
3
3
  module Playbook
4
4
  PREVIOUS_VERSION = "13.7.0"
5
- VERSION = "13.7.0.pre.alpha.play845allkitsbytypes1234"
5
+ VERSION = "13.7.0.pre.alpha.play978makehighchartsadevdependencypoc1223"
6
6
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: playbook_ui
3
3
  version: !ruby/object:Gem::Version
4
- version: 13.7.0.pre.alpha.play845allkitsbytypes1234
4
+ version: 13.7.0.pre.alpha.play978makehighchartsadevdependencypoc1223
5
5
  platform: ruby
6
6
  authors:
7
7
  - Power UX
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2023-09-28 00:00:00.000000000 Z
12
+ date: 2023-09-25 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: actionpack