Skip to content

Commit

Permalink
docs: improve custom field docs (#50)
Browse files Browse the repository at this point in the history
  • Loading branch information
cugu authored Jan 2, 2025
1 parent 68b76c9 commit e3c7bbf
Showing 1 changed file with 45 additions and 7 deletions.
52 changes: 45 additions & 7 deletions docs/catalyst/admin/types.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,48 @@ There are two default ticket types: `Alert` and `Incident`, but you can add more

## Fields

- **singular**: The singular name of the ticket type.
- **plural**: The plural name of the ticket type.
- **icon**: The icon of the ticket type. You can use [Lucide icons](https://lucide.dev/icons/),
but need to convert the icon name to camelCase, e.g. `flask-conical` becomes `FlaskConical`
- **schema**: The schema of the ticket type. The schema is used to generate the details form for the ticket type.
You need use the [JSON Schema](https://json-schema.org/) format to define the schema,
but currently only string properties are supported.
### `singular` and `plural` Fields

The `singular` and `plural` fields are used to define the name of the ticket type.

### `icon` Field

The `icon` field is used to define the icon of the ticket type.
You can use [Lucide icons](https://lucide.dev/icons/),
but need to convert the icon name to camelCase, e.g. `flask-conical` becomes `FlaskConical`

### `schema` Field

The `schema` field is used to define the custom fields for details of the ticket type.
It uses a subset of the [JSON Schema](https://json-schema.org/) format to define the schema,
currently enum, boolean, string, and integer properties are supported without any additional constraints.

The following example shows a schema with the four different property types:

```json
{
"type": "object",
"properties": {
"severity": {
"type": "string",
"enum": [
"Low",
"Medium",
"High"
]
},
"false_positive": {
"type": "boolean",
"title": "False Positive"
},
"source": {
"type": "string",
"title": "Source"
},
"affected_user_count": {
"type": "integer",
"title": "Affected User Count"
}
}
}
```

0 comments on commit e3c7bbf

Please sign in to comment.