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
3 changes: 2 additions & 1 deletion Changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@
[#956](https://github.com/aws/graph-explorer/pull/956),
[#957](https://github.com/aws/graph-explorer/pull/957),
[#974](https://github.com/aws/graph-explorer/pull/974),
[#958](https://github.com/aws/graph-explorer/pull/958))
[#958](https://github.com/aws/graph-explorer/pull/958),
[#989](https://github.com/aws/graph-explorer/pull/989))
- **Updated** graph layout options to include better descriptions and new
directions for hierarchical and subway
([#973](https://github.com/aws/graph-explorer/pull/973))
Expand Down
4 changes: 2 additions & 2 deletions packages/graph-explorer/src/components/Button/Button.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ export const buttonStyles = cva({
},
size: {
small: "h-8 rounded px-1 text-base [&_svg]:size-5",
base: "h-10 rounded-md px-3 text-base [&_svg]:size-5",
large: "h-12 rounded-md px-4 text-lg [&_svg]:size-6",
base: "h-10 rounded-md px-4 text-base [&_svg]:size-5",
large: "h-12 rounded-md px-5 text-lg [&_svg]:size-6",
},
},
compoundVariants: [
Expand Down
17 changes: 17 additions & 0 deletions packages/graph-explorer/src/components/KeyboardKey.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import { ComponentPropsWithRef } from "react";
import { cn } from "@/utils";

export function KeyboardKey({
className,
...props
}: ComponentPropsWithRef<"div">) {

Check warning on line 7 in packages/graph-explorer/src/components/KeyboardKey.tsx

View check run for this annotation

Codecov / codecov/patch

packages/graph-explorer/src/components/KeyboardKey.tsx#L7

Added line #L7 was not covered by tests
return (
<div
className={cn(
"border-text-secondary inline rounded border bg-transparent px-1 py-0.5 font-mono text-xs leading-none tracking-wider [&_svg]:inline [&_svg]:size-[10px]",
className
)}
{...props}
/>

Check warning on line 15 in packages/graph-explorer/src/components/KeyboardKey.tsx

View check run for this annotation

Codecov / codecov/patch

packages/graph-explorer/src/components/KeyboardKey.tsx#L9-L15

Added lines #L9 - L15 were not covered by tests
);
}
2 changes: 2 additions & 0 deletions packages/graph-explorer/src/components/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,8 @@ export * from "./Input";
export { default as InputField } from "./InputField";
export * from "./InputField";

export * from "./KeyboardKey";

export * from "./Label";

export { default as ListItem } from "./ListItem";
Expand Down
21 changes: 11 additions & 10 deletions packages/graph-explorer/src/modules/GraphViewer/SelectLayout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
...selectTriggerProps
}: ComponentPropsWithRef<typeof SelectTrigger>) {
const [value, setValue] = useAtom(graphLayoutSelectionAtom);

return (
<Select
value={value}
Expand All @@ -41,24 +42,24 @@
<SelectSeparator />
<SelectGroup>
<SelectLabel>Klay</SelectLabel>
<SelectItem value="KLAY_LR">Left to Right</SelectItem>
<SelectItem value="KLAY_TB">Top to Bottom</SelectItem>
<SelectItem value="KLAY_LR">Klay (Left to Right)</SelectItem>
<SelectItem value="KLAY_TB">Klay (Top to Bottom)</SelectItem>

Check warning on line 46 in packages/graph-explorer/src/modules/GraphViewer/SelectLayout.tsx

View check run for this annotation

Codecov / codecov/patch

packages/graph-explorer/src/modules/GraphViewer/SelectLayout.tsx#L45-L46

Added lines #L45 - L46 were not covered by tests
</SelectGroup>
<SelectSeparator />
<SelectGroup>
<SelectLabel>Hierarchical</SelectLabel>
<SelectItem value="DAGRE_LR">Left to Right</SelectItem>
<SelectItem value="DAGRE_RL">Right to Left</SelectItem>
<SelectItem value="DAGRE_TB">Top to Bottom</SelectItem>
<SelectItem value="DAGRE_BT">Bottom to Top</SelectItem>
<SelectItem value="DAGRE_LR">Hierarchical (Left to Right)</SelectItem>
<SelectItem value="DAGRE_RL">Hierarchical (Right to Left)</SelectItem>
<SelectItem value="DAGRE_TB">Hierarchical (Top to Bottom)</SelectItem>
<SelectItem value="DAGRE_BT">Hierarchical (Bottom to Top)</SelectItem>

Check warning on line 54 in packages/graph-explorer/src/modules/GraphViewer/SelectLayout.tsx

View check run for this annotation

Codecov / codecov/patch

packages/graph-explorer/src/modules/GraphViewer/SelectLayout.tsx#L51-L54

Added lines #L51 - L54 were not covered by tests
</SelectGroup>
<SelectSeparator />
<SelectGroup>
<SelectLabel>Subway</SelectLabel>
<SelectItem value="SUBWAY_LR">Left to Right</SelectItem>
<SelectItem value="SUBWAY_RL">Right to Left</SelectItem>
<SelectItem value="SUBWAY_TB">Top to Bottom</SelectItem>
<SelectItem value="SUBWAY_BT">Bottom to Top</SelectItem>
<SelectItem value="SUBWAY_LR">Subway (Left to Right)</SelectItem>
<SelectItem value="SUBWAY_RL">Subway (Right to Left)</SelectItem>
<SelectItem value="SUBWAY_TB">Subway (Top to Bottom)</SelectItem>
<SelectItem value="SUBWAY_BT">Subway (Bottom to Top)</SelectItem>

Check warning on line 62 in packages/graph-explorer/src/modules/GraphViewer/SelectLayout.tsx

View check run for this annotation

Codecov / codecov/patch

packages/graph-explorer/src/modules/GraphViewer/SelectLayout.tsx#L59-L62

Added lines #L59 - L62 were not covered by tests
</SelectGroup>
</SelectContent>
</Select>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,19 @@
FormControl,
FormField,
FormItem,
KeyboardKey,
LoadingSpinner,
PanelEmptyState,
PanelError,
SearchSadIcon,
TextArea,
Tooltip,
TooltipContent,
TooltipTrigger,
} from "@/components";
import { useExplorer, useUpdateSchemaFromEntities } from "@/core";
import { useMutation, useQueryClient } from "@tanstack/react-query";
import { CornerDownRightIcon } from "lucide-react";
import { SendHorizonalIcon } from "lucide-react";

Check warning on line 19 in packages/graph-explorer/src/modules/SearchSidebar/QuerySearchTabContent.tsx

View check run for this annotation

Codecov / codecov/patch

packages/graph-explorer/src/modules/SearchSidebar/QuerySearchTabContent.tsx#L19

Added line #L19 was not covered by tests
import { z } from "zod";
import { useForm } from "react-hook-form";
import { zodResolver } from "@hookform/resolvers/zod";
Expand Down Expand Up @@ -90,16 +94,25 @@
</FormItem>
)}
/>
<div className="flex gap-3">
<Button
className="w-full"
variant="filled"
type="submit"
disabled={form.formState.isSubmitting}
>
<CornerDownRightIcon />
Run query
</Button>
<div className="flex justify-end gap-3">
<Tooltip>
<TooltipTrigger asChild>
<Button
variant="default"
type="submit"
disabled={form.formState.isSubmitting}
>

Check warning on line 104 in packages/graph-explorer/src/modules/SearchSidebar/QuerySearchTabContent.tsx

View check run for this annotation

Codecov / codecov/patch

packages/graph-explorer/src/modules/SearchSidebar/QuerySearchTabContent.tsx#L97-L104

Added lines #L97 - L104 were not covered by tests
Run Query
<SendHorizonalIcon />
</Button>
</TooltipTrigger>
<TooltipContent>
<KeyboardKey>Cmd</KeyboardKey> +{" "}
<KeyboardKey>Enter</KeyboardKey> or{" "}
<KeyboardKey>Ctrl</KeyboardKey> +{" "}
<KeyboardKey>Enter</KeyboardKey>
</TooltipContent>
</Tooltip>

Check warning on line 115 in packages/graph-explorer/src/modules/SearchSidebar/QuerySearchTabContent.tsx

View check run for this annotation

Codecov / codecov/patch

packages/graph-explorer/src/modules/SearchSidebar/QuerySearchTabContent.tsx#L106-L115

Added lines #L106 - L115 were not covered by tests
</div>
</form>
</Form>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
import { MappedQueryResults } from "@/connector";
import { NodeSearchResult } from "./NodeSearchResult";
import { useAddToGraphMutation } from "@/hooks/useAddToGraph";
import { ChevronLeftIcon, ChevronRightIcon } from "lucide-react";
import { ChevronLeftIcon, ChevronRightIcon, ListPlusIcon } from "lucide-react";

Check warning on line 11 in packages/graph-explorer/src/modules/SearchSidebar/SearchResultsList.tsx

View check run for this annotation

Codecov / codecov/patch

packages/graph-explorer/src/modules/SearchSidebar/SearchResultsList.tsx#L11

Added line #L11 was not covered by tests
import { EdgeSearchResult } from "./EdgeSearchResult";
import { ScalarSearchResult } from "./ScalarSearchResult";
import { Edge, Vertex } from "@/core";
Expand Down Expand Up @@ -57,7 +57,7 @@
vertices={results.vertices}
edges={results.edges}
/>
<div className="flex items-center gap-2">
<div className="flex min-h-10 items-center gap-2">

Check warning on line 60 in packages/graph-explorer/src/modules/SearchSidebar/SearchResultsList.tsx

View check run for this annotation

Codecov / codecov/patch

packages/graph-explorer/src/modules/SearchSidebar/SearchResultsList.tsx#L60

Added line #L60 was not covered by tests
<ResultCounts results={results} />
{isPagingNecessary ? (
<div className="flex">
Expand Down Expand Up @@ -135,22 +135,29 @@
...props
}: ButtonProps & { vertices: Vertex[]; edges: Edge[] }) {
const mutation = useAddToGraphMutation();
const canSendToGraph = vertices.length > 0 || edges.length > 0;
const counts = vertices.length + edges.length;

if (counts === 0) {
// Ensure there are entities that can be added to the graph
const canSendToGraph = vertices.length + edges.length > 0;
if (!canSendToGraph) {

Check warning on line 141 in packages/graph-explorer/src/modules/SearchSidebar/SearchResultsList.tsx

View check run for this annotation

Codecov / codecov/patch

packages/graph-explorer/src/modules/SearchSidebar/SearchResultsList.tsx#L140-L141

Added lines #L140 - L141 were not covered by tests
return null;
}

return (
<Button
variant="filled"

Check warning on line 147 in packages/graph-explorer/src/modules/SearchSidebar/SearchResultsList.tsx

View check run for this annotation

Codecov / codecov/patch

packages/graph-explorer/src/modules/SearchSidebar/SearchResultsList.tsx#L147

Added line #L147 was not covered by tests
onClick={() => mutation.mutate({ vertices, edges })}
disabled={!canSendToGraph || mutation.isPending}
disabled={mutation.isPending}

Check warning on line 149 in packages/graph-explorer/src/modules/SearchSidebar/SearchResultsList.tsx

View check run for this annotation

Codecov / codecov/patch

packages/graph-explorer/src/modules/SearchSidebar/SearchResultsList.tsx#L149

Added line #L149 was not covered by tests
className="stack shrink-0 items-center justify-center"
{...props}
>
<span className={cn("visible", mutation.isPending && "invisible")}>
Add All ({counts})
<span
className={cn(
"visible inline-flex items-center gap-2",
mutation.isPending && "invisible"
)}

Check warning on line 157 in packages/graph-explorer/src/modules/SearchSidebar/SearchResultsList.tsx

View check run for this annotation

Codecov / codecov/patch

packages/graph-explorer/src/modules/SearchSidebar/SearchResultsList.tsx#L153-L157

Added lines #L153 - L157 were not covered by tests
>
<ListPlusIcon />

Check warning on line 159 in packages/graph-explorer/src/modules/SearchSidebar/SearchResultsList.tsx

View check run for this annotation

Codecov / codecov/patch

packages/graph-explorer/src/modules/SearchSidebar/SearchResultsList.tsx#L159

Added line #L159 was not covered by tests
Add All
</span>
<span
className={cn("invisible", mutation.isPending && "visible mx-auto")}
Expand Down