Compare commits
	
		
			No commits in common. "6e8476c11640f85b5b12824affc64377b8cec281" and "2baef1a07e14ff9da093d565bc532846f8e0a735" have entirely different histories.
		
	
	
		
			6e8476c116
			...
			2baef1a07e
		
	
		
							
								
								
									
										29
									
								
								js/ds.js
									
									
									
									
									
								
							
							
						
						
									
										29
									
								
								js/ds.js
									
									
									
									
									
								
							@ -61,26 +61,18 @@ DataSpace.OBJECT_REPORT = OBJECT_REPORT;
 | 
				
			|||||||
 * 
 | 
					 * 
 | 
				
			||||||
 * @return {Map<string, object>}
 | 
					 * @return {Map<string, object>}
 | 
				
			||||||
 */
 | 
					 */
 | 
				
			||||||
DataSpace.createObjectShape = function (resource) {
 | 
					DataSpace.createObjectShape = function(resource) {
 | 
				
			||||||
    const shape = this.OBJECT_REPORT;
 | 
					    const shape = this.OBJECT_REPORT;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    let beforeGallery = shape.get('before-gallery'),
 | 
					    let beforeGallery = shape.get('before-gallery'),
 | 
				
			||||||
        afterGallery = shape.get('after-gallery');
 | 
					        afterGallery = shape.get('after-gallery');
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    for (const key in shape.get('before-gallery')) {
 | 
					    for (const key in shape.get('before-gallery')) {
 | 
				
			||||||
        if (resource[key]) {
 | 
					        beforeGallery[key] = resource[key];
 | 
				
			||||||
            beforeGallery[key] = resource[key];
 | 
					 | 
				
			||||||
        } else {
 | 
					 | 
				
			||||||
            delete beforeGallery[key];
 | 
					 | 
				
			||||||
        }
 | 
					 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    for (const key in shape.get('after-gallery')) {
 | 
					    for (const key in shape.get('after-gallery')) {
 | 
				
			||||||
        if (resource[key]) {
 | 
					        afterGallery[key] = resource[key];
 | 
				
			||||||
            afterGallery[key] = resource[key];
 | 
					 | 
				
			||||||
        } else {
 | 
					 | 
				
			||||||
            delete afterGallery[key];
 | 
					 | 
				
			||||||
        }
 | 
					 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    shape.set('before-gallery', beforeGallery);
 | 
					    shape.set('before-gallery', beforeGallery);
 | 
				
			||||||
@ -95,17 +87,14 @@ DataSpace.createObjectShape = function (resource) {
 | 
				
			|||||||
 * 
 | 
					 * 
 | 
				
			||||||
 * @return {object}
 | 
					 * @return {object}
 | 
				
			||||||
 */
 | 
					 */
 | 
				
			||||||
DataSpace.fetchReport = async function (uuid, format='json')
 | 
					DataSpace.fetchReport = async function(uuid, format='json')
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
    const jsonRep =
 | 
					    const jsonRep =
 | 
				
			||||||
        await fetch(
 | 
					        await fetch(`${this.BASE_URL}${this.RES_ENDPOINT}${uuid}?format=${format}&indent=2`)
 | 
				
			||||||
            `${this.BASE_URL}${this.RES_ENDPOINT}${uuid}?format=${format}&indent=2`
 | 
					 | 
				
			||||||
        )
 | 
					 | 
				
			||||||
        .then(res => res.json())
 | 
					        .then(res => res.json())
 | 
				
			||||||
        .catch(excep => {
 | 
					        .catch(excep => {
 | 
				
			||||||
            _fetchError(excep, 'error');
 | 
					            _createError(excep, 'error')
 | 
				
			||||||
            document.querySelector('.modal')
 | 
					            document.querySelector('.modal').classList.remove('active');
 | 
				
			||||||
                .classList.remove('active');
 | 
					 | 
				
			||||||
        });
 | 
					        });
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    return jsonRep;
 | 
					    return jsonRep;
 | 
				
			||||||
@ -115,7 +104,7 @@ DataSpace.fetchReport = async function (uuid, format='json')
 | 
				
			|||||||
 * 
 | 
					 * 
 | 
				
			||||||
 * @return {void}
 | 
					 * @return {void}
 | 
				
			||||||
 */
 | 
					 */
 | 
				
			||||||
DataSpace.printReport = function () {
 | 
					DataSpace.printReport = function() {
 | 
				
			||||||
    document.querySelector('#print')
 | 
					    document.querySelector('#print')
 | 
				
			||||||
        .addEventListener('click', () => {
 | 
					        .addEventListener('click', () => {
 | 
				
			||||||
            window.print();
 | 
					            window.print();
 | 
				
			||||||
@ -174,7 +163,7 @@ DataSpace.getImagesSrc = function(resource) {
 | 
				
			|||||||
    return fileNames;
 | 
					    return fileNames;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
function _fetchError(message, htmlId)
 | 
					function _createError(message, htmlId)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
    const error = document.createElement('div');
 | 
					    const error = document.createElement('div');
 | 
				
			||||||
    const clear = document.createElement('button');
 | 
					    const clear = document.createElement('button');
 | 
				
			||||||
 | 
				
			|||||||
@ -38,7 +38,7 @@
 | 
				
			|||||||
                <h2 class="mt-1 p-2" id="rep-tit"></h2>
 | 
					                <h2 class="mt-1 p-2" id="rep-tit"></h2>
 | 
				
			||||||
                <div class="columns">
 | 
					                <div class="columns">
 | 
				
			||||||
                    <div class="column col-7">
 | 
					                    <div class="column col-7">
 | 
				
			||||||
                        <table class="table mt-2" id="res-before">
 | 
					                        <table class="table table-hover mt-2" id="res-before">
 | 
				
			||||||
                            <tbody>
 | 
					                            <tbody>
 | 
				
			||||||
                            </tbody>
 | 
					                            </tbody>
 | 
				
			||||||
                        </table>
 | 
					                        </table>
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
		Reference in New Issue
	
	Block a user