-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Moved configuration data to a JSON file for better organization. - Updated local and remote dependencies to utilize this JSON file. - Streamlined configuration handling for consistency across environments.
- Loading branch information
1 parent
a01222a
commit 6950868
Showing
9 changed files
with
124 additions
and
216 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
73 changes: 0 additions & 73 deletions
73
solara/lib/core/dashboard/handler/brand_configurations_manager.rb
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
class BrandConfigurationsManager | ||
|
||
def initialize(brand_key) | ||
@brand_key = brand_key | ||
end | ||
|
||
def template_with_key(key) | ||
templates.select { |section| section[:key] === key }.first | ||
end | ||
|
||
def templates | ||
configurations = JSON.parse(File.read(FilePath.brand_configurations))['configurations'] | ||
configurations.map do |config| | ||
{ | ||
key: config['key'], | ||
name: config['name'], | ||
path: "#{FilePath.brand(@brand_key)}/#{config['filePath']}" | ||
} | ||
end | ||
end | ||
|
||
def create | ||
config_templates = templates | ||
|
||
config_templates.map do |template| | ||
create_config_item( | ||
template[:key], | ||
template[:name], | ||
template[:path] | ||
) | ||
end | ||
end | ||
|
||
def create_config_item(key, name, path) | ||
{ | ||
key: key, | ||
name: name, | ||
content: JSON.parse(File.read(path)), | ||
} | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.