tibi-types/schemas/api-config/collectionNavigation.json
Sebastian Frank 922cf2ff2e
All checks were successful
continuous-integration/drone/push Build is passing
meta: folding, foreignKey
2023-03-18 09:48:26 +00:00

171 lines
7.0 KiB
JSON

{
"$schema": "http://json-schema.org/draft-07/schema#",
"title": "JSON Schema tibi-server collection meta navigation configuration",
"description": "tibi-server collection navigation linter",
"type": "object",
"additionalProperties": true,
"patternProperties": {
"^x\\-": {
"description": "template property"
}
},
"required": [],
"properties": {
"name": {
"type": "string",
"description": "name of navigation"
},
"label": {
"$ref": "definitions.json#/definitions/i18nString"
},
"defaultImageFilter": {
"type": "string",
"description": "image filter name used for image previews"
},
"muiIcon": {
"type": "string",
"description": "material ui icon name"
},
"defaultSort": {
"type": "object",
"description": "default sort in admin ui lists",
"additionalProperties": false,
"properties": {
"field": {
"$ref": "definitions.json#/definitions/fieldSource"
},
"order": {
"description": "sort order",
"enum": ["ASC", "DESC"]
}
}
},
"defaultCallback": {
"description": "default action on entry, defaults to edit - can be one of: edit, view, Object with js eval",
"oneOf": [
{
"type": "string",
"enum": ["edit", "view"]
},
{
"type": "object",
"properties": {
"eval": {
"type": "string",
"description": "js eval string of (entry) => {}"
}
},
"additionalProperties": false
}
]
},
"filter": {
"type": "object",
"description": "filter for prefiltering collection view"
},
"views": {
"type": "array",
"description": "list views",
"items": {
"type": "object",
"properties": {
"mediaQuery": {
"type": "string",
"description": "css media query to select this view in ui"
}
},
"oneOf": [
{
"properties": {
"type": {
"const": "simpleList"
},
"primaryText": {
"oneOf": [
{
"$ref": "definitions.json#/definitions/fieldSource"
},
{
"$ref": "definitions.json#/definitions/evalExpressions"
}
]
},
"secondaryText": {
"oneOf": [
{
"$ref": "definitions.json#/definitions/fieldSource"
},
{
"$ref": "definitions.json#/definitions/evalExpressions"
}
]
},
"tertiaryText": {
"oneOf": [
{
"$ref": "definitions.json#/definitions/fieldSource"
},
{
"$ref": "definitions.json#/definitions/evalExpressions"
}
]
}
},
"required": ["type", "primaryText"]
},
{
"properties": {
"type": {
"const": "table"
},
"columns": {
"type": "array",
"items": {
"oneOf": [
{
"anyOf": [
{
"$ref": "definitions.json#/definitions/fieldSource"
},
{
"type": "object",
"properties": {
"label": {
"$ref": "definitions.json#/definitions/i18nString"
},
"renderValue": {
"description": "render value based on entry ($ variable)",
"$ref": "definitions.json#/definitions/evalObjectWithRaw"
}
}
}
]
},
{
"allOf": [
{
"$ref": "definitions.json#/definitions/evalExpressions"
},
{
"properties": {
"label": {
"$ref": "definitions.json#/definitions/i18nString"
}
}
}
]
}
]
},
"minItems": 1
}
},
"required": ["type", "columns"]
}
],
"required": ["type"]
}
}
}
}