Skip to content

Commit 8001fb5

Browse files
authored
add common relatives property in schema viewer (#6564)
1 parent 156c35e commit 8001fb5

File tree

2 files changed

+19
-1
lines changed

2 files changed

+19
-1
lines changed

frontend/app/src/entities/schema/ui/relationship-display.tsx

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import { components } from "@/shared/api/rest/types.generated";
22
import { Badge } from "@/shared/components/ui/badge";
33
import { warnUnexpectedType } from "@/shared/utils/common";
44
import { Icon } from "@iconify-icon/react";
5-
import { AccordionStyled, ModelDisplay, PropertyRow } from "./styled";
5+
import { AccordionStyled, ListDisplay, ModelDisplay, PropertyRow } from "./styled";
66

77
export const RelationshipDisplay = ({
88
relationship,
@@ -42,6 +42,10 @@ export const RelationshipDisplay = ({
4242
<div>
4343
<PropertyRow title="Peer" value={<ModelDisplay kinds={[relationship.peer]} />} />
4444
<PropertyRow title="Peer identifier" value={relationship.identifier} />
45+
<PropertyRow
46+
title="Common relatives"
47+
value={<ListDisplay items={relationship.common_relatives} />}
48+
/>
4549
<PropertyRow title="Cardinality" value={relationship.cardinality} />
4650
<PropertyRow title="Direction" value={relationship.direction} />
4751
<PropertyRow title="Kind" value={relationship.kind} />

frontend/app/src/entities/schema/ui/styled.tsx

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -168,3 +168,17 @@ export const ModelDisplay = ({ kinds }: { kinds?: string[] }) => {
168168
</div>
169169
);
170170
};
171+
172+
export const ListDisplay = ({ items }: { items?: string[] }) => {
173+
return (
174+
<div className="space-y-1 flex flex-col items-end">
175+
{items?.map((item, index) => {
176+
return (
177+
<Badge variant={"gray-outline"} key={`${item}_${index}`}>
178+
{item}
179+
</Badge>
180+
);
181+
})}
182+
</div>
183+
);
184+
};

0 commit comments

Comments
 (0)