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