Add single inspect results download

This commit is contained in:
Stephan Porada 2020-09-08 14:14:52 +02:00
parent e1f4b0f35e
commit d6a19a9d7c
2 changed files with 19 additions and 4 deletions

View File

@ -223,6 +223,7 @@ document.addEventListener("DOMContentLoaded", () => {
'#query-results-table',
'#display-options-form-expert_mode',
'.pagination',
'#inspect-results-export',
]);
/**
@ -313,6 +314,7 @@ document.addEventListener("DOMContentLoaded", () => {
* 2. Create sub-results
* 3. Download full-results
* 4. Download sub-results
* 5. Download single inspect-results
*/
resultsList.fullResultsCreate.onclick = () => {
resultsList.fullResultsCreate.querySelector('i').classList.toggle('hide');
@ -336,7 +338,7 @@ document.addEventListener("DOMContentLoaded", () => {
dataIndexes: dataIndexes});
}
/**
* Before the downland events are added the needed modal is initialized.
* Before the download events are added the needed modal is initialized.
*/
resultsList.queryResultsDownloadModal = M.Modal.init(resultsList.queryResultsDownloadModal);
// Open download modal when full results export button is pressed
@ -346,7 +348,8 @@ document.addEventListener("DOMContentLoaded", () => {
resultsList.downloadResultsJson.onclick = () => {
let filename = results.fullResultsData.createDownloadFilename('full-results');
results.fullResultsData.addData(results.metaData);
results.fullResultsData.downloadJSONRessource(filename, results.fullResultsData,
results.fullResultsData.downloadJSONRessource(filename,
results.fullResultsData,
resultsList.downloadResultsJson)};
}
// Open download modal when sub results export button is pressed
@ -356,7 +359,19 @@ document.addEventListener("DOMContentLoaded", () => {
resultsList.downloadResultsJson.onclick = () => {
let filename = results.subResultsData.createDownloadFilename('sub-results');
results.subResultsData.addData(results.metaData);
results.subResultsData.downloadJSONRessource(filename, results.subResultsData,
results.subResultsData.downloadJSONRessource(filename,
results.subResultsData,
resultsList.downloadResultsJson)};
}
// Open download modal when inspect-results-export button is pressed
resultsList.inspectResultsExport.onclick = () => {
resultsList.queryResultsDownloadModal.open();
// add onclick to download JSON button and download the file
resultsList.downloadResultsJson.onclick = () => {
let filename = results.subResultsData.createDownloadFilename('inspect-results');
results.subResultsData.addData(results.metaData);
results.subResultsData.downloadJSONRessource(filename,
results.inspectResultsData,
resultsList.downloadResultsJson)};
}

View File

@ -67,7 +67,7 @@
</div>
</div>
<div class="modal-footer">
<a id="inspect-download-context" class="left waves-effect waves-light btn">
<a id="inspect-results-export" class="left waves-effect waves-light btn">
Export Single Context
<i class="material-icons right">file_download</i>
</a>