Skip to content

Commit

Permalink
Solara
Browse files Browse the repository at this point in the history
  • Loading branch information
IdeaS0ft committed Sep 10, 2024
1 parent 114a7ae commit 153e324
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion solara/lib/core/brands/brands_manager.rb
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ def brand_name(brand_key)
def brand_with_configurations(brand_key)
configurations = BrandConfigurationsManager.new(brand_key).create
{
solaraVesion: Gem.loaded_specs['solara'].version.to_s,
solaraVersion: Gem.loaded_specs['solara'].version.to_s,
brand: brand_data(brand_key),
configurations: configurations
}
Expand Down
7 changes: 4 additions & 3 deletions solara/lib/core/dashboard/brand/source/BrandRemoteSource.js
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ class BrandRemoteSource {
}

async getBrandConfigurationsJsonFromDirectory(dirHandle) {
const schema = await this.fetchBrandConfigurationsSchema()
const schema = await this.fetchBrandConfigurationsSchema();

const ajv = new Ajv();
const validate = ajv.compile(schema);
Expand All @@ -146,7 +146,7 @@ class BrandRemoteSource {
json = JSON.parse(text);
} catch (e) {
console.error("Invalid JSON:", e);
return null
return null;
}

const valid = validate(json);
Expand All @@ -155,7 +155,8 @@ class BrandRemoteSource {
return json;
} else {
console.error("Schema validation failed:", validate.errors);
alert(`The selected JSON file is not a valid configuration for Solara brands. Error: ${validate.errors}`);
const errorMessages = validate.errors.map(error => `${error.instancePath}: ${error.message}`).join(', ');
alert(`The selected JSON file is not a valid configuration for Solara brands. Errors: ${errorMessages}`);
}

return null;
Expand Down

0 comments on commit 153e324

Please sign in to comment.