Skip to content

Commit

Permalink
updates component dependencies to fail loudly #1300 (#1301)
Browse files Browse the repository at this point in the history
  • Loading branch information
chrabyrd authored Sep 15, 2023
1 parent e2350cd commit 8b55a6e
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 12 deletions.
14 changes: 8 additions & 6 deletions arches_for_science/media/js/afs-formats.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,13 @@ define(['utils/load-component-dependencies'], function(loadComponentDependencies
return string.replace(/,\s*}*$/, "}");
}

const afsFormatDataHTML = document.querySelector('#afsFormatData');
const afsFormatData = afsFormatDataHTML.getAttribute('afsFormats');
const fileRenderers = JSON.parse(removeTrailingCommaFromObject(afsFormatData));
try {
const afsFormatDataHTML = document.querySelector('#afsFormatData');
const afsFormatData = afsFormatDataHTML.getAttribute('afsFormats');
const fileRenderers = JSON.parse(removeTrailingCommaFromObject(afsFormatData));

// loadComponentDependencies(Object.values(fileRenderers).map(value => value['component']));

return fileRenderers;
return fileRenderers;
} catch (error) {
console.error(error);
}
});
16 changes: 10 additions & 6 deletions arches_for_science/media/js/afs-settings.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,15 @@ define([], function() {
return string.replace(/,\s*}*$/, "}");
}

const afsSettingsDataHTML = document.querySelector('#projectSettings');
const cloudStorageText = afsSettingsDataHTML.getAttribute('cloudStorage');
const cloudStorage = JSON.parse(removeTrailingCommaFromObject(cloudStorageText));
try {
const afsSettingsDataHTML = document.querySelector('#projectSettings');
const cloudStorageText = afsSettingsDataHTML.getAttribute('cloudStorage');
const cloudStorage = JSON.parse(removeTrailingCommaFromObject(cloudStorageText));

return {
cloudStorage
};
return {
cloudStorage
};
} catch (error) {
console.error(error);
}
});

0 comments on commit 8b55a6e

Please sign in to comment.