Skip to content

Commit 4c29083

Browse files
committed
docs update
1 parent 171b5f0 commit 4c29083

4 files changed

Lines changed: 98 additions & 8 deletions

File tree

docs/configuringUiJson.md

Lines changed: 44 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -147,6 +147,7 @@ The `fieldGroup` field groups a number of other controls together and, optionall
147147
"type": "fieldGroup",
148148
"name": "advancedLabelsGroup",
149149
"label": "Advanced Options",
150+
"isInline": true,
150151
"visible": {
151152
"advancedLabels": "show"
152153
},
@@ -159,9 +160,50 @@ The `fieldGroup` field groups a number of other controls together and, optionall
159160
```
160161
More information about the syntax of the `visible` node can be found on the [Plugin Field Types](https://squaredup-eng.atlassian.net/wiki/spaces/PPD/pages/26922639097857/Plugin+Field+Types) page in Confluence.
161162

162-
There is no real visibility of the `fieldGroup` control in the UI. If it's conditionally visible and the condition is false, it's completely absent from the UI. If it's not conditionally visible, or the condition is true, the child controls appear in the UI just as they would if they were not in a `fieldGroup`.
163+
**Controlling UI Rendering with `displayAs`**
163164

164-
There is no useful presence in the `pluginConfig` object for this field type.
165+
You can use `displayAs` to control how components render in the UI. There are three `displayAs` options: `"tabs"`, `"tab"`, and `"inline-fields"`.
166+
167+
- `"tabs"` and `"inline-fields"` are **top-level** `displayAs` options, meaning they define how the main component is displayed.
168+
- `"tab"` is used **within** a `"tabs"` structure to define individual tabs.
169+
170+
**Important Note**
171+
When a `fieldGroup` has `"displayAs": "tabs"`, its `fields` property **must** contain child `fieldGroups` with `"displayAs": "tab"`. Without this structure, the UI will not render properly.
172+
173+
### Example: Working `tabs` Template
174+
175+
```json
176+
{
177+
"type": "fieldGroup",
178+
"name": "webApiConfig",
179+
"visible": "true",
180+
"displayAs": "tabs",
181+
"fields": [
182+
{
183+
"type": "fieldGroup",
184+
"name": "basics",
185+
"visible": "true",
186+
"displayAs": "tab",
187+
"label": "Basics",
188+
"fields": [...]
189+
},
190+
{
191+
"type": "fieldGroup",
192+
"name": "parameters",
193+
"displayAs": "tab",
194+
"label": "Parameters",
195+
"visible": {
196+
"httpMethod": "post"
197+
},
198+
"fields": [...]
199+
}
200+
]
201+
}
202+
```
203+
204+
This ensures that the UI correctly renders the tabbed structure.
205+
206+
By default, when there is no `displayAs` property, the `fieldGroup` is not rendered in the UI only the `fields` referenced in its `fields` property. If a `fieldGroup` is conditionally visible and the condition is false, it's completely absent from the UI. If a `fieldGroup` is not conditionally visible, or the condition is true, the child controls appear in the UI (if `displayAs` isn't used the fields appear just as they would if they were not in a `fieldGroup`).
165207

166208
### key-value
167209
The `key-value` field allows the user to add an arbitrary number of key-value pairs:

docs/newPluginBase.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Writing a new Plugin
1+
# Creating a new Plugin Base
22

33
- [Getting Started](#getting-started)
44
- [`metadata.json`](#metadatajson)

docs/testingAPlugin.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -67,9 +67,9 @@ Imported 37 vertices and 0 edges:
6767
6868
Testing readDataSource()
6969
? Which dataStreamName do you want to test? (Use arrow keys)
70-
> (Quit)
71-
appHealth
72-
stuffUnscoped
70+
> (Quit)
71+
appHealth
72+
stuffUnscoped
7373
```
7474

7575
(In the example above, the import is returning hard-coded objects, which is why it appears to work even though the preceding `testConfig()` test call showed errors).
@@ -107,4 +107,4 @@ Testing appHealth - matches: {"sourceType":{"type":"equals","value":"mySortOfApp
107107
stuffUnscoped
108108
```
109109

110-
Note at this time that the script returns the raw payload from each call on `readDataSource()`; it does not honour the `rowPath` setting you have chosen. You should check the output visually to check that the data you wish to see in dashboards is actually present at the appropriate location in the payload your plugin returns for each stream.
110+
Note at this time that the script returns the raw payload from each call on `readDataSource()`; it does not honour the `rowPath` setting you have chosen. You should check the output visually to check that the data you wish to see in dashboards is actually present at the appropriate location in the payload your plugin returns for each stream.

docs/writingANewPlugin.md

Lines changed: 49 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,4 +119,52 @@ Given a version number MAJOR.MINOR.PATCH, increment the:
119119

120120
Breaking changes to a plugin (i.e., incrementing the MAJOR version) will result in a new version of that plugin being made available alongside the existing, older version. In this unlikely scenario, you should create a whole new source directory, `plugins/`_plugin-name_`/v`_N_ for each new major version.
121121

122-
Any changes to the MINOR or PATCH numbers will simply result in the existing plugin being upgraded/updated in-place, so care should be taken to ensure your plugin continues to work with older, existing configuration payloads being passed to your plugin handler.
122+
Any changes to the MINOR or PATCH numbers will simply result in the existing plugin being upgraded/updated in-place, so care should be taken to ensure your plugin continues to work with older, existing configuration payloads being passed to your plugin handler.
123+
124+
## Minimal Viable Plugin
125+
**Must**
126+
127+
+ Out-of-box dashboard - Dashboards created on setup Guideline for creating OOB scopes and dashboards
128+
129+
+ Basic Data Source
130+
131+
+ At least one Data Stream
132+
133+
+ Test configuration button
134+
135+
+ Handle all plugin import errors
136+
137+
**Should**
138+
139+
+ Mustache should support the standard promises
140+
141+
+ Use Configurable Datastreams where appropriate
142+
143+
+ Contain Vertices and Edges for imported objects
144+
145+
+ Populating Configurable Datastream with Autocomplete values
146+
147+
## Guidelines for plugin writing
148+
149+
| **Category** | **Description** |
150+
| -------------- | ------------- |
151+
| Versioning | Use patch version change for small bug fixes <br> Use minor version changes for new data streams, text changes, internal performance improvements, added paging <br> Configuration with lower version of the plugin should work with upgraded plugin to a later version (non major) <br> When a plugin change will cause a breaking change communicate this to PMs and analyse the usage of the plugin and data stream to decide how best to handle it <br> Examples of breaking changes: <br><ul><li> Use major version change for Data Stream change that makes pervious version of same Data Stream to break (but consider creating a new data stream instead, liaise with PM) </li><li> Use major version change if removing certain objects from the graph, or if moving them over into data streams as this would break tiles where they are used as scope </li></ul>
152+
| Keywords | Include a relevant set of keywords in the metadata.json file. <br> Do not include the plugin name <br> Include relevant datastream references, e.g. BigQuery or Kusto. <br> Include related search terms, e.g. CI/CD, Database |
153+
| Spelling | American (not British) for all UI visible information (plugin name, description, data stream names) |
154+
| Data Stream metadata/columns | Every column should have a shape specified <br> Every column should have a name and a display name. The display name should typically be Title Case. |
155+
| External Links | A link should be added to all imported objects to take the user to the relevant platform, e.g. the Host in the Azure Portal, via the links property on imported nodes. <br> When it makes sense, a link should be included in the datastream data too. The column must be called “Link”. |
156+
| Timeframe | Whenever possible, all data streams should support timeframes, obeying the start/end dates included in the event. <br> Exception to the rule: data streams where it does not make sense to support a timeframe (e.g. current open alerts). Until such time that we can have a better visual cue, these data streams name should be appended with “Anytime” e.g. Open Incidents (Anytime) <br> Exception to the rule: some Health/Status data streams that show “current” data.
157+
| Health | Whenever possible, a datastream called “Health” for each imported node type should be included. |
158+
| Unscoped Data Streams | There must never be any unscoped data streams. |
159+
| Nodes / Objects | Where it makes sense, a plugin should create a top-level node that represents the account/organisation/instance, e.g. Azure subscription, Github organization. <br> The platform will create a node that represents the plugin itself and edges will be added automatically to top-level nodes such as the Github organization. <br> Add a link for each object to the tool, using the “links“ property (e.g. see the Dynatrace plugin) <br> Consider normalising the casing for case insensitive properties on the imported objects to ensure that correlation can work between them |
160+
161+
## Dictionary
162+
| **Word (standard display name)** | **Synonyms** |
163+
|-------------|-----------|
164+
| CPU | Processor <br> Memory |
165+
| Disk | Volume
166+
| Response Time | Response <br> HTTP Response|
167+
| Availability | Synthetic <br> Check |
168+
| Hosts | Server |
169+
| Latest | Top 1 <br> Current <br> Most Recent |
170+
| Status | State <br> Health |

0 commit comments

Comments
 (0)