Skip to content
Snippets Groups Projects
Commit d6a19a9d authored by Stephan Porada's avatar Stephan Porada :speech_balloon:
Browse files

Add single inspect results download

parent e1f4b0f3
No related branches found
No related tags found
No related merge requests found
......@@ -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)};
}
......
......@@ -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>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment