mirror of
https://github.com/christianvidalwolf-prog/Craze-Data-check.git
synced 2026-08-03 16:55:24 +02:00
feat: implement multi-word AND search in all views and initialize RuFlo V3
This commit is contained in:
@@ -78,11 +78,13 @@ export function HistoryView({ headers, data, onRevert, onEdit }: HistoryViewProp
|
||||
}).format(date);
|
||||
};
|
||||
|
||||
const filteredHistory = history.filter(entry =>
|
||||
entry.article_name?.toLowerCase().includes(search.toLowerCase()) ||
|
||||
entry.product_id.toLowerCase().includes(search.toLowerCase()) ||
|
||||
entry.changed_by?.toLowerCase().includes(search.toLowerCase())
|
||||
);
|
||||
const filteredHistory = history.filter(entry => {
|
||||
const terms = search.toLowerCase().split(/\s+/).filter(Boolean);
|
||||
if (terms.length === 0) return true;
|
||||
|
||||
const searchableText = `${entry.article_name} ${entry.product_id} ${entry.changed_by}`.toLowerCase();
|
||||
return terms.every(term => searchableText.includes(term));
|
||||
});
|
||||
|
||||
if (loading) {
|
||||
return (
|
||||
|
||||
Reference in New Issue
Block a user