Skip to content

Commit d22ef76

Browse files
authored
Merge pull request #2677 from port-labs/PORTN-3395-refactor-section-on-entity-relation
Enhance entity page documentation with detailed instructions for adding Related Entities tab
2 parents 02a76df + 03a69c2 commit d22ef76

File tree

1 file changed

+68
-2
lines changed

1 file changed

+68
-2
lines changed

docs/customize-pages-dashboards-and-plugins/page/entity-page.md

Lines changed: 68 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,9 +43,75 @@ Since we changed direction midway, this relation is **indirect**:
4343

4444
When looking at the entity page of a certain `Workflow Run`, the related entities `Deployment Workflow` and `Service` automatically appear, but `Deployment` does not, since its relation is in the other direction.
4545

46-
You can add additional entities to the `Related entities` table by clicking on the `+` button above the table.
46+
### Add a Related entities tab
4747

48-
In the form that appears, the `Related blueprint` dropdown will display all entities that are related in any way to the current entity. In our `Workflow Run` example above, we can use this button to add a `Deployment` tab to our widget.
48+
Click the `+` button above the table to add a custom tab.
49+
50+
1. Set the tab's `Name` and optional `Description`.
51+
52+
2. Choose the `Related blueprint` you want to display.
53+
54+
3. Pick a `Relation path`:
55+
56+
- **All paths** – includes all available paths from the current blueprint to the target blueprint.
57+
- **Specific path** – choose one specific relation chain (multi‑hop is supported).
58+
59+
4. (Optional) Add `Additional filters` to restrict the result set.
60+
61+
:::tip Relation path options
62+
Use "all paths" for a broad overview. Choose a specific path when multiple paths exist to the same blueprint and you want the tab to reflect exactly one path.
63+
:::
64+
65+
66+
#### Filters and Edit JSON
67+
68+
Selecting `Filters` opens a dialog where you can build conditions using form controls (property, operator, value).
69+
You can switch to a JSON editor using the `Edit JSON` button to define the dataset directly.
70+
71+
The dataset follows this structure:
72+
73+
```json showLineNumbers
74+
{
75+
"combinator": "and",
76+
"rules": [
77+
{
78+
"property": "$title",
79+
"operator": "contains",
80+
"value": "awesome-package"
81+
}
82+
]
83+
}
84+
```
85+
86+
87+
Use the JSON editor when you need to copy/paste filter sets, keep them in source control, or express conditions that are faster to author as JSON. You can toggle back to the form at any time.
88+
89+
<h4>Define the tab in JSON mode</h4>
90+
91+
You can also toggle `Json Mode` in the "Add tab" dialog to author the entire tab as JSON. An example:
92+
93+
```json showLineNumbers
94+
{
95+
"dataset": {
96+
"combinator": "and",
97+
"rules": [
98+
{
99+
"property": "$title",
100+
"operator": "contains",
101+
"value": "awesome-package"
102+
}
103+
]
104+
},
105+
"title": "custom path package",
106+
"targetBlueprint": "Package",
107+
"relationPath": {
108+
"path": ["service_in_env", "package"],
109+
"fromBlueprint": "service_in_env_deployments"
110+
}
111+
}
112+
```
113+
114+
This JSON corresponds to a tab named `custom path package` that targets the `Package` blueprint, follows a specific path from `service_in_env_deployments` via `service_in_env` to `package`, and filters results to titles containing the letter `awesome-package`.
49115

50116
#### Show/hide columns
51117

0 commit comments

Comments
 (0)