You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* Adjust all example in the doc + add topic section
* Remove all display_labels in base
* Ip fabric
* nautobot1
* Round of refactoring
* netbox
* Refactor the rest
Copy file name to clipboardExpand all lines: docs/docs/topics/schema.mdx
+37-3Lines changed: 37 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -587,6 +587,41 @@ Order uniqueness constraint elements from most selective (returning fewer matche
587
587
588
588
:::
589
589
590
+
### Display Label
591
+
592
+
The `display_label` property allows you to define a custom label for nodes in the Infrahub UI. This label is used in various parts of the interface, such as list views and detail views, to provide a more user-friendly representation of the node.
593
+
594
+
The `display_label` supports template syntax, allowing you to combine multiple attributes and relationships to create a meaningful label.
595
+
596
+
Display label value is automatically computed and saved when the object is created or updated.
597
+
598
+
In the example below, the `display_label` for the `DcimCircuit` node is defined to show both the `reference_id` attribute and `provider` relationship.
This will create a display label like `CIR12345 (ProviderName)`.
618
+
:::
619
+
620
+
:::warning Limitations
621
+
Relationships used in the `display_label` must be of cardinality `one`.
622
+
Display label supports only one level of relationships.
623
+
:::
624
+
590
625
### Human friendly identifier (hfid)
591
626
592
627
In addition to the internal ID automatically generated for each object (UUID), Infrahub provide a way to define a set of fields that will constitute a human friendly identifier (HFID).
@@ -716,8 +751,7 @@ generics:
716
751
default_filter: name__value
717
752
order_by:
718
753
- name__value
719
-
display_labels:
720
-
- name__value
754
+
display_label: "{{ name__value }}"
721
755
attributes:
722
756
- name: name
723
757
kind: Text
@@ -798,7 +832,7 @@ nodes:
798
832
#### List of inheritable properties
799
833
800
834
- **human_friendly_id**: A user-friendly identifier for the entity.
801
-
- **display_labels**: Labels used for display purposes.
835
+
- **display_label**: Label used for display purposes.
802
836
- **default_filter**: The default filter applied to the entity.
803
837
- **menu_placement**: Defines where the entity appears in menus.
804
838
- **uniqueness_constraints**: Constraints ensuring unique values for certain attributes.
0 commit comments