From 1aa8f77590e1d417bd33c8b3797def0c594cf506 Mon Sep 17 00:00:00 2001 From: Elio Struyf Date: Wed, 20 Jul 2022 15:00:17 +0300 Subject: [PATCH] #370 - updated JSON schema --- CHANGELOG.md | 1 + package.json | 32 +++++++++++++++++++++++++++++--- src/helpers/TaxonomyHelper.ts | 2 +- 3 files changed, 31 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index a5c048bf..d70f839b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,7 @@ ### 🎨 Enhancements +- [#370](https://github.com/estruyf/vscode-front-matter/issues/370): Define the tags and categories as reserved keywords for custom taxonomy - [#372](https://github.com/estruyf/vscode-front-matter/issues/372): Rename Taxonomy tab to Taxonomies ### ⚡️ Optimizations diff --git a/package.json b/package.json index 923e1516..520d14b6 100644 --- a/package.json +++ b/package.json @@ -893,7 +893,20 @@ "taxonomyId": { "type": "string", "default": "", - "description": "The ID of your taxonomy field" + "description": "The ID of your taxonomy field. It cannot contain the \"tags\" or \"categories\" value.", + "not": { + "anyOf": [ + { + "const": "" + }, + { + "const": "tags" + }, + { + "const": "categories" + } + ] + } }, "fileExtensions": { "type": "array", @@ -1151,11 +1164,24 @@ "properties": { "id": { "type": "string", - "description": "ID for your taxonomy field" + "description": "ID for your taxonomy field. It cannot contain the \"tags\" or \"categories\" value.", + "not": { + "anyOf": [ + { + "const": "" + }, + { + "const": "tags" + }, + { + "const": "categories" + } + ] + } }, "options": { "type": "array", - "description": "Options from which you can pick", + "description": "Options from which you can pick.", "items": { "type": "string" } diff --git a/src/helpers/TaxonomyHelper.ts b/src/helpers/TaxonomyHelper.ts index 4f55db81..b69c0715 100644 --- a/src/helpers/TaxonomyHelper.ts +++ b/src/helpers/TaxonomyHelper.ts @@ -116,7 +116,7 @@ export class TaxonomyHelper { const options = this.getTaxonomyOptions(taxonomyType); const newOption = await window.showInputBox({ - title: `Create a new ${taxonomyType} value`, + title: `Create a new ${type} value`, placeHolder: `The value you want to add`, ignoreFocusOut: true, validateInput: (text) => {