Draft reordering of object keys
This commit is contained in:
parent
29560c166f
commit
00b5195a1f
BIN
js/.ds.js.swp
BIN
js/.ds.js.swp
Binary file not shown.
8
js/ds.js
8
js/ds.js
@ -5,13 +5,19 @@ const RES_ENDPOINT = '/resources/';
|
|||||||
/**
|
/**
|
||||||
* @todo Report shapes??
|
* @todo Report shapes??
|
||||||
*/
|
*/
|
||||||
/*
|
|
||||||
export const OBJECT_ORDER = {
|
export const OBJECT_ORDER = {
|
||||||
"Object Type" : null,
|
"Object Type" : null,
|
||||||
"Object ID" : null,
|
"Object ID" : null,
|
||||||
|
"Object Excavation code" : null,
|
||||||
"Object Chronology" : null,
|
"Object Chronology" : null,
|
||||||
"Object Era" : 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 = {
|
export const SAMPLE_ORDER = {
|
||||||
|
|
||||||
};
|
};
|
||||||
|
@ -4,19 +4,19 @@ import {
|
|||||||
BASE_URL,
|
BASE_URL,
|
||||||
fetchReport,
|
fetchReport,
|
||||||
printReport,
|
printReport,
|
||||||
getImageSrc
|
getImageSrc,
|
||||||
|
OBJECT_ORDER
|
||||||
} from "../ds.js";
|
} from "../ds.js";
|
||||||
|
|
||||||
document.addEventListener('readystatechange', async () => {
|
document.addEventListener('readystatechange', async () => {
|
||||||
const report = await fetchReport(location.search.replace("?id=", ''));
|
const report = await fetchReport(location.search.replace("?id=", ''));
|
||||||
const resource = report.resource;
|
|
||||||
const archesJson = await fetchReport(location.search.replace("?id=", ''), 'arches-json');
|
const archesJson = await fetchReport(location.search.replace("?id=", ''), 'arches-json');
|
||||||
|
|
||||||
// DEBUG
|
|
||||||
const files = getImageSrc(archesJson);
|
const files = getImageSrc(archesJson);
|
||||||
|
|
||||||
printReport();
|
printReport();
|
||||||
|
|
||||||
|
const resource = Object.assign(OBJECT_ORDER, report.resource);
|
||||||
|
|
||||||
let resKeys = Object.keys(resource);
|
let resKeys = Object.keys(resource);
|
||||||
// Default value...
|
// Default value...
|
||||||
let resType = 'Object';
|
let resType = 'Object';
|
||||||
|
Loading…
Reference in New Issue
Block a user