tibi-types/schemas/api-config/collectionNavigation.json
robin 59c269f0c4
All checks were successful
continuous-integration/drone/push Build is passing
dashboard fixes
2023-07-23 20:57:50 +00:00

268 lines
11 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"
},
"multiupload": {
"type": "object",
"description": "Configuration for multi-upload behavior.",
"properties": {
"fields": {
"type": "array",
"description": "Fields editable in the modal. If not set, all fields will be selected automatically.",
"items": {
"type": "object",
"properties": {
"source": {
"type": "string",
"description": "Name of the field."
}
},
"required": ["source"]
}
},
"prefilledFields": {
"type": "array",
"description": "Fields that should have default values. They won't be visible to the user but just an informational text for which fields will receive a default value.",
"items": {
"type": "object",
"properties": {
"source": {
"type": "string",
"description": "Name of the field."
},
"defaultValue": {
"type": "object",
"properties": {
"eval": {
"type": "string",
"description": "JavaScript evaluation string to determine the default value."
}
},
"required": ["eval"]
}
},
"required": ["source", "defaultValue"]
}
}
},
"required": ["fields"]
},
"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"
},
"selectionPriority": {
"type": "number",
"description": "priority for selection based on media query"
},
"fileDropArea": {
"type": "object",
"properties": {
"label": {
"$ref": "definitions.json#/definitions/i18nString"
},
"helperText": {
"$ref": "definitions.json#/definitions/i18nString"
},
"targetField": {
"type": "string"
},
"pageAsDropArea": {
"type": "boolean"
}
}
}
},
"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"]
},
{
"properties": {
"type": {
"const": "cardList"
},
"fields": {
"type": "array",
"items": {
"type": "object",
"properties": {
"source": {
"type": "string"
},
"type": {
"type": "string"
},
"label": {
"type": "string"
},
"filter": {
"type": "boolean"
}
},
"required": ["source"]
}
}
},
"required": ["type", "fields"]
}
],
"required": ["type"]
}
}
}
}