From d35ba2eedb497dc5d98eaaf677ba435d59fdf0f9 Mon Sep 17 00:00:00 2001 From: Eugenio Romano Date: Mon, 22 Mar 2021 14:02:05 +0000 Subject: [PATCH] Validate config improvements (#6837) * validate config * fix * fix --- lib/core/app-config/schema.json | 25 +++++++++++-------------- package.json | 10 +++++----- scripts/lint.sh | 3 ++- 3 files changed, 18 insertions(+), 20 deletions(-) diff --git a/lib/core/app-config/schema.json b/lib/core/app-config/schema.json index a537d4bd7c..9fa3e22d30 100644 --- a/lib/core/app-config/schema.json +++ b/lib/core/app-config/schema.json @@ -1,6 +1,6 @@ { "$schema": "http://json-schema.org/schema", - "id": "https://github.com/Alfresco/alfresco-ng2-components/tree/master/lib/core/app-config/schema.json", + "$id": "https://github.com/Alfresco/alfresco-ng2-components/tree/master/lib/core/app-config/schema.json", "title": "ADF Application config", "description": "Configuration object for ADF components used by your application", "definitions": { @@ -348,6 +348,7 @@ }, "exclude": { "type": "array", + "minItems": 0, "items": { "description": "Property name", "type": "string" @@ -355,6 +356,7 @@ }, "readOnlyAspects": { "type": "array", + "minItems": 0, "items": { "description": "Disable editing in these aspects", "type": "string" @@ -362,6 +364,7 @@ }, "readOnlyProperties": { "type": "array", + "minItems": 0, "items": { "description": "Disable editing in these properties", "type": "string" @@ -1010,6 +1013,7 @@ ], "properties": { "presets": { + "type": "object", "description": "Presets for content metadata component", "patternProperties": { ".*": { @@ -1378,6 +1382,7 @@ } }, "highlight": { + "type": "object", "description": " Request that highlight fragments to be added to result set rows The properties reflect SOLR highlighting parameters.", "properties": { "prefix": { @@ -1440,6 +1445,7 @@ } }, "sorting": { + "type" : "object", "description": "Sorting options and defaults", "required": [ "options" @@ -1479,18 +1485,10 @@ }, "defaults": { "description": "Predefined sorting to execute by default", - "options": { - "type": "array", - "minItems": 1, - "items": { - "type": "object", - "required": [ - "key", - "label", - "type", - "field", - "ascending" - ], + "type": "array", + "minItems": 1, + "items": { + "type": "object", "properties": { "key": { "type": "string" @@ -1508,7 +1506,6 @@ "type": "boolean" } } - } } } } diff --git a/package.json b/package.json index 848d64f386..e4768d6aa1 100644 --- a/package.json +++ b/package.json @@ -35,12 +35,12 @@ "stylelint": "stylelint ./**/*.scss --config stylelint-config.json", "04": "echo -------------------------------------------- Demo Shell -----------------------------------------------", "04s": "", - "start": "npm run validate-config && concurrently \"ng serve demoshell --open\" \"npm run style:dev -- --watch >&-\" ", - "start:prod": "npm run validate-config && ng serve demoshell --prod --open", - "build": "npm run validate-config && npm run style:dev && ng build demoshell", - "build:prod": "npm run validate-config && node --max-old-space-size=12000 node_modules/@angular/cli/bin/ng build demoshell --prod", + "start": "concurrently \"ng serve demoshell --open\" \"npm run style:dev -- --watch >&-\" ", + "start:prod": "ng serve demoshell --prod --open", + "build": "npm run style:dev && ng build demoshell", + "build:prod": "node --max-old-space-size=12000 node_modules/@angular/cli/bin/ng build demoshell --prod", "style:dev": "npm run webpack -- --config ./lib/config/webpack.style.js --progress --profile --bail", - "test": "npm run validate-config && ng test demoshell --watch=false", + "test": "ng test demoshell --watch=false", "05": "echo -------------------------------------------- E2e -----------------------------------------------", "05s": "", "e2e": "./scripts/test-e2e-lib.sh -host 'localhost:4200' -dev --folder demo-shell", diff --git a/scripts/lint.sh b/scripts/lint.sh index 770752391e..84079734fa 100755 --- a/scripts/lint.sh +++ b/scripts/lint.sh @@ -12,4 +12,5 @@ nx affected:lint --parallel --all --maxParallel=9 && \ npm run lint-e2e && \ npm run stylelint && \ npm run spellcheck && \ -npm run license-checker +npm run license-checker && \ +npm run validate-config