refactor: Small improvements to sidebar, customParams, and flowToolbar for easier DSLF merges (#4487)

* DSLF refactor

* [autofix.ci] apply automated fixes

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
This commit is contained in:
Mike Fortman 2024-11-11 09:28:46 -06:00 • committed by GitHub
commit f66f31d4ce
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 30 additions and 13 deletions

View file

@ -129,6 +129,7 @@ export default function NodeInputField({
<span> <span>
{getCustomParameterTitle({ {getCustomParameterTitle({
title, title,
nodeId: data.id,
isFlexView, isFlexView,
})} })}
</span> </span>
@ -141,6 +142,7 @@ export default function NodeInputField({
<span className="text-sm font-medium"> <span className="text-sm font-medium">
{getCustomParameterTitle({ {getCustomParameterTitle({
title, title,
nodeId: data.id,
isFlexView, isFlexView,
})} })}
</span> </span>

View file

@ -1,5 +1,8 @@
import ShadTooltip from "@/components/shadTooltipComponent"; import ShadTooltip from "@/components/shadTooltipComponent";
import { ENABLE_API } from "@/customization/feature-flags"; import {
ENABLE_API,
ENABLE_LANGFLOW_STORE,
} from "@/customization/feature-flags";
import { track } from "@/customization/utils/analytics"; import { track } from "@/customization/utils/analytics";
import IOModal from "@/modals/IOModal/newModal"; import IOModal from "@/modals/IOModal/newModal";
import { useEffect, useMemo, useState } from "react"; import { useEffect, useMemo, useState } from "react";
@ -180,17 +183,19 @@ export default function FlowToolbar(): JSX.Element {
</div> </div>
</> </>
)} )}
<div className="flex items-center gap-2"> {ENABLE_LANGFLOW_STORE && (
<div <div className="flex items-center gap-2">
className={`side-bar-button ${ <div
!hasApiKey || !validApiKey || !hasStore className={`side-bar-button ${
? "cursor-not-allowed" !hasApiKey || !validApiKey || !hasStore
: "cursor-pointer" ? "cursor-not-allowed"
}`} : "cursor-pointer"
> }`}
{ModalMemo} >
{ModalMemo}
</div>
</div> </div>
</div> )}
</div> </div>
</div> </div>
</Panel> </Panel>

View file

@ -6,6 +6,8 @@ import { cn } from "../../utils/utils";
const Popover = PopoverPrimitive.Root; const Popover = PopoverPrimitive.Root;
const PopoverAnchor = PopoverPrimitive.Anchor;
const PopoverTrigger = PopoverPrimitive.Trigger; const PopoverTrigger = PopoverPrimitive.Trigger;
const PopoverContent = React.forwardRef< const PopoverContent = React.forwardRef<
@ -44,4 +46,10 @@ const PopoverContentWithoutPortal = React.forwardRef<
)); ));
PopoverContentWithoutPortal.displayName = PopoverPrimitive.Content.displayName; PopoverContentWithoutPortal.displayName = PopoverPrimitive.Content.displayName;
export { Popover, PopoverContent, PopoverContentWithoutPortal, PopoverTrigger }; export {
Popover,
PopoverAnchor,
PopoverContent,
PopoverContentWithoutPortal,
PopoverTrigger,
};

View file

@ -213,7 +213,7 @@ const Sidebar = React.forwardRef<
/> />
<div <div
className={cn( className={cn(
"absolute inset-y-0 z-50 flex h-full transition-[left,right,width] duration-200 ease-linear", "z-45 absolute inset-y-0 flex h-full transition-[left,right,width] duration-200 ease-linear",
// Adjust width based on state and device // Adjust width based on state and device
"w-[--sidebar-width]", "w-[--sidebar-width]",
"max-sm:group-data-[state=collapsed]:w-[--sidebar-width-icon]", "max-sm:group-data-[state=collapsed]:w-[--sidebar-width-icon]",

View file

@ -47,9 +47,11 @@ export function CustomParameterComponent({
export function getCustomParameterTitle({ export function getCustomParameterTitle({
title, title,
nodeId,
isFlexView, isFlexView,
}: { }: {
title: string; title: string;
nodeId: string;
isFlexView: boolean; isFlexView: boolean;
}) { }) {
return ( return (