@lingk/sync 0.1.54 → 0.1.55
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/lightning.js +10 -6
- package/build/lightning.js.map +1 -1
- package/build/lightningStyles.js.map +1 -1
- package/build/lingk.js +4 -3
- package/build/lingk.js.map +1 -1
- package/build/lingkStyles.js.map +1 -1
- package/build/main.js +202 -280
- package/build/main.js.map +1 -1
- package/build/reducer.js +14 -27
- package/build/reducer.js.map +1 -1
- package/package.json +1 -1
package/build/main.js
CHANGED
|
@@ -1317,9 +1317,6 @@ module.exports =
|
|
|
1317
1317
|
}
|
|
1318
1318
|
|
|
1319
1319
|
_createClass(SelectWrapper, [{
|
|
1320
|
-
key: 'componentDidMount',
|
|
1321
|
-
value: function componentDidMount() {}
|
|
1322
|
-
}, {
|
|
1323
1320
|
key: 'expand',
|
|
1324
1321
|
value: function expand(v, parents) {
|
|
1325
1322
|
this.setState({ expanded: _nestExpand2.default.expand(v, parents, this.state.expanded) });
|
|
@@ -1701,16 +1698,15 @@ module.exports =
|
|
|
1701
1698
|
var SET_WIZARD_TRIGGER = exports.SET_WIZARD_TRIGGER = 'SET_WIZARD_TRIGGER';
|
|
1702
1699
|
var SET_WIZARD_LOADED = exports.SET_WIZARD_LOADED = 'SET_WIZARD_LOADED';
|
|
1703
1700
|
var SET_WIZARD_DATA_LOADED = exports.SET_WIZARD_DATA_LOADED = 'SET_WIZARD_DATA_LOADED';
|
|
1704
|
-
var
|
|
1705
|
-
var
|
|
1706
|
-
var
|
|
1707
|
-
var
|
|
1708
|
-
var
|
|
1709
|
-
var
|
|
1710
|
-
var CLEAR_WIZARD = exports.CLEAR_WIZARD = 'CLEAR_WIZARD';
|
|
1711
|
-
var SET_OAUTH_URL = exports.SET_OAUTH_URL = 'SET_OAUTH_URL';
|
|
1712
|
-
var GETTING_OAUTH_URL = exports.GETTING_OAUTH_URL = 'GETTING_OAUTH_URL';
|
|
1701
|
+
var START_WIZARD_ENV_CHECK = exports.START_WIZARD_ENV_CHECK = 'START_WIZARD_ENV_CHECK';
|
|
1702
|
+
var FINISH_WIZARD_ENV_CHECK = exports.FINISH_WIZARD_ENV_CHECK = 'FINISH_WIZARD_ENV_CHECK';
|
|
1703
|
+
var START_WIZARD_GET_SCENARIO = exports.START_WIZARD_GET_SCENARIO = 'START_WIZARD_GET_SCENARIO';
|
|
1704
|
+
var FINISH_WIZARD_GET_SCENARIO = exports.FINISH_WIZARD_GET_SCENARIO = 'FINISH_WIZARD_GET_SCENARIO';
|
|
1705
|
+
var SET_WIZARD_OAUTH_URL = exports.SET_WIZARD_OAUTH_URL = 'SET_WIZARD_OAUTH_URL';
|
|
1706
|
+
var GETTING_WIZARD_OAUTH_URL = exports.GETTING_WIZARD_OAUTH_URL = 'GETTING_WIZARD_OAUTH_URL';
|
|
1713
1707
|
var SET_WIZARD_SAVED_CREDENTIALS = exports.SET_WIZARD_SAVED_CREDENTIALS = 'SET_WIZARD_SAVED_CREDENTIALS';
|
|
1708
|
+
|
|
1709
|
+
var CLEAR_WIZARD = exports.CLEAR_WIZARD = 'CLEAR_WIZARD';
|
|
1714
1710
|
|
|
1715
1711
|
/***/ },
|
|
1716
1712
|
/* 41 */
|
|
@@ -2036,7 +2032,8 @@ module.exports =
|
|
|
2036
2032
|
}
|
|
2037
2033
|
}, {
|
|
2038
2034
|
key: 'addDefaultResourceGroup',
|
|
2039
|
-
value: function addDefaultResourceGroup(v, selectIdx,
|
|
2035
|
+
value: function addDefaultResourceGroup(v, selectIdx, newGroup) {
|
|
2036
|
+
var section = newGroup.section;
|
|
2040
2037
|
var _props = this.props,
|
|
2041
2038
|
addGroup = _props.addGroup,
|
|
2042
2039
|
resourceGroups = _props.resourceGroups,
|
|
@@ -2060,7 +2057,7 @@ module.exports =
|
|
|
2060
2057
|
if (!(resourceGroups && resourceGroups.length === 0)) {
|
|
2061
2058
|
this.go(false, finalIndex);
|
|
2062
2059
|
}
|
|
2063
|
-
addGroup(v, finalIndex,
|
|
2060
|
+
addGroup(v, finalIndex, newGroup);
|
|
2064
2061
|
}
|
|
2065
2062
|
}, {
|
|
2066
2063
|
key: 'pickEntity',
|
|
@@ -2072,7 +2069,7 @@ module.exports =
|
|
|
2072
2069
|
}
|
|
2073
2070
|
}, {
|
|
2074
2071
|
key: 'addDefaultEntity',
|
|
2075
|
-
value: function addDefaultEntity(
|
|
2072
|
+
value: function addDefaultEntity(v, rscIndex, entity, groupIndex) {
|
|
2076
2073
|
var _this3 = this;
|
|
2077
2074
|
|
|
2078
2075
|
var resourceGroups = this.props.resourceGroups;
|
|
@@ -2086,7 +2083,7 @@ module.exports =
|
|
|
2086
2083
|
}, 40);
|
|
2087
2084
|
}
|
|
2088
2085
|
|
|
2089
|
-
this.props.addDefaultEntity(
|
|
2086
|
+
this.props.addDefaultEntity(v, rscIndex, entity, groupIndex);
|
|
2090
2087
|
}
|
|
2091
2088
|
}, {
|
|
2092
2089
|
key: 'unPick',
|
|
@@ -2384,7 +2381,7 @@ module.exports =
|
|
|
2384
2381
|
value: true
|
|
2385
2382
|
});
|
|
2386
2383
|
|
|
2387
|
-
function saveData(resourceGroups,
|
|
2384
|
+
function saveData(resourceGroups, targetProvider, sourceMetadata, destinationMetadata, sourceEndpoint) {
|
|
2388
2385
|
var bundles = resourceGroups || [];
|
|
2389
2386
|
var mappings = [];
|
|
2390
2387
|
var endpoints = {};
|
|
@@ -2395,7 +2392,7 @@ module.exports =
|
|
|
2395
2392
|
}) : group;
|
|
2396
2393
|
group.name = destinationResource.type;
|
|
2397
2394
|
group.resourceLabel = destinationResource.name;
|
|
2398
|
-
group.provider =
|
|
2395
|
+
group.provider = targetProvider.toLowerCase();
|
|
2399
2396
|
if (destinationResource.recordTypeId) {
|
|
2400
2397
|
group.recordTypeId = destinationResource.recordTypeId;
|
|
2401
2398
|
}
|
|
@@ -2432,7 +2429,7 @@ module.exports =
|
|
|
2432
2429
|
var sourceKeyResourceProvider = group.resources.find(function (r) {
|
|
2433
2430
|
return r.name === group.sourceKeysObjects[i];
|
|
2434
2431
|
}).provider;
|
|
2435
|
-
var dataSourceMetadata = sourceKeyResourceProvider ===
|
|
2432
|
+
var dataSourceMetadata = sourceKeyResourceProvider === targetProvider ? destinationMetadata : sourceMetadata;
|
|
2436
2433
|
var sourceResource = dataSourceMetadata.find(function (metaRsc) {
|
|
2437
2434
|
return metaRsc.name === group.sourceKeysObjects[i];
|
|
2438
2435
|
});
|
|
@@ -2480,7 +2477,7 @@ module.exports =
|
|
|
2480
2477
|
var transConcatSourceResourceProvider = group.resources.find(function (r) {
|
|
2481
2478
|
return r.name === s[0];
|
|
2482
2479
|
}).provider;
|
|
2483
|
-
var transConcatSourceMetadata = transConcatSourceResourceProvider ===
|
|
2480
|
+
var transConcatSourceMetadata = transConcatSourceResourceProvider === targetProvider ? destinationMetadata : sourceMetadata;
|
|
2484
2481
|
var transConcatSourceResource = transConcatSourceMetadata.find(function (rsc) {
|
|
2485
2482
|
return rsc.name === s[0];
|
|
2486
2483
|
});
|
|
@@ -2525,7 +2522,7 @@ module.exports =
|
|
|
2525
2522
|
group.resources = group.resources.map(function (rsc) {
|
|
2526
2523
|
|
|
2527
2524
|
//get resource source (check both metadatas)
|
|
2528
|
-
var dataSourceMetadata = rsc.provider ===
|
|
2525
|
+
var dataSourceMetadata = rsc.provider === targetProvider ? destinationMetadata : sourceMetadata;
|
|
2529
2526
|
var sourceResource = dataSourceMetadata.find(function (metaRsc) {
|
|
2530
2527
|
return metaRsc.name === rsc.name;
|
|
2531
2528
|
});
|
|
@@ -2537,7 +2534,7 @@ module.exports =
|
|
|
2537
2534
|
}
|
|
2538
2535
|
|
|
2539
2536
|
//get first resource in bundle (for primaryKeyName)
|
|
2540
|
-
var primaryDataSourceMetadata = group.resources[0].provider ===
|
|
2537
|
+
var primaryDataSourceMetadata = group.resources[0].provider === targetProvider ? destinationMetadata : sourceMetadata;
|
|
2541
2538
|
var primarySourceResource = primaryDataSourceMetadata.find(function (metaRsc) {
|
|
2542
2539
|
return metaRsc.name === group.resources[0].name;
|
|
2543
2540
|
});
|
|
@@ -4932,17 +4929,14 @@ module.exports =
|
|
|
4932
4929
|
Object.defineProperty(exports, "__esModule", {
|
|
4933
4930
|
value: true
|
|
4934
4931
|
});
|
|
4935
|
-
exports.
|
|
4936
|
-
exports.
|
|
4937
|
-
exports.callCheckConnectionForProvider = callCheckConnectionForProvider;
|
|
4932
|
+
exports.callGetMetadata = callGetMetadata;
|
|
4933
|
+
exports.tryCheckConnection = tryCheckConnection;
|
|
4938
4934
|
exports.callGetProviderMetadata = callGetProviderMetadata;
|
|
4939
4935
|
exports.getOauthUrl = getOauthUrl;
|
|
4940
4936
|
exports.createLingkExternalIds = createLingkExternalIds;
|
|
4941
|
-
exports.callTest = callTest;
|
|
4942
4937
|
exports.callAddCustomField = callAddCustomField;
|
|
4943
4938
|
exports.gotEmptyScenario = gotEmptyScenario;
|
|
4944
4939
|
exports.callGetScenario = callGetScenario;
|
|
4945
|
-
exports.callPreviewIntegration = callPreviewIntegration;
|
|
4946
4940
|
exports.callGetScenarioList = callGetScenarioList;
|
|
4947
4941
|
exports.callCreateScenario = callCreateScenario;
|
|
4948
4942
|
exports.callUpdateScenarioList = callUpdateScenarioList;
|
|
@@ -4958,12 +4952,13 @@ module.exports =
|
|
|
4958
4952
|
exports.callDeployTrigger = callDeployTrigger;
|
|
4959
4953
|
exports.callInit = callInit;
|
|
4960
4954
|
exports.callGetPiConfig = callGetPiConfig;
|
|
4955
|
+
exports.tryGetMetadataIntro = tryGetMetadataIntro;
|
|
4956
|
+
exports.callGetCredentialsAndMetadatas = callGetCredentialsAndMetadatas;
|
|
4957
|
+
exports.tryGetCredentials = tryGetCredentials;
|
|
4961
4958
|
exports.tryGetMetadata = tryGetMetadata;
|
|
4962
4959
|
exports.callGetBundles = callGetBundles;
|
|
4963
4960
|
exports.callGetMapping = callGetMapping;
|
|
4964
4961
|
exports.postCredentials = postCredentials;
|
|
4965
|
-
exports.callGetCredentials = callGetCredentials;
|
|
4966
|
-
exports.tryGetCredentials = tryGetCredentials;
|
|
4967
4962
|
exports.callGetTrigger = callGetTrigger;
|
|
4968
4963
|
exports.setWizardLoaded = setWizardLoaded;
|
|
4969
4964
|
exports.setWizardDataLoaded = setWizardDataLoaded;
|
|
@@ -4983,82 +4978,56 @@ module.exports =
|
|
|
4983
4978
|
|
|
4984
4979
|
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }
|
|
4985
4980
|
|
|
4986
|
-
//
|
|
4987
|
-
|
|
4981
|
+
// bug: when reloading a wizard that has no creds saved, the metadata will be called
|
|
4982
|
+
// automatically, because it assumes it doesnt need creds.
|
|
4983
|
+
// need to check "credentials" config object AND creds in tryCheckConnection
|
|
4984
|
+
function callGetMetadata(tenantId, appId, mode, providerType, urlSuffix, apiUrl, endpoint, credsConfig) {
|
|
4988
4985
|
return function (dispatch) {
|
|
4989
|
-
if (urlSuffix) {
|
|
4990
|
-
dispatch(callGetProviderMetadata(tenantId, appId, urlSuffix, apiUrl, mode, providerType));
|
|
4991
|
-
}
|
|
4992
|
-
if (endpoint && endpoint.length > 8) {
|
|
4993
|
-
//dont check if its just https://
|
|
4994
|
-
dispatch(callCheckConnection(tenantId, appId, endpoint, mode, providerType, creds));
|
|
4995
|
-
}
|
|
4996
|
-
};
|
|
4997
|
-
}
|
|
4998
|
-
|
|
4999
|
-
function callCheckConnection(tenantId, appId, url, mode, providerType, creds) {
|
|
5000
|
-
return function (dispatch, getState, api) {
|
|
5001
4986
|
dispatch({
|
|
5002
|
-
type: types.
|
|
4987
|
+
type: types.START_WIZARD_ENV_CHECK,
|
|
5003
4988
|
mode: mode
|
|
5004
4989
|
});
|
|
5005
|
-
return dispatch(
|
|
4990
|
+
return dispatch(tryCheckConnection(tenantId, appId, providerType, credsConfig)).then(function (r) {
|
|
4991
|
+
return dispatch(callGetProviderMetadata(tenantId, appId, urlSuffix, apiUrl, mode, providerType, endpoint));
|
|
4992
|
+
}).then(function (res) {
|
|
5006
4993
|
dispatch({
|
|
5007
|
-
type: types.
|
|
4994
|
+
type: types.FINISH_WIZARD_ENV_CHECK,
|
|
5008
4995
|
data: { res: res, mode: mode, code: '200 OK', providerType: providerType }
|
|
5009
4996
|
});
|
|
5010
4997
|
}).catch(function (err) {
|
|
5011
4998
|
dispatch({
|
|
5012
|
-
type: types.
|
|
4999
|
+
type: types.FINISH_WIZARD_ENV_CHECK,
|
|
5013
5000
|
data: { res: null, mode: mode, code: '404 Error', providerType: providerType }
|
|
5014
5001
|
});
|
|
5015
5002
|
});
|
|
5016
5003
|
};
|
|
5017
5004
|
}
|
|
5018
5005
|
|
|
5019
|
-
function
|
|
5006
|
+
function tryCheckConnection(tenantId, appId, providerType, credsConfig) {
|
|
5020
5007
|
return function (dispatch, getState, api) {
|
|
5008
|
+
var needsCredentials = credsConfig && credsConfig.length > 0 && credsConfig[0] !== 'Oauth';
|
|
5009
|
+
|
|
5021
5010
|
var _getState = getState(),
|
|
5022
5011
|
config = _getState.config;
|
|
5023
5012
|
|
|
5024
|
-
if (
|
|
5025
|
-
|
|
5026
|
-
return api.post(tenantId + '/' + appId + '/testconnection/canvas', {
|
|
5013
|
+
if (needsCredentials) {
|
|
5014
|
+
return api.post(tenantId + '/' + appId + '/testconnection/' + providerType.toLowerCase(), {
|
|
5027
5015
|
endpoint: config.TRANS_API_URL
|
|
5028
5016
|
});
|
|
5029
|
-
} else
|
|
5030
|
-
// else just check for adapter connection
|
|
5031
|
-
return api.get(tenantId + '/' + appId + '/testconnection?url=' + url, {
|
|
5032
|
-
endpoint: config.TRANS_API_URL
|
|
5033
|
-
});
|
|
5034
|
-
}
|
|
5017
|
+
} else return Promise.resolve(null);
|
|
5035
5018
|
};
|
|
5036
5019
|
}
|
|
5037
5020
|
|
|
5038
|
-
function callGetProviderMetadata(tenantId, appId, urlSuffix, apiUrl, mode, providerType) {
|
|
5021
|
+
function callGetProviderMetadata(tenantId, appId, urlSuffix, apiUrl, mode, providerType, endpoint) {
|
|
5039
5022
|
return function (dispatch, getState, api) {
|
|
5040
|
-
dispatch({
|
|
5041
|
-
type: types.START_ENV_CHECK,
|
|
5042
|
-
mode: mode
|
|
5043
|
-
});
|
|
5044
|
-
|
|
5045
5023
|
var _getState2 = getState(),
|
|
5046
5024
|
config = _getState2.config;
|
|
5047
5025
|
|
|
5026
|
+
if (urlSuffix === 'testconnection') {
|
|
5027
|
+
urlSuffix = 'testconnection?url=' + endpoint;
|
|
5028
|
+
}
|
|
5048
5029
|
return api.get(tenantId + '/' + appId + '/' + urlSuffix, {
|
|
5049
5030
|
endpoint: config[apiUrl]
|
|
5050
|
-
}).then(function (res) {
|
|
5051
|
-
dispatch({
|
|
5052
|
-
type: types.FINISH_ENV_CHECK,
|
|
5053
|
-
data: { res: res, mode: mode, code: '200 OK', providerType: providerType }
|
|
5054
|
-
});
|
|
5055
|
-
return true;
|
|
5056
|
-
}).catch(function (err) {
|
|
5057
|
-
console.log(err);
|
|
5058
|
-
dispatch({
|
|
5059
|
-
type: types.FINISH_ENV_CHECK,
|
|
5060
|
-
data: { res: null, mode: mode, code: '404 Error' }
|
|
5061
|
-
});
|
|
5062
5031
|
});
|
|
5063
5032
|
};
|
|
5064
5033
|
}
|
|
@@ -5066,7 +5035,7 @@ module.exports =
|
|
|
5066
5035
|
function getOauthUrl(tenantId, appId, typeGuid, orgType, mode) {
|
|
5067
5036
|
return function (dispatch, getState, api) {
|
|
5068
5037
|
dispatch({
|
|
5069
|
-
type: types.
|
|
5038
|
+
type: types.GETTING_WIZARD_OAUTH_URL,
|
|
5070
5039
|
bool: true,
|
|
5071
5040
|
mode: mode
|
|
5072
5041
|
});
|
|
@@ -5078,7 +5047,7 @@ module.exports =
|
|
|
5078
5047
|
endpoint: config.SF_AGENT_API_URL
|
|
5079
5048
|
}).then(function (data) {
|
|
5080
5049
|
dispatch({
|
|
5081
|
-
type: types.
|
|
5050
|
+
type: types.SET_WIZARD_OAUTH_URL,
|
|
5082
5051
|
data: data.url
|
|
5083
5052
|
});
|
|
5084
5053
|
}).catch(function (err) {
|
|
@@ -5133,19 +5102,6 @@ module.exports =
|
|
|
5133
5102
|
};
|
|
5134
5103
|
}
|
|
5135
5104
|
|
|
5136
|
-
function asyncFunction(v, callback) {
|
|
5137
|
-
setTimeout(function () {
|
|
5138
|
-
return callback(v * 2);
|
|
5139
|
-
}, 1000);
|
|
5140
|
-
}
|
|
5141
|
-
function callTest(v, completedCallback) {
|
|
5142
|
-
return new Promise(function (resolve) {
|
|
5143
|
-
return asyncFunction(v, function (r) {
|
|
5144
|
-
return resolve(r * 2);
|
|
5145
|
-
});
|
|
5146
|
-
});
|
|
5147
|
-
}
|
|
5148
|
-
|
|
5149
5105
|
function callAddCustomField(tenantId, appId, objectType, fieldName, completedCallback) {
|
|
5150
5106
|
return function (dispatch, getState, api) {
|
|
5151
5107
|
var _getState5 = getState(),
|
|
@@ -5167,7 +5123,7 @@ module.exports =
|
|
|
5167
5123
|
function gotEmptyScenario() {
|
|
5168
5124
|
return function (dispatch) {
|
|
5169
5125
|
dispatch({
|
|
5170
|
-
type: types.
|
|
5126
|
+
type: types.FINISH_WIZARD_GET_SCENARIO
|
|
5171
5127
|
});
|
|
5172
5128
|
dispatch({
|
|
5173
5129
|
type: types.SET_WIZARD_SAVED_BUNDLES,
|
|
@@ -5183,13 +5139,13 @@ module.exports =
|
|
|
5183
5139
|
function callGetScenario(magicNumber, bundleGuid, mappingGuid, completedCallback) {
|
|
5184
5140
|
return function (dispatch, getState, api) {
|
|
5185
5141
|
dispatch({
|
|
5186
|
-
type: types.
|
|
5142
|
+
type: types.START_WIZARD_GET_SCENARIO
|
|
5187
5143
|
});
|
|
5188
5144
|
var tenantId = magicNumber;
|
|
5189
5145
|
var accountId = magicNumber;
|
|
5190
5146
|
return Promise.all([dispatch(callGetBundles(tenantId, accountId, bundleGuid)), dispatch(callGetMapping(tenantId, accountId, mappingGuid))]).then(function (res) {
|
|
5191
5147
|
dispatch({
|
|
5192
|
-
type: types.
|
|
5148
|
+
type: types.FINISH_WIZARD_GET_SCENARIO
|
|
5193
5149
|
});
|
|
5194
5150
|
completedCallback();
|
|
5195
5151
|
}).catch(function (err) {
|
|
@@ -5199,31 +5155,11 @@ module.exports =
|
|
|
5199
5155
|
};
|
|
5200
5156
|
}
|
|
5201
5157
|
|
|
5202
|
-
function
|
|
5158
|
+
function callGetScenarioList(tenantId, appId, typeGuid) {
|
|
5203
5159
|
return function (dispatch, getState, api) {
|
|
5204
|
-
dispatch({
|
|
5205
|
-
type: types.START_PREVIEW
|
|
5206
|
-
});
|
|
5207
|
-
|
|
5208
5160
|
var _getState6 = getState(),
|
|
5209
5161
|
config = _getState6.config;
|
|
5210
5162
|
|
|
5211
|
-
return api.get(tenantId + '/' + appId + '/previewintegration?url=' + url, {
|
|
5212
|
-
endpoint: config.TRANS_API_URL
|
|
5213
|
-
}).then(function (res) {
|
|
5214
|
-
dispatch({
|
|
5215
|
-
type: types.FINISH_PREVIEW,
|
|
5216
|
-
data: res
|
|
5217
|
-
});
|
|
5218
|
-
});
|
|
5219
|
-
};
|
|
5220
|
-
}
|
|
5221
|
-
|
|
5222
|
-
function callGetScenarioList(tenantId, appId, typeGuid) {
|
|
5223
|
-
return function (dispatch, getState, api) {
|
|
5224
|
-
var _getState7 = getState(),
|
|
5225
|
-
config = _getState7.config;
|
|
5226
|
-
|
|
5227
5163
|
return api.get(tenantId + '/' + appId + '/scenarios/' + typeGuid, {
|
|
5228
5164
|
endpoint: config.TRANS_API_URL
|
|
5229
5165
|
});
|
|
@@ -5232,8 +5168,8 @@ module.exports =
|
|
|
5232
5168
|
|
|
5233
5169
|
function callCreateScenario(tenantId, appId, data) {
|
|
5234
5170
|
return function (dispatch, getState, api) {
|
|
5235
|
-
var
|
|
5236
|
-
config =
|
|
5171
|
+
var _getState7 = getState(),
|
|
5172
|
+
config = _getState7.config;
|
|
5237
5173
|
|
|
5238
5174
|
return api.post(tenantId + '/' + appId + '/scenario', {
|
|
5239
5175
|
endpoint: config.TRANS_API_URL,
|
|
@@ -5244,8 +5180,8 @@ module.exports =
|
|
|
5244
5180
|
|
|
5245
5181
|
function callUpdateScenarioList(tenantId, appId, typeGuid, scenarioIds) {
|
|
5246
5182
|
return function (dispatch, getState, api) {
|
|
5247
|
-
var
|
|
5248
|
-
config =
|
|
5183
|
+
var _getState8 = getState(),
|
|
5184
|
+
config = _getState8.config;
|
|
5249
5185
|
|
|
5250
5186
|
return api.post(tenantId + '/' + appId + '/scenarios/' + typeGuid, {
|
|
5251
5187
|
endpoint: config.TRANS_API_URL,
|
|
@@ -5258,8 +5194,8 @@ module.exports =
|
|
|
5258
5194
|
|
|
5259
5195
|
function callPostBundles(tenantId, appId, bundles) {
|
|
5260
5196
|
return function (dispatch, getState, api) {
|
|
5261
|
-
var
|
|
5262
|
-
config =
|
|
5197
|
+
var _getState9 = getState(),
|
|
5198
|
+
config = _getState9.config;
|
|
5263
5199
|
|
|
5264
5200
|
var data = { bundles: bundles };
|
|
5265
5201
|
return api.post(tenantId + '/' + appId + '/bundle', {
|
|
@@ -5273,8 +5209,8 @@ module.exports =
|
|
|
5273
5209
|
|
|
5274
5210
|
function callPostMapping(tenantId, appId, mappings) {
|
|
5275
5211
|
return function (dispatch, getState, api) {
|
|
5276
|
-
var
|
|
5277
|
-
config =
|
|
5212
|
+
var _getState10 = getState(),
|
|
5213
|
+
config = _getState10.config;
|
|
5278
5214
|
|
|
5279
5215
|
var data = { mappings: mappings };
|
|
5280
5216
|
return api.post(tenantId + '/' + appId + '/schemamappings', {
|
|
@@ -5288,8 +5224,8 @@ module.exports =
|
|
|
5288
5224
|
|
|
5289
5225
|
function callPostProductizedIntegration(tenantId, appId, schemaMappingGuid, bundlePackGuid, configuration, title, typeGuid) {
|
|
5290
5226
|
return function (dispatch, getState, api) {
|
|
5291
|
-
var
|
|
5292
|
-
config =
|
|
5227
|
+
var _getState11 = getState(),
|
|
5228
|
+
config = _getState11.config;
|
|
5293
5229
|
|
|
5294
5230
|
var data = {
|
|
5295
5231
|
schemaMappingGuid: schemaMappingGuid,
|
|
@@ -5309,8 +5245,8 @@ module.exports =
|
|
|
5309
5245
|
|
|
5310
5246
|
function callUpdateProductizedIntegration(tenantId, appId, schemaMappingGuid, bundlePackGuid, configuration, title, typeGuid, piGuid) {
|
|
5311
5247
|
return function (dispatch, getState, api) {
|
|
5312
|
-
var
|
|
5313
|
-
config =
|
|
5248
|
+
var _getState12 = getState(),
|
|
5249
|
+
config = _getState12.config;
|
|
5314
5250
|
|
|
5315
5251
|
var data = {
|
|
5316
5252
|
schemaMappingGuid: schemaMappingGuid,
|
|
@@ -5330,8 +5266,8 @@ module.exports =
|
|
|
5330
5266
|
|
|
5331
5267
|
function callGenerateRecipe(tenantId, appId, typeId, typeGuid, title, piGuid, mappingGuid, sourceMetadata, destinationMetadata, isManagedPackage) {
|
|
5332
5268
|
return function (dispatch, getState, api) {
|
|
5333
|
-
var
|
|
5334
|
-
config =
|
|
5269
|
+
var _getState13 = getState(),
|
|
5270
|
+
config = _getState13.config;
|
|
5335
5271
|
|
|
5336
5272
|
return api.post(tenantId + '/' + appId + '/productizedintegrations/' + piGuid + '/generate', {
|
|
5337
5273
|
endpoint: config.TRANS_API_URL,
|
|
@@ -5387,8 +5323,8 @@ module.exports =
|
|
|
5387
5323
|
|
|
5388
5324
|
function callExecuteTransformer(transId) {
|
|
5389
5325
|
return function (dispatch, getState, api) {
|
|
5390
|
-
var
|
|
5391
|
-
config =
|
|
5326
|
+
var _getState14 = getState(),
|
|
5327
|
+
config = _getState14.config;
|
|
5392
5328
|
|
|
5393
5329
|
var query = '';
|
|
5394
5330
|
var d = new Date();
|
|
@@ -5412,8 +5348,8 @@ module.exports =
|
|
|
5412
5348
|
|
|
5413
5349
|
function callLookupLogData(externalExecutionId, index, onFinish, generatedRecipe, pi) {
|
|
5414
5350
|
return function (dispatch, getState, api) {
|
|
5415
|
-
var
|
|
5416
|
-
config =
|
|
5351
|
+
var _getState15 = getState(),
|
|
5352
|
+
config = _getState15.config;
|
|
5417
5353
|
|
|
5418
5354
|
return api.get('logs/transformers/externalExecutionId/' + externalExecutionId, {
|
|
5419
5355
|
endpoint: config.TRANS_API_URL
|
|
@@ -5456,8 +5392,8 @@ module.exports =
|
|
|
5456
5392
|
};
|
|
5457
5393
|
}
|
|
5458
5394
|
return function (dispatch, getState, api) {
|
|
5459
|
-
var
|
|
5460
|
-
config =
|
|
5395
|
+
var _getState16 = getState(),
|
|
5396
|
+
config = _getState16.config;
|
|
5461
5397
|
|
|
5462
5398
|
return api.post('createtrigger', {
|
|
5463
5399
|
endpoint: config.TRANS_API_URL,
|
|
@@ -5470,8 +5406,8 @@ module.exports =
|
|
|
5470
5406
|
|
|
5471
5407
|
function callDeployTrigger(generatedRecipe, pi, onFinish) {
|
|
5472
5408
|
return function (dispatch, getState, api) {
|
|
5473
|
-
var
|
|
5474
|
-
config =
|
|
5409
|
+
var _getState17 = getState(),
|
|
5410
|
+
config = _getState17.config;
|
|
5475
5411
|
|
|
5476
5412
|
return api.put('transformer/deploy/' + generatedRecipe.Id, {
|
|
5477
5413
|
endpoint: config.TRANS_API_URL,
|
|
@@ -5503,20 +5439,15 @@ module.exports =
|
|
|
5503
5439
|
};
|
|
5504
5440
|
}
|
|
5505
5441
|
|
|
5506
|
-
function callGetPiConfig(tenantId, accountId, piGuid,
|
|
5507
|
-
|
|
5508
|
-
|
|
5509
|
-
sourceApi = metadataEndpoints.sourceApi,
|
|
5510
|
-
destination = metadataEndpoints.destination,
|
|
5511
|
-
destinationApi = metadataEndpoints.destinationApi;
|
|
5512
|
-
var skipSourceEnv = providers.skipSourceEnv,
|
|
5513
|
-
skipDestinationEnv = providers.skipDestinationEnv;
|
|
5442
|
+
function callGetPiConfig(tenantId, accountId, piGuid, wizardConfig) {
|
|
5443
|
+
var source = wizardConfig.source,
|
|
5444
|
+
destination = wizardConfig.destination;
|
|
5514
5445
|
|
|
5515
5446
|
|
|
5516
5447
|
if (piGuid && piGuid !== '_') {
|
|
5517
5448
|
return function (dispatch, getState, api) {
|
|
5518
|
-
var
|
|
5519
|
-
config =
|
|
5449
|
+
var _getState18 = getState(),
|
|
5450
|
+
config = _getState18.config;
|
|
5520
5451
|
|
|
5521
5452
|
return api.get(tenantId + '/' + accountId + '/productizedintegration/' + piGuid, {
|
|
5522
5453
|
endpoint: config.TRANS_API_URL
|
|
@@ -5535,34 +5466,72 @@ module.exports =
|
|
|
5535
5466
|
type: types.SET_WIZARD_SAVED_CONFIGURATION,
|
|
5536
5467
|
data: config
|
|
5537
5468
|
});
|
|
5538
|
-
return Promise.all([dispatch(
|
|
5469
|
+
return Promise.all([dispatch(callGetMapping(tenantId, accountId, pi.schemaMappingGuid)), dispatch(callGetBundles(tenantId, accountId, pi.bundlePackGuid)), dispatch(callGetCredentialsAndMetadatas(tenantId, accountId, wizardConfig, savedSourceEndpoint, savedDestinationEndpoint)), dispatch(callGetTrigger(pi.transformerBaseId))]);
|
|
5539
5470
|
});
|
|
5540
5471
|
};
|
|
5541
5472
|
} else return function (dispatch) {
|
|
5542
5473
|
// FIRST TIME!
|
|
5543
|
-
return Promise.all([dispatch(
|
|
5474
|
+
return Promise.all([dispatch(tryGetMetadataIntro(tenantId, accountId, 'source', source)), dispatch(tryGetMetadataIntro(tenantId, accountId, 'destination', destination))]);
|
|
5544
5475
|
};
|
|
5545
5476
|
}
|
|
5546
5477
|
|
|
5547
|
-
// this function runs when wizard first loads
|
|
5548
|
-
function
|
|
5549
|
-
|
|
5550
|
-
|
|
5551
|
-
|
|
5552
|
-
|
|
5553
|
-
|
|
5554
|
-
|
|
5555
|
-
|
|
5556
|
-
};
|
|
5557
|
-
} else if (savedEndpoint && savedEndpoint !== 'https://' && savedEndpoint !== 'http://' && savedEndpoint !== '_blank') {
|
|
5478
|
+
// this function runs when a NEW wizard first loads ONLY in Salesforce App (no env step)
|
|
5479
|
+
function tryGetMetadataIntro(tenantId, appId, mode, config) {
|
|
5480
|
+
var type = config.type,
|
|
5481
|
+
metadataEndpoint = config.metadataEndpoint,
|
|
5482
|
+
metadataApi = config.metadataApi,
|
|
5483
|
+
skipEnvStep = config.skipEnvStep;
|
|
5484
|
+
// automatically pull metadata (SF app)
|
|
5485
|
+
|
|
5486
|
+
if (skipEnvStep) {
|
|
5558
5487
|
return function (dispatch) {
|
|
5559
|
-
return dispatch(
|
|
5488
|
+
return dispatch(callGetProviderMetadata(tenantId, appId, metadataEndpoint, metadataApi, mode, type));
|
|
5560
5489
|
};
|
|
5561
5490
|
} else return function () {
|
|
5562
5491
|
return Promise.resolve(null);
|
|
5563
5492
|
};
|
|
5564
5493
|
}
|
|
5565
5494
|
|
|
5495
|
+
function callGetCredentialsAndMetadatas(tenantId, appId, config, savedSourceEndpoint, savedDestinationEndpoint) {
|
|
5496
|
+
var source = config.source,
|
|
5497
|
+
destination = config.destination;
|
|
5498
|
+
|
|
5499
|
+
return function (dispatch, getState, api) {
|
|
5500
|
+
return Promise.all([dispatch(tryGetCredentials(tenantId, appId, source.type, source.credentials)), dispatch(tryGetCredentials(tenantId, appId, destination.type, destination.credentials))]).then(function (res) {
|
|
5501
|
+
dispatch({
|
|
5502
|
+
type: types.SET_WIZARD_SAVED_CREDENTIALS,
|
|
5503
|
+
data: {
|
|
5504
|
+
source: res[0] && res[0].credentialsJson,
|
|
5505
|
+
destination: res[1] && res[1].credentialsJson
|
|
5506
|
+
}
|
|
5507
|
+
});
|
|
5508
|
+
return Promise.all([dispatch(tryGetMetadata(tenantId, appId, 'source', source, savedSourceEndpoint, source.credentials)), dispatch(tryGetMetadata(tenantId, appId, 'destination', destination, savedDestinationEndpoint, destination.credentials))]);
|
|
5509
|
+
});
|
|
5510
|
+
};
|
|
5511
|
+
}
|
|
5512
|
+
|
|
5513
|
+
function tryGetCredentials(tenantId, appId, credentialType, credsConfig) {
|
|
5514
|
+
return function (dispatch, getState, api) {
|
|
5515
|
+
var _getState19 = getState(),
|
|
5516
|
+
config = _getState19.config;
|
|
5517
|
+
|
|
5518
|
+
if (credsConfig && credsConfig.length > 0 && credsConfig[0] !== 'Oauth') {
|
|
5519
|
+
return api.get(tenantId + '/' + appId + '/credentials/' + credentialType, {
|
|
5520
|
+
endpoint: config.TRANS_API_URL
|
|
5521
|
+
});
|
|
5522
|
+
} else return Promise.resolve(null);
|
|
5523
|
+
};
|
|
5524
|
+
}
|
|
5525
|
+
|
|
5526
|
+
function tryGetMetadata(tenantId, appId, mode, config, savedEndpoint, credsConfig) {
|
|
5527
|
+
return function (dispatch, getState, api) {
|
|
5528
|
+
// if skipEnvStep (as in SF App), auto pull SF metadata
|
|
5529
|
+
if (savedEndpoint && savedEndpoint.length > 8 || config.skipEnvStep) {
|
|
5530
|
+
return dispatch(callGetMetadata(tenantId, appId, mode, config.type, config.metadataEndpoint, config.metadataApi, savedEndpoint, credsConfig));
|
|
5531
|
+
} else return Promise.resolve(null);
|
|
5532
|
+
};
|
|
5533
|
+
}
|
|
5534
|
+
|
|
5566
5535
|
function callGetBundles(tenantId, accountId, bundlePackGuid) {
|
|
5567
5536
|
if (bundlePackGuid) {
|
|
5568
5537
|
return function (dispatch, getState, api) {
|
|
@@ -5578,9 +5547,7 @@ module.exports =
|
|
|
5578
5547
|
});
|
|
5579
5548
|
});
|
|
5580
5549
|
};
|
|
5581
|
-
} else return
|
|
5582
|
-
return Promise.resolve(null);
|
|
5583
|
-
};
|
|
5550
|
+
} else return Promise.resolve(null);
|
|
5584
5551
|
}
|
|
5585
5552
|
|
|
5586
5553
|
function callGetMapping(tenantId, accountId, mappingGuid) {
|
|
@@ -5598,15 +5565,13 @@ module.exports =
|
|
|
5598
5565
|
});
|
|
5599
5566
|
});
|
|
5600
5567
|
};
|
|
5601
|
-
} else return
|
|
5602
|
-
return Promise.resolve(null);
|
|
5603
|
-
};
|
|
5568
|
+
} else return Promise.resolve(null);
|
|
5604
5569
|
}
|
|
5605
5570
|
|
|
5606
5571
|
function postCredentials(tenantId, appId, providerType, url, credentials, mode) {
|
|
5607
5572
|
return function (dispatch, getState, api) {
|
|
5608
5573
|
dispatch({
|
|
5609
|
-
type: types.
|
|
5574
|
+
type: types.START_WIZARD_ENV_CHECK,
|
|
5610
5575
|
mode: mode
|
|
5611
5576
|
});
|
|
5612
5577
|
|
|
@@ -5641,40 +5606,11 @@ module.exports =
|
|
|
5641
5606
|
return data;
|
|
5642
5607
|
}
|
|
5643
5608
|
|
|
5644
|
-
function
|
|
5645
|
-
return function (dispatch, getState, api) {
|
|
5646
|
-
return Promise.all([dispatch(tryGetCredentials(tenantId, appId, providers.source, providers.sourceCredentials)), dispatch(tryGetCredentials(tenantId, appId, providers.destination, providers.destinationCredentials))]).then(function (res) {
|
|
5647
|
-
dispatch({
|
|
5648
|
-
type: types.SET_WIZARD_SAVED_CREDENTIALS,
|
|
5649
|
-
data: {
|
|
5650
|
-
source: res[0] && res[0].credentialsJson,
|
|
5651
|
-
destination: res[1] && res[1].credentialsJson
|
|
5652
|
-
}
|
|
5653
|
-
});
|
|
5654
|
-
});
|
|
5655
|
-
};
|
|
5656
|
-
}
|
|
5657
|
-
|
|
5658
|
-
function tryGetCredentials(tenantId, appId, credentialType, creds) {
|
|
5609
|
+
function callGetTrigger(transBaseId) {
|
|
5659
5610
|
return function (dispatch, getState, api) {
|
|
5660
5611
|
var _getState23 = getState(),
|
|
5661
5612
|
config = _getState23.config;
|
|
5662
5613
|
|
|
5663
|
-
if (creds && creds.length > 0 && creds[0] !== 'Oauth') {
|
|
5664
|
-
return api.get(tenantId + '/' + appId + '/credentials/' + credentialType, {
|
|
5665
|
-
endpoint: config.TRANS_API_URL
|
|
5666
|
-
});
|
|
5667
|
-
} else {
|
|
5668
|
-
return Promise.resolve(null);
|
|
5669
|
-
}
|
|
5670
|
-
};
|
|
5671
|
-
}
|
|
5672
|
-
|
|
5673
|
-
function callGetTrigger(transBaseId) {
|
|
5674
|
-
return function (dispatch, getState, api) {
|
|
5675
|
-
var _getState24 = getState(),
|
|
5676
|
-
config = _getState24.config;
|
|
5677
|
-
|
|
5678
5614
|
if (transBaseId) {
|
|
5679
5615
|
return api.get('gettrigger/' + transBaseId, {
|
|
5680
5616
|
endpoint: config.TRANS_API_URL
|
|
@@ -5684,9 +5620,7 @@ module.exports =
|
|
|
5684
5620
|
data: data
|
|
5685
5621
|
});
|
|
5686
5622
|
});
|
|
5687
|
-
} else return
|
|
5688
|
-
return Promise.resolve(null);
|
|
5689
|
-
};
|
|
5623
|
+
} else return Promise.resolve(null);
|
|
5690
5624
|
};
|
|
5691
5625
|
}
|
|
5692
5626
|
|
|
@@ -5988,7 +5922,7 @@ module.exports =
|
|
|
5988
5922
|
_react2.default.createElement(
|
|
5989
5923
|
'div',
|
|
5990
5924
|
{ style: { display: 'inline-block', width: 'calc(50% - 120px)' } },
|
|
5991
|
-
'
|
|
5925
|
+
'Target Objects'
|
|
5992
5926
|
)
|
|
5993
5927
|
),
|
|
5994
5928
|
_react2.default.createElement(
|
|
@@ -6244,41 +6178,41 @@ module.exports =
|
|
|
6244
6178
|
props.update();
|
|
6245
6179
|
};
|
|
6246
6180
|
|
|
6247
|
-
var selectSourceKeyForLingk = function selectSourceKeyForLingk(key,
|
|
6181
|
+
var selectSourceKeyForLingk = function selectSourceKeyForLingk(key, i, field) {
|
|
6248
6182
|
var rgs = [].concat(_toConsumableArray(resourceGroups));
|
|
6249
6183
|
var group = rgs[bundleIndex];
|
|
6250
6184
|
group.lingkSourceKey = key;
|
|
6251
|
-
group.lingkSourceKeyObject = section;
|
|
6252
|
-
group.lingkSourceKeyParents = parents;
|
|
6185
|
+
group.lingkSourceKeyObject = field.section;
|
|
6186
|
+
group.lingkSourceKeyParents = field.parents;
|
|
6253
6187
|
change('resourceGroups', rgs);
|
|
6254
6188
|
props.update();
|
|
6255
6189
|
};
|
|
6256
6190
|
|
|
6257
|
-
var selectCustomSourceKey = function selectCustomSourceKey(key,
|
|
6191
|
+
var selectCustomSourceKey = function selectCustomSourceKey(key, i, field) {
|
|
6258
6192
|
var rgs = [].concat(_toConsumableArray(resourceGroups));
|
|
6259
6193
|
var group = rgs[bundleIndex];
|
|
6260
6194
|
if (i === 0) {
|
|
6261
6195
|
group.sourceKeys = [key];
|
|
6262
|
-
group.sourceKeysObjects = [section];
|
|
6263
|
-
group.sourceKeysParents = [parents];
|
|
6196
|
+
group.sourceKeysObjects = [field.section];
|
|
6197
|
+
group.sourceKeysParents = [field.parents];
|
|
6264
6198
|
} else {
|
|
6265
6199
|
group.sourceKeys[i] = key;
|
|
6266
|
-
group.sourceKeysObjects[i] = section;
|
|
6267
|
-
group.sourceKeysParents[i] = parents;
|
|
6200
|
+
group.sourceKeysObjects[i] = field.section;
|
|
6201
|
+
group.sourceKeysParents[i] = field.parents;
|
|
6268
6202
|
}
|
|
6269
6203
|
change('resourceGroups', rgs);
|
|
6270
6204
|
props.update();
|
|
6271
6205
|
};
|
|
6272
6206
|
|
|
6273
|
-
var selectCustomDestinationKey = function selectCustomDestinationKey(key, i,
|
|
6207
|
+
var selectCustomDestinationKey = function selectCustomDestinationKey(key, i, field) {
|
|
6274
6208
|
var rgs = [].concat(_toConsumableArray(resourceGroups));
|
|
6275
6209
|
var group = rgs[bundleIndex];
|
|
6276
6210
|
if (i === 0) {
|
|
6277
6211
|
group.destinationKeys = [key];
|
|
6278
|
-
group.destinationKeysParents = [parents];
|
|
6212
|
+
group.destinationKeysParents = [field.parents];
|
|
6279
6213
|
} else {
|
|
6280
6214
|
group.destinationKeys[i] = key;
|
|
6281
|
-
group.destinationKeysParents[i] = parents;
|
|
6215
|
+
group.destinationKeysParents[i] = field.parents;
|
|
6282
6216
|
}
|
|
6283
6217
|
change('resourceGroups', rgs);
|
|
6284
6218
|
props.update();
|
|
@@ -6400,9 +6334,10 @@ module.exports =
|
|
|
6400
6334
|
'div',
|
|
6401
6335
|
{ className: 'external-keys-column' },
|
|
6402
6336
|
_react2.default.createElement(_selectWrapper2.default, { label: sourceLabel || 'Choose Key',
|
|
6403
|
-
onSelect: function onSelect(v, iii,
|
|
6404
|
-
return selectCustomSourceKey(v,
|
|
6405
|
-
},
|
|
6337
|
+
onSelect: function onSelect(v, iii, field) {
|
|
6338
|
+
return selectCustomSourceKey(v, i, field);
|
|
6339
|
+
},
|
|
6340
|
+
inputs: inputs,
|
|
6406
6341
|
type: 'brand', fieldPropLabel: 'label',
|
|
6407
6342
|
values: vals, sectionLabels: sectionLabels,
|
|
6408
6343
|
selectedValues: group.sourceKeys && [{
|
|
@@ -6422,9 +6357,10 @@ module.exports =
|
|
|
6422
6357
|
'div',
|
|
6423
6358
|
{ className: 'external-keys-column' },
|
|
6424
6359
|
_react2.default.createElement(_selectWrapper2.default, { label: group.destinationKeys && group.destinationKeys[i] || 'Choose Key',
|
|
6425
|
-
onSelect: function onSelect(v, iii,
|
|
6426
|
-
return selectCustomDestinationKey(v, i,
|
|
6427
|
-
},
|
|
6360
|
+
onSelect: function onSelect(v, iii, field) {
|
|
6361
|
+
return selectCustomDestinationKey(v, i, field);
|
|
6362
|
+
},
|
|
6363
|
+
type: 'brand', inputs: inputs,
|
|
6428
6364
|
values: destinationVals,
|
|
6429
6365
|
sectionLabels: [bundle.name], fieldPropLabel: 'label',
|
|
6430
6366
|
selectedValues: group.destinationKeys && [{
|
|
@@ -6520,9 +6456,10 @@ module.exports =
|
|
|
6520
6456
|
{ className: 'external-keys-column' },
|
|
6521
6457
|
_react2.default.createElement(_selectWrapper2.default, { label: sourceLabel || 'Choose Key',
|
|
6522
6458
|
menuItemStyle: { height: 20, padding: '1px 8px' },
|
|
6523
|
-
onSelect: function onSelect(v, i,
|
|
6524
|
-
return selectSourceKeyForLingk(v,
|
|
6525
|
-
},
|
|
6459
|
+
onSelect: function onSelect(v, i, field) {
|
|
6460
|
+
return selectSourceKeyForLingk(v, i, field);
|
|
6461
|
+
},
|
|
6462
|
+
type: 'brand', inputs: inputs,
|
|
6526
6463
|
values: vals, sectionLabels: sectionLabels,
|
|
6527
6464
|
fieldPropLabel: 'label',
|
|
6528
6465
|
selectedValues: [{
|
|
@@ -7640,8 +7577,8 @@ module.exports =
|
|
|
7640
7577
|
)
|
|
7641
7578
|
),
|
|
7642
7579
|
_react2.default.createElement(_selectWrapper2.default, { label: primaryKeyLabel || 'Primary Join Key',
|
|
7643
|
-
onSelect: function onSelect(v,
|
|
7644
|
-
|
|
7580
|
+
onSelect: function onSelect(v, idx, field) {
|
|
7581
|
+
selectPrimaryKey(v, field, resourceGroupIndex, i);
|
|
7645
7582
|
},
|
|
7646
7583
|
onClick: showOverflow,
|
|
7647
7584
|
type: 'neutral', inputs: inputs,
|
|
@@ -7676,8 +7613,8 @@ module.exports =
|
|
|
7676
7613
|
)
|
|
7677
7614
|
),
|
|
7678
7615
|
_react2.default.createElement(_selectWrapper2.default, { label: joinKeyLabel || 'Join Key',
|
|
7679
|
-
onSelect: function onSelect(v,
|
|
7680
|
-
|
|
7616
|
+
onSelect: function onSelect(v, idx, field) {
|
|
7617
|
+
selectJoinKey(v, field, resourceGroupIndex, i);
|
|
7681
7618
|
},
|
|
7682
7619
|
onClick: showOverflow,
|
|
7683
7620
|
type: 'neutral', inputs: inputs,
|
|
@@ -7729,9 +7666,10 @@ module.exports =
|
|
|
7729
7666
|
'div',
|
|
7730
7667
|
{ style: { display: 'inline-block', marginLeft: 11 } },
|
|
7731
7668
|
_react2.default.createElement(_selectWrapper2.default, { label: 'Add Data Source', style: { height: 40 }, onClick: showOverflow,
|
|
7732
|
-
onSelect: function onSelect(v, i,
|
|
7733
|
-
addDefaultEntity(
|
|
7734
|
-
},
|
|
7669
|
+
onSelect: function onSelect(v, i, entity) {
|
|
7670
|
+
return addDefaultEntity(v, i, entity, resourceGroupIndex);
|
|
7671
|
+
},
|
|
7672
|
+
type: 'neutral', inputs: inputs
|
|
7735
7673
|
//selectedValues={resourceGroups && resourceGroups[resourceGroupIndex] &&
|
|
7736
7674
|
//resourceGroups[resourceGroupIndex].resources}
|
|
7737
7675
|
, values: !isReverse ? [sourceSchema, destinationSchema] : [destinationSchema, sourceSchema],
|
|
@@ -7892,7 +7830,9 @@ module.exports =
|
|
|
7892
7830
|
}
|
|
7893
7831
|
}, {
|
|
7894
7832
|
key: 'changeConcatField',
|
|
7895
|
-
value: function changeConcatField(
|
|
7833
|
+
value: function changeConcatField(v, field, mappingIndex) {
|
|
7834
|
+
var section = field.section,
|
|
7835
|
+
parents = field.parents;
|
|
7896
7836
|
var _props2 = this.props,
|
|
7897
7837
|
change = _props2.change,
|
|
7898
7838
|
resourceGroups = _props2.resourceGroups,
|
|
@@ -7900,11 +7840,11 @@ module.exports =
|
|
|
7900
7840
|
|
|
7901
7841
|
var groups = [].concat(_toConsumableArray(resourceGroups));
|
|
7902
7842
|
var trans = resourceGroups[resourceGroupIndex].mappings[mappingIndex].transformations[0];
|
|
7903
|
-
var s =
|
|
7843
|
+
var s = section + '->';
|
|
7904
7844
|
parents && parents.forEach(function (p) {
|
|
7905
7845
|
s += p + '.';
|
|
7906
7846
|
});
|
|
7907
|
-
s +=
|
|
7847
|
+
s += v;
|
|
7908
7848
|
trans.args = trans.args || [];
|
|
7909
7849
|
trans.args[1] = s;
|
|
7910
7850
|
change('resourceGroups', groups);
|
|
@@ -8247,8 +8187,8 @@ module.exports =
|
|
|
8247
8187
|
if (label) sourceLabel += label;
|
|
8248
8188
|
|
|
8249
8189
|
return _react2.default.createElement(_selectWrapper2.default, { key: ta, label: sourceLabel || 'Choose Field',
|
|
8250
|
-
onSelect: function onSelect(v, iii,
|
|
8251
|
-
return _this3.changeConcatField(v,
|
|
8190
|
+
onSelect: function onSelect(v, iii, field) {
|
|
8191
|
+
return _this3.changeConcatField(v, field, mappingIndex);
|
|
8252
8192
|
},
|
|
8253
8193
|
inputs: inputs,
|
|
8254
8194
|
type: 'brand', fieldPropLabel: 'label',
|
|
@@ -8903,10 +8843,10 @@ module.exports =
|
|
|
8903
8843
|
|
|
8904
8844
|
if (credentials) {
|
|
8905
8845
|
actions.postCredentials(tenantId, accountId, step.providerType, endpoint, credentials, step.mode).then(function () {
|
|
8906
|
-
actions.
|
|
8846
|
+
actions.callGetMetadata(tenantId, accountId, step.mode, step.providerType, step.metadataEndpoint, step.metadataApi, endpoint || '_blank', step.credentials);
|
|
8907
8847
|
});
|
|
8908
8848
|
} else {
|
|
8909
|
-
actions.
|
|
8849
|
+
actions.callGetMetadata(tenantId, accountId, step.mode, step.providerType, step.metadataEndpoint, step.metadataApi, endpoint || '_blank', step.credentials);
|
|
8910
8850
|
}
|
|
8911
8851
|
}
|
|
8912
8852
|
}, {
|
|
@@ -8945,6 +8885,8 @@ module.exports =
|
|
|
8945
8885
|
return m.method === 'POST' || m.method === 'PUT';
|
|
8946
8886
|
});
|
|
8947
8887
|
|
|
8888
|
+
var hasEndpoint = formValues[step.mode + 'Endpoint'] && formValues[step.mode + 'Endpoint'].length > 8;
|
|
8889
|
+
|
|
8948
8890
|
return _react2.default.createElement(
|
|
8949
8891
|
'form',
|
|
8950
8892
|
{ onKeyPress: function onKeyPress(e) {
|
|
@@ -9072,7 +9014,8 @@ module.exports =
|
|
|
9072
9014
|
onClick: function onClick() {
|
|
9073
9015
|
return _this2.check();
|
|
9074
9016
|
},
|
|
9075
|
-
style: { marginLeft: 8, marginBottom: 2, height: 30, lineHeight: '10px' }
|
|
9017
|
+
style: { marginLeft: 8, marginBottom: 2, height: 30, lineHeight: '10px' },
|
|
9018
|
+
disabled: !hasEndpoint },
|
|
9076
9019
|
'Test Connection'
|
|
9077
9020
|
) : null,
|
|
9078
9021
|
_react2.default.createElement(
|
|
@@ -9124,7 +9067,7 @@ module.exports =
|
|
|
9124
9067
|
disabled: step.credentials.some(function (c) {
|
|
9125
9068
|
var formCreds = formValues[step.mode + 'Credentials'];
|
|
9126
9069
|
return !(formCreds && Object.keys(formCreds).includes(c.split(' ').join('')));
|
|
9127
|
-
}) },
|
|
9070
|
+
}) || !hasEndpoint },
|
|
9128
9071
|
'Test Connection'
|
|
9129
9072
|
)
|
|
9130
9073
|
)
|
|
@@ -10474,7 +10417,7 @@ module.exports =
|
|
|
10474
10417
|
}
|
|
10475
10418
|
}, {
|
|
10476
10419
|
key: 'addGroup',
|
|
10477
|
-
value: function addGroup(v, index,
|
|
10420
|
+
value: function addGroup(v, index, newGroup) {
|
|
10478
10421
|
var _props4 = this.props,
|
|
10479
10422
|
change = _props4.change,
|
|
10480
10423
|
formValues = _props4.formValues;
|
|
@@ -10485,15 +10428,15 @@ module.exports =
|
|
|
10485
10428
|
resourceGroups.splice(index, 0, {
|
|
10486
10429
|
name: v,
|
|
10487
10430
|
resources: null,
|
|
10488
|
-
recordTypeId: recordTypeId,
|
|
10489
|
-
provider: section
|
|
10431
|
+
recordTypeId: newGroup.recordTypeId,
|
|
10432
|
+
provider: newGroup.section
|
|
10490
10433
|
});
|
|
10491
10434
|
|
|
10492
10435
|
change('resourceGroups', resourceGroups);
|
|
10493
10436
|
}
|
|
10494
10437
|
}, {
|
|
10495
10438
|
key: 'addDefaultEntity',
|
|
10496
|
-
value: function addDefaultEntity(
|
|
10439
|
+
value: function addDefaultEntity(v, rscIndex, entity, groupIndex) {
|
|
10497
10440
|
var _props5 = this.props,
|
|
10498
10441
|
change = _props5.change,
|
|
10499
10442
|
formValues = _props5.formValues;
|
|
@@ -10510,7 +10453,7 @@ module.exports =
|
|
|
10510
10453
|
group.resources = [];
|
|
10511
10454
|
this.openConnectionModal(group, groupIndex);
|
|
10512
10455
|
}
|
|
10513
|
-
// ADD PARENTS AS WELL
|
|
10456
|
+
// ADD PARENTS AS WELL ?
|
|
10514
10457
|
/*if(parentRef && parentRef.length>0){
|
|
10515
10458
|
parentRef.forEach((pr,i)=>{
|
|
10516
10459
|
if(!(group.resources.find(r=>r.name===pr))){
|
|
@@ -10525,9 +10468,9 @@ module.exports =
|
|
|
10525
10468
|
}*/
|
|
10526
10469
|
group.resources.push(Object.assign({
|
|
10527
10470
|
name: v,
|
|
10528
|
-
provider: section,
|
|
10471
|
+
provider: entity.section,
|
|
10529
10472
|
joinType: 'LEFT JOIN'
|
|
10530
|
-
}, parentRef && { parentRef: parentRef },
|
|
10473
|
+
}, entity.parentRef && { parentRef: entity.parentRef }, entity.recordTypeId && { recordTypeId: entity.rtid }));
|
|
10531
10474
|
change('resourceGroups', resourceGroups);
|
|
10532
10475
|
this.forceUpdate();
|
|
10533
10476
|
}
|
|
@@ -10621,7 +10564,8 @@ module.exports =
|
|
|
10621
10564
|
}
|
|
10622
10565
|
}, {
|
|
10623
10566
|
key: 'selectPrimaryKey',
|
|
10624
|
-
value: function selectPrimaryKey(v,
|
|
10567
|
+
value: function selectPrimaryKey(v, field, rgi, i) {
|
|
10568
|
+
console.log(field.parents);
|
|
10625
10569
|
var _props10 = this.props,
|
|
10626
10570
|
change = _props10.change,
|
|
10627
10571
|
formValues = _props10.formValues;
|
|
@@ -10629,13 +10573,13 @@ module.exports =
|
|
|
10629
10573
|
var resourceGroups = [].concat(_toConsumableArray(formValues['resourceGroups']));
|
|
10630
10574
|
var rsc = resourceGroups[rgi].resources[i];
|
|
10631
10575
|
rsc.primaryKeyName = v;
|
|
10632
|
-
rsc.primaryKeyParents = parents;
|
|
10576
|
+
rsc.primaryKeyParents = field.parents;
|
|
10633
10577
|
change('resourceGroups', resourceGroups);
|
|
10634
10578
|
this.forceUpdate();
|
|
10635
10579
|
}
|
|
10636
10580
|
}, {
|
|
10637
10581
|
key: 'selectJoinKey',
|
|
10638
|
-
value: function selectJoinKey(v,
|
|
10582
|
+
value: function selectJoinKey(v, field, rgi, i) {
|
|
10639
10583
|
var _props11 = this.props,
|
|
10640
10584
|
change = _props11.change,
|
|
10641
10585
|
formValues = _props11.formValues;
|
|
@@ -10643,7 +10587,7 @@ module.exports =
|
|
|
10643
10587
|
var resourceGroups = [].concat(_toConsumableArray(formValues['resourceGroups']));
|
|
10644
10588
|
var rsc = resourceGroups[rgi].resources[i];
|
|
10645
10589
|
rsc.joinKeyName = v;
|
|
10646
|
-
rsc.joinKeyParents = parents;
|
|
10590
|
+
rsc.joinKeyParents = field.parents;
|
|
10647
10591
|
change('resourceGroups', resourceGroups);
|
|
10648
10592
|
this.forceUpdate();
|
|
10649
10593
|
}
|
|
@@ -10737,7 +10681,8 @@ module.exports =
|
|
|
10737
10681
|
{ className: 'connect-modal' },
|
|
10738
10682
|
resourceGroups && resourceGroups.length > 0 && this.state.showModal && _react2.default.createElement(_connectModal2.default, { inputs: inputs, hideModal: this.hideModal,
|
|
10739
10683
|
bundle: this.state.selectedBundle, opened: this.state.showModal, change: change,
|
|
10740
|
-
resourceGroups: resourceGroups, step: step,
|
|
10684
|
+
resourceGroups: resourceGroups, step: step,
|
|
10685
|
+
bundleIndex: this.state.selectedBundleIndex,
|
|
10741
10686
|
sourceSchema: sourceSchema, destinationSchema: destinationSchema,
|
|
10742
10687
|
update: function update() {
|
|
10743
10688
|
return _this2.forceUpdate();
|
|
@@ -11027,10 +10972,9 @@ module.exports =
|
|
|
11027
10972
|
destinationMetadata = _props3.destinationMetadata,
|
|
11028
10973
|
sourceEndpoint = _props3.sourceEndpoint;
|
|
11029
10974
|
|
|
11030
|
-
var providers = { source: step.sourceProvider, destination: step.destinationProvider };
|
|
11031
10975
|
var clone = (0, _objectAssignDeep2.default)({}, { bundles: resourceGroups });
|
|
11032
10976
|
|
|
11033
|
-
var _saveData = (0, _saveData3.default)(clone.bundles,
|
|
10977
|
+
var _saveData = (0, _saveData3.default)(clone.bundles, step.destinationProvider, sourceMetadata, destinationMetadata, sourceEndpoint),
|
|
11034
10978
|
bundles = _saveData.bundles,
|
|
11035
10979
|
mappings = _saveData.mappings;
|
|
11036
10980
|
|
|
@@ -11459,10 +11403,9 @@ module.exports =
|
|
|
11459
11403
|
actions = _props.actions,
|
|
11460
11404
|
tenantId = _props.tenantId,
|
|
11461
11405
|
accountId = _props.accountId,
|
|
11462
|
-
|
|
11463
|
-
providers = _props.providers;
|
|
11406
|
+
wizardConfig = _props.wizardConfig;
|
|
11464
11407
|
|
|
11465
|
-
actions.callInit(tenantId, accountId, piGuid,
|
|
11408
|
+
actions.callInit(tenantId, accountId, piGuid, wizardConfig);
|
|
11466
11409
|
}
|
|
11467
11410
|
}]);
|
|
11468
11411
|
|
|
@@ -11508,7 +11451,7 @@ module.exports =
|
|
|
11508
11451
|
//resources: Type is the real value, Name is the displayed value
|
|
11509
11452
|
//properties: Name is the real value, Label is the displayed value
|
|
11510
11453
|
|
|
11511
|
-
var _saveData = (0, _saveData3.default)(formValues['resourceGroups'], this.props.
|
|
11454
|
+
var _saveData = (0, _saveData3.default)(formValues['resourceGroups'], this.props.wizardConfig.destination.type, this.props.wizard.sourceMetadata, this.props.wizard.destinationMetadata, formValues.sourceEndpoint),
|
|
11512
11455
|
bundles = _saveData.bundles,
|
|
11513
11456
|
mappings = _saveData.mappings,
|
|
11514
11457
|
endpoints = _saveData.endpoints;
|
|
@@ -11767,7 +11710,7 @@ module.exports =
|
|
|
11767
11710
|
mode: 'source'
|
|
11768
11711
|
}, {
|
|
11769
11712
|
type: 'environment',
|
|
11770
|
-
title: '
|
|
11713
|
+
title: 'Target Environment',
|
|
11771
11714
|
mode: 'destination'
|
|
11772
11715
|
}, {
|
|
11773
11716
|
type: 'filter',
|
|
@@ -11847,33 +11790,14 @@ module.exports =
|
|
|
11847
11790
|
stepList.push(step);
|
|
11848
11791
|
}
|
|
11849
11792
|
}
|
|
11850
|
-
var providers = {
|
|
11851
|
-
source: wizard.source.type,
|
|
11852
|
-
destination: wizard.destination.type,
|
|
11853
|
-
sourceCredentials: wizard.source.credentials,
|
|
11854
|
-
destinationCredentials: wizard.destination.credentials,
|
|
11855
|
-
skipSourceEnv: wizard.source.skipEnvStep,
|
|
11856
|
-
skipDestinationEnv: wizard.destination.skipEnvStep
|
|
11857
|
-
};
|
|
11858
|
-
var metadataEndpoints = {
|
|
11859
|
-
source: wizard.source.metadataEndpoint || null,
|
|
11860
|
-
sourceApi: wizard.source.metadataApi || null,
|
|
11861
|
-
destination: wizard.destination.metadataEndpoint || null,
|
|
11862
|
-
destinationApi: wizard.destination.metadataApi || null
|
|
11863
|
-
};
|
|
11864
11793
|
this.setState({
|
|
11865
|
-
steps: stepList
|
|
11866
|
-
providers: providers,
|
|
11867
|
-
metadataEndpoints: metadataEndpoints
|
|
11794
|
+
steps: stepList
|
|
11868
11795
|
});
|
|
11869
11796
|
}
|
|
11870
11797
|
}, {
|
|
11871
11798
|
key: 'render',
|
|
11872
11799
|
value: function render() {
|
|
11873
|
-
var
|
|
11874
|
-
steps = _state.steps,
|
|
11875
|
-
providers = _state.providers,
|
|
11876
|
-
metadataEndpoints = _state.metadataEndpoints;
|
|
11800
|
+
var steps = this.state.steps;
|
|
11877
11801
|
|
|
11878
11802
|
if (!steps) return _react2.default.createElement('div', null);
|
|
11879
11803
|
return _react2.default.createElement(
|
|
@@ -11884,9 +11808,7 @@ module.exports =
|
|
|
11884
11808
|
height: '100%'
|
|
11885
11809
|
} },
|
|
11886
11810
|
_react2.default.createElement(_wizardForm2.default, Object.assign({
|
|
11887
|
-
steps: steps
|
|
11888
|
-
providers: providers,
|
|
11889
|
-
metadataEndpoints: metadataEndpoints
|
|
11811
|
+
steps: steps
|
|
11890
11812
|
}, this.props))
|
|
11891
11813
|
);
|
|
11892
11814
|
}
|