diff --git a/forward_engineering/helpers/alterScriptHelpers/commonScript.js b/forward_engineering/helpers/alterScriptHelpers/commonScript.js index 21bf82c3..767d011d 100644 --- a/forward_engineering/helpers/alterScriptHelpers/commonScript.js +++ b/forward_engineering/helpers/alterScriptHelpers/commonScript.js @@ -55,9 +55,9 @@ module.exports = ({ getName, getFullName, templates, assignTemplates, tab }) => return escapeString(scriptFormat, propValue); } else if (key === 'targetLag') { - const { targetLagAmount, targetLagType, targetLagDownstream } = data[operation].targetLag ?? {}; + const { targetLagAmount, targetLagTimeSpan, targetLagDownstream } = data[operation].targetLag ?? {}; - return targetLagDownstream ? 'DOWNSTREAM' : `'${targetLagAmount} ${targetLagType}'`; + return targetLagDownstream ? 'DOWNSTREAM' : `'${targetLagAmount} ${targetLagTimeSpan}'`; } return propValue; diff --git a/forward_engineering/helpers/tableHelper.js b/forward_engineering/helpers/tableHelper.js index b1fc08bb..7e0b4cff 100644 --- a/forward_engineering/helpers/tableHelper.js +++ b/forward_engineering/helpers/tableHelper.js @@ -47,8 +47,12 @@ module.exports = app => { const mergeKeys = keys => keys.map(key => `"${key.name}"`).join(', '); - function getTargetLag({ targetLagType, targetLagAmount, targetLagDownstream }) { - return `TARGET_LAG = ${targetLagDownstream ? 'DOWNSTREAM' : `'${targetLagAmount} ${targetLagType}'`}\n`; + function getTargetLag({ targetLagTimeSpan, targetLagAmount, targetLagDownstream }) { + if (!(targetLagTimeSpan && targetLagAmount) && !targetLagDownstream) { + return ''; + } + + return `TARGET_LAG = ${targetLagDownstream ? 'DOWNSTREAM' : `'${targetLagAmount} ${targetLagTimeSpan}'`}\n`; } function getSelectStatement(selectStatement) { @@ -85,12 +89,12 @@ module.exports = app => { } = tableData.dynamicTableProps; return { - targetLag: targetLag ? getTargetLag(targetLag) : '', + targetLag: getTargetLag(targetLag), warehouse: warehouse ? `WAREHOUSE = ${warehouse}\n` : '', selectStatement: selectStatement ? getSelectStatement(selectStatement) : '', - externalVolume: externalVolume ? `EXTERNAL_VOLUME = ${externalVolume}\n` : '', - catalog: catalog ? `CATALOG = ${catalog}\n` : '', - baseLocation: baseLocation ? `BASE_LOCATION = ${baseLocation}\n` : '', + externalVolume: externalVolume ? `EXTERNAL_VOLUME = '${externalVolume}'\n` : '', + catalog: catalog ? `CATALOG = '${catalog}'\n` : '', + baseLocation: baseLocation ? `BASE_LOCATION = '${baseLocation}'\n` : '', column_definitions: columnDefinitions ? `\t(\n\t\t${columnDefinitions}\n\t)\n` : '', refreshMode: refreshMode ? `REFRESH_MODE = ${refreshMode}\n` : '', initialize: initialize ? `INITIALIZE = ${initialize}\n` : '', diff --git a/properties_pane/entity_level/entityLevelConfig.json b/properties_pane/entity_level/entityLevelConfig.json index 35da29d0..09c33922 100644 --- a/properties_pane/entity_level/entityLevelConfig.json +++ b/properties_pane/entity_level/entityLevelConfig.json @@ -2,9 +2,11 @@ * Copyright © 2016-2019 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. +* 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. +* IntegrIT S.A. or in accordance with the terms and conditions stipulated in +* the agreement/contract under which the software has been supplied. In order to define custom properties for any object's properties pane, you may copy/paste from the following, making sure that you maintain a proper JSON format. @@ -70,8 +72,8 @@ making sure that you maintain a proper JSON format. ] }, // “groupInput” can have the following states - 0 items, 1 item, and many items. -// “blockInput” has only 2 states - 0 items or 1 item. -// This gives us an easy way to represent it as an object and not as an array internally which is beneficial for processing +// “blockInput” has only 2 states - 0 items or 1 item. +// This gives us an easy way to represent it as an object and not as an array internally which is beneficial for processing // and forward-engineering in particular. { "propertyName": "Block", @@ -99,7 +101,7 @@ making sure that you maintain a proper JSON format. "propertyKeyword": "keyList", "propertyType": "fieldList", "template": "orderedList" - }, + }, { "propertyName": "List with attribute", "propertyKeyword": "keyListOrder", @@ -155,7 +157,7 @@ making sure that you maintain a proper JSON format. } }, { - "propertyName": "As Dynamic", + "propertyName": "Dynamic", "propertyKeyword": "dynamic", "propertyType": "checkbox" }, @@ -201,8 +203,8 @@ making sure that you maintain a proper JSON format. "propertyType": "block", "structure": [ { - "propertyName": "Type", - "propertyKeyword": "targetLagType", + "propertyName": "Time span", + "propertyKeyword": "targetLagTimeSpan", "propertyType": "select", "options": ["seconds", "minutes", "hours", "days"] },