Skip to content

Commit

Permalink
Add Parent columns on list view
Browse files Browse the repository at this point in the history
  • Loading branch information
bilalabbad committed Sep 24, 2024
1 parent 90c0540 commit ee62450
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
2 changes: 1 addition & 1 deletion frontend/app/src/config/constants.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ export const SCHEMA_ATTRIBUTE_KIND = {
export const attributesKindForDetailsViewExclude = ["HashedPassword"];

export const relationshipsForListView = {
one: ["Attribute", "Hierarchy"],
one: ["Attribute", "Hierarchy", "Parent"],
many: ["Attribute"],
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,15 @@ export default function RelationshipDetails(props: iRelationDetailsProps) {
const columns = getSchemaObjectColumns({
schema: relationshipSchemaData,
forListView: mode === "TABLE",
}).filter((column) => {
if (column.isAttribute) return true;

return relationshipsData.some((relationship: { node: any }) => {
const relatedObject = relationship.node[column.name]?.node;
if (!relatedObject) return true;

return relatedObject.id !== objectid;
});
});

let options: SelectOption[] = [];
Expand Down

0 comments on commit ee62450

Please sign in to comment.