Skip to content

Commit

Permalink
Fix bug: user-defined JSON files not displaying in dashboard
Browse files Browse the repository at this point in the history
  • Loading branch information
MalekKamel committed Oct 28, 2024
1 parent 558bb4f commit e4a0969
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 7 deletions.
2 changes: 1 addition & 1 deletion Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
PATH
remote: .
specs:
solara (0.7.0)
solara (0.7.1)
cgi (~> 0.4.1)
colorize (~> 1.1.0)
json-schema (~> 4.3.1)
Expand Down
12 changes: 7 additions & 5 deletions solara/lib/core/scripts/brand_configurations_manager.rb
Original file line number Diff line number Diff line change
Expand Up @@ -40,11 +40,13 @@ def initialize(brand_key)
end

def templates
result = parse_configurations
collect_json_templates.each do |template|
result << template unless result.any? { |r| r['filename'] == template['filename'] }
result = parse_configurations.compact
user_defined_items = collect_user_defined_json.compact
user_defined_items.each do |user_defined_item|
next if result.any? { |r| r[:filename] == user_defined_item[:filename] }
result << user_defined_item
end
result.compact
result
rescue StandardError => e
Solara.logger.error("Failed to generate templates: #{e.message}")
[]
Expand All @@ -71,7 +73,7 @@ def parse_configurations
[]
end

def collect_json_templates
def collect_user_defined_json
directories = [
FilePath.brand_global_json_dir,
FilePath.brand_json_dir(@brand_key)
Expand Down
1 change: 0 additions & 1 deletion solara/lib/core/scripts/gitignore_manager.rb
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ def add_items(items)
end

def add_item(item)
puts item
existing_items = read_gitignore

if existing_items.include?(item)
Expand Down

0 comments on commit e4a0969

Please sign in to comment.