Merge branch 'cz/inspection' of https://github.com/langflow-ai/langflow into cz/inspection

This commit is contained in:
cristhianzl 2024-05-30 11:00:10 -03:00
commit 4c927517b2
5 changed files with 33 additions and 26 deletions

View file

@ -6,13 +6,13 @@ import TableComponent from "../tableComponent";
import { extractColumnsFromRows } from "../../utils/utils";
function RecordsOutputComponent({
flowPool,
flowPoolObject,
pagination,
}: {
flowPool: FlowPoolObjectType;
flowPoolObject: FlowPoolObjectType;
pagination: boolean;
}) {
const rows = flowPool?.data?.artifacts?.records ?? [];
const rows = flowPoolObject?.data?.artifacts?.records ?? [];
const columns = extractColumnsFromRows(rows, "union");
const columnDefs = columns.map((col, idx) => ({
...col,

View file

@ -31,7 +31,10 @@ export default function SwitchOutputView(nodeId): JSX.Element {
</Case>
<Case condition={node && Array.isArray(results)}>
<RecordsOutputComponent flowPool={flowPoolNode} pagination={true} />
<RecordsOutputComponent
flowPoolObject={flowPoolNode}
pagination={true}
/>
</Case>
</>
);

View file

@ -258,28 +258,30 @@ export default function ParameterComponent({
<span className={!left && data.node?.frozen ? " text-ice" : ""}>
{title}
</span>
<ShadTooltip
content={
displayOutputPreview
? "Inspect Output"
: "Please build the component first"
}
>
<button
disabled={!displayOutputPreview}
onClick={() => setOpenOutputModal(true)}
{!left && (
<ShadTooltip
content={
displayOutputPreview
? "Inspect Output"
: "Please build the component first"
}
>
<IconComponent
className={classNames(
"h-5 w-5",
displayOutputPreview
? ""
: " cursor-not-allowed text-muted-foreground",
)}
name={"Eye"}
/>
</button>
</ShadTooltip>
<button
disabled={!displayOutputPreview}
onClick={() => setOpenOutputModal(true)}
>
<IconComponent
className={classNames(
"h-5 w-5",
displayOutputPreview
? ""
: " cursor-not-allowed text-muted-foreground",
)}
name={"ScanEye"}
/>
</button>
</ShadTooltip>
)}
</div>
)}
<span className={(required ? "ml-2 " : "") + "text-status-red"}>

View file

@ -256,7 +256,7 @@ export default function IOFieldView({
return (
<div className={left ? "h-56" : "h-full"}>
<RecordsOutputComponent
flowPool={flowPoolNode}
flowPoolObject={flowPoolNode}
pagination={!left}
/>
</div>

View file

@ -53,6 +53,7 @@ import {
FileType2,
FileUp,
FlaskConical,
ScanEye,
FolderIcon,
FolderPlus,
FolderPlusIcon,
@ -397,6 +398,7 @@ export const nodeIconsLucide: iconsType = {
textsplitters: Scissors,
wrappers: Gift,
helpers: Wand2,
ScanEye,
experimental: FlaskConical,
langchain_utilities: PocketKnife,
WolframAlphaAPIWrapper: SvgWolfram,