Skip to content

Commit a4fd3ee

Browse files
authored
Display Parent relationship in list view (#4426)
if the parent is a relationship, we do not display to avoide noise
1 parent 5de9bfd commit a4fd3ee

File tree

3 files changed

+430
-399
lines changed

3 files changed

+430
-399
lines changed

frontend/app/src/config/constants.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,7 @@ export const SCHEMA_ATTRIBUTE_KIND = {
174174
export const attributesKindForDetailsViewExclude = ["HashedPassword"];
175175

176176
export const relationshipsForListView = {
177-
one: ["Attribute", "Hierarchy"],
177+
one: ["Attribute", "Hierarchy", "Parent"],
178178
many: ["Attribute"],
179179
};
180180

frontend/app/src/screens/object-item-details/relationship-details-paginated.tsx

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,15 @@ export default function RelationshipDetails(props: iRelationDetailsProps) {
6464
const columns = getSchemaObjectColumns({
6565
schema: relationshipSchemaData,
6666
forListView: mode === "TABLE",
67+
}).filter((column) => {
68+
if (column.isAttribute) return true;
69+
70+
return relationshipsData?.some((relationship: { node: any }) => {
71+
const relatedObject = relationship.node[column.name]?.node;
72+
if (!relatedObject) return true;
73+
74+
return relatedObject.id !== objectid;
75+
});
6776
});
6877

6978
const [, setShowMetaEditModal] = useAtom(showMetaEditState);

0 commit comments

Comments
 (0)