Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add config_list.yaml schema #4

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,15 @@ https://raw.githubusercontent.com/inetis-ch/october-schemas/master/columns.json
```
[October CMS documentation](https://octobercms.com/docs/backend/lists#list-columns)

## List config `config_list.yaml`
> The list configuration is used for creating backend record list

**config_list.yaml schema URL**:
```
https://raw.githubusercontent.com/inetis-ch/october-schemas/master/config_list.json
```
[October CMS documentation](https://docs.octobercms.com/3.x/extend/lists/list-controller.html)

---

## Setup your IDE for autocomplete
Expand Down
160 changes: 160 additions & 0 deletions config_list.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,160 @@
{
"title": "JSON schema for OctoberCMS list configuration",
"$schema": "http://json-schema.org/draft-07/schema#",
"$comment": "https://docs.octobercms.com/3.x/extend/lists/list-controller.html",
"type": "object",
"required": [
"title",
"list",
"modelClass"
],
"properties": {
"title": {
"type": "string",
"description": "A title for this list."
},
"list": {
"type": [
"array",
"string"
],
"description": "A configuration array or reference to a list column definition file."
},
"modelClass": {
"type": "string",
"description": "The model class name, the list data is loaded from this model."
},
"filter": {
"type": [
"object",
"string"
],
"description": "Filter configuration, either as an array with the configuration or a reference to a filter configuration file."
},
"recordUrl": {
"type": "string",
"description": "Link each list record to another page, e.g., users/update:id."
},
"recordOnClick": {
"type": "string",
"description": "Custom JavaScript code to execute when clicking on a record."
},
"noRecordsMessage": {
"type": "string",
"description": "Message to display when no records are found."
},
"deleteMessage": {
"type": "string",
"description": "Message to display when records are bulk deleted."
},
"noRecordsDeletedMessage": {
"type": "string",
"description": "Message to display when a bulk delete action is triggered, but no records were deleted."
},
"recordsPerPage": {
"type": "integer",
"description": "Records to display per page, use 0 for no pages.",
"default": 0
},
"perPageOptions": {
"type": "array",
"items": {
"type": "integer"
},
"description": "Options for number of items per page.",
"default": [
20,
40,
80,
100,
120
]
},
"showPageNumbers": {
"type": "boolean",
"description": "Displays page numbers with pagination.",
"default": true
},
"toolbar": {
"type": "object",
"description": "Reference to a Toolbar Widget configuration file, or an array with configuration.",
"properties": {
"buttons": {
"type": "string",
"description": "A reference to a controller partial file with the toolbar buttons. Eg: _list_toolbar.htm"
},
"search": {
"type": [
"object",
"string"
],
"description": "Reference to a Search Widget configuration file, or an array with configuration.",
"properties": {
"prompt": {
"type": "string",
"description": "A placeholder to display when there is no active search, can refer to a localization string."
},
"mode": {
"type": "string",
"description": "Defines the search strategy to either contain all words, any word or exact phrase. Supported options: all, any, exact.",
"enum": [
"all",
"any",
"exact"
],
"default": "all"
},
"scope": {
"type": "string",
"description": "Specifies a query scope method defined in the list model to apply to the search query. The first argument will contain the query object (as per a regular scope method), the second will contain the search term, and the third will be an array of the columns to be searched."
},
"searchOnEnter": {
"type": "boolean",
"description": "Setting this to true will make the search widget wait for the Enter key to be pressed before it starts searching. Default: false.",
"default": false
}
}
}
}
},
"showSorting": {
"type": "boolean",
"description": "Displays the sorting link on each column.",
"default": true
},
"defaultSort": {
"type": [
"object",
"string"
],
"description": "Sets a default sorting column and direction."
},
"showCheckboxes": {
"type": "boolean",
"description": "Displays checkboxes next to each record.",
"default": false
},
"showSetup": {
"type": "boolean",
"description": "Displays the list column set up button.",
"default": false
},
"structure": {
"type": "boolean",
"description": "Enables a structured list.",
"default": false
},
"customViewPath": {
"type": "string",
"description": "Specify a custom view path to override partials used by the list."
},
"customPageName": {
"type": [
"string",
"boolean"
],
"description": "Specify a custom variable name to use in the page URL for paginated records.",
"default": "page"
}
}
}