import Utils from "./utils.js"; /** * @class Finding */ export class Finding { biblioElements = []; images = null; set data(data) { this._data = data; } async render() { return `
Oggetto: ${this._data.object}
Materia: ${this._data.material}
Misure: ${this._data.measurements}
Luogo e anno rinvenimento: ${this._data.place}. ${this._data.year}
Datazione: ${this._data.dating}
Stato di conservazione: ${this._data.conservationState}
Luogo di conservazione: ${this._data.conservationPlace}
Descrizione ${this._data.description}
Bibliografia: ${await this.biblio(this._data.id)}
Autore scheda: ${this._data.author}
Nessuna risorsa visuale disponibile
'; } /** * @param {number} recordId */ async biblio(recordId) { let {citations, biblioElements} = await Utils.buildBibliography('not_conserved', recordId); this.biblioElements = biblioElements; return citations; } getReference(id) { return this.biblioElements.find(ref => { let regex = new RegExp('ref-'+id+'"'); return ref.match(regex); }); } }