Skip to content

Commit 6ae191a

Browse files
authored
docs: Adjust condition list docs (#3656)
* Adjust condition list docs * Fix examples
1 parent 51f2213 commit 6ae191a

File tree

2 files changed

+31
-20
lines changed

2 files changed

+31
-20
lines changed

docs/extensibility/50-list-and-details-widgets.md

Lines changed: 31 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -93,43 +93,54 @@ This is an exaple of kind only:
9393
kindOnly: true
9494
```
9595

96+
<img src="./assets/display-widgets/ControlledBy--kindOnly.png" alt="Example of a ControlledBy widget without name link" width="40%" style="border: 1px solid #D2D5D9">
97+
9698
### `ConditionList`
9799

98100
The `ConditionList` widget renders the conditions as an expandable list with condition details. This widget is primarily designed for the overview section **data.details.status** or **data.details.status.body**
99101

100-
| Parameter | Required | Type | Description |
101-
| -------------- | -------- | ---- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
102-
| **highlights** | No | | A map of highlight rules that will only be applied to the `condition` matching `type`. Key refers to the type of highlight, while the rule can be a plain array of values ​​or a string containing the [JSONata](100-jsonata.md) rule. Allowed keys are `informative`, `positive`, `warning`, `critical`, and `type`. <br><br> With the `type` key (required), you can specify which condition the highlighting must be applied to. It must contain one of the `types` of the source condition. <br><br> If no highlighting is provided, the following values ​​are automatically supported: <br> - rendered as informational: `Unknown`. <br> - rendered as positive: `True`. <br> - rendered as critical: `False`. |
102+
| Parameter | Required | Type | Description |
103+
| -------------- | -------- | ---- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
104+
| **highlights** | No | | A map of highlight rules that will only be applied to the `condition` matching `type`. Key refers to the type of highlight, while the rule can be a plain array of values ​​or a string containing the [JSONata](100-jsonata.md) rule. Allowed keys are `informative`, `positive`, `negative`, `critical`, and `type`. <br><br> With the `type` key (required), you can specify which condition the highlighting must be applied to. It must contain one of the `types` of the source condition. <br><br> If no highlighting is provided, the following values ​​are automatically supported: <br> - rendered as informational: `Unknown`. <br> - rendered as positive: `True`. <br> - rendered as critical: `False`. |
103105

104106
See the following example of the standard `ConditionList`:
105107

106108
```yaml
107109
status:
108-
- name: Condition details
109-
widget: ConditionList
110-
source: status.conditions
110+
body:
111+
- name: Condition details
112+
widget: ConditionList
113+
source: status.conditions
111114
```
112115

116+
<img src="./assets/display-widgets/ConditionList.png" alt="Example of a condition list widget" style="border: 1px solid #D2D5D9">
117+
113118
This is an example of `ConditionList` with overriden statuses:
114119

115120
```yaml
116121
status:
117-
- name: Condition details
118-
widget: ConditionList
119-
source: status.conditions
120-
highlights:
121-
- type: ScalingActive
122-
positive:
123-
- 'False'
124-
negative:
125-
- 'True'
126-
informative:
127-
- unknown
122+
body:
123+
- name: Condition details
124+
widget: ConditionList
125+
source: status.conditions
126+
highlights:
127+
- type: ScalingActive
128+
positive:
129+
- 'False'
130+
negative:
131+
- 'True'
132+
informative:
133+
- unknown
134+
- type: ScalingLimited
135+
positive:
136+
- 'False'
137+
critical:
138+
- 'True'
139+
informative:
140+
- unknown
128141
```
129142

130-
<img src="./assets/display-widgets/ConditionList.png" alt="Example of a condition list widget" style="border: 1px solid #D2D5D9">
131-
132-
<img src="./assets/display-widgets/ControlledBy--kindOnly.png" alt="Example of a ControlledBy widget without name link" width="40%" style="border: 1px solid #D2D5D9">
143+
<img src="./assets/display-widgets/ConditionListHighlights.png" alt="Example of a condition list widget with overriden statuses" style="border: 1px solid #D2D5D9">
133144

134145
### `ExternalLink`
135146

14.1 KB
Loading

0 commit comments

Comments
 (0)