Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: adjust UI on nodetoolbar caused by svg icon without props #2809

Merged
merged 2 commits into from
Jul 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions src/frontend/src/CustomNodes/GenericNode/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -320,8 +320,6 @@ export default function GenericNode({
return (
<NodeToolbar>
<NodeToolbarComponent
// openWDoubleClick={openWDoubleCLick}
// setOpenWDoubleClick={setOpenWDoubleCLick}
data={data}
deleteNode={(id) => {
takeSnapshot();
Expand Down
7 changes: 5 additions & 2 deletions src/frontend/src/icons/freezeAll/freezeAll.jsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
const FreezeAllSvg = (props) => {
import { cn } from "../../utils/utils";

const FreezeAllSvg = ({ className, ...props }) => {
return (
<svg
xmlns="http://www.w3.org/2000/svg"
version="1.2"
viewBox="0 0 24 24"
className="h-4 w-4 stroke-[1.5]"
className={cn("h-4 w-4 stroke-[1.5]", className)}
{...props}
>
<title>snowflake-svg</title>
<path
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -219,10 +219,6 @@ export default function NodeToolbarComponent({
},
});

// useEffect(() => {
// if (openWDoubleClick) setShowModalAdvanced(true);
// }, [openWDoubleClick, setOpenWDoubleClick]);

const openInNewTab = (url) => {
window.open(url, "_blank", "noreferrer");
};
Expand Down Expand Up @@ -492,24 +488,6 @@ export default function NodeToolbarComponent({
</ShadTooltip>
)}

{/*<ShadTooltip content={"Save"} side="top">
<button
data-testid="save-button-modal"
className={classNames(
"relative -ml-px inline-flex items-center bg-background px-2 py-2 text-foreground shadow-md ring-1 ring-inset ring-ring transition-all duration-500 ease-in-out hover:bg-muted focus:z-10",
hasCode ? " " : " rounded-l-md ",
)}
onClick={(event) => {
event.preventDefault();
if (isSaved) {
return setShowOverrideModal(true);
}
saveComponent(cloneDeep(data), false);
}}
>
<IconComponent name="SaveAll" className="h-4 w-4" />
</button>
</ShadTooltip>*/}
<ShadTooltip
content={displayShortcut(
shortcuts.find(
Expand Down Expand Up @@ -542,29 +520,14 @@ export default function NodeToolbarComponent({
</button>
</ShadTooltip>

{/*<ShadTooltip content={"Duplicate"} side="top">
<button
data-testid="duplicate-button-modal"
className={classNames(
"relative -ml-px inline-flex items-center bg-background px-2 py-2 text-foreground shadow-md ring-1 ring-inset ring-ring transition-all duration-500 ease-in-out hover:bg-muted focus:z-10",
)}
onClick={(event) => {
event.preventDefault();
handleSelectChange("duplicate");
}}
>
<IconComponent name="Copy" className="h-4 w-4" />
</button>
</ShadTooltip>*/}

<Select onValueChange={handleSelectChange} value="">
<ShadTooltip content="All" side="top">
<SelectTrigger>
<div>
<div
data-testid="more-options-modal"
className={classNames(
"relative -ml-px inline-flex h-8 w-[31px] items-center rounded-r-md bg-background text-foreground shadow-md ring-1 ring-inset ring-ring transition-all duration-500 ease-in-out hover:bg-muted focus:z-10",
"relative -ml-px inline-flex h-8 w-[2rem] items-center rounded-r-md bg-background text-foreground shadow-md ring-1 ring-inset ring-ring transition-all duration-500 ease-in-out hover:bg-muted focus:z-10",
)}
>
<IconComponent
Expand Down Expand Up @@ -659,19 +622,7 @@ export default function NodeToolbarComponent({
/>
</SelectItem>
)}
{/* {(!hasStore || !hasApiKey || !validApiKey) && (
<SelectItem value={"Download"}>
<ToolbarSelectItem
shortcut={
shortcuts.find((obj) => obj.name === "Download")
?.shortcut!
}
value={"Download"}
icon={"Download"}
dataTestId="Download-button-modal"
/>
</SelectItem>
)} */}

<SelectItem
value={"documentation"}
disabled={data.node?.documentation === ""}
Expand Down Expand Up @@ -717,7 +668,7 @@ export default function NodeToolbarComponent({
}
value={"Freeze"}
icon={"Snowflake"}
dataTestId="group-button-modal"
dataTestId="freeze-button"
style={`${frozen ? " text-ice" : ""} transition-all`}
/>
</SelectItem>
Expand All @@ -729,7 +680,7 @@ export default function NodeToolbarComponent({
}
value={"Freeze Path"}
icon={"FreezeAll"}
dataTestId="group-button-modal"
dataTestId="freeze-path-button"
style={`${frozen ? " text-ice" : ""} transition-all`}
/>
</SelectItem>
Expand Down