mirror of
https://github.com/discourse/discourse.git
synced 2024-12-28 01:36:22 +08:00
476d91d233
Why this change?
This is a follow-up to 86b2e3aa3e
.
Basically, we want to allow people to select more than 1 category as well.
What does this change do?
1. Change `type: category` to `type: categories` and support `min` and `max`
validations for `type: categories`.
2. Fix the `<SchemaThemeSetting::Types::Categories>` component to support the
`min` and `max` validations and switch it to use the `<CategorySelector>` component
instead of the `<CategoryChooser>` component which only supports selecting one category.
52 lines
1.1 KiB
YAML
52 lines
1.1 KiB
YAML
objects_setting:
|
|
description:
|
|
en: "This is a description for objects setting"
|
|
type: objects
|
|
default:
|
|
- name: "section 1"
|
|
links:
|
|
- name: "link 1"
|
|
url: "http://example.com"
|
|
- name: "link 2"
|
|
url: "http://example.com"
|
|
- name: "section 2"
|
|
links:
|
|
- name: "link 3"
|
|
url: "http://example.com"
|
|
- name: "link 4"
|
|
url: "http://example.com"
|
|
schema:
|
|
name: section
|
|
properties:
|
|
name:
|
|
type: string
|
|
required: true
|
|
links:
|
|
type: objects
|
|
schema:
|
|
name: link
|
|
properties:
|
|
name:
|
|
type: string
|
|
required: true
|
|
validations:
|
|
max_length: 20
|
|
url:
|
|
type: string
|
|
|
|
objects_with_categories:
|
|
type: objects
|
|
default: []
|
|
schema:
|
|
name: categories
|
|
properties:
|
|
category_ids:
|
|
type: categories
|
|
child_categories:
|
|
type: objects
|
|
schema:
|
|
name: child category
|
|
properties:
|
|
category_ids:
|
|
type: categories
|