[Perl] DAQ system for the FAPG.
fix remove misleading "No readings found" status text
Delete the reading-status paragraph and its JS rendering from probe cards.
Changed files
roles/dashboard/public/js/dashboard/charts.js
@@ -254,7 +254,6 @@
254
254
const canvas = chartElement(probe);
255
255
if (!probe || !canvas) return;
256
256
257
Removed:
const status = document.querySelector(`[data-status="${probe}"]`);
258
257
const hasMessageTable = Boolean(document.querySelector(`[data-reading-messages="${probe}"]`));
259
258
260
259
try {
@@ -296,21 +295,11 @@
296
295
chart.update();
297
296
}
298
297
299
Removed:
if (status) {
300
Removed:
status.classList.remove("placeholder-glow");
301
Removed:
status.textContent = latest
302
Removed:
? `Latest: ${latest.value} ${latest.unit || ""} at ${formatDateTime(latest.timestamp)} (${formatAge(ageMs(latest.timestamp))})`
303
Removed:
: "No readings found for this probe yet.";
304
Removed:
}
305
298
renderVariation(probe, series.trend, timeframeRangeLabel(timeframe.selected(), timeframe.range()));
306
299
renderMessageTable(probe, data.readings);
307
300
} catch (error) {
308
301
if (error.name === "AbortError") return;
309
302
310
Removed:
if (status) {
311
Removed:
status.classList.remove("placeholder-glow");
312
Removed:
status.textContent = `Could not load ${probe} readings: ${error.message}`;
313
Removed:
}
314
303
renderMessageTable(probe, []);
315
304
}
316
305
}
roles/dashboard/t/01-graph-page.t
@@ -17,7 +17,6 @@
17
17
->text_is( '.card-header h1 a[href="/probes/ph"]', 'pH' )
18
18
->element_exists('.navbar-nav a.nav-link.active.dropdown-toggle')
19
19
->element_exists('section#probe-ph[data-panel="ph"] canvas#chart-ph')
20
Removed:
->element_exists_not('[data-status="ph"]')
21
20
->text_is( 'a[data-raw-download][data-probe="ph"]', 'Download data' )
22
21
->element_exists(
23
22
'button[data-timeframe="day"].timeframe-button.btn-outline-secondary'
@@ -52,7 +51,6 @@
52
51
$t->element_exists(
53
52
qq{section#probe-${probe}[data-panel="$probe"] canvas#chart-$probe});
54
53
$t->element_exists(qq{a[data-raw-download][data-probe="$probe"]});
55
Removed:
$t->element_exists(qq{[data-status="$probe"]});
56
54
}
57
55
58
56
done_testing;
roles/dashboard/templates/dashboard/probe-card.html.ep
@@ -57,11 +57,6 @@
57
57
<div class="chart-wrap">
58
58
<canvas id="chart-<%= $probe->{key} %>" role="img" aria-label="<%= $probe->{label} %> trend over time"></canvas>
59
59
</div>
60
Removed:
% unless (stash('single_probe')) {
61
Removed:
<p class="text-body-secondary small mt-2 mb-0 reading-status placeholder-glow" data-status="<%= $probe->{key} %>">
62
Removed:
<span class="placeholder col-8">Waiting for data…</span>
63
Removed:
</p>
64
Removed:
% }
65
60
</section>
66
61
</div>
67
62
</div>