FEATURE: Allow multiple required tag groups for a category (#16381)

Previously we only supported a single 'required tag group' for a category. This commit allows admins to specify multiple required tag groups, each with their own minimum tag count.

A new category_required_tag_groups database table replaces the existing columns on the categories table. Data is automatically migrated.
This commit is contained in:
David Taylor
2022-04-06 14:08:06 +01:00
committed by GitHub
parent 8f03baaf8e
commit 68c74e9b93
32 changed files with 387 additions and 156 deletions

View File

@@ -128,9 +128,6 @@
]
},
"min_tags_from_required_group": {
"type": "integer"
},
"allowed_tags": {
"type": "array"
},
@@ -140,10 +137,25 @@
"allow_global_tags": {
"type": "boolean"
},
"required_tag_group_name": {
"type": [
"string",
"null"
"required_tag_groups": {
"type": "array",
"items": [
{
"type": "object",
"additionalProperties": false,
"properties": {
"name": {
"type": "string"
},
"min_count": {
"type": "integer"
}
},
"required": [
"name",
"min_count"
]
}
]
},
"read_only_banner": {
@@ -267,8 +279,7 @@
"minimum_required_tags",
"navigate_to_first_post_after_read",
"custom_fields",
"min_tags_from_required_group",
"required_tag_group_name",
"required_tag_groups",
"read_only_banner",
"available_groups",
"auto_close_hours",

View File

@@ -131,9 +131,6 @@
]
},
"min_tags_from_required_group": {
"type": "integer"
},
"allowed_tags": {
"type": "array"
},
@@ -143,10 +140,25 @@
"allow_global_tags": {
"type": "boolean"
},
"required_tag_group_name": {
"type": [
"string",
"null"
"required_tag_groups": {
"type": "array",
"items": [
{
"type": "object",
"additionalProperties": false,
"properties": {
"name": {
"type": "string"
},
"min_count": {
"type": "integer"
}
},
"required": [
"name",
"min_count"
]
}
]
},
"read_only_banner": {
@@ -270,8 +282,7 @@
"minimum_required_tags",
"navigate_to_first_post_after_read",
"custom_fields",
"min_tags_from_required_group",
"required_tag_group_name",
"required_tag_groups",
"read_only_banner",
"available_groups",
"auto_close_hours",

View File

@@ -593,13 +593,25 @@
"allow_global_tags": {
"type": "boolean"
},
"min_tags_from_required_group": {
"type": "integer"
},
"required_tag_group_name": {
"type": [
"string",
"null"
"required_tag_groups": {
"type": "array",
"items": [
{
"type": "object",
"additionalProperties": false,
"properties": {
"name": {
"type": "string"
},
"min_count": {
"type": "integer"
}
},
"required": [
"name",
"min_count"
]
}
]
},
"read_only_banner": {
@@ -655,8 +667,7 @@
"allowed_tags",
"allowed_tag_groups",
"allow_global_tags",
"min_tags_from_required_group",
"required_tag_group_name",
"required_tag_groups",
"read_only_banner",
"uploaded_logo",
"uploaded_background",