fix: adjust UI on nodetoolbar caused by svg icon without props (#2809)
* 📝 (GenericNode/index.tsx): Remove commented-out code for openWDoubleClick in GenericNode component 🔧 (freezeAll.jsx): Refactor FreezeAllSvg component to use cn utility function for className and spread props 📝 (nodeToolbarComponent/index.tsx): Clean up commented-out code and unused elements in NodeToolbarComponent to improve code readability and maintainability * [autofix.ci] apply automated fixes --------- Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
This commit is contained in:
parent
f86e3d3a8c
commit
418a173feb
3 changed files with 9 additions and 57 deletions
|
|
@ -320,8 +320,6 @@ export default function GenericNode({
|
||||||
return (
|
return (
|
||||||
<NodeToolbar>
|
<NodeToolbar>
|
||||||
<NodeToolbarComponent
|
<NodeToolbarComponent
|
||||||
// openWDoubleClick={openWDoubleCLick}
|
|
||||||
// setOpenWDoubleClick={setOpenWDoubleCLick}
|
|
||||||
data={data}
|
data={data}
|
||||||
deleteNode={(id) => {
|
deleteNode={(id) => {
|
||||||
takeSnapshot();
|
takeSnapshot();
|
||||||
|
|
|
||||||
|
|
@ -1,10 +1,13 @@
|
||||||
const FreezeAllSvg = (props) => {
|
import { cn } from "../../utils/utils";
|
||||||
|
|
||||||
|
const FreezeAllSvg = ({ className, ...props }) => {
|
||||||
return (
|
return (
|
||||||
<svg
|
<svg
|
||||||
xmlns="http://www.w3.org/2000/svg"
|
xmlns="http://www.w3.org/2000/svg"
|
||||||
version="1.2"
|
version="1.2"
|
||||||
viewBox="0 0 24 24"
|
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>
|
<title>snowflake-svg</title>
|
||||||
<path
|
<path
|
||||||
|
|
|
||||||
|
|
@ -219,10 +219,6 @@ export default function NodeToolbarComponent({
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
// useEffect(() => {
|
|
||||||
// if (openWDoubleClick) setShowModalAdvanced(true);
|
|
||||||
// }, [openWDoubleClick, setOpenWDoubleClick]);
|
|
||||||
|
|
||||||
const openInNewTab = (url) => {
|
const openInNewTab = (url) => {
|
||||||
window.open(url, "_blank", "noreferrer");
|
window.open(url, "_blank", "noreferrer");
|
||||||
};
|
};
|
||||||
|
|
@ -492,24 +488,6 @@ export default function NodeToolbarComponent({
|
||||||
</ShadTooltip>
|
</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
|
<ShadTooltip
|
||||||
content={displayShortcut(
|
content={displayShortcut(
|
||||||
shortcuts.find(
|
shortcuts.find(
|
||||||
|
|
@ -542,21 +520,6 @@ export default function NodeToolbarComponent({
|
||||||
</button>
|
</button>
|
||||||
</ShadTooltip>
|
</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="">
|
<Select onValueChange={handleSelectChange} value="">
|
||||||
<ShadTooltip content="All" side="top">
|
<ShadTooltip content="All" side="top">
|
||||||
<SelectTrigger>
|
<SelectTrigger>
|
||||||
|
|
@ -564,7 +527,7 @@ export default function NodeToolbarComponent({
|
||||||
<div
|
<div
|
||||||
data-testid="more-options-modal"
|
data-testid="more-options-modal"
|
||||||
className={classNames(
|
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
|
<IconComponent
|
||||||
|
|
@ -659,19 +622,7 @@ export default function NodeToolbarComponent({
|
||||||
/>
|
/>
|
||||||
</SelectItem>
|
</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
|
<SelectItem
|
||||||
value={"documentation"}
|
value={"documentation"}
|
||||||
disabled={data.node?.documentation === ""}
|
disabled={data.node?.documentation === ""}
|
||||||
|
|
@ -717,7 +668,7 @@ export default function NodeToolbarComponent({
|
||||||
}
|
}
|
||||||
value={"Freeze"}
|
value={"Freeze"}
|
||||||
icon={"Snowflake"}
|
icon={"Snowflake"}
|
||||||
dataTestId="group-button-modal"
|
dataTestId="freeze-button"
|
||||||
style={`${frozen ? " text-ice" : ""} transition-all`}
|
style={`${frozen ? " text-ice" : ""} transition-all`}
|
||||||
/>
|
/>
|
||||||
</SelectItem>
|
</SelectItem>
|
||||||
|
|
@ -729,7 +680,7 @@ export default function NodeToolbarComponent({
|
||||||
}
|
}
|
||||||
value={"Freeze Path"}
|
value={"Freeze Path"}
|
||||||
icon={"FreezeAll"}
|
icon={"FreezeAll"}
|
||||||
dataTestId="group-button-modal"
|
dataTestId="freeze-path-button"
|
||||||
style={`${frozen ? " text-ice" : ""} transition-all`}
|
style={`${frozen ? " text-ice" : ""} transition-all`}
|
||||||
/>
|
/>
|
||||||
</SelectItem>
|
</SelectItem>
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue