diff --git a/js/.ds.js.swp b/js/.ds.js.swp deleted file mode 100644 index 37c9de5..0000000 Binary files a/js/.ds.js.swp and /dev/null differ diff --git a/js/ds.js b/js/ds.js index 2d33795..ddd69ef 100644 --- a/js/ds.js +++ b/js/ds.js @@ -5,13 +5,19 @@ const RES_ENDPOINT = '/resources/'; /** * @todo Report shapes?? */ -/* export const OBJECT_ORDER = { "Object Type" : null, "Object ID" : null, + "Object Excavation code" : null, "Object Chronology" : null, "Object Era" : null, + "Object Geographical Context of Discovery" : null, + "Object Description" : null, + "Object Conservation State" : null, + "Object Dimensions" : null, + "Object Material" : null, }; +/* export const SAMPLE_ORDER = { }; diff --git a/js/views/report.js b/js/views/report.js index 960fc09..8ec4dc7 100644 --- a/js/views/report.js +++ b/js/views/report.js @@ -4,19 +4,19 @@ import { BASE_URL, fetchReport, printReport, - getImageSrc + getImageSrc, + OBJECT_ORDER } from "../ds.js"; document.addEventListener('readystatechange', async () => { const report = await fetchReport(location.search.replace("?id=", '')); - const resource = report.resource; const archesJson = await fetchReport(location.search.replace("?id=", ''), 'arches-json'); - - // DEBUG const files = getImageSrc(archesJson); printReport(); + const resource = Object.assign(OBJECT_ORDER, report.resource); + let resKeys = Object.keys(resource); // Default value... let resType = 'Object';