Draft reordering of object keys

This commit is contained in:
Nicolò P 2023-03-01 17:56:34 +01:00
parent 29560c166f
commit 00b5195a1f
3 changed files with 11 additions and 5 deletions

Binary file not shown.

View File

@ -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 = {
};

View File

@ -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';