Skip to content

Commit

Permalink
[Fix] Removed tooltip message for highlight not supported (#1070)
Browse files Browse the repository at this point in the history
removed tooltip for highlight not supported

Co-authored-by: Gayathri <[email protected]>
  • Loading branch information
jagadeeswaran-zipstack and gaya3-zipstack authored Jan 20, 2025
1 parent dd7cdf7 commit 538a83d
Show file tree
Hide file tree
Showing 5 changed files with 28 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -380,7 +380,7 @@ function DocumentManager({ generateIndex, handleUpdateTool, handleDocChange }) {
) : null}
</div>
<div>
<Tooltip title="Manage Documents">
<Tooltip title="Manage Document Variants">
<Button
className="doc-manager-btn"
onClick={() => setOpenManageDocsModal(true)}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -307,7 +307,7 @@ function ManageDocsModal({

const columns = [
{
title: "Document",
title: "Document Variants",
dataIndex: "document",
key: "document",
},
Expand Down Expand Up @@ -663,7 +663,7 @@ function ManageDocsModal({
<SpaceWrapper>
<Space>
<Typography.Text className="add-cus-tool-header">
Manage Documents
Manage Document Variants
</Typography.Text>
</Space>
<div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -300,7 +300,7 @@ function OutputForDocModal({

const columns = [
{
title: "Document",
title: "Document Variants",
dataIndex: "document",
key: "document",
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import {
Row,
Select,
Space,
Tag,
Typography,
} from "antd";
import { useEffect, useRef, useState } from "react";
Expand Down Expand Up @@ -251,6 +252,22 @@ function PromptCardItems({
</Space>
</Button>
</Space>
<Space>
{details?.enable_highlight &&
["json", "table", "record"].includes(enforceType) && (
<Tag
color="red"
style={{
whiteSpace: "normal",
wordWrap: "break-word",
minWidth: "200px",
}}
>
Highlighting is not supported when enforce type is{" "}
{enforceType}
</Tag>
)}
</Space>
<Space>
{(enforceType === TABLE_ENFORCE_TYPE ||
enforceType === RECORD_ENFORCE_TYPE) &&
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,9 @@ function PromptOutput({
const { generatePromptOutputKey } = usePromptOutput();
const isTableExtraction =
enforceType === TABLE_ENFORCE_TYPE || enforceType === RECORD_ENFORCE_TYPE;
const noHighlightEnforceType = !["json", "table", "record"].includes(
enforceType
);
const tooltipContent = (adapterConf) => (
<div>
{Object.entries(adapterConf)?.map(([key, value]) => (
Expand Down Expand Up @@ -204,17 +207,17 @@ function PromptOutput({
transition={{ duration: 0.5, ease: "linear" }}
className={`prompt-card-llm ${
details?.enable_highlight &&
enforceType !== "json" &&
noHighlightEnforceType &&
selectedHighlight?.highlightedPrompt === promptId &&
selectedHighlight?.highlightedProfile === profileId &&
"highlighted-prompt-cell"
}`}
>
<Tooltip
title={
details?.enable_highlight && enforceType !== "json"
? "Click to highlight"
: "Highlighting is not supported when enforce type is JSON"
details?.enable_highlight &&
noHighlightEnforceType &&
"Click to highlight"
}
>
<Col
Expand Down

0 comments on commit 538a83d

Please sign in to comment.