-
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.
Add template sync and JSON file viewer in dashboard
- Display user-defined JSON files in dashboard - Add mechanism to sync existing brand with template changes
- Loading branch information
1 parent
5784e1b
commit 1b778b6
Showing
26 changed files
with
371 additions
and
143 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
PATH | ||
remote: . | ||
specs: | ||
solara (0.4.0) | ||
solara (0.6.0) | ||
cgi (~> 0.4.1) | ||
colorize (~> 1.1.0) | ||
json-schema (~> 4.3.1) | ||
|
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
class BrandConfigUpdater | ||
|
||
def update(filename, data, brand_key) | ||
template = BrandConfigurationsManager.new(brand_key).template_with_filename(filename) | ||
|
||
path = template[:path] | ||
json = JSON.pretty_generate(data) | ||
|
||
begin | ||
# Check if the file exists | ||
if File.exist?(path) | ||
# If it exists, update the file | ||
File.write(path, json) | ||
Solara.logger.debug("Updated Config for #{path}: #{data}") | ||
else | ||
# If it doesn't exist, create the file with the data | ||
File.write(path, json) | ||
Solara.logger.debug("Created Config for #{path}: #{data}") | ||
end | ||
rescue StandardError => e | ||
Solara.logger.failure("Error updating #{brand_key} config file #{path}: #{e.message}") | ||
raise | ||
end | ||
end | ||
end |
Oops, something went wrong.