Skip to content
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
10 changes: 8 additions & 2 deletions src/components/Editor/EditorAreaSidebar/EditorAreaSidebar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
import { BlockType } from '../../../api/types';
import { BlockCard } from '../BlockCard';
import { ConfigurationDB, CrossplaneProviderDB } from '../../../api/typesDB';
import { Filter } from 'lucide-react';
import { Box, Filter } from 'lucide-react';
import crossplaneIcon from '../../../assets/crossplane-icon.svg';

export const EditorAreaSidebar = () => {
Expand Down Expand Up @@ -56,7 +56,7 @@

useEffect(() => {
fetchConfiguration();
}, [entity, entityId]);

Check warning on line 59 in src/components/Editor/EditorAreaSidebar/EditorAreaSidebar.tsx

View workflow job for this annotation

GitHub Actions / Lint, typecheck, build

React Hook useEffect has a missing dependency: 'fetchConfiguration'. Either include it or remove the dependency array

const { value: listCrossplaneProvidersValue } = useAsync(async () => {
return await adapter.listCrossplaneProviders();
Expand Down Expand Up @@ -120,7 +120,7 @@
const fullUrl = pr.version ? `${pr.url}:${pr.version}` : pr.url;
fetchBlockTypes(fullUrl, pr.icon);
});
}, [providers]);

Check warning on line 123 in src/components/Editor/EditorAreaSidebar/EditorAreaSidebar.tsx

View workflow job for this annotation

GitHub Actions / Lint, typecheck, build

React Hook useEffect has a missing dependency: 'fetchBlockTypes'. Either include it or remove the dependency array

const filterBlockTypes = (
blockTypes: BlockType[],
Expand Down Expand Up @@ -188,14 +188,20 @@
className="border border-sidebar-border rounded-md px-2 last:border-b"
>
<AccordionTrigger className="justify-start gap-3 no-underline hover:no-underline py-3">
{headerIcon && (
{headerIcon ? (
<img
src={headerIcon}
alt=""
width={20}
height={20}
draggable={false}
/>
) : (
<Box
className="text-muted-foreground"
width={24}
height={24}
/>
)}
{getProviderDisplayName(pr)}
</AccordionTrigger>
Expand Down
54 changes: 43 additions & 11 deletions src/components/Editor/Nodes/ContainerNode.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import {
useReactFlow,
type NodeDimensionChange,
} from '@xyflow/react';
import { Pencil, Plus, Trash2 } from 'lucide-react';
import { Box, Pencil, Plus, Trash2 } from 'lucide-react';
import { NodeDeletionDialog } from '../ConfirmDeletionDialog';
import { useNodeDeleteShortcut } from '../../../lib/useNodeDeleteShortcut';
import { ContainerNodeFooter } from './ContainerNodeFooter';
Expand Down Expand Up @@ -540,30 +540,27 @@ const ContainerNodeComponent = ({

return (
<>
<NodeResizeControl
minWidth={MIN_CONTAINER_WIDTH}
minHeight={minRequiredHeight}
onResize={(_, data) => {
setIsUserResizing(true);
setNodeHeight(data.height);
setNodeWidth(data.width);
}}
/>
<div
className="node-body relative"
data-parent-id={containerId}
style={{ width: '100%', height: '100%' }}
>
<div className="flex items-center border-b-[2px] border-muted-foreground/20 px-2 py-1 rounded-t-lg">
<div className="w-14 flex items-center">
{icon && (
{icon ? (
<img
src={icon}
alt=""
width={20}
height={20}
draggable={false}
/>
) : (
<Box
className="text-muted-foreground"
width={20}
height={20}
/>
)}
</div>
<div className="flex-1 text-center">
Expand Down Expand Up @@ -653,6 +650,41 @@ const ContainerNodeComponent = ({
</Dialog>
<ContainerNodeFooter functions={functions} />
</div>
<NodeResizeControl
minWidth={MIN_CONTAINER_WIDTH}
minHeight={minRequiredHeight}
onResize={(_, data) => {
setIsUserResizing(true);
setNodeHeight(data.height);
setNodeWidth(data.width);
}}
style={{
background: 'transparent',
border: 'none',
width: 18,
height: 18,
cursor: 'nwse-resize',
translate: '-20px -20px',
zIndex: 10,
}}
>
<svg
width="18"
height="18"
viewBox="0 0 18 18"
xmlns="http://www.w3.org/2000/svg"
className="text-muted-foreground/70"
style={{ display: 'block', pointerEvents: 'none' }}
>
<path
d="M10 16 L16 10 M13 16 L16 13"
stroke="currentColor"
strokeWidth="1.5"
strokeLinecap="round"
fill="none"
/>
</svg>
</NodeResizeControl>
<NodeDeletionDialog
open={openDeleteDialog}
nodeId={containerId}
Expand Down
10 changes: 8 additions & 2 deletions src/components/Editor/Nodes/ResourceNode.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import {
useConnection,
useReactFlow,
} from '@xyflow/react';
import { Plus, Trash2 } from 'lucide-react';
import { Box, Plus, Trash2 } from 'lucide-react';
import { NodeDeletionDialog } from '../ConfirmDeletionDialog';
import { CustomHandle } from '../CustomHandle';
import { useEditorAreaContext } from '../EditorAreaContext';
Expand Down Expand Up @@ -180,14 +180,20 @@ const ResourceNodeComponent = ({
>
<div className="flex items-center border-b-[2px] border-muted-foreground/20 px-2 py-1 rounded-t-lg">
<div className="w-14 flex items-center">
{icon && (
{icon ? (
<img
src={icon}
alt=""
width={20}
height={20}
draggable={false}
/>
) : (
<Box
className="text-muted-foreground"
width={20}
height={20}
/>
)}
</div>
<div className="flex-1 text-center">
Expand Down
Loading