[Fix] UI Fixes (#266)

Rather than have a bunch of pull-requests that @jebus will have to merge shall we collect some of the fixes for the UI issues I found in here.

- [x] #259
- [x] #260
- [x] #261
- [x] #262
- [x] #263
- [x] #264
- [x] #265

Co-authored-by: Tobias O <tobias.olenyi@envipath.com>
Reviewed-on: enviPath/enviPy#266
Co-authored-by: Liam Brydon <lbry121@aucklanduni.ac.nz>
Co-committed-by: Liam Brydon <lbry121@aucklanduni.ac.nz>
This commit is contained in:
2025-12-15 21:28:43 +13:00
committed by jebus
parent 8adb93012a
commit 4bf20e62ef
15 changed files with 279 additions and 170 deletions

View File

@ -136,7 +136,11 @@
</button>
</div>
</div>
<div id="predictLoading" class="mt-2"></div>
<div id="predictLoading" class="mt-2 flex hidden justify-center">
<div class="h-8 w-8">
{% include "components/loading-spinner.html" %}
</div>
</div>
<div id="predictResultTable" class="mt-4"></div>
</div>
</div>
@ -167,7 +171,11 @@
</button>
</div>
</div>
<div id="appDomainLoading" class="mt-2"></div>
<div id="appDomainLoading" class="mt-2 flex hidden justify-center">
<div class="h-8 w-8">
{% include "components/loading-spinner.html" %}
</div>
</div>
<div id="appDomainAssessmentResultTable" class="mt-4"></div>
</div>
</div>
@ -397,7 +405,8 @@
return;
}
makeLoadingGif("#predictLoading", "{% static '/images/wait.gif' %}");
const loadingEl = document.getElementById("predictLoading");
if (loadingEl) loadingEl.classList.remove("hidden");
const params = new URLSearchParams({
smiles: smiles,
@ -418,12 +427,12 @@
})
.then(data => {
const loadingEl = document.getElementById("predictLoading");
if (loadingEl) loadingEl.innerHTML = "";
if (loadingEl) loadingEl.classList.add("hidden");
handlePredictionResponse(data);
})
.catch(error => {
const loadingEl = document.getElementById("predictLoading");
if (loadingEl) loadingEl.innerHTML = "";
if (loadingEl) loadingEl.classList.add("hidden");
const resultTable = document.getElementById("predictResultTable");
if (resultTable) {
resultTable.classList.add("alert", "alert-error");
@ -453,7 +462,8 @@
return;
}
makeLoadingGif("#appDomainLoading", "{% static '/images/wait.gif' %}");
const loadingEl = document.getElementById("appDomainLoading");
if (loadingEl) loadingEl.classList.remove("hidden");
const params = new URLSearchParams({
smiles: smiles,
@ -474,7 +484,7 @@
})
.then(data => {
const loadingEl = document.getElementById("appDomainLoading");
if (loadingEl) loadingEl.innerHTML = "";
if (loadingEl) loadingEl.classList.add("hidden");
if (typeof handleAssessmentResponse === 'function') {
handleAssessmentResponse("{% url 'depict' %}", data);
}
@ -482,7 +492,7 @@
})
.catch(error => {
const loadingEl = document.getElementById("appDomainLoading");
if (loadingEl) loadingEl.innerHTML = "";
if (loadingEl) loadingEl.classList.add("hidden");
const resultTable = document.getElementById("appDomainAssessmentResultTable");
if (resultTable) {
resultTable.classList.add("alert", "alert-error");