Rework "view brick item" conditional access

Change from never show the operator if the relation is "type" to not showing it only if the "type" is the current class being viewed.

This may come in handy if other list views other than hierarchy are implemented.

It also implies why we don't want to show "view brick item" here: because we already viewing it.
This commit is contained in:
rileywong311
2023-08-15 21:53:37 -07:00
parent 4066cfc7ff
commit 0dfdfb6463
@@ -187,7 +187,7 @@ class BIM_PT_brickschema(Panel):
op = row.operator("bim.remove_brick_relation", text="", icon="UNLINKED")
op.predicate = relation["predicate"]
op.object = relation["object"]
if relation["is_uri"] and relation["predicate_name"] != "type":
if relation["is_uri"] and relation["object_name"] != self.props.active_brick_class:
op = row.operator("bim.view_brick_item", text="", icon="DISCLOSURE_TRI_RIGHT")
op.item = relation["object_uri"]
if relation["is_globalid"]: