diff --git a/arches_for_science/media/js/afs-formats.js b/arches_for_science/media/js/afs-formats.js deleted file mode 100644 index 91a363150..000000000 --- a/arches_for_science/media/js/afs-formats.js +++ /dev/null @@ -1,15 +0,0 @@ -define(['utils/load-component-dependencies'], function(loadComponentDependencies) { - function removeTrailingCommaFromObject(string) { - return string.replace(/,\s*}*$/, "}"); - } - - try { - const afsFormatDataHTML = document.querySelector('#afsFormatData'); - const afsFormatData = afsFormatDataHTML.getAttribute('afsFormats'); - const fileRenderers = JSON.parse(removeTrailingCommaFromObject(afsFormatData)); - - return fileRenderers; - } catch (error) { - console.error(error); - } -}); \ No newline at end of file diff --git a/arches_for_science/media/js/views/components/workflows/chemical-analysis-workflow/ca-upload-files-step.js b/arches_for_science/media/js/views/components/workflows/chemical-analysis-workflow/ca-upload-files-step.js index c682fa9b2..54e00e284 100644 --- a/arches_for_science/media/js/views/components/workflows/chemical-analysis-workflow/ca-upload-files-step.js +++ b/arches_for_science/media/js/views/components/workflows/chemical-analysis-workflow/ca-upload-files-step.js @@ -4,27 +4,18 @@ define([ 'uuid', 'arches', 'models/tile', - 'afs-formats', 'js-cookie', 'templates/views/components/workflows/chemical-analysis-workflow/ca-upload-files-step.htm', 'bindings/uppy' -], function(_, ko, uuid, arches, TileModel, formats, Cookies, uploadFilesStepTemplate) { +], function(_, ko, uuid, arches, TileModel, Cookies, uploadFilesStepTemplate) { return ko.components.register('ca-upload-files-step', { viewModel: function(params) { - // TODO: Fix afs-formats.js, loadComponentDependencies was commented out var self = this; const physicalThingId = params.projectinfo["select-phys-thing-step"].savedData().physicalThing; const observationInfo = params.observationinfo['instrument-info'].savedData(); const datasetFileNodeId = "7c486328-d380-11e9-b88e-a4d18cec433a"; - const rendererLookup = { - "3526790a-c73d-4558-b29d-98f574c91e61": {name: "Bruker Artax x-ray fluorescence spectrometer", renderer: "xrf-reader", rendererid: "31be40ae-dbe6-4f41-9c13-1964d7d17042"}, - "73717b33-1235-44a1-8acb-63c97a5c1157": {name: "Renishaw inVia Raman microscope using a 785 nm laser", renderer: "raman-reader", rendererid: "94fa1720-6773-4f99-b49b-4ea0926b3933"}, - "3365c1bf-070d-4a8e-b859-52dec6876c1d": {name: "ASD HiRes FieldSpec4", renderer: "fors-renderer", rendererid: "88dccb59-14e3-4445-8f1b-07f0470b38bb"}, - "image": {rendererid: "5e05aa2e-5db0-4922-8938-b4d2b7919733", renderer: "imagereader"}, - "pdf": {rendererid: "09dec059-1ee8-4fbd-85dd-c0ab0428aa94", renderer: "pdfreader"}, - }; const physThingName = params.projectinfo["select-phys-thing-step"].savedData().physThingName; this.datasetId = undefined; @@ -54,7 +45,6 @@ define([ this.loadingMessage = ko.observable(); this.loading = ko.observable(false); - this.formats = ko.observableArray(Object.values(formats).map(format => {return {"text": format.name, "id": format.id};})); this.deleteFile = async(file) => { const fileTile = ko.unwrap(file.tileId); diff --git a/arches_for_science/media/js/views/components/workflows/upload-dataset/file-interpretation-step.js b/arches_for_science/media/js/views/components/workflows/upload-dataset/file-interpretation-step.js index 6a088f52d..3242b96d3 100644 --- a/arches_for_science/media/js/views/components/workflows/upload-dataset/file-interpretation-step.js +++ b/arches_for_science/media/js/views/components/workflows/upload-dataset/file-interpretation-step.js @@ -12,7 +12,6 @@ define([ 'models/tile', ], function($, ko, fileInterpretationStepTemplate, arches, uuid, CardComponentViewModel, CardMultiSelectViewModel, WorkbenchComponentViewModel, fileRenderers, Cookies, TileModel) { function viewModel(params) { - // TODO: Fix afs-formats.js, loadComponentDependencies was commented out params.configKeys = ['acceptedFiles', 'maxFilesize']; var self = this; diff --git a/arches_for_science/media/js/views/components/workflows/upload-dataset/select-dataset-files-step.js b/arches_for_science/media/js/views/components/workflows/upload-dataset/select-dataset-files-step.js index e3d62cb3a..5e5c1e269 100644 --- a/arches_for_science/media/js/views/components/workflows/upload-dataset/select-dataset-files-step.js +++ b/arches_for_science/media/js/views/components/workflows/upload-dataset/select-dataset-files-step.js @@ -9,13 +9,11 @@ define([ 'viewmodels/alert-json', 'views/components/iiif-viewer', 'js-cookie', - 'afs-formats', 'templates/views/components/workflows/upload-dataset/select-dataset-files-step.htm', 'bindings/dropzone' -], function(ko, koMapping, uuid, arches, resourceUtils, reportUtils, physicalThingUtils, JsonErrorAlertViewModel, IIIFViewerViewmodel, Cookies, formats, selectDatasetFilesStepTemplate) { +], function(ko, koMapping, uuid, arches, resourceUtils, reportUtils, physicalThingUtils, JsonErrorAlertViewModel, IIIFViewerViewmodel, Cookies, selectDatasetFilesStepTemplate) { return ko.components.register('select-dataset-files-step', { viewModel: function(params) { - // TODO: Fix afs-formats.js, loadComponentDependencies was commented out this.buildStrObject = str => { return {[arches.activeLanguage]: { @@ -68,7 +66,6 @@ define([ this.mainMenu = ko.observable(false); this.files = ko.observableArray([]); this.uploadFailed = ko.observable(false); - self.formats = ko.observableArray(Object.values(formats).map(format => {return {"text": format.name, "id": format.id};})); this.initialValue = params.form.savedData() || undefined; this.snapshot = undefined; this.loadingMessage = ko.observable(); diff --git a/arches_for_science/media/js/views/components/workflows/upload-dataset/select-renderer-step.js b/arches_for_science/media/js/views/components/workflows/upload-dataset/select-renderer-step.js index b1c01b6d7..557700f61 100644 --- a/arches_for_science/media/js/views/components/workflows/upload-dataset/select-renderer-step.js +++ b/arches_for_science/media/js/views/components/workflows/upload-dataset/select-renderer-step.js @@ -8,7 +8,6 @@ define([ 'views/components/plugins/file-configuration', ], function($, ko, fileInterpretationStepTemplate, arches, WorkbenchComponentViewModel, fileRenderers) { function viewModel(params) { - // TODO: Fix afs-formats.js, loadComponentDependencies was commented out params.configKeys = ['acceptedFiles', 'maxFilesize']; const datasetInfo = params.datasetInfo; diff --git a/arches_for_science/media/js/views/components/workflows/upload-dataset/upload-files-step.js b/arches_for_science/media/js/views/components/workflows/upload-dataset/upload-files-step.js index c2b2679f4..19dfd9bce 100644 --- a/arches_for_science/media/js/views/components/workflows/upload-dataset/upload-files-step.js +++ b/arches_for_science/media/js/views/components/workflows/upload-dataset/upload-files-step.js @@ -4,14 +4,12 @@ define([ 'uuid', 'arches', 'models/tile', - 'afs-formats', 'js-cookie', 'templates/views/components/workflows/upload-dataset/upload-files-step.htm', 'bindings/dropzone' -], function(_, ko, uuid, arches, TileModel, formats, Cookies, uploadFilesStepTemplate) { +], function(_, ko, uuid, arches, TileModel, Cookies, uploadFilesStepTemplate) { return ko.components.register('upload-files-step', { viewModel: function(params) { - // TODO: Fix afs-formats.js, loadComponentDependencies was commented out var self = this; self.uploadFailed = ko.observable(false); @@ -36,7 +34,6 @@ define([ this.loadingMessage = ko.observable(); this.loading = ko.observable(false); - this.formats = ko.observableArray(Object.values(formats).map(format => {return {"text": format.name, "id": format.id}})); this.deleteFile = async(file) => { const fileTile = ko.unwrap(file.tileId); diff --git a/arches_for_science/templates/javascript.htm b/arches_for_science/templates/javascript.htm index e6fff8a69..1efd927eb 100644 --- a/arches_for_science/templates/javascript.htm +++ b/arches_for_science/templates/javascript.htm @@ -45,16 +45,4 @@ cloudStorage='{"enabled": {{ project_settings.CLOUD_STORAGE_ENABLED }}}' > - -
{% endblock project_modules %} \ No newline at end of file diff --git a/arches_for_science/utils/context_processors.py b/arches_for_science/utils/context_processors.py index 565759cee..657045933 100644 --- a/arches_for_science/utils/context_processors.py +++ b/arches_for_science/utils/context_processors.py @@ -23,4 +23,4 @@ def project_settings(request): cloud_storage_enabled = ( settings.STORAGES["default"]["BACKEND"] == "storages.backends.s3boto3.S3Boto3Storage" ) # add additional supported formats as needed - return {"project_settings": {"FORMATS": settings.FORMATS, "CLOUD_STORAGE_ENABLED": "true" if cloud_storage_enabled else "false"}} + return {"project_settings": {"CLOUD_STORAGE_ENABLED": "true" if cloud_storage_enabled else "false"}}