Some small fixes

This commit is contained in:
Stephan Porada 2020-10-07 14:48:47 +02:00
parent 8c707fa81c
commit 4241c13e13
8 changed files with 27 additions and 36 deletions

View File

@ -127,7 +127,7 @@ class Client {
objectKey = 'fullResultsData';
} else if (resultsType === 'sub-results') {
objectKey = 'subResultsData';
} else if (resultsType = 'inspect-results') {
} else if (resultsType === 'inspect-results') {
objectKey = 'inspectResultsData';
}
// Delete old data before new data is coming in.

View File

@ -123,8 +123,8 @@ function saveResultsData() {
// Notify view to update progress bar
client.notifyView('results-data-recieving', {type: type,
progress: payload.progress})
client.isBusy = false;
if (payload.progress === 100) {
client.isBusy = false;
if (objectKey === 'fullResultsData') {
// Get match count per text from results.data only for fullResultsData
results[objectKey].text_lookup = results.data.text_lookup;

View File

@ -7,12 +7,12 @@
// Results class bundleing the different data objects.
class Results {
constructor() {
this.data = new Data();
this.metaData = new MetaData();
this.fullResultsData = new Data();
this.subResultsData = new Data();
this.inspectResultsData = new Data();
console.info('Initialized the Results object.');
this.data = new Data();
this.metaData = new MetaData();
this.fullResultsData = new Data();
this.subResultsData = new Data();
this.inspectResultsData = new Data();
console.info('Initialized the Results object.');
}
// Reset all the data objects in the results class and thus emptying them.

View File

@ -58,20 +58,11 @@ class ResultsList extends List {
this.notificationListeners = {};
this.knownHTMLElements = new Set();
}
/**
* // TODO:
* Init function that gets all needed HTML Elements. Implement this, or not?
* Or build a check into the get HTMLElements function if element already exists.
* Also think about saving alle elements in resultsList.es.nameOfElement
*/
/**
* Function to clear/reset some class field values. Usefull if a new query
* hase been issued by the user.
*/
resetFields() {
this.addToSubResultsIdsToShow = new Set();
this.addToSubResultsStatus = {};
this.subResultsIndexes = {};
}

View File

@ -82,7 +82,7 @@ function queryDataPreparingCallback(resultsList, detail) {
'#query-results-create',
'#sub-results-indexes-display',
'#nr-marked-matches',
]);
]);
// show or enable some things for the user
resultsList.interactionsMenu.classList.toggle('hide', false);
resultsList.queryResultsUserFeedback.classList.toggle('hide', false);

View File

@ -181,13 +181,13 @@ function createFullResults(resultsList, results) {
resultsList.fullResultsCreate.innerText = 'Creating...';
resultsList.fullResultsCreate.insertAdjacentHTML('afterbegin',
loadingSpinnerHTML);
// .keys() is for a zero based array. I think...
let dataIndexes = [...Array(results.data.match_count).keys()];
// Empty fullResultsData so that no previous data is used.
results.fullResultsData.init();
resultsList.notifyClient('get-results', { resultsType: 'full-results',
dataIndexes: dataIndexes,
resultsList: resultsList,
});
resultsList.notifyClient('get-results', {resultsType: 'full-results',
dataIndexes: dataIndexes,
resultsList: resultsList,});
}
}
@ -204,10 +204,9 @@ function createSubResults(resultsList, results) {
loadingSpinnerHTML);
// Empty subResultsData so that no previous data is used.
results.subResultsData.init();
resultsList.notifyClient('get-results', { resultsType: 'sub-results',
dataIndexes: dataIndexes,
resultsList: resultsList,
});
resultsList.notifyClient('get-results', {resultsType: 'sub-results',
dataIndexes: dataIndexes,
resultsList: resultsList,});
}
}
// 3. Open download modal when full results export button is pressed

View File

@ -43,6 +43,7 @@
<div class="card-content" id="result-list" style="overflow: hidden;">
<div id="interactions-menu" class="row hide"
style="margin-bottom: 0px;">
{# Importing menus for query settings, export etc. #}
{% include 'interactions/infos.html.j2' %}
{% include 'interactions/export.html.j2' %}
{% include 'interactions/create.html.j2' %}

View File

@ -6,16 +6,6 @@ result.-->
<h6 style="margin-top: 0px;">Infos</h6>
<div class="divider" style="margin-bottom: 10px;"></div>
<div class="row">
<div class="col s12">
<button id="show-meta-data"
class="waves-effect
waves-light
btn-flat
flat-interaction"
type="submit">Corpus Meta Data
<i class="material-icons left">info_outline</i>
</button>
</div>
<div class="col s12">
<button id="loading-matches"
class="waves-effect
@ -36,6 +26,16 @@ result.-->
<div class="determinate"></div>
</div>
</div>
<div class="col s12">
<button id="show-meta-data"
class="waves-effect
waves-light
btn-flat
flat-interaction"
type="submit">Corpus Meta Data
<i class="material-icons left">info_outline</i>
</button>
</div>
<div class="col s12">
<button id="show-corpus-files"
class="waves-effect