456 files
This commit is contained in:
@@ -19,6 +19,7 @@ import { historyPhotoIds } from "../helpers/history-photos";
|
||||
import { renderRefChip } from "../helpers/reference";
|
||||
import { entryReadingValues } from "../helpers/reading-slots";
|
||||
import { matchesQuery } from "../helpers/search-match";
|
||||
import { historyNoteText } from "../helpers/history-note";
|
||||
|
||||
/** v2.2.0: only "lifecycle + cost-bearing" entries are user-editable.
|
||||
* Triggers are auto-generated by sensors and shouldn't be retroactively
|
||||
@@ -131,7 +132,13 @@ export function renderHistoryList(task: MaintenanceTask, ctx: HistoryContext) {
|
||||
if (ctx.search) {
|
||||
const search = ctx.search.toLowerCase();
|
||||
// #170: "8.3-2" (or just "-2") in the notes filter finds the entry by number.
|
||||
filtered = filtered.filter((h) => matchesQuery(h.notes, ctx.search) || (entryRefOf(ctx, h) ?? "").toLowerCase().endsWith(search));
|
||||
// The shown (translated) text of a note the backend wrote matches too.
|
||||
filtered = filtered.filter(
|
||||
(h) =>
|
||||
matchesQuery(h.notes, ctx.search) ||
|
||||
matchesQuery(historyNoteText(h.notes, L), ctx.search) ||
|
||||
(entryRefOf(ctx, h) ?? "").toLowerCase().endsWith(search),
|
||||
);
|
||||
}
|
||||
|
||||
if (filtered.length === 0) {
|
||||
@@ -213,7 +220,7 @@ export function renderHistoryEntry(entry: HistoryEntry, ctx: HistoryEntryContext
|
||||
: nothing}
|
||||
</div>
|
||||
<div class="history-date">${formatDateTime(entry.timestamp, L)}</div>
|
||||
${entry.notes ? html`<div>${entry.notes}</div>` : nothing}
|
||||
${entry.notes ? html`<div>${historyNoteText(entry.notes, L)}</div>` : nothing}
|
||||
${renderHistoryPhotos(ctx.hass, entry)}
|
||||
${renderHistoryReadings(entry, ctx)}
|
||||
${entry.cost != null || entry.duration != null || entry.trigger_value != null
|
||||
|
||||
Reference in New Issue
Block a user