1
0
mirror of https://github.com/laurent22/joplin.git synced 2025-11-26 22:41:17 +02:00

Fixed schema

This commit is contained in:
Laurent Cozic
2021-02-09 18:15:27 +00:00
parent 69acced2fb
commit b7f37fdf89
2 changed files with 119 additions and 55 deletions

View File

@@ -55,7 +55,12 @@ class Command extends BaseCommand {
const props: Record<string, any> = {};
props.type = type;
props.default = md.value;
if (md.description && md.description('desktop')) props.description = md.description('desktop');
const description: string[] = [];
if (md.label && md.label()) description.push(md.label());
if (md.description && md.description('desktop')) description.push(md.description('desktop'));
if (description.length) props.description = description.join('. ');
if (md.isEnum) props.enum = Object.keys(md.options()).map((v: any) => Setting.formatValue(key, v));
if ('minimum' in md) props.minimum = md.minimum;
if ('maximum' in md) props.maximum = md.maximum;