Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

HCK-7642 #137

Merged
merged 11 commits into from
Aug 22, 2024
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
16 changes: 10 additions & 6 deletions forward_engineering/helpers/tableHelper.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down Expand Up @@ -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` : '',
Expand Down
20 changes: 11 additions & 9 deletions properties_pane/entity_level/entityLevelConfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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",
Expand Down Expand Up @@ -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",
Expand Down Expand Up @@ -155,7 +157,7 @@ making sure that you maintain a proper JSON format.
}
},
{
"propertyName": "As Dynamic",
"propertyName": "Dynamic",
"propertyKeyword": "dynamic",
"propertyType": "checkbox"
},
Expand Down Expand Up @@ -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"]
},
Expand Down