filter analysis web
This commit is contained in:
@@ -431,7 +431,7 @@
|
||||
const emptyEl = modal.querySelector("#analysisEmptyBox");
|
||||
const errorEl = modal.querySelector("#analysisErrorBox");
|
||||
|
||||
const webOnly = webOnlyEl ? webOnlyEl.checked : false;
|
||||
const webOnly = true;
|
||||
const searchValue = searchEl ? searchEl.value.trim().toLowerCase() : "";
|
||||
|
||||
let visibleCount = 0;
|
||||
@@ -496,8 +496,10 @@
|
||||
emptyEl.classList.add("d-none");
|
||||
}
|
||||
|
||||
if (analysisLoadedCache[String(matrixId)]) {
|
||||
renderAnalysesList(analysisLoadedCache[String(matrixId)]);
|
||||
const cacheKey = String(matrixId) + "_WEB_ONLY";
|
||||
|
||||
if (analysisLoadedCache[cacheKey]) {
|
||||
renderAnalysesList(analysisLoadedCache[cacheKey]);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -509,13 +511,21 @@
|
||||
dataType: "json",
|
||||
data: {
|
||||
id_matrice: matrixId,
|
||||
web_only: 1,
|
||||
},
|
||||
})
|
||||
.done(function (response) {
|
||||
const analyses = Array.isArray(response.value)
|
||||
? response.value
|
||||
? response.value.filter(function (item) {
|
||||
return (
|
||||
item.SelezionabileSuWeb === true ||
|
||||
item.SelezionabileSuWeb === 1 ||
|
||||
item.SelezionabileSuWeb === "1"
|
||||
);
|
||||
})
|
||||
: [];
|
||||
analysisLoadedCache[String(matrixId)] = analyses;
|
||||
|
||||
analysisLoadedCache[cacheKey] = analyses;
|
||||
renderAnalysesList(analyses);
|
||||
})
|
||||
.fail(function (xhr) {
|
||||
@@ -674,12 +684,7 @@
|
||||
});
|
||||
}
|
||||
|
||||
const webOnlyEl = modal.querySelector("#analysisWebOnly");
|
||||
if (webOnlyEl) {
|
||||
webOnlyEl.addEventListener("change", function () {
|
||||
filterAnalysisList();
|
||||
});
|
||||
}
|
||||
// WEB only is now fixed by default
|
||||
|
||||
const searchEl = modal.querySelector("#analysisSearchInput");
|
||||
if (searchEl) {
|
||||
|
||||
@@ -18,7 +18,15 @@ try {
|
||||
|
||||
$api = VisualLimsApiClient::getInstance();
|
||||
|
||||
$filter = rawurlencode("Matrice/IdMatrice eq $idMatrice");
|
||||
$webOnly = isset($_GET['web_only']) ? (int)$_GET['web_only'] : 1;
|
||||
|
||||
$filterString = "Matrice/IdMatrice eq $idMatrice";
|
||||
|
||||
if ($webOnly === 1) {
|
||||
$filterString .= " and SelezionabileSuWeb eq true";
|
||||
}
|
||||
|
||||
$filter = rawurlencode($filterString);
|
||||
$endpoint = "Analisi?\$filter={$filter}";
|
||||
|
||||
$base_url = 'https://93.43.5.102/limsapi/api/odata/';
|
||||
|
||||
@@ -259,11 +259,9 @@ $matrixGroups = array_values($matrixGroups);
|
||||
</div>
|
||||
|
||||
<div class="d-flex flex-wrap align-items-center gap-2 mb-3">
|
||||
<div class="form-check m-0">
|
||||
<input class="form-check-input" type="checkbox" id="analysisWebOnly">
|
||||
<label class="form-check-label small" for="analysisWebOnly">
|
||||
Web only
|
||||
</label>
|
||||
<input type="hidden" id="analysisWebOnly" value="1">
|
||||
<div class="small text-success fw-semibold">
|
||||
Showing WEB analyses only
|
||||
</div>
|
||||
|
||||
<div class="flex-grow-1" style="min-width: 220px;">
|
||||
|
||||
Reference in New Issue
Block a user