From cdf35d9e3f3e262930ffc6f7dd21a80dd308827f Mon Sep 17 00:00:00 2001 From: Rutuja Chaudhari <36963955+rutujaac@users.noreply.github.com> Date: Wed, 21 Aug 2024 17:45:53 +0530 Subject: [PATCH] add confidence score at snippet level (#489) --- .../src/components/snippetDetails.js | 171 +++++++++--------- .../app/pebblo-ui/src/components/tooltip.js | 6 +- pebblo/app/pebblo-ui/static/index.css | 6 +- 3 files changed, 97 insertions(+), 86 deletions(-) diff --git a/pebblo/app/pebblo-ui/src/components/snippetDetails.js b/pebblo/app/pebblo-ui/src/components/snippetDetails.js index 2e9aac11..77150ad3 100644 --- a/pebblo/app/pebblo-ui/src/components/snippetDetails.js +++ b/pebblo/app/pebblo-ui/src/components/snippetDetails.js @@ -16,6 +16,7 @@ function DisplaySnippet(props) { title: `Confidence: ${item?.score}`, variant: "top", inline: true, + width: "width-max-content", }) : `${item.string}` )} @@ -30,62 +31,6 @@ export function SnippetDetails(props) { if (inputEl) inputEl?.addEventListener(KEYUP, onChange); }); - function onChange(evt) { - let filteredData; - if (evt.target.value) { - filteredData = data?.snippets?.filter((item) => - eval( - searchField - ?.map((sch) => - item[sch] - ?.toLocaleLowerCase() - ?.includes(evt.target.value.toLocaleLowerCase()) - ) - .join(" || ") - ) - ); - } else { - filteredData = data?.snippets; - } - const snippet_body = document.getElementById("snippet_body"); - snippet_body.innerHTML = ""; - snippet_body.innerHTML = filteredData?.length - ? filteredData?.myMap( - (item) => /*html*/ ` -