From c1a7dc368ddf4d3e2cd721942958683fdcf85a43 Mon Sep 17 00:00:00 2001 From: Vitalii Yarmus <71256742+Vitalii4as@users.noreply.github.com> Date: Thu, 5 Sep 2024 18:25:44 +0300 Subject: [PATCH 01/10] HCK-7867: move default value into configs to add it only when the dependency is satisfied (#140) --- properties_pane/defaultData.json | 5 +---- properties_pane/entity_level/entityLevelConfig.json | 3 +++ 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/properties_pane/defaultData.json b/properties_pane/defaultData.json index 6ebadb96..f57e2cd4 100644 --- a/properties_pane/defaultData.json +++ b/properties_pane/defaultData.json @@ -10,10 +10,7 @@ }, "collection": { "collectionName": "New table", - "external": false, - "formatTypeOptions": { - "NULL_IF": [{ "NULL_IF_item": "\\N" }] - } + "external": false }, "field": { "name": "New column", diff --git a/properties_pane/entity_level/entityLevelConfig.json b/properties_pane/entity_level/entityLevelConfig.json index 09c33922..ec67a82d 100644 --- a/properties_pane/entity_level/entityLevelConfig.json +++ b/properties_pane/entity_level/entityLevelConfig.json @@ -648,6 +648,9 @@ making sure that you maintain a proper JSON format. } ] }, + "defaultValue": { + "NULL_IF": [{ "NULL_IF_item": "\\N" }] + }, "structure": [ { "propertyName": "Trim space", From 8b1cfd4e241edff60b546393d8905c6ed2033dd0 Mon Sep 17 00:00:00 2001 From: Ugo Bechameil Date: Thu, 5 Sep 2024 20:54:43 +0200 Subject: [PATCH 02/10] add github action for triggering tests automatically on Teamcity when the PR is approved on Plugins --- .github/workflows/fake-pr-tests.yml | 18 ------------------ .../workflows/trigger-pr-tests-plugins.yml | 19 +++++++++++++++++++ 2 files changed, 19 insertions(+), 18 deletions(-) delete mode 100644 .github/workflows/fake-pr-tests.yml create mode 100644 .github/workflows/trigger-pr-tests-plugins.yml diff --git a/.github/workflows/fake-pr-tests.yml b/.github/workflows/fake-pr-tests.yml deleted file mode 100644 index f2dd9fbb..00000000 --- a/.github/workflows/fake-pr-tests.yml +++ /dev/null @@ -1,18 +0,0 @@ -name: PR tests -on: - pull_request: - types: [auto_merge_enabled] - workflow_dispatch: - -jobs: - skip: - name: Report fake success for PR tests - runs-on: ubuntu-latest - permissions: - checks: write - steps: - - uses: LouisBrunner/checks-action@v2.0.0 - with: - name: Run PR tests (Plugins) (Plugins) - conclusion: success - token: ${{ secrets.GITHUB_TOKEN }} \ No newline at end of file diff --git a/.github/workflows/trigger-pr-tests-plugins.yml b/.github/workflows/trigger-pr-tests-plugins.yml new file mode 100644 index 00000000..b618ae11 --- /dev/null +++ b/.github/workflows/trigger-pr-tests-plugins.yml @@ -0,0 +1,19 @@ +name: Trigger PR tests (Plugins) + +on: + pull_request: + types: [auto_merge_enabled] + +jobs: + trigger-pr-tests-plugins: + name: Trigger PR tests (Plugins) + runs-on: ubuntu-latest + steps: + - name: Call TeamCity API endpoint + run: | + curl \ + -X POST \ + -H 'Authorization: Bearer ${{ secrets.TEAMCITY_TRIGGER_TESTS_TOKEN }}' \ + -H 'Content-Type: application/json' \ + -d '{"branchName": "pull/${{ github.event.number }}", "buildType": {"id": "${{ vars.TEAMCITY_BUILD_ID_FOR_TESTING_PLUGIN_PR }}"}}' \ + ${{ vars.TEAMCITY_API_URL }}/buildQueue \ No newline at end of file From 895e245d278145e5e9d2da85babc7e7df2b64b8e Mon Sep 17 00:00:00 2001 From: Serhii Filonenko <91055067+serhii-filonenko@users.noreply.github.com> Date: Fri, 6 Sep 2024 12:14:10 +0300 Subject: [PATCH 03/10] HCK-7861, HCK-7862, HCK-7866: fix generating tags clause if tag has empty name (#142) * HCK-7861: fix generating tag clause if tag has no name * HCK-7862: fix tag name quoting in unset clause --------- Co-authored-by: Vitalii Yarmus <71256742+Vitalii4as@users.noreply.github.com> --- forward_engineering/ddlProvider.js | 4 ++-- forward_engineering/helpers/tagHelper.js | 26 ++++++++++++++++-------- 2 files changed, 19 insertions(+), 11 deletions(-) diff --git a/forward_engineering/ddlProvider.js b/forward_engineering/ddlProvider.js index c796071d..b39d1061 100644 --- a/forward_engineering/ddlProvider.js +++ b/forward_engineering/ddlProvider.js @@ -71,7 +71,7 @@ module.exports = (baseProvider, options, app) => { tab, }); - const { getTagStatement, getTagAllowedValues, getTagKeyValues, prepareObjectTagsData } = + const { getTagStatement, getTagAllowedValues, getTagKeyValues, prepareObjectTagsData, isEmptyTags } = require('./helpers/tagHelper')({ getName, toString, @@ -233,7 +233,7 @@ module.exports = (baseProvider, options, app) => { this.createTag({ tag, schemaName: currentSchemaName, isCaseSensitive }), ); - if (!_.isEmpty(schemaTags)) { + if (!isEmptyTags({ tags: schemaTags })) { const schemaTagStatement = assignTemplates(templates.alterSchema, { name: fullName, operation: 'SET TAG', diff --git a/forward_engineering/helpers/tagHelper.js b/forward_engineering/helpers/tagHelper.js index 64e48b1d..fadf68ef 100644 --- a/forward_engineering/helpers/tagHelper.js +++ b/forward_engineering/helpers/tagHelper.js @@ -10,7 +10,7 @@ module.exports = ({ getName, toString }) => { * @returns {string} */ const getTagStatement = ({ tags, isCaseSensitive, indent = ' ' }) => { - if (isEmpty(tags)) { + if (isEmptyTags({ tags })) { return ''; } @@ -23,14 +23,13 @@ module.exports = ({ getName, toString }) => { * @param {{ allowedValues: string[] }} * @returns {string} */ - const getTagAllowedValues = ({ allowedValues }) => { - if (isEmpty(allowedValues)) { - return ''; - } - - const values = allowedValues.map(({ value }) => toString(value)).join(', '); + const getTagAllowedValues = ({ allowedValues = [] }) => { + const values = allowedValues + .filter(({ value }) => value) + .map(({ value }) => toString(value)) + .join(', '); - return ` ALLOWED_VALUES ${values}`; + return isEmpty(values) ? '' : ` ALLOWED_VALUES ${values}`; }; /** @@ -83,7 +82,7 @@ module.exports = ({ getName, toString }) => { return ''; } - const tagNames = droppedTags.map(({ tagName }) => tagName).join(', '); + const tagNames = droppedTags.map(({ tagName }) => getTagName({ tagName, isCaseSensitive })).join(', '); return `TAG ${tagNames}`; }; @@ -114,6 +113,14 @@ module.exports = ({ getName, toString }) => { }; }; + /** + * @param {{ tags: ObjectTag[] }} + * @returns {boolean} + */ + const isEmptyTags = ({ tags }) => { + return isEmpty(tags) || tags.every(tag => !tag.tagName); + }; + return { getTagStatement, getTagAllowedValues, @@ -121,5 +128,6 @@ module.exports = ({ getName, toString }) => { prepareObjectTagsData, getSetTagValue, getUnsetTagValue, + isEmptyTags, }; }; From 7b6add466aeb23da755c5f1bd570ab513420d2e1 Mon Sep 17 00:00:00 2001 From: Teamcity Date: Fri, 6 Sep 2024 16:37:34 +0000 Subject: [PATCH 04/10] Bump plugin version to 0.2.9 for next development track --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 01d48017..8a905cbc 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "Snowflake", - "version": "0.2.8", + "version": "0.2.9", "author": "hackolade", "engines": { "hackolade": "6.1.2", From 81bd10e6ed4258d0a3cedbdb1550616c85d2afb5 Mon Sep 17 00:00:00 2001 From: Serhii Filonenko <91055067+serhii-filonenko@users.noreply.github.com> Date: Mon, 9 Sep 2024 14:21:06 +0300 Subject: [PATCH 05/10] HCK-7370, HCK-7371: details tab of any object only declared tag at sc (#132) * HCK-7370: change level configs for level tags * HCK-7370: add adapter config * HCK-7370: fix creating a tag with empty value * HCK-7852: add disable input for tag value if tag name is not selected (#141) --------- Co-authored-by: chulanovskyi-bs <56116665+chulanovskyi-bs@users.noreply.github.com> --- adapter/0.2.7.json | 59 + forward_engineering/helpers/tagHelper.js | 2 +- .../container_level/containerLevelConfig.json | 90 +- .../entity_level/entityLevelConfig.json | 95 +- .../field_level/fieldLevelConfig.json | 1433 ++++++++++++++++- .../view_level/viewLevelConfig.json | 95 +- 6 files changed, 1751 insertions(+), 23 deletions(-) create mode 100644 adapter/0.2.7.json diff --git a/adapter/0.2.7.json b/adapter/0.2.7.json new file mode 100644 index 00000000..05860993 --- /dev/null +++ b/adapter/0.2.7.json @@ -0,0 +1,59 @@ +/** + * Copyright © 2016-2024 by IntegrIT S.A. dba Hackolade. All rights reserved. + * + * The copyright to the computer software herein is the property of IntegrIT S.A. + * The software may be used and/or copied only with the written permission of + * IntegrIT S.A. or in accordance with the terms and conditions stipulated in + * the agreement/contract under which the software has been supplied. + * + * { + * "add": { + * "entity": [], + * "container": [], + * "model": [], + * "view": [], + * "field": { + * "": [] + * } + * }, + * "delete": { + * "entity": [], + * "container": [], + * "model": [], + * "view": [], + * "field": { + * "": [] + * } + * }, + * "modify": { + * "entity": [ + * { + * "from": { }, + * "to": { } + * } + * ], + * "container": [], + * "model": [], + * "view": [], + * "field": [] + * }, + * } + */ + +{ + "modify": { + "model": [ + [ + "populateByPropertySource", + { + "modify": { + "container": [["getNameFromDottedIdentifier", "tagName", "schemaTags"]], + "entity": [["getNameFromDottedIdentifier", "tagName", "tableTags"]], + "view": [["getNameFromDottedIdentifier", "tagName", "viewTags"]], + "field": [["getNameFromDottedIdentifier", "tagName", "columnTags"]] + } + } + ] + ] + } +} diff --git a/forward_engineering/helpers/tagHelper.js b/forward_engineering/helpers/tagHelper.js index fadf68ef..c6a853a8 100644 --- a/forward_engineering/helpers/tagHelper.js +++ b/forward_engineering/helpers/tagHelper.js @@ -39,7 +39,7 @@ module.exports = ({ getName, toString }) => { const getTagKeyValues = ({ tags, isCaseSensitive }) => { return tags .filter(tag => tag.tagName) - .map(tag => `${getTagName({ tagName: tag.tagName, isCaseSensitive })} = ${toString(tag.tagValue)}`) + .map(tag => `${getTagName({ tagName: tag.tagName, isCaseSensitive })} = ${toString(tag.tagValue || '')}`) .join(', '); }; diff --git a/properties_pane/container_level/containerLevelConfig.json b/properties_pane/container_level/containerLevelConfig.json index 290c1533..9a22a6ae 100644 --- a/properties_pane/container_level/containerLevelConfig.json +++ b/properties_pane/container_level/containerLevelConfig.json @@ -167,17 +167,105 @@ making sure that you maintain a proper JSON format. "propertyName": "Tag name", "propertyKeyword": "tagName", "propertyTooltip": "", - "propertyType": "text" + "propertyType": "selecthashed", + "withEmptyOption": true, + "propertySource": { + "source": "tags.*.name" + } + }, + { + "propertyName": "Value", + "propertyKeyword": "tagValue", + "propertyTooltip": "", + "propertyType": "selecthashed", + "withEmptyOption": true, + "propertySource": { + "source": "tags.${tagName}.allowedValues.*.value" + }, + "dependency": { + "type": "and", + "values": [ + { + "type": "not", + "values": [ + { + "level": "container", + "source": "tags.${tagName}", + "key": "allowedValues", + "isEmpty": true + } + ] + }, + { + "level": "container", + "source": "tags.${tagName}", + "key": "allowedValues", + "exist": true + } + ] + } }, { "propertyName": "Value", "propertyKeyword": "tagValue", "propertyTooltip": "", "propertyType": "text", + "propertySource": { + "source": "tags.${tagName}.allowedValues.*.value" + }, + "dependency": { + "type": "and", + "values": [ + { + "key": "tagName", + "pattern": "^.+$" + }, + { + "type": "or", + "values": [ + { + "source": "tags.${tagName}", + "key": "allowedValues", + "isEmpty": true + }, + { + "type": "not", + "values": [ + { + "source": "tags.${tagName}", + "key": "allowedValues", + "exist": true + } + ] + } + ] + } + ] + }, "shouldValidate": true, "validation": { "regex": "^.{0,256}$" } + }, + { + "propertyName": "Value", + "propertyKeyword": "tagValue", + "propertyTooltip": "", + "propertyType": "select", + "disabled": true, + "dependency": { + "type": "or", + "values": [ + { + "key": "tagName", + "exist": false + }, + { + "key": "tagName", + "pattern": "^$" + } + ] + } } ] }, diff --git a/properties_pane/entity_level/entityLevelConfig.json b/properties_pane/entity_level/entityLevelConfig.json index ec67a82d..631220e8 100644 --- a/properties_pane/entity_level/entityLevelConfig.json +++ b/properties_pane/entity_level/entityLevelConfig.json @@ -1025,17 +1025,110 @@ making sure that you maintain a proper JSON format. "propertyName": "Tag name", "propertyKeyword": "tagName", "propertyTooltip": "", - "propertyType": "text" + "propertyType": "selecthashed", + "withEmptyOption": true, + "propertySource": { + "level": "container", + "source": "tags.*.name" + } + }, + { + "propertyName": "Value", + "propertyKeyword": "tagValue", + "propertyTooltip": "", + "propertyType": "selecthashed", + "withEmptyOption": true, + "propertySource": { + "level": "container", + "source": "tags.${tagName}.allowedValues.*.value" + }, + "dependency": { + "type": "and", + "values": [ + { + "type": "not", + "values": [ + { + "level": "container", + "source": "tags.${tagName}", + "key": "allowedValues", + "isEmpty": true + } + ] + }, + { + "level": "container", + "source": "tags.${tagName}", + "key": "allowedValues", + "exist": true + } + ] + } }, { "propertyName": "Value", "propertyKeyword": "tagValue", "propertyTooltip": "", "propertyType": "text", + "propertySource": { + "level": "container", + "source": "tags.${tagName}.allowedValues.*.value" + }, + "dependency": { + "type": "and", + "values": [ + { + "key": "tagName", + "pattern": "^.+$" + }, + { + "type": "or", + "values": [ + { + "level": "container", + "source": "tags.${tagName}", + "key": "allowedValues", + "isEmpty": true + }, + { + "type": "not", + "values": [ + { + "level": "container", + "source": "tags.${tagName}", + "key": "allowedValues", + "exist": true + } + ] + } + ] + } + ] + }, "shouldValidate": true, "validation": { "regex": "^.{0,256}$" } + }, + { + "propertyName": "Value", + "propertyKeyword": "tagValue", + "propertyTooltip": "", + "propertyType": "select", + "disabled": true, + "dependency": { + "type": "or", + "values": [ + { + "key": "tagName", + "exist": false + }, + { + "key": "tagName", + "pattern": "^$" + } + ] + } } ] }, diff --git a/properties_pane/field_level/fieldLevelConfig.json b/properties_pane/field_level/fieldLevelConfig.json index 0cd5df88..951767f0 100644 --- a/properties_pane/field_level/fieldLevelConfig.json +++ b/properties_pane/field_level/fieldLevelConfig.json @@ -510,17 +510,110 @@ making sure that you maintain a proper JSON format. "propertyName": "Tag name", "propertyKeyword": "tagName", "propertyTooltip": "", - "propertyType": "text" + "propertyType": "selecthashed", + "withEmptyOption": true, + "propertySource": { + "level": "container", + "source": "tags.*.name" + } + }, + { + "propertyName": "Value", + "propertyKeyword": "tagValue", + "propertyTooltip": "", + "propertyType": "selecthashed", + "withEmptyOption": true, + "propertySource": { + "level": "container", + "source": "tags.${tagName}.allowedValues.*.value" + }, + "dependency": { + "type": "and", + "values": [ + { + "type": "not", + "values": [ + { + "level": "container", + "source": "tags.${tagName}", + "key": "allowedValues", + "isEmpty": true + } + ] + }, + { + "level": "container", + "source": "tags.${tagName}", + "key": "allowedValues", + "exist": true + } + ] + } }, { "propertyName": "Value", "propertyKeyword": "tagValue", "propertyTooltip": "", "propertyType": "text", + "propertySource": { + "level": "container", + "source": "tags.${tagName}.allowedValues.*.value" + }, + "dependency": { + "type": "and", + "values": [ + { + "key": "tagName", + "pattern": "^.+$" + }, + { + "type": "or", + "values": [ + { + "level": "container", + "source": "tags.${tagName}", + "key": "allowedValues", + "isEmpty": true + }, + { + "type": "not", + "values": [ + { + "level": "container", + "source": "tags.${tagName}", + "key": "allowedValues", + "exist": true + } + ] + } + ] + } + ] + }, "shouldValidate": true, "validation": { "regex": "^.{0,256}$" } + }, + { + "propertyName": "Value", + "propertyKeyword": "tagValue", + "propertyTooltip": "", + "propertyType": "select", + "disabled": true, + "dependency": { + "type": "or", + "values": [ + { + "key": "tagName", + "exist": false + }, + { + "key": "tagName", + "pattern": "^$" + } + ] + } } ] }, @@ -940,17 +1033,110 @@ making sure that you maintain a proper JSON format. "propertyName": "Tag name", "propertyKeyword": "tagName", "propertyTooltip": "", - "propertyType": "text" + "propertyType": "selecthashed", + "withEmptyOption": true, + "propertySource": { + "level": "container", + "source": "tags.*.name" + } + }, + { + "propertyName": "Value", + "propertyKeyword": "tagValue", + "propertyTooltip": "", + "propertyType": "selecthashed", + "withEmptyOption": true, + "propertySource": { + "level": "container", + "source": "tags.${tagName}.allowedValues.*.value" + }, + "dependency": { + "type": "and", + "values": [ + { + "type": "not", + "values": [ + { + "level": "container", + "source": "tags.${tagName}", + "key": "allowedValues", + "isEmpty": true + } + ] + }, + { + "level": "container", + "source": "tags.${tagName}", + "key": "allowedValues", + "exist": true + } + ] + } }, { "propertyName": "Value", "propertyKeyword": "tagValue", "propertyTooltip": "", "propertyType": "text", + "propertySource": { + "level": "container", + "source": "tags.${tagName}.allowedValues.*.value" + }, + "dependency": { + "type": "and", + "values": [ + { + "key": "tagName", + "pattern": "^.+$" + }, + { + "type": "or", + "values": [ + { + "level": "container", + "source": "tags.${tagName}", + "key": "allowedValues", + "isEmpty": true + }, + { + "type": "not", + "values": [ + { + "level": "container", + "source": "tags.${tagName}", + "key": "allowedValues", + "exist": true + } + ] + } + ] + } + ] + }, "shouldValidate": true, "validation": { "regex": "^.{0,256}$" } + }, + { + "propertyName": "Value", + "propertyKeyword": "tagValue", + "propertyTooltip": "", + "propertyType": "select", + "disabled": true, + "dependency": { + "type": "or", + "values": [ + { + "key": "tagName", + "exist": false + }, + { + "key": "tagName", + "pattern": "^$" + } + ] + } } ] }, @@ -1352,17 +1538,110 @@ making sure that you maintain a proper JSON format. "propertyName": "Tag name", "propertyKeyword": "tagName", "propertyTooltip": "", - "propertyType": "text" + "propertyType": "selecthashed", + "withEmptyOption": true, + "propertySource": { + "level": "container", + "source": "tags.*.name" + } + }, + { + "propertyName": "Value", + "propertyKeyword": "tagValue", + "propertyTooltip": "", + "propertyType": "selecthashed", + "withEmptyOption": true, + "propertySource": { + "level": "container", + "source": "tags.${tagName}.allowedValues.*.value" + }, + "dependency": { + "type": "and", + "values": [ + { + "type": "not", + "values": [ + { + "level": "container", + "source": "tags.${tagName}", + "key": "allowedValues", + "isEmpty": true + } + ] + }, + { + "level": "container", + "source": "tags.${tagName}", + "key": "allowedValues", + "exist": true + } + ] + } }, { "propertyName": "Value", "propertyKeyword": "tagValue", "propertyTooltip": "", "propertyType": "text", + "propertySource": { + "level": "container", + "source": "tags.${tagName}.allowedValues.*.value" + }, + "dependency": { + "type": "and", + "values": [ + { + "key": "tagName", + "pattern": "^.+$" + }, + { + "type": "or", + "values": [ + { + "level": "container", + "source": "tags.${tagName}", + "key": "allowedValues", + "isEmpty": true + }, + { + "type": "not", + "values": [ + { + "level": "container", + "source": "tags.${tagName}", + "key": "allowedValues", + "exist": true + } + ] + } + ] + } + ] + }, "shouldValidate": true, "validation": { "regex": "^.{0,256}$" } + }, + { + "propertyName": "Value", + "propertyKeyword": "tagValue", + "propertyTooltip": "", + "propertyType": "select", + "disabled": true, + "dependency": { + "type": "or", + "values": [ + { + "key": "tagName", + "exist": false + }, + { + "key": "tagName", + "pattern": "^$" + } + ] + } } ] }, @@ -1764,17 +2043,110 @@ making sure that you maintain a proper JSON format. "propertyName": "Tag name", "propertyKeyword": "tagName", "propertyTooltip": "", - "propertyType": "text" + "propertyType": "selecthashed", + "withEmptyOption": true, + "propertySource": { + "level": "container", + "source": "tags.*.name" + } + }, + { + "propertyName": "Value", + "propertyKeyword": "tagValue", + "propertyTooltip": "", + "propertyType": "selecthashed", + "withEmptyOption": true, + "propertySource": { + "level": "container", + "source": "tags.${tagName}.allowedValues.*.value" + }, + "dependency": { + "type": "and", + "values": [ + { + "type": "not", + "values": [ + { + "level": "container", + "source": "tags.${tagName}", + "key": "allowedValues", + "isEmpty": true + } + ] + }, + { + "level": "container", + "source": "tags.${tagName}", + "key": "allowedValues", + "exist": true + } + ] + } }, { "propertyName": "Value", "propertyKeyword": "tagValue", "propertyTooltip": "", "propertyType": "text", + "propertySource": { + "level": "container", + "source": "tags.${tagName}.allowedValues.*.value" + }, + "dependency": { + "type": "and", + "values": [ + { + "key": "tagName", + "pattern": "^.+$" + }, + { + "type": "or", + "values": [ + { + "level": "container", + "source": "tags.${tagName}", + "key": "allowedValues", + "isEmpty": true + }, + { + "type": "not", + "values": [ + { + "level": "container", + "source": "tags.${tagName}", + "key": "allowedValues", + "exist": true + } + ] + } + ] + } + ] + }, "shouldValidate": true, "validation": { "regex": "^.{0,256}$" } + }, + { + "propertyName": "Value", + "propertyKeyword": "tagValue", + "propertyTooltip": "", + "propertyType": "select", + "disabled": true, + "dependency": { + "type": "or", + "values": [ + { + "key": "tagName", + "exist": false + }, + { + "key": "tagName", + "pattern": "^$" + } + ] + } } ] }, @@ -2176,17 +2548,110 @@ making sure that you maintain a proper JSON format. "propertyName": "Tag name", "propertyKeyword": "tagName", "propertyTooltip": "", - "propertyType": "text" + "propertyType": "selecthashed", + "withEmptyOption": true, + "propertySource": { + "level": "container", + "source": "tags.*.name" + } + }, + { + "propertyName": "Value", + "propertyKeyword": "tagValue", + "propertyTooltip": "", + "propertyType": "selecthashed", + "withEmptyOption": true, + "propertySource": { + "level": "container", + "source": "tags.${tagName}.allowedValues.*.value" + }, + "dependency": { + "type": "and", + "values": [ + { + "type": "not", + "values": [ + { + "level": "container", + "source": "tags.${tagName}", + "key": "allowedValues", + "isEmpty": true + } + ] + }, + { + "level": "container", + "source": "tags.${tagName}", + "key": "allowedValues", + "exist": true + } + ] + } }, { "propertyName": "Value", "propertyKeyword": "tagValue", "propertyTooltip": "", "propertyType": "text", + "propertySource": { + "level": "container", + "source": "tags.${tagName}.allowedValues.*.value" + }, + "dependency": { + "type": "and", + "values": [ + { + "key": "tagName", + "pattern": "^.+$" + }, + { + "type": "or", + "values": [ + { + "level": "container", + "source": "tags.${tagName}", + "key": "allowedValues", + "isEmpty": true + }, + { + "type": "not", + "values": [ + { + "level": "container", + "source": "tags.${tagName}", + "key": "allowedValues", + "exist": true + } + ] + } + ] + } + ] + }, "shouldValidate": true, "validation": { "regex": "^.{0,256}$" } + }, + { + "propertyName": "Value", + "propertyKeyword": "tagValue", + "propertyTooltip": "", + "propertyType": "select", + "disabled": true, + "dependency": { + "type": "or", + "values": [ + { + "key": "tagName", + "exist": false + }, + { + "key": "tagName", + "pattern": "^$" + } + ] + } } ] }, @@ -2493,16 +2958,109 @@ making sure that you maintain a proper JSON format. "propertyName": "Tag name", "propertyKeyword": "tagName", "propertyTooltip": "", - "propertyType": "text" + "propertyType": "selecthashed", + "withEmptyOption": true, + "propertySource": { + "level": "container", + "source": "tags.*.name" + } }, { "propertyName": "Value", "propertyKeyword": "tagValue", "propertyTooltip": "", - "propertyType": "text", - "shouldValidate": true, - "validation": { - "regex": "^.{0,256}$" + "propertyType": "selecthashed", + "withEmptyOption": true, + "propertySource": { + "level": "container", + "source": "tags.${tagName}.allowedValues.*.value" + }, + "dependency": { + "type": "and", + "values": [ + { + "type": "not", + "values": [ + { + "level": "container", + "source": "tags.${tagName}", + "key": "allowedValues", + "isEmpty": true + } + ] + }, + { + "level": "container", + "source": "tags.${tagName}", + "key": "allowedValues", + "exist": true + } + ] + } + }, + { + "propertyName": "Value", + "propertyKeyword": "tagValue", + "propertyTooltip": "", + "propertyType": "text", + "propertySource": { + "level": "container", + "source": "tags.${tagName}.allowedValues.*.value" + }, + "dependency": { + "type": "and", + "values": [ + { + "key": "tagName", + "pattern": "^.+$" + }, + { + "type": "or", + "values": [ + { + "level": "container", + "source": "tags.${tagName}", + "key": "allowedValues", + "isEmpty": true + }, + { + "type": "not", + "values": [ + { + "level": "container", + "source": "tags.${tagName}", + "key": "allowedValues", + "exist": true + } + ] + } + ] + } + ] + }, + "shouldValidate": true, + "validation": { + "regex": "^.{0,256}$" + } + }, + { + "propertyName": "Value", + "propertyKeyword": "tagValue", + "propertyTooltip": "", + "propertyType": "select", + "disabled": true, + "dependency": { + "type": "or", + "values": [ + { + "key": "tagName", + "exist": false + }, + { + "key": "tagName", + "pattern": "^$" + } + ] } } ] @@ -2823,17 +3381,110 @@ making sure that you maintain a proper JSON format. "propertyName": "Tag name", "propertyKeyword": "tagName", "propertyTooltip": "", - "propertyType": "text" + "propertyType": "selecthashed", + "withEmptyOption": true, + "propertySource": { + "level": "container", + "source": "tags.*.name" + } + }, + { + "propertyName": "Value", + "propertyKeyword": "tagValue", + "propertyTooltip": "", + "propertyType": "selecthashed", + "withEmptyOption": true, + "propertySource": { + "level": "container", + "source": "tags.${tagName}.allowedValues.*.value" + }, + "dependency": { + "type": "and", + "values": [ + { + "type": "not", + "values": [ + { + "level": "container", + "source": "tags.${tagName}", + "key": "allowedValues", + "isEmpty": true + } + ] + }, + { + "level": "container", + "source": "tags.${tagName}", + "key": "allowedValues", + "exist": true + } + ] + } }, { "propertyName": "Value", "propertyKeyword": "tagValue", "propertyTooltip": "", "propertyType": "text", + "propertySource": { + "level": "container", + "source": "tags.${tagName}.allowedValues.*.value" + }, + "dependency": { + "type": "and", + "values": [ + { + "key": "tagName", + "pattern": "^.+$" + }, + { + "type": "or", + "values": [ + { + "level": "container", + "source": "tags.${tagName}", + "key": "allowedValues", + "isEmpty": true + }, + { + "type": "not", + "values": [ + { + "level": "container", + "source": "tags.${tagName}", + "key": "allowedValues", + "exist": true + } + ] + } + ] + } + ] + }, "shouldValidate": true, "validation": { "regex": "^.{0,256}$" } + }, + { + "propertyName": "Value", + "propertyKeyword": "tagValue", + "propertyTooltip": "", + "propertyType": "select", + "disabled": true, + "dependency": { + "type": "or", + "values": [ + { + "key": "tagName", + "exist": false + }, + { + "key": "tagName", + "pattern": "^$" + } + ] + } } ] }, @@ -3145,17 +3796,110 @@ making sure that you maintain a proper JSON format. "propertyName": "Tag name", "propertyKeyword": "tagName", "propertyTooltip": "", - "propertyType": "text" + "propertyType": "selecthashed", + "withEmptyOption": true, + "propertySource": { + "level": "container", + "source": "tags.*.name" + } + }, + { + "propertyName": "Value", + "propertyKeyword": "tagValue", + "propertyTooltip": "", + "propertyType": "selecthashed", + "withEmptyOption": true, + "propertySource": { + "level": "container", + "source": "tags.${tagName}.allowedValues.*.value" + }, + "dependency": { + "type": "and", + "values": [ + { + "type": "not", + "values": [ + { + "level": "container", + "source": "tags.${tagName}", + "key": "allowedValues", + "isEmpty": true + } + ] + }, + { + "level": "container", + "source": "tags.${tagName}", + "key": "allowedValues", + "exist": true + } + ] + } }, { "propertyName": "Value", "propertyKeyword": "tagValue", "propertyTooltip": "", "propertyType": "text", + "propertySource": { + "level": "container", + "source": "tags.${tagName}.allowedValues.*.value" + }, + "dependency": { + "type": "and", + "values": [ + { + "key": "tagName", + "pattern": "^.+$" + }, + { + "type": "or", + "values": [ + { + "level": "container", + "source": "tags.${tagName}", + "key": "allowedValues", + "isEmpty": true + }, + { + "type": "not", + "values": [ + { + "level": "container", + "source": "tags.${tagName}", + "key": "allowedValues", + "exist": true + } + ] + } + ] + } + ] + }, "shouldValidate": true, "validation": { "regex": "^.{0,256}$" } + }, + { + "propertyName": "Value", + "propertyKeyword": "tagValue", + "propertyTooltip": "", + "propertyType": "select", + "disabled": true, + "dependency": { + "type": "or", + "values": [ + { + "key": "tagName", + "exist": false + }, + { + "key": "tagName", + "pattern": "^$" + } + ] + } } ] }, @@ -3476,17 +4220,110 @@ making sure that you maintain a proper JSON format. "propertyName": "Tag name", "propertyKeyword": "tagName", "propertyTooltip": "", - "propertyType": "text" + "propertyType": "selecthashed", + "withEmptyOption": true, + "propertySource": { + "level": "container", + "source": "tags.*.name" + } + }, + { + "propertyName": "Value", + "propertyKeyword": "tagValue", + "propertyTooltip": "", + "propertyType": "selecthashed", + "withEmptyOption": true, + "propertySource": { + "level": "container", + "source": "tags.${tagName}.allowedValues.*.value" + }, + "dependency": { + "type": "and", + "values": [ + { + "type": "not", + "values": [ + { + "level": "container", + "source": "tags.${tagName}", + "key": "allowedValues", + "isEmpty": true + } + ] + }, + { + "level": "container", + "source": "tags.${tagName}", + "key": "allowedValues", + "exist": true + } + ] + } }, { "propertyName": "Value", "propertyKeyword": "tagValue", "propertyTooltip": "", "propertyType": "text", + "propertySource": { + "level": "container", + "source": "tags.${tagName}.allowedValues.*.value" + }, + "dependency": { + "type": "and", + "values": [ + { + "key": "tagName", + "pattern": "^.+$" + }, + { + "type": "or", + "values": [ + { + "level": "container", + "source": "tags.${tagName}", + "key": "allowedValues", + "isEmpty": true + }, + { + "type": "not", + "values": [ + { + "level": "container", + "source": "tags.${tagName}", + "key": "allowedValues", + "exist": true + } + ] + } + ] + } + ] + }, "shouldValidate": true, "validation": { "regex": "^.{0,256}$" } + }, + { + "propertyName": "Value", + "propertyKeyword": "tagValue", + "propertyTooltip": "", + "propertyType": "select", + "disabled": true, + "dependency": { + "type": "or", + "values": [ + { + "key": "tagName", + "exist": false + }, + { + "key": "tagName", + "pattern": "^$" + } + ] + } } ] }, @@ -3815,17 +4652,110 @@ making sure that you maintain a proper JSON format. "propertyName": "Tag name", "propertyKeyword": "tagName", "propertyTooltip": "", - "propertyType": "text" + "propertyType": "selecthashed", + "withEmptyOption": true, + "propertySource": { + "level": "container", + "source": "tags.*.name" + } + }, + { + "propertyName": "Value", + "propertyKeyword": "tagValue", + "propertyTooltip": "", + "propertyType": "selecthashed", + "withEmptyOption": true, + "propertySource": { + "level": "container", + "source": "tags.${tagName}.allowedValues.*.value" + }, + "dependency": { + "type": "and", + "values": [ + { + "type": "not", + "values": [ + { + "level": "container", + "source": "tags.${tagName}", + "key": "allowedValues", + "isEmpty": true + } + ] + }, + { + "level": "container", + "source": "tags.${tagName}", + "key": "allowedValues", + "exist": true + } + ] + } }, { "propertyName": "Value", "propertyKeyword": "tagValue", "propertyTooltip": "", "propertyType": "text", + "propertySource": { + "level": "container", + "source": "tags.${tagName}.allowedValues.*.value" + }, + "dependency": { + "type": "and", + "values": [ + { + "key": "tagName", + "pattern": "^.+$" + }, + { + "type": "or", + "values": [ + { + "level": "container", + "source": "tags.${tagName}", + "key": "allowedValues", + "isEmpty": true + }, + { + "type": "not", + "values": [ + { + "level": "container", + "source": "tags.${tagName}", + "key": "allowedValues", + "exist": true + } + ] + } + ] + } + ] + }, "shouldValidate": true, "validation": { "regex": "^.{0,256}$" } + }, + { + "propertyName": "Value", + "propertyKeyword": "tagValue", + "propertyTooltip": "", + "propertyType": "select", + "disabled": true, + "dependency": { + "type": "or", + "values": [ + { + "key": "tagName", + "exist": false + }, + { + "key": "tagName", + "pattern": "^$" + } + ] + } } ] }, @@ -4154,17 +5084,110 @@ making sure that you maintain a proper JSON format. "propertyName": "Tag name", "propertyKeyword": "tagName", "propertyTooltip": "", - "propertyType": "text" + "propertyType": "selecthashed", + "withEmptyOption": true, + "propertySource": { + "level": "container", + "source": "tags.*.name" + } + }, + { + "propertyName": "Value", + "propertyKeyword": "tagValue", + "propertyTooltip": "", + "propertyType": "selecthashed", + "withEmptyOption": true, + "propertySource": { + "level": "container", + "source": "tags.${tagName}.allowedValues.*.value" + }, + "dependency": { + "type": "and", + "values": [ + { + "type": "not", + "values": [ + { + "level": "container", + "source": "tags.${tagName}", + "key": "allowedValues", + "isEmpty": true + } + ] + }, + { + "level": "container", + "source": "tags.${tagName}", + "key": "allowedValues", + "exist": true + } + ] + } }, { "propertyName": "Value", "propertyKeyword": "tagValue", "propertyTooltip": "", "propertyType": "text", + "propertySource": { + "level": "container", + "source": "tags.${tagName}.allowedValues.*.value" + }, + "dependency": { + "type": "and", + "values": [ + { + "key": "tagName", + "pattern": "^.+$" + }, + { + "type": "or", + "values": [ + { + "level": "container", + "source": "tags.${tagName}", + "key": "allowedValues", + "isEmpty": true + }, + { + "type": "not", + "values": [ + { + "level": "container", + "source": "tags.${tagName}", + "key": "allowedValues", + "exist": true + } + ] + } + ] + } + ] + }, "shouldValidate": true, "validation": { "regex": "^.{0,256}$" } + }, + { + "propertyName": "Value", + "propertyKeyword": "tagValue", + "propertyTooltip": "", + "propertyType": "select", + "disabled": true, + "dependency": { + "type": "or", + "values": [ + { + "key": "tagName", + "exist": false + }, + { + "key": "tagName", + "pattern": "^$" + } + ] + } } ] }, @@ -4493,17 +5516,110 @@ making sure that you maintain a proper JSON format. "propertyName": "Tag name", "propertyKeyword": "tagName", "propertyTooltip": "", - "propertyType": "text" + "propertyType": "selecthashed", + "withEmptyOption": true, + "propertySource": { + "level": "container", + "source": "tags.*.name" + } + }, + { + "propertyName": "Value", + "propertyKeyword": "tagValue", + "propertyTooltip": "", + "propertyType": "selecthashed", + "withEmptyOption": true, + "propertySource": { + "level": "container", + "source": "tags.${tagName}.allowedValues.*.value" + }, + "dependency": { + "type": "and", + "values": [ + { + "type": "not", + "values": [ + { + "level": "container", + "source": "tags.${tagName}", + "key": "allowedValues", + "isEmpty": true + } + ] + }, + { + "level": "container", + "source": "tags.${tagName}", + "key": "allowedValues", + "exist": true + } + ] + } }, { "propertyName": "Value", "propertyKeyword": "tagValue", "propertyTooltip": "", "propertyType": "text", + "propertySource": { + "level": "container", + "source": "tags.${tagName}.allowedValues.*.value" + }, + "dependency": { + "type": "and", + "values": [ + { + "key": "tagName", + "pattern": "^.+$" + }, + { + "type": "or", + "values": [ + { + "level": "container", + "source": "tags.${tagName}", + "key": "allowedValues", + "isEmpty": true + }, + { + "type": "not", + "values": [ + { + "level": "container", + "source": "tags.${tagName}", + "key": "allowedValues", + "exist": true + } + ] + } + ] + } + ] + }, "shouldValidate": true, "validation": { "regex": "^.{0,256}$" } + }, + { + "propertyName": "Value", + "propertyKeyword": "tagValue", + "propertyTooltip": "", + "propertyType": "select", + "disabled": true, + "dependency": { + "type": "or", + "values": [ + { + "key": "tagName", + "exist": false + }, + { + "key": "tagName", + "pattern": "^$" + } + ] + } } ] }, @@ -4914,17 +6030,110 @@ making sure that you maintain a proper JSON format. "propertyName": "Tag name", "propertyKeyword": "tagName", "propertyTooltip": "", - "propertyType": "text" + "propertyType": "selecthashed", + "withEmptyOption": true, + "propertySource": { + "level": "container", + "source": "tags.*.name" + } + }, + { + "propertyName": "Value", + "propertyKeyword": "tagValue", + "propertyTooltip": "", + "propertyType": "selecthashed", + "withEmptyOption": true, + "propertySource": { + "level": "container", + "source": "tags.${tagName}.allowedValues.*.value" + }, + "dependency": { + "type": "and", + "values": [ + { + "type": "not", + "values": [ + { + "level": "container", + "source": "tags.${tagName}", + "key": "allowedValues", + "isEmpty": true + } + ] + }, + { + "level": "container", + "source": "tags.${tagName}", + "key": "allowedValues", + "exist": true + } + ] + } }, { "propertyName": "Value", "propertyKeyword": "tagValue", "propertyTooltip": "", "propertyType": "text", + "propertySource": { + "level": "container", + "source": "tags.${tagName}.allowedValues.*.value" + }, + "dependency": { + "type": "and", + "values": [ + { + "key": "tagName", + "pattern": "^.+$" + }, + { + "type": "or", + "values": [ + { + "level": "container", + "source": "tags.${tagName}", + "key": "allowedValues", + "isEmpty": true + }, + { + "type": "not", + "values": [ + { + "level": "container", + "source": "tags.${tagName}", + "key": "allowedValues", + "exist": true + } + ] + } + ] + } + ] + }, "shouldValidate": true, "validation": { "regex": "^.{0,256}$" } + }, + { + "propertyName": "Value", + "propertyKeyword": "tagValue", + "propertyTooltip": "", + "propertyType": "select", + "disabled": true, + "dependency": { + "type": "or", + "values": [ + { + "key": "tagName", + "exist": false + }, + { + "key": "tagName", + "pattern": "^$" + } + ] + } } ] }, @@ -5247,17 +6456,110 @@ making sure that you maintain a proper JSON format. "propertyName": "Tag name", "propertyKeyword": "tagName", "propertyTooltip": "", - "propertyType": "text" + "propertyType": "selecthashed", + "withEmptyOption": true, + "propertySource": { + "level": "container", + "source": "tags.*.name" + } + }, + { + "propertyName": "Value", + "propertyKeyword": "tagValue", + "propertyTooltip": "", + "propertyType": "selecthashed", + "withEmptyOption": true, + "propertySource": { + "level": "container", + "source": "tags.${tagName}.allowedValues.*.value" + }, + "dependency": { + "type": "and", + "values": [ + { + "type": "not", + "values": [ + { + "level": "container", + "source": "tags.${tagName}", + "key": "allowedValues", + "isEmpty": true + } + ] + }, + { + "level": "container", + "source": "tags.${tagName}", + "key": "allowedValues", + "exist": true + } + ] + } }, { "propertyName": "Value", "propertyKeyword": "tagValue", "propertyTooltip": "", "propertyType": "text", + "propertySource": { + "level": "container", + "source": "tags.${tagName}.allowedValues.*.value" + }, + "dependency": { + "type": "and", + "values": [ + { + "key": "tagName", + "pattern": "^.+$" + }, + { + "type": "or", + "values": [ + { + "level": "container", + "source": "tags.${tagName}", + "key": "allowedValues", + "isEmpty": true + }, + { + "type": "not", + "values": [ + { + "level": "container", + "source": "tags.${tagName}", + "key": "allowedValues", + "exist": true + } + ] + } + ] + } + ] + }, "shouldValidate": true, "validation": { "regex": "^.{0,256}$" } + }, + { + "propertyName": "Value", + "propertyKeyword": "tagValue", + "propertyTooltip": "", + "propertyType": "select", + "disabled": true, + "dependency": { + "type": "or", + "values": [ + { + "key": "tagName", + "exist": false + }, + { + "key": "tagName", + "pattern": "^$" + } + ] + } } ] }, @@ -5336,17 +6638,110 @@ making sure that you maintain a proper JSON format. "propertyName": "Tag name", "propertyKeyword": "tagName", "propertyTooltip": "", - "propertyType": "text" + "propertyType": "selecthashed", + "withEmptyOption": true, + "propertySource": { + "level": "container", + "source": "tags.*.name" + } + }, + { + "propertyName": "Value", + "propertyKeyword": "tagValue", + "propertyTooltip": "", + "propertyType": "selecthashed", + "withEmptyOption": true, + "propertySource": { + "level": "container", + "source": "tags.${tagName}.allowedValues.*.value" + }, + "dependency": { + "type": "and", + "values": [ + { + "type": "not", + "values": [ + { + "level": "container", + "source": "tags.${tagName}", + "key": "allowedValues", + "isEmpty": true + } + ] + }, + { + "level": "container", + "source": "tags.${tagName}", + "key": "allowedValues", + "exist": true + } + ] + } }, { "propertyName": "Value", "propertyKeyword": "tagValue", "propertyTooltip": "", "propertyType": "text", + "propertySource": { + "level": "container", + "source": "tags.${tagName}.allowedValues.*.value" + }, + "dependency": { + "type": "and", + "values": [ + { + "key": "tagName", + "pattern": "^.+$" + }, + { + "type": "or", + "values": [ + { + "level": "container", + "source": "tags.${tagName}", + "key": "allowedValues", + "isEmpty": true + }, + { + "type": "not", + "values": [ + { + "level": "container", + "source": "tags.${tagName}", + "key": "allowedValues", + "exist": true + } + ] + } + ] + } + ] + }, "shouldValidate": true, "validation": { "regex": "^.{0,256}$" } + }, + { + "propertyName": "Value", + "propertyKeyword": "tagValue", + "propertyTooltip": "", + "propertyType": "select", + "disabled": true, + "dependency": { + "type": "or", + "values": [ + { + "key": "tagName", + "exist": false + }, + { + "key": "tagName", + "pattern": "^$" + } + ] + } } ] } diff --git a/properties_pane/view_level/viewLevelConfig.json b/properties_pane/view_level/viewLevelConfig.json index dfdab135..8a1dc763 100644 --- a/properties_pane/view_level/viewLevelConfig.json +++ b/properties_pane/view_level/viewLevelConfig.json @@ -96,17 +96,110 @@ "propertyName": "Tag name", "propertyKeyword": "tagName", "propertyTooltip": "", - "propertyType": "text" + "propertyType": "selecthashed", + "withEmptyOption": true, + "propertySource": { + "level": "container", + "source": "tags.*.name" + } + }, + { + "propertyName": "Value", + "propertyKeyword": "tagValue", + "propertyTooltip": "", + "propertyType": "selecthashed", + "withEmptyOption": true, + "propertySource": { + "level": "container", + "source": "tags.${tagName}.allowedValues.*.value" + }, + "dependency": { + "type": "and", + "values": [ + { + "type": "not", + "values": [ + { + "level": "container", + "source": "tags.${tagName}", + "key": "allowedValues", + "isEmpty": true + } + ] + }, + { + "level": "container", + "source": "tags.${tagName}", + "key": "allowedValues", + "exist": true + } + ] + } }, { "propertyName": "Value", "propertyKeyword": "tagValue", "propertyTooltip": "", "propertyType": "text", + "propertySource": { + "level": "container", + "source": "tags.${tagName}.allowedValues.*.value" + }, + "dependency": { + "type": "and", + "values": [ + { + "key": "tagName", + "pattern": "^.+$" + }, + { + "type": "or", + "values": [ + { + "level": "container", + "source": "tags.${tagName}", + "key": "allowedValues", + "isEmpty": true + }, + { + "type": "not", + "values": [ + { + "level": "container", + "source": "tags.${tagName}", + "key": "allowedValues", + "exist": true + } + ] + } + ] + } + ] + }, "shouldValidate": true, "validation": { "regex": "^.{0,256}$" } + }, + { + "propertyName": "Value", + "propertyKeyword": "tagValue", + "propertyTooltip": "", + "propertyType": "select", + "disabled": true, + "dependency": { + "type": "or", + "values": [ + { + "key": "tagName", + "exist": false + }, + { + "key": "tagName", + "pattern": "^$" + } + ] + } } ] } From df5da74f987007afa9907eba0d22547f561c4096 Mon Sep 17 00:00:00 2001 From: Vitalii Yarmus <71256742+Vitalii4as@users.noreply.github.com> Date: Wed, 11 Sep 2024 12:37:14 +0300 Subject: [PATCH 06/10] HCK-7951: do not generate tag script when tag value is not provided (#143) * HCK-7951: do not generate tag script when tag value is not provided * Remove empty value --- forward_engineering/helpers/tagHelper.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/forward_engineering/helpers/tagHelper.js b/forward_engineering/helpers/tagHelper.js index c6a853a8..be970fcd 100644 --- a/forward_engineering/helpers/tagHelper.js +++ b/forward_engineering/helpers/tagHelper.js @@ -16,6 +16,10 @@ module.exports = ({ getName, toString }) => { const keyValues = getTagKeyValues({ tags, isCaseSensitive }); + if (isEmpty(keyValues)) { + return ''; + } + return `${indent}WITH TAG ( ${keyValues} )`; }; @@ -38,8 +42,8 @@ module.exports = ({ getName, toString }) => { */ const getTagKeyValues = ({ tags, isCaseSensitive }) => { return tags - .filter(tag => tag.tagName) - .map(tag => `${getTagName({ tagName: tag.tagName, isCaseSensitive })} = ${toString(tag.tagValue || '')}`) + .filter(tag => tag.tagName && tag.tagValue) + .map(tag => `${getTagName({ tagName: tag.tagName, isCaseSensitive })} = ${toString(tag.tagValue)}`) .join(', '); }; From 4192848e304520b703313eb41c9834583a02fe0e Mon Sep 17 00:00:00 2001 From: Vitalii Yarmus <71256742+Vitalii4as@users.noreply.github.com> Date: Thu, 12 Sep 2024 17:38:28 +0300 Subject: [PATCH 07/10] HCK-7960: fix RE of schemaTags (#145) --- reverse_engineering/helpers/snowflakeHelper.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/reverse_engineering/helpers/snowflakeHelper.js b/reverse_engineering/helpers/snowflakeHelper.js index e7ae908a..aa12edea 100644 --- a/reverse_engineering/helpers/snowflakeHelper.js +++ b/reverse_engineering/helpers/snowflakeHelper.js @@ -1381,7 +1381,7 @@ const getSchemaTags = async ({ dbName, schemaName, logger }) => { ); return rows.map(row => ({ - tagName: [row['TAG_DATABASE'], row['TAG_SCHEMA'], row['TAG_NAME']].join('.'), + tagName: row['TAG_NAME'], tagValue: row['TAG_VALUE'], })); } catch (error) { From 8838ede0979bc2e5751dcbb8943fef5d5017b8c3 Mon Sep 17 00:00:00 2001 From: Vitalii Yarmus <71256742+Vitalii4as@users.noreply.github.com> Date: Thu, 12 Sep 2024 17:52:27 +0300 Subject: [PATCH 08/10] HCK-7389: add helpUrl for tags (#144) --- properties_pane/container_level/containerLevelConfig.json | 2 ++ properties_pane/entity_level/entityLevelConfig.json | 1 + properties_pane/field_level/fieldLevelConfig.json | 1 + properties_pane/view_level/viewLevelConfig.json | 1 + 4 files changed, 5 insertions(+) diff --git a/properties_pane/container_level/containerLevelConfig.json b/properties_pane/container_level/containerLevelConfig.json index 9a22a6ae..c0490546 100644 --- a/properties_pane/container_level/containerLevelConfig.json +++ b/properties_pane/container_level/containerLevelConfig.json @@ -162,6 +162,7 @@ making sure that you maintain a proper JSON format. "propertyTooltip": "", "propertyType": "group", "groupItemLimit": 50, + "helpUrl": "https://hackolade.com/help/Snowflake.html#Tags", "structure": [ { "propertyName": "Tag name", @@ -1039,6 +1040,7 @@ making sure that you maintain a proper JSON format. "propertyType": "group", "propertyKeyword": "tags", "propertyTooltip": "Creates a new stored tag or replaces an existing tag for the current database.", + "helpUrl": "https://hackolade.com/help/Snowflake.html#Tags", "structure": [ { "propertyName": "Name", diff --git a/properties_pane/entity_level/entityLevelConfig.json b/properties_pane/entity_level/entityLevelConfig.json index 631220e8..b4f1b670 100644 --- a/properties_pane/entity_level/entityLevelConfig.json +++ b/properties_pane/entity_level/entityLevelConfig.json @@ -1020,6 +1020,7 @@ making sure that you maintain a proper JSON format. "propertyTooltip": "", "propertyType": "group", "groupItemLimit": 50, + "helpUrl": "https://hackolade.com/help/Snowflake.html#Tags", "structure": [ { "propertyName": "Tag name", diff --git a/properties_pane/field_level/fieldLevelConfig.json b/properties_pane/field_level/fieldLevelConfig.json index 951767f0..8986ef66 100644 --- a/properties_pane/field_level/fieldLevelConfig.json +++ b/properties_pane/field_level/fieldLevelConfig.json @@ -505,6 +505,7 @@ making sure that you maintain a proper JSON format. "propertyTooltip": "", "propertyType": "group", "groupItemLimit": 50, + "helpUrl": "https://hackolade.com/help/Snowflake.html#Tags", "structure": [ { "propertyName": "Tag name", diff --git a/properties_pane/view_level/viewLevelConfig.json b/properties_pane/view_level/viewLevelConfig.json index 8a1dc763..55c4ca0a 100644 --- a/properties_pane/view_level/viewLevelConfig.json +++ b/properties_pane/view_level/viewLevelConfig.json @@ -91,6 +91,7 @@ "propertyTooltip": "", "propertyType": "group", "groupItemLimit": 50, + "helpUrl": "https://hackolade.com/help/Snowflake.html#Tags", "structure": [ { "propertyName": "Tag name", From b70402cd733894221d39cb69b6e88b16b3c17d3f Mon Sep 17 00:00:00 2001 From: Vitalii Yarmus <71256742+Vitalii4as@users.noreply.github.com> Date: Fri, 13 Sep 2024 16:52:45 +0300 Subject: [PATCH 09/10] HCK-7980: add validation of tag values (#146) Co-authored-by: chulanovskyi-bs <56116665+chulanovskyi-bs@users.noreply.github.com> --- .../container_level/containerLevelConfig.json | 5 ++ .../entity_level/entityLevelConfig.json | 5 ++ .../field_level/fieldLevelConfig.json | 75 +++++++++++++++++++ .../view_level/viewLevelConfig.json | 5 ++ 4 files changed, 90 insertions(+) diff --git a/properties_pane/container_level/containerLevelConfig.json b/properties_pane/container_level/containerLevelConfig.json index c0490546..0716a89e 100644 --- a/properties_pane/container_level/containerLevelConfig.json +++ b/properties_pane/container_level/containerLevelConfig.json @@ -183,6 +183,10 @@ making sure that you maintain a proper JSON format. "propertySource": { "source": "tags.${tagName}.allowedValues.*.value" }, + "shouldValidate": true, + "validation": { + "required": true + }, "dependency": { "type": "and", "values": [ @@ -245,6 +249,7 @@ making sure that you maintain a proper JSON format. }, "shouldValidate": true, "validation": { + "required": true, "regex": "^.{0,256}$" } }, diff --git a/properties_pane/entity_level/entityLevelConfig.json b/properties_pane/entity_level/entityLevelConfig.json index b4f1b670..bcb2a6e8 100644 --- a/properties_pane/entity_level/entityLevelConfig.json +++ b/properties_pane/entity_level/entityLevelConfig.json @@ -1064,6 +1064,10 @@ making sure that you maintain a proper JSON format. "exist": true } ] + }, + "shouldValidate": true, + "validation": { + "required": true } }, { @@ -1108,6 +1112,7 @@ making sure that you maintain a proper JSON format. }, "shouldValidate": true, "validation": { + "required": true, "regex": "^.{0,256}$" } }, diff --git a/properties_pane/field_level/fieldLevelConfig.json b/properties_pane/field_level/fieldLevelConfig.json index 8986ef66..672e6633 100644 --- a/properties_pane/field_level/fieldLevelConfig.json +++ b/properties_pane/field_level/fieldLevelConfig.json @@ -549,6 +549,10 @@ making sure that you maintain a proper JSON format. "exist": true } ] + }, + "shouldValidate": true, + "validation": { + "required": true } }, { @@ -593,6 +597,7 @@ making sure that you maintain a proper JSON format. }, "shouldValidate": true, "validation": { + "required": true, "regex": "^.{0,256}$" } }, @@ -1072,6 +1077,10 @@ making sure that you maintain a proper JSON format. "exist": true } ] + }, + "shouldValidate": true, + "validation": { + "required": true } }, { @@ -1116,6 +1125,7 @@ making sure that you maintain a proper JSON format. }, "shouldValidate": true, "validation": { + "required": true, "regex": "^.{0,256}$" } }, @@ -1577,6 +1587,10 @@ making sure that you maintain a proper JSON format. "exist": true } ] + }, + "shouldValidate": true, + "validation": { + "required": true } }, { @@ -1621,6 +1635,7 @@ making sure that you maintain a proper JSON format. }, "shouldValidate": true, "validation": { + "required": true, "regex": "^.{0,256}$" } }, @@ -2082,6 +2097,10 @@ making sure that you maintain a proper JSON format. "exist": true } ] + }, + "shouldValidate": true, + "validation": { + "required": true } }, { @@ -2126,6 +2145,7 @@ making sure that you maintain a proper JSON format. }, "shouldValidate": true, "validation": { + "required": true, "regex": "^.{0,256}$" } }, @@ -2587,6 +2607,10 @@ making sure that you maintain a proper JSON format. "exist": true } ] + }, + "shouldValidate": true, + "validation": { + "required": true } }, { @@ -2631,6 +2655,7 @@ making sure that you maintain a proper JSON format. }, "shouldValidate": true, "validation": { + "required": true, "regex": "^.{0,256}$" } }, @@ -2997,6 +3022,10 @@ making sure that you maintain a proper JSON format. "exist": true } ] + }, + "shouldValidate": true, + "validation": { + "required": true } }, { @@ -3041,6 +3070,7 @@ making sure that you maintain a proper JSON format. }, "shouldValidate": true, "validation": { + "required": true, "regex": "^.{0,256}$" } }, @@ -3420,6 +3450,10 @@ making sure that you maintain a proper JSON format. "exist": true } ] + }, + "shouldValidate": true, + "validation": { + "required": true } }, { @@ -3464,6 +3498,7 @@ making sure that you maintain a proper JSON format. }, "shouldValidate": true, "validation": { + "required": true, "regex": "^.{0,256}$" } }, @@ -3835,6 +3870,10 @@ making sure that you maintain a proper JSON format. "exist": true } ] + }, + "shouldValidate": true, + "validation": { + "required": true } }, { @@ -3879,6 +3918,7 @@ making sure that you maintain a proper JSON format. }, "shouldValidate": true, "validation": { + "required": true, "regex": "^.{0,256}$" } }, @@ -4259,6 +4299,10 @@ making sure that you maintain a proper JSON format. "exist": true } ] + }, + "shouldValidate": true, + "validation": { + "required": true } }, { @@ -4303,6 +4347,7 @@ making sure that you maintain a proper JSON format. }, "shouldValidate": true, "validation": { + "required": true, "regex": "^.{0,256}$" } }, @@ -4691,6 +4736,10 @@ making sure that you maintain a proper JSON format. "exist": true } ] + }, + "shouldValidate": true, + "validation": { + "required": true } }, { @@ -4735,6 +4784,7 @@ making sure that you maintain a proper JSON format. }, "shouldValidate": true, "validation": { + "required": true, "regex": "^.{0,256}$" } }, @@ -5123,6 +5173,10 @@ making sure that you maintain a proper JSON format. "exist": true } ] + }, + "shouldValidate": true, + "validation": { + "required": true } }, { @@ -5167,6 +5221,7 @@ making sure that you maintain a proper JSON format. }, "shouldValidate": true, "validation": { + "required": true, "regex": "^.{0,256}$" } }, @@ -5555,6 +5610,10 @@ making sure that you maintain a proper JSON format. "exist": true } ] + }, + "shouldValidate": true, + "validation": { + "required": true } }, { @@ -5599,6 +5658,7 @@ making sure that you maintain a proper JSON format. }, "shouldValidate": true, "validation": { + "required": true, "regex": "^.{0,256}$" } }, @@ -6069,6 +6129,10 @@ making sure that you maintain a proper JSON format. "exist": true } ] + }, + "shouldValidate": true, + "validation": { + "required": true } }, { @@ -6113,6 +6177,7 @@ making sure that you maintain a proper JSON format. }, "shouldValidate": true, "validation": { + "required": true, "regex": "^.{0,256}$" } }, @@ -6495,6 +6560,10 @@ making sure that you maintain a proper JSON format. "exist": true } ] + }, + "shouldValidate": true, + "validation": { + "required": true } }, { @@ -6539,6 +6608,7 @@ making sure that you maintain a proper JSON format. }, "shouldValidate": true, "validation": { + "required": true, "regex": "^.{0,256}$" } }, @@ -6677,6 +6747,10 @@ making sure that you maintain a proper JSON format. "exist": true } ] + }, + "shouldValidate": true, + "validation": { + "required": true } }, { @@ -6721,6 +6795,7 @@ making sure that you maintain a proper JSON format. }, "shouldValidate": true, "validation": { + "required": true, "regex": "^.{0,256}$" } }, diff --git a/properties_pane/view_level/viewLevelConfig.json b/properties_pane/view_level/viewLevelConfig.json index 55c4ca0a..a457d40f 100644 --- a/properties_pane/view_level/viewLevelConfig.json +++ b/properties_pane/view_level/viewLevelConfig.json @@ -135,6 +135,10 @@ "exist": true } ] + }, + "shouldValidate": true, + "validation": { + "required": true } }, { @@ -179,6 +183,7 @@ }, "shouldValidate": true, "validation": { + "required": true, "regex": "^.{0,256}$" } }, From ce159003655ae3723b20cbe21b0b39fbae1e5181 Mon Sep 17 00:00:00 2001 From: Teamcity Date: Sat, 14 Sep 2024 10:11:48 +0000 Subject: [PATCH 10/10] Bump plugin version to 0.2.10 for next development track --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 8a905cbc..a0a67167 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "Snowflake", - "version": "0.2.9", + "version": "0.2.10", "author": "hackolade", "engines": { "hackolade": "6.1.2",