@lingk/sync 0.1.62 → 0.1.64
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.map +1 -1
- package/build/lightningStyles.js.map +1 -1
- package/build/lingk.js.map +1 -1
- package/build/lingkStyles.js.map +1 -1
- package/build/main.js +202 -100
- package/build/main.js.map +1 -1
- package/build/reducer.js +57 -69
- package/build/reducer.js.map +1 -1
- package/package.json +1 -1
package/build/main.js
CHANGED
|
@@ -243,7 +243,7 @@ module.exports =
|
|
|
243
243
|
|
|
244
244
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
245
245
|
|
|
246
|
-
function loadData(step, wizard, change, formValues, actions) {
|
|
246
|
+
function loadData(step, wizard, change, formValues, actions, isReverse) {
|
|
247
247
|
|
|
248
248
|
var defaults = {
|
|
249
249
|
sourceEndpoint: 'https://',
|
|
@@ -269,14 +269,24 @@ module.exports =
|
|
|
269
269
|
}
|
|
270
270
|
|
|
271
271
|
if (!formValues['resourceGroups']) {
|
|
272
|
+
var sourceMetadata = wizard.sourceMetadata,
|
|
273
|
+
destinationMetadata = wizard.destinationMetadata;
|
|
272
274
|
|
|
273
|
-
if (wizard.savedBundles && wizard.savedBundles.bundles &&
|
|
275
|
+
if (wizard.savedBundles && wizard.savedBundles.bundles && sourceMetadata && destinationMetadata) {
|
|
274
276
|
(function () {
|
|
277
|
+
|
|
278
|
+
var SM = sourceMetadata;
|
|
279
|
+
var DM = destinationMetadata;
|
|
280
|
+
var DP = step.destinationProvider;
|
|
281
|
+
if (isReverse) {
|
|
282
|
+
SM = destinationMetadata;
|
|
283
|
+
DM = sourceMetadata;
|
|
284
|
+
DP = step.sourceProvider;
|
|
285
|
+
}
|
|
275
286
|
var resourceGroups = [];
|
|
276
287
|
wizard.savedBundles.bundles.forEach(function (bundle, index) {
|
|
277
|
-
|
|
278
288
|
// get bundle resource
|
|
279
|
-
var bundleResource =
|
|
289
|
+
var bundleResource = DM.find(function (rsc) {
|
|
280
290
|
return rsc.name === bundle.resourceLabel;
|
|
281
291
|
});
|
|
282
292
|
if (bundleResource) {
|
|
@@ -304,7 +314,7 @@ module.exports =
|
|
|
304
314
|
});
|
|
305
315
|
if (sourceKeyResourceObj) {
|
|
306
316
|
var sourceKeyResourceProvider = sourceKeyResourceObj.provider.replace('Reader', '');
|
|
307
|
-
var primaryDataSourceMetadata = sourceKeyResourceProvider.toLowerCase() ===
|
|
317
|
+
var primaryDataSourceMetadata = sourceKeyResourceProvider.toLowerCase() === DP.toLowerCase() ? DM : SM;
|
|
308
318
|
|
|
309
319
|
var sourceKeyResource = primaryDataSourceMetadata.find(function (r) {
|
|
310
320
|
return r.type === bundle.sourceKeysObjects[i];
|
|
@@ -323,26 +333,54 @@ module.exports =
|
|
|
323
333
|
|
|
324
334
|
//get resource and joinKey for bundleResource (check both metadatas)
|
|
325
335
|
var resourceProvider = rsc.provider.charAt(0).toUpperCase() + rsc.provider.slice(1).replace('Reader', '');
|
|
326
|
-
var dataSourceMetadata = resourceProvider ===
|
|
336
|
+
var dataSourceMetadata = resourceProvider === DP ? DM : SM;
|
|
327
337
|
var rscResource = dataSourceMetadata.find(function (r) {
|
|
328
338
|
return r.name === rsc.resourceLabel;
|
|
329
339
|
});
|
|
330
340
|
|
|
331
|
-
var deNestedJoinKey =
|
|
341
|
+
var deNestedJoinKey = {};
|
|
342
|
+
var joinKeyResourceName = null;
|
|
343
|
+
if (rsc.joinKeyName) {
|
|
344
|
+
// joinKeyName coming from parameter from another resource
|
|
345
|
+
deNestedJoinKey = { property: rsc.joinKeyName };
|
|
346
|
+
joinKeyResourceName = rsc.joinKeyResource;
|
|
347
|
+
|
|
348
|
+
// joinKeyName coming from field on this resource
|
|
349
|
+
if (rsc.resourceLabel === rsc.joinKeyResource) {
|
|
350
|
+
var joinKeyResource = dataSourceMetadata.find(function (r) {
|
|
351
|
+
return r.type === rsc.joinKeyResource;
|
|
352
|
+
});
|
|
353
|
+
deNestedJoinKey = deNest(rsc.joinKeyName, rsc.joinKeyParents, joinKeyResource);
|
|
354
|
+
joinKeyResourceName = joinKeyResource.name;
|
|
355
|
+
}
|
|
356
|
+
}
|
|
332
357
|
|
|
333
358
|
//get resource and primaryKey for first resource in bundle (check both metadatas)
|
|
334
359
|
var primaryResourceProvider = bundle.resources[0].provider.charAt(0).toUpperCase() + bundle.resources[0].provider.slice(1).replace('Reader', '');
|
|
335
|
-
var primaryDataSourceMetadata = primaryResourceProvider ===
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
360
|
+
var primaryDataSourceMetadata = primaryResourceProvider === DP ? DM : SM;
|
|
361
|
+
|
|
362
|
+
var deNestedPrimaryKey = {};
|
|
363
|
+
var primaryKeyResourceName = null;
|
|
364
|
+
if (rsc.primaryKeyName) {
|
|
365
|
+
//primaryKeyName coming from parameter (another resource)
|
|
366
|
+
deNestedPrimaryKey = { property: rsc.primaryKeyName };
|
|
367
|
+
primaryKeyResourceName = rsc.primaryKeyResource;
|
|
368
|
+
|
|
369
|
+
// primaryKeyName coming from field on this resource
|
|
370
|
+
if (bundle.resources[0].resourceLabel === rsc.primaryKeyResource) {
|
|
371
|
+
var rscPrimaryResource = primaryDataSourceMetadata.find(function (r) {
|
|
372
|
+
return r.type === rsc.primaryKeyResource;
|
|
373
|
+
});
|
|
374
|
+
deNestedPrimaryKey = deNest(rsc.primaryKeyName, rsc.primaryKeyParents, rscPrimaryResource);
|
|
375
|
+
primaryKeyResourceName = rscPrimaryResource.name;
|
|
376
|
+
}
|
|
377
|
+
}
|
|
340
378
|
|
|
341
379
|
if (rscResource) {
|
|
342
380
|
resources.push(Object.assign({
|
|
343
381
|
name: rscResource.name,
|
|
344
382
|
provider: resourceProvider
|
|
345
|
-
}, deNestedJoinKey.property && { joinKeyName: deNestedJoinKey.property }, deNestedJoinKey.parentsArray && deNestedJoinKey.parentsArray.length > 0 && { joinKeyParents: deNestedJoinKey.parentsArray }, deNestedPrimaryKey.property && { primaryKeyName: deNestedPrimaryKey.property }, deNestedPrimaryKey.parentsArray && deNestedPrimaryKey.parentsArray.length > 0 && { primaryKeyParents: deNestedPrimaryKey.parentsArray }, {
|
|
383
|
+
}, deNestedJoinKey.property && { joinKeyName: deNestedJoinKey.property }, joinKeyResourceName && { joinKeyResource: joinKeyResourceName }, deNestedJoinKey.parentsArray && deNestedJoinKey.parentsArray.length > 0 && { joinKeyParents: deNestedJoinKey.parentsArray }, deNestedPrimaryKey.property && { primaryKeyName: deNestedPrimaryKey.property }, primaryKeyResourceName && { primaryKeyResource: primaryKeyResourceName }, deNestedPrimaryKey.parentsArray && deNestedPrimaryKey.parentsArray.length > 0 && { primaryKeyParents: deNestedPrimaryKey.parentsArray }, {
|
|
346
384
|
joinType: rsc.joinType || 'LEFT JOIN'
|
|
347
385
|
}, rscResource.parentRef && { parentRef: rscResource.parentRef }, rsc.parameterFilters && { parameterFilters: rsc.parameterFilters }));
|
|
348
386
|
}
|
|
@@ -352,7 +390,10 @@ module.exports =
|
|
|
352
390
|
wizard.savedMapping && wizard.savedMapping.mappings && wizard.savedMapping.mappings.filter(function (map) {
|
|
353
391
|
return map.bundleIndex === index;
|
|
354
392
|
}).forEach(function (m) {
|
|
355
|
-
var dataSourceMetadata = m.isDestinationResource ?
|
|
393
|
+
var dataSourceMetadata = m.isDestinationResource ? DM : SM;
|
|
394
|
+
if (isReverse) {
|
|
395
|
+
dataSourceMetadata = m.isDestinationResource ? SM : DM;
|
|
396
|
+
}
|
|
356
397
|
|
|
357
398
|
var resourceFromBundle = bundle.resources.find(function (br) {
|
|
358
399
|
return br.resourceName === m.resourceFromName;
|
|
@@ -387,7 +428,7 @@ module.exports =
|
|
|
387
428
|
return r.resourceLabel === transConcatResourceName;
|
|
388
429
|
});
|
|
389
430
|
var concatRscProvider = concatRsc.provider.replace('Reader', '');
|
|
390
|
-
var concatRscMetadata = concatRscProvider.toLowerCase() ===
|
|
431
|
+
var concatRscMetadata = concatRscProvider.toLowerCase() === DP.toLowerCase() ? DM : SM;
|
|
391
432
|
var transConcatResource = concatRscMetadata.find(function (r) {
|
|
392
433
|
return r.type === concatRsc.resourceName;
|
|
393
434
|
});
|
|
@@ -2410,20 +2451,36 @@ module.exports =
|
|
|
2410
2451
|
|
|
2411
2452
|
If a new dropdown with fields is added to the UI, it must be added to this function as well
|
|
2412
2453
|
|
|
2454
|
+
sP = sourceProvider
|
|
2455
|
+
tM = targetMetadata
|
|
2413
2456
|
**************************/
|
|
2414
2457
|
|
|
2415
|
-
function saveData(resourceGroups,
|
|
2458
|
+
function saveData(resourceGroups, sP, tP, sM, tM, sourceEndpoint, isReverse) {
|
|
2459
|
+
|
|
2460
|
+
// switch providers and metadatas if the wizard is reverse
|
|
2461
|
+
var sourceProvider = sP;
|
|
2462
|
+
var targetProvider = tP;
|
|
2463
|
+
var sourceMetadata = sM;
|
|
2464
|
+
var targetMetadata = tM;
|
|
2465
|
+
if (isReverse) {
|
|
2466
|
+
// switch em!
|
|
2467
|
+
sourceProvider = tP;
|
|
2468
|
+
targetProvider = sP;
|
|
2469
|
+
sourceMetadata = tM;
|
|
2470
|
+
targetMetadata = sM;
|
|
2471
|
+
}
|
|
2472
|
+
|
|
2416
2473
|
var bundles = resourceGroups || [];
|
|
2417
2474
|
var mappings = [];
|
|
2418
2475
|
var endpoints = {};
|
|
2419
2476
|
bundles && bundles.forEach(function (group, index) {
|
|
2420
2477
|
// first get target resource
|
|
2421
|
-
var destinationResource =
|
|
2478
|
+
var destinationResource = targetMetadata ? targetMetadata.find(function (rsc) {
|
|
2422
2479
|
return rsc.name === group.name;
|
|
2423
2480
|
}) : group;
|
|
2424
2481
|
group.name = destinationResource.type;
|
|
2425
2482
|
group.resourceLabel = destinationResource.name;
|
|
2426
|
-
group.provider = targetProvider
|
|
2483
|
+
group.provider = targetProvider;
|
|
2427
2484
|
if (destinationResource.recordTypeId) {
|
|
2428
2485
|
group.recordTypeId = destinationResource.recordTypeId;
|
|
2429
2486
|
}
|
|
@@ -2460,7 +2517,7 @@ module.exports =
|
|
|
2460
2517
|
var sourceKeyResourceProvider = group.resources.find(function (r) {
|
|
2461
2518
|
return r.name === group.sourceKeysObjects[i];
|
|
2462
2519
|
}).provider;
|
|
2463
|
-
var dataSourceMetadata = sourceKeyResourceProvider === targetProvider ?
|
|
2520
|
+
var dataSourceMetadata = sourceKeyResourceProvider === targetProvider ? targetMetadata : sourceMetadata;
|
|
2464
2521
|
var sourceResource = dataSourceMetadata.find(function (metaRsc) {
|
|
2465
2522
|
return metaRsc.name === group.sourceKeysObjects[i];
|
|
2466
2523
|
});
|
|
@@ -2481,7 +2538,10 @@ module.exports =
|
|
|
2481
2538
|
if (group.mappings) {
|
|
2482
2539
|
group.mappings.forEach(function (singleMapping) {
|
|
2483
2540
|
// get mapping source resource (check both metadatas)
|
|
2484
|
-
var dataSourceMetadata = singleMapping.dataSourceIsDestinationEntity ?
|
|
2541
|
+
var dataSourceMetadata = singleMapping.dataSourceIsDestinationEntity ? targetMetadata : sourceMetadata;
|
|
2542
|
+
if (isReverse) {
|
|
2543
|
+
dataSourceMetadata = singleMapping.dataSourceIsDestinationEntity ? sourceMetadata : targetMetadata;
|
|
2544
|
+
}
|
|
2485
2545
|
var sourceResource = dataSourceMetadata.find(function (rsc) {
|
|
2486
2546
|
return rsc.name === singleMapping.resourceFromName;
|
|
2487
2547
|
});
|
|
@@ -2508,7 +2568,7 @@ module.exports =
|
|
|
2508
2568
|
var transConcatSourceResourceProvider = group.resources.find(function (r) {
|
|
2509
2569
|
return r.name === s[0];
|
|
2510
2570
|
}).provider;
|
|
2511
|
-
var transConcatSourceMetadata = transConcatSourceResourceProvider === targetProvider ?
|
|
2571
|
+
var transConcatSourceMetadata = transConcatSourceResourceProvider === targetProvider ? targetMetadata : sourceMetadata;
|
|
2512
2572
|
var transConcatSourceResource = transConcatSourceMetadata.find(function (rsc) {
|
|
2513
2573
|
return rsc.name === s[0];
|
|
2514
2574
|
});
|
|
@@ -2531,6 +2591,7 @@ module.exports =
|
|
|
2531
2591
|
|
|
2532
2592
|
if (sourceResource && nestedSourceProp.property && destinationResource && destinationProperty) {
|
|
2533
2593
|
mappings = mappings.concat(Object.assign({ // add to mappings obj
|
|
2594
|
+
resourceFromLabel: singleMapping.dataSourceIsDestinationEntity ? sourceResource.type + '_' + targetProvider : sourceResource.type + '_' + sourceProvider,
|
|
2534
2595
|
resourceFromName: sourceResource.type,
|
|
2535
2596
|
propertyFromName: nestedSourceProp.property
|
|
2536
2597
|
}, nestedSourceProp.parentsArray && nestedSourceProp.parentsArray.length > 0 && { propertyFromParents: nestedSourceProp.parentsArray }, {
|
|
@@ -2553,10 +2614,18 @@ module.exports =
|
|
|
2553
2614
|
group.resources = group.resources.map(function (rsc) {
|
|
2554
2615
|
|
|
2555
2616
|
//get resource source (check both metadatas)
|
|
2556
|
-
var dataSourceMetadata = rsc.provider === targetProvider ?
|
|
2617
|
+
var dataSourceMetadata = rsc.provider === targetProvider ? targetMetadata : sourceMetadata;
|
|
2557
2618
|
var sourceResource = dataSourceMetadata.find(function (metaRsc) {
|
|
2558
2619
|
return metaRsc.name === rsc.name;
|
|
2559
2620
|
});
|
|
2621
|
+
// via parameter, dont change because its already "type"
|
|
2622
|
+
var nestedJoinKey = { property: rsc.joinKeyName };
|
|
2623
|
+
var joinKeyResource = rsc.joinKeyResource;
|
|
2624
|
+
// is from a same resource (not via parameters)
|
|
2625
|
+
if (sourceResource.type === rsc.joinKeyResource) {
|
|
2626
|
+
nestedJoinKey = findNestedProp(rsc.joinKeyName, rsc.joinKeyParents, sourceResource);
|
|
2627
|
+
joinKeyResource = sourceResource.type;
|
|
2628
|
+
}
|
|
2560
2629
|
|
|
2561
2630
|
//make endpoint
|
|
2562
2631
|
var suffix = sourceResource.endpointSuffix;
|
|
@@ -2565,22 +2634,30 @@ module.exports =
|
|
|
2565
2634
|
}
|
|
2566
2635
|
|
|
2567
2636
|
//get first resource in bundle (for primaryKeyName)
|
|
2568
|
-
var primaryDataSourceMetadata = group.resources[0].provider === targetProvider ?
|
|
2637
|
+
var primaryDataSourceMetadata = group.resources[0].provider === targetProvider ? targetMetadata : sourceMetadata;
|
|
2569
2638
|
var primarySourceResource = primaryDataSourceMetadata.find(function (metaRsc) {
|
|
2570
2639
|
return metaRsc.name === group.resources[0].name;
|
|
2571
2640
|
});
|
|
2572
2641
|
|
|
2573
|
-
|
|
2574
|
-
|
|
2575
|
-
var
|
|
2642
|
+
// via parameter, dont change because its already "type"
|
|
2643
|
+
var nestedPrimaryKey = { property: rsc.primaryKeyName };
|
|
2644
|
+
var primaryKeyResource = rsc.primaryKeyResource;
|
|
2645
|
+
// is from a same resource (not via parameters)
|
|
2646
|
+
if (primarySourceResource.type === rsc.primaryKeyResource) {
|
|
2647
|
+
nestedPrimaryKey = findNestedProp(rsc.primaryKeyName, rsc.primaryKeyParents, primarySourceResource);
|
|
2648
|
+
primaryKeyResource = primarySourceResource.type;
|
|
2649
|
+
}
|
|
2576
2650
|
|
|
2577
2651
|
if (sourceResource) {
|
|
2578
2652
|
return Object.assign({
|
|
2579
2653
|
resourceName: sourceResource.type,
|
|
2580
2654
|
resourceLabel: sourceResource.name,
|
|
2581
|
-
|
|
2655
|
+
resourceNameAndProvider: sourceResource.type + '_' + rsc.provider,
|
|
2656
|
+
joinKeyName: nestedJoinKey.property,
|
|
2657
|
+
joinKeyResource: joinKeyResource
|
|
2582
2658
|
}, nestedJoinKey.parentsArray && nestedJoinKey.parentsArray.length > 0 && { joinKeyParents: nestedJoinKey.parentsArray }, {
|
|
2583
|
-
primaryKeyName: nestedPrimaryKey.property
|
|
2659
|
+
primaryKeyName: nestedPrimaryKey.property,
|
|
2660
|
+
primaryKeyResource: primaryKeyResource
|
|
2584
2661
|
}, nestedPrimaryKey.parentsArray && nestedPrimaryKey.parentsArray.length > 0 && { primaryKeyParents: nestedPrimaryKey.parentsArray }, {
|
|
2585
2662
|
provider: rsc.provider.toLowerCase() + 'Reader',
|
|
2586
2663
|
joinType: rsc.joinType
|
|
@@ -5112,27 +5189,20 @@ module.exports =
|
|
|
5112
5189
|
config = _getState4.config;
|
|
5113
5190
|
|
|
5114
5191
|
var externalIdlessObjects = [];
|
|
5115
|
-
|
|
5116
|
-
|
|
5117
|
-
|
|
5118
|
-
|
|
5119
|
-
r.primaryKeyName==='lingk__Lingk_External_Id__c'
|
|
5120
|
-
}) ||
|
|
5121
|
-
mappings.find(m=>{
|
|
5122
|
-
console.log(m)
|
|
5123
|
-
return b.name===m.resourceToName && m.propertyToName==='lingk__Lingk_External_Id__c'
|
|
5124
|
-
}) ){*/
|
|
5192
|
+
// only run for Salesforce
|
|
5193
|
+
bundles && bundles.filter(function (b) {
|
|
5194
|
+
return b.provider === 'Salesforce';
|
|
5195
|
+
}).forEach(function (b) {
|
|
5125
5196
|
var rsc = destinationMetadata.find(function (r) {
|
|
5126
5197
|
return r.type === b.name;
|
|
5127
5198
|
});
|
|
5128
|
-
var externalIdProp = rsc.properties && rsc.properties.find(function (p) {
|
|
5199
|
+
var externalIdProp = rsc && rsc.properties && rsc.properties.find(function (p) {
|
|
5129
5200
|
return p.name === 'Lingk_External_Id__c';
|
|
5130
5201
|
});
|
|
5131
5202
|
// only add to the array if Lingk External Id does not already exist
|
|
5132
5203
|
if (!externalIdProp || externalIdProp.fake === true) {
|
|
5133
5204
|
externalIdlessObjects.push(b.name);
|
|
5134
5205
|
}
|
|
5135
|
-
//}
|
|
5136
5206
|
});
|
|
5137
5207
|
|
|
5138
5208
|
if (externalIdlessObjects.length > 0) {
|
|
@@ -5429,6 +5499,7 @@ module.exports =
|
|
|
5429
5499
|
}
|
|
5430
5500
|
|
|
5431
5501
|
function callSaveTrigger(deployment, onFinish, generatedRecipe, pi) {
|
|
5502
|
+
console.log(deployment);
|
|
5432
5503
|
var triggerData = {
|
|
5433
5504
|
baseid: generatedRecipe.BaseId,
|
|
5434
5505
|
isrecurring: true
|
|
@@ -5922,16 +5993,7 @@ module.exports =
|
|
|
5922
5993
|
if (!(resourceGroups && resourceGroups.length > 0)) return _react2.default.createElement('div', null);
|
|
5923
5994
|
|
|
5924
5995
|
var isReverse = mode === 'reverse';
|
|
5925
|
-
|
|
5926
|
-
var normalGroup = resourceGroups.filter(function (g) {
|
|
5927
|
-
return step.destinationProvider === g.provider;
|
|
5928
|
-
});
|
|
5929
|
-
var reverseGroup = resourceGroups.filter(function (g) {
|
|
5930
|
-
return step.sourceProvider === g.provider;
|
|
5931
|
-
});
|
|
5932
|
-
|
|
5933
|
-
var groups = isReverse ? reverseGroup : normalGroup;
|
|
5934
|
-
var extraIndex = isReverse ? normalGroup.length : 0;
|
|
5996
|
+
var groups = resourceGroups;
|
|
5935
5997
|
|
|
5936
5998
|
if (!groups.length > 0) return _react2.default.createElement('div', null);
|
|
5937
5999
|
|
|
@@ -6012,9 +6074,9 @@ module.exports =
|
|
|
6012
6074
|
_react2.default.createElement(
|
|
6013
6075
|
'div',
|
|
6014
6076
|
{ className: 'bundle-table-row', key: i,
|
|
6015
|
-
style: { background: i
|
|
6077
|
+
style: { background: i === resourceGroupIndex ? '#f4f6f9' : 'white' },
|
|
6016
6078
|
onClick: function onClick() {
|
|
6017
|
-
return clickTableRow(i
|
|
6079
|
+
return clickTableRow(i);
|
|
6018
6080
|
} },
|
|
6019
6081
|
_react2.default.createElement(
|
|
6020
6082
|
'div',
|
|
@@ -6072,7 +6134,7 @@ module.exports =
|
|
|
6072
6134
|
'div',
|
|
6073
6135
|
{ className: 'connect-resource-group', onClick: function onClick(e) {
|
|
6074
6136
|
e.stopPropagation();
|
|
6075
|
-
openConnectionModal(group, i
|
|
6137
|
+
openConnectionModal(group, i);
|
|
6076
6138
|
}, style: { paddingTop: linked ? 5 : 6 } },
|
|
6077
6139
|
linked ? _react2.default.createElement(
|
|
6078
6140
|
'svg',
|
|
@@ -6092,7 +6154,7 @@ module.exports =
|
|
|
6092
6154
|
'div',
|
|
6093
6155
|
{ className: 'remove-resource-group',
|
|
6094
6156
|
onClick: function onClick(e) {
|
|
6095
|
-
return removeResourceGroup(e, i
|
|
6157
|
+
return removeResourceGroup(e, i);
|
|
6096
6158
|
} },
|
|
6097
6159
|
_react2.default.createElement(
|
|
6098
6160
|
'svg',
|
|
@@ -6337,7 +6399,7 @@ module.exports =
|
|
|
6337
6399
|
{ style: { padding: '1em' } },
|
|
6338
6400
|
_react2.default.createElement(
|
|
6339
6401
|
'p',
|
|
6340
|
-
|
|
6402
|
+
{ style: { hyphens: 'none' } },
|
|
6341
6403
|
'Choose one or more Unique Keys from both the Data Source and the Data Target. These keys will be used to keep records synchronized.'
|
|
6342
6404
|
),
|
|
6343
6405
|
_react2.default.createElement(
|
|
@@ -6765,7 +6827,7 @@ module.exports =
|
|
|
6765
6827
|
|
|
6766
6828
|
var mappings = {};
|
|
6767
6829
|
var filteredMappings = {};
|
|
6768
|
-
group.mappings && group.mappings.forEach(function (m, i) {
|
|
6830
|
+
group && group.mappings && group.mappings.forEach(function (m, i) {
|
|
6769
6831
|
mappings[m.propertyToName] = {
|
|
6770
6832
|
propFrom: m.propertyFromName,
|
|
6771
6833
|
unique: m.isUnique || false,
|
|
@@ -7731,6 +7793,36 @@ module.exports =
|
|
|
7731
7793
|
})
|
|
7732
7794
|
})*/
|
|
7733
7795
|
|
|
7796
|
+
var primaryRscVals = null;
|
|
7797
|
+
var primaryRscSectionLabels = null;
|
|
7798
|
+
if (group && group.resources) {
|
|
7799
|
+
var primaryResourceSchema = group.resources[0].provider === step.destinationProvider ? destinationSchema : sourceSchema;
|
|
7800
|
+
primaryRscVals = primaryResourceSchema && primaryResourceSchema.find(function (defaultRsc) {
|
|
7801
|
+
return defaultRsc.name === group.resources[0].name;
|
|
7802
|
+
}) && [primaryResourceSchema.find(function (defaultRsc) {
|
|
7803
|
+
return defaultRsc.name === group.resources[0].name;
|
|
7804
|
+
}).properties.filter(function (f) {
|
|
7805
|
+
return !f.fake;
|
|
7806
|
+
})];
|
|
7807
|
+
|
|
7808
|
+
var primaryHasParameters = group.resources[0].parentRef && group.resources[0].parentRef.length > 0 && group.resources[0].parentRef.some(function (pr) {
|
|
7809
|
+
return pr.foreignKeyFields && pr.foreignKeyFields.length > 0;
|
|
7810
|
+
});
|
|
7811
|
+
|
|
7812
|
+
primaryRscSectionLabels = [group.resources[0].name];
|
|
7813
|
+
|
|
7814
|
+
if (primaryHasParameters) {
|
|
7815
|
+
group.resources[0].parentRef.forEach(function (pr) {
|
|
7816
|
+
var params = [];
|
|
7817
|
+
primaryRscSectionLabels.push(pr.ref.split('/')[2]);
|
|
7818
|
+
pr.foreignKeyFields.forEach(function (fkf) {
|
|
7819
|
+
params.push({ label: fkf });
|
|
7820
|
+
});
|
|
7821
|
+
primaryRscVals.push(params);
|
|
7822
|
+
});
|
|
7823
|
+
}
|
|
7824
|
+
}
|
|
7825
|
+
|
|
7734
7826
|
return _react2.default.createElement(
|
|
7735
7827
|
'div',
|
|
7736
7828
|
{ style: { position: 'relative' } },
|
|
@@ -7792,20 +7884,35 @@ module.exports =
|
|
|
7792
7884
|
{ style: { position: 'relative' } },
|
|
7793
7885
|
group && group.resources && group.resources.map(function (rsc, i) {
|
|
7794
7886
|
|
|
7795
|
-
var
|
|
7796
|
-
|
|
7797
|
-
|
|
7798
|
-
|
|
7799
|
-
|
|
7800
|
-
|
|
7801
|
-
|
|
7802
|
-
|
|
7803
|
-
|
|
7804
|
-
return defaultRsc.name ===
|
|
7887
|
+
var isDestinationEntity = rsc.provider === step.destinationProvider;
|
|
7888
|
+
var isSelected = selectedEntity.name === rsc.name && selectedEntity.isDestinationEntity === isDestinationEntity;
|
|
7889
|
+
|
|
7890
|
+
var hasParameters = rsc.parentRef && rsc.parentRef.length > 0 && rsc.parentRef.some(function (pr) {
|
|
7891
|
+
return pr.foreignKeyFields && pr.foreignKeyFields.length > 0;
|
|
7892
|
+
});
|
|
7893
|
+
|
|
7894
|
+
var rscSchema = isDestinationEntity ? destinationSchema : sourceSchema;
|
|
7895
|
+
var joinRscVals = rscSchema && rscSchema.find(function (defaultRsc) {
|
|
7896
|
+
return defaultRsc.name === rsc.name;
|
|
7897
|
+
}) && [rscSchema.find(function (defaultRsc) {
|
|
7898
|
+
return defaultRsc.name === rsc.name;
|
|
7805
7899
|
}).properties.filter(function (f) {
|
|
7806
7900
|
return !f.fake;
|
|
7807
7901
|
})];
|
|
7808
7902
|
|
|
7903
|
+
var joinRscSectionLabels = [rsc.name];
|
|
7904
|
+
|
|
7905
|
+
if (hasParameters) {
|
|
7906
|
+
rsc.parentRef.forEach(function (pr) {
|
|
7907
|
+
var params = [];
|
|
7908
|
+
joinRscSectionLabels.push(pr.ref.split('/')[2]);
|
|
7909
|
+
pr.foreignKeyFields.forEach(function (fkf) {
|
|
7910
|
+
params.push({ label: fkf });
|
|
7911
|
+
});
|
|
7912
|
+
joinRscVals.push(params);
|
|
7913
|
+
});
|
|
7914
|
+
}
|
|
7915
|
+
|
|
7809
7916
|
var primaryKeyLabel = '';
|
|
7810
7917
|
rsc.primaryKeyParents && rsc.primaryKeyParents.forEach(function (skp) {
|
|
7811
7918
|
primaryKeyLabel += skp;
|
|
@@ -7815,20 +7922,6 @@ module.exports =
|
|
|
7815
7922
|
primaryKeyLabel += rsc.primaryKeyName;
|
|
7816
7923
|
}
|
|
7817
7924
|
|
|
7818
|
-
var joinRscVals = rsc.provider === step.destinationProvider ? destinationSchema && destinationSchema.find(function (defaultRsc) {
|
|
7819
|
-
return defaultRsc.name === rsc.name;
|
|
7820
|
-
}) && [destinationSchema.find(function (defaultRsc) {
|
|
7821
|
-
return defaultRsc.name === rsc.name;
|
|
7822
|
-
}).properties.filter(function (f) {
|
|
7823
|
-
return !f.fake;
|
|
7824
|
-
})] : sourceSchema && sourceSchema.find(function (defaultRsc) {
|
|
7825
|
-
return defaultRsc.name === rsc.name;
|
|
7826
|
-
}) && [sourceSchema.find(function (defaultRsc) {
|
|
7827
|
-
return defaultRsc.name === rsc.name;
|
|
7828
|
-
}).properties.filter(function (f) {
|
|
7829
|
-
return !f.fake;
|
|
7830
|
-
})];
|
|
7831
|
-
|
|
7832
7925
|
var joinKeyLabel = '';
|
|
7833
7926
|
rsc.joinKeyParents && rsc.joinKeyParents.forEach(function (skp) {
|
|
7834
7927
|
joinKeyLabel += skp;
|
|
@@ -7838,17 +7931,12 @@ module.exports =
|
|
|
7838
7931
|
joinKeyLabel += rsc.joinKeyName;
|
|
7839
7932
|
}
|
|
7840
7933
|
|
|
7841
|
-
|
|
7842
|
-
group.resources && group.resources.forEach(
|
|
7843
|
-
if
|
|
7844
|
-
|
|
7845
|
-
})) {
|
|
7846
|
-
isDependency = true;
|
|
7934
|
+
/*let isDependency = false
|
|
7935
|
+
group.resources && group.resources.forEach(gr=>{
|
|
7936
|
+
if(gr.parentRef && gr.parentRef.find(pr=>pr===rsc.name)){
|
|
7937
|
+
isDependency=true
|
|
7847
7938
|
}
|
|
7848
|
-
})
|
|
7849
|
-
|
|
7850
|
-
var isDestinationEntity = rsc.provider === step.destinationProvider;
|
|
7851
|
-
var isSelected = selectedEntity.name === rsc.name && selectedEntity.isDestinationEntity === isDestinationEntity;
|
|
7939
|
+
})*/
|
|
7852
7940
|
|
|
7853
7941
|
var rscName = rsc.name;
|
|
7854
7942
|
if (isReverse) {
|
|
@@ -7897,9 +7985,7 @@ module.exports =
|
|
|
7897
7985
|
{ style: { maxWidth: 260, overflow: 'hidden', textOverflow: 'ellipsis', whiteSpace: 'nowrap', display: 'inline-block' } },
|
|
7898
7986
|
rscName
|
|
7899
7987
|
),
|
|
7900
|
-
|
|
7901
|
-
return pr.foreignKeyFields && pr.foreignKeyFields.length > 0;
|
|
7902
|
-
}) && _react2.default.createElement(
|
|
7988
|
+
hasParameters && _react2.default.createElement(
|
|
7903
7989
|
'div',
|
|
7904
7990
|
{ className: 'accordion-panel-parameters',
|
|
7905
7991
|
onClick: function onClick() {
|
|
@@ -7917,7 +8003,7 @@ module.exports =
|
|
|
7917
8003
|
),
|
|
7918
8004
|
_react2.default.createElement(
|
|
7919
8005
|
'div',
|
|
7920
|
-
{ className:
|
|
8006
|
+
{ className: 'accordion-panel-close',
|
|
7921
8007
|
onClick: function onClick(e) {
|
|
7922
8008
|
return didRemoveEntity(e, resourceGroupIndex, rsc.name, i);
|
|
7923
8009
|
} },
|
|
@@ -7978,7 +8064,7 @@ module.exports =
|
|
|
7978
8064
|
onClick: showOverflow,
|
|
7979
8065
|
type: 'neutral', inputs: inputs,
|
|
7980
8066
|
values: primaryRscVals,
|
|
7981
|
-
sectionLabels:
|
|
8067
|
+
sectionLabels: primaryRscSectionLabels,
|
|
7982
8068
|
fieldPropLabel: 'label',
|
|
7983
8069
|
selectedValues: [{
|
|
7984
8070
|
label: rsc.primaryKeyName,
|
|
@@ -8014,7 +8100,7 @@ module.exports =
|
|
|
8014
8100
|
onClick: showOverflow,
|
|
8015
8101
|
type: 'neutral', inputs: inputs,
|
|
8016
8102
|
values: joinRscVals,
|
|
8017
|
-
sectionLabels:
|
|
8103
|
+
sectionLabels: joinRscSectionLabels,
|
|
8018
8104
|
fieldPropLabel: 'label',
|
|
8019
8105
|
selectedValues: [{
|
|
8020
8106
|
label: rsc.joinKeyName,
|
|
@@ -9491,6 +9577,9 @@ module.exports =
|
|
|
9491
9577
|
onClickOption: function onClickOption(v) {
|
|
9492
9578
|
change('resourceGroups', []);
|
|
9493
9579
|
change('scenario', null);
|
|
9580
|
+
if (_this2.props.nav.limitBackToCurrentPage) {
|
|
9581
|
+
_this2.props.nav.limitBackToCurrentPage();
|
|
9582
|
+
}
|
|
9494
9583
|
},
|
|
9495
9584
|
options: {
|
|
9496
9585
|
'normal': 'Read Data from ' + step[step.mode + 'Provider'],
|
|
@@ -10781,8 +10870,9 @@ module.exports =
|
|
|
10781
10870
|
formValues = _props.formValues,
|
|
10782
10871
|
actions = _props.actions;
|
|
10783
10872
|
|
|
10873
|
+
var isReverse = formValues.direction === 'reverse';
|
|
10784
10874
|
if (!wizard.dataLoaded) {
|
|
10785
|
-
(0, _loadData2.default)(step, wizard, change, formValues, actions);
|
|
10875
|
+
(0, _loadData2.default)(step, wizard, change, formValues, actions, isReverse);
|
|
10786
10876
|
}
|
|
10787
10877
|
}
|
|
10788
10878
|
}, {
|
|
@@ -10990,6 +11080,7 @@ module.exports =
|
|
|
10990
11080
|
var resourceGroups = [].concat(_toConsumableArray(formValues['resourceGroups']));
|
|
10991
11081
|
var rsc = resourceGroups[rgi].resources[i];
|
|
10992
11082
|
rsc.primaryKeyName = v;
|
|
11083
|
+
rsc.primaryKeyResource = field.section;
|
|
10993
11084
|
rsc.primaryKeyParents = field.parents;
|
|
10994
11085
|
change('resourceGroups', resourceGroups);
|
|
10995
11086
|
this.forceUpdate();
|
|
@@ -11004,6 +11095,7 @@ module.exports =
|
|
|
11004
11095
|
var resourceGroups = [].concat(_toConsumableArray(formValues['resourceGroups']));
|
|
11005
11096
|
var rsc = resourceGroups[rgi].resources[i];
|
|
11006
11097
|
rsc.joinKeyName = v;
|
|
11098
|
+
rsc.joinKeyResource = field.section;
|
|
11007
11099
|
rsc.joinKeyParents = field.parents;
|
|
11008
11100
|
change('resourceGroups', resourceGroups);
|
|
11009
11101
|
this.forceUpdate();
|
|
@@ -11374,6 +11466,8 @@ module.exports =
|
|
|
11374
11466
|
step = _props2.step,
|
|
11375
11467
|
actions = _props2.actions,
|
|
11376
11468
|
isReverse = _props2.isReverse;
|
|
11469
|
+
var sourceProvider = step.sourceProvider,
|
|
11470
|
+
destinationProvider = step.destinationProvider;
|
|
11377
11471
|
|
|
11378
11472
|
if (manageScenarios) {
|
|
11379
11473
|
this.setState({ loading: true });
|
|
@@ -11389,7 +11483,7 @@ module.exports =
|
|
|
11389
11483
|
|
|
11390
11484
|
var clone = (0, _objectAssignDeep2.default)({}, { bundles: resourceGroups });
|
|
11391
11485
|
|
|
11392
|
-
var _saveData = (0, _saveData3.default)(clone.bundles,
|
|
11486
|
+
var _saveData = (0, _saveData3.default)(clone.bundles, sourceProvider, destinationProvider, sourceMetadata, destinationMetadata, sourceEndpoint, isReverse),
|
|
11393
11487
|
bundles = _saveData.bundles,
|
|
11394
11488
|
mappings = _saveData.mappings;
|
|
11395
11489
|
|
|
@@ -11834,6 +11928,7 @@ module.exports =
|
|
|
11834
11928
|
_this.onSubmit = _this.onSubmit.bind(_this);
|
|
11835
11929
|
_this.goToPage = _this.goToPage.bind(_this);
|
|
11836
11930
|
_this.exitWithoutSaving = _this.exitWithoutSaving.bind(_this);
|
|
11931
|
+
_this.limitBackToCurrentPage = _this.limitBackToCurrentPage.bind(_this);
|
|
11837
11932
|
_this.state = {
|
|
11838
11933
|
currentPage: 1,
|
|
11839
11934
|
highestPage: 1
|
|
@@ -11865,8 +11960,9 @@ module.exports =
|
|
|
11865
11960
|
var formValues = Object.assign({}, values);
|
|
11866
11961
|
//resources: Type is the real value, Name is the displayed value
|
|
11867
11962
|
//properties: Name is the real value, Label is the displayed value
|
|
11963
|
+
var isReverse = formValues['direction'] === 'reverse';
|
|
11868
11964
|
|
|
11869
|
-
var _saveData = (0, _saveData3.default)(formValues['resourceGroups'], this.props.wizardConfig.destination.type, this.props.wizard.sourceMetadata, this.props.wizard.destinationMetadata, formValues.sourceEndpoint),
|
|
11965
|
+
var _saveData = (0, _saveData3.default)(formValues['resourceGroups'], this.props.wizardConfig.source.type, this.props.wizardConfig.destination.type, this.props.wizard.sourceMetadata, this.props.wizard.destinationMetadata, formValues.sourceEndpoint, isReverse),
|
|
11870
11966
|
bundles = _saveData.bundles,
|
|
11871
11967
|
mappings = _saveData.mappings,
|
|
11872
11968
|
endpoints = _saveData.endpoints;
|
|
@@ -11937,6 +12033,11 @@ module.exports =
|
|
|
11937
12033
|
this.props.exitWithoutSaving();
|
|
11938
12034
|
}
|
|
11939
12035
|
}
|
|
12036
|
+
}, {
|
|
12037
|
+
key: 'limitBackToCurrentPage',
|
|
12038
|
+
value: function limitBackToCurrentPage() {
|
|
12039
|
+
this.setState({ highestPage: this.state.currentPage });
|
|
12040
|
+
}
|
|
11940
12041
|
}, {
|
|
11941
12042
|
key: 'render',
|
|
11942
12043
|
value: function render() {
|
|
@@ -11993,7 +12094,8 @@ module.exports =
|
|
|
11993
12094
|
last: page === steps.length,
|
|
11994
12095
|
previousPage: _this2.previousPage,
|
|
11995
12096
|
nextPage: _this2.nextPage,
|
|
11996
|
-
exitWithoutSaving: _this2.exitWithoutSaving
|
|
12097
|
+
exitWithoutSaving: _this2.exitWithoutSaving,
|
|
12098
|
+
limitBackToCurrentPage: _this2.limitBackToCurrentPage
|
|
11997
12099
|
};
|
|
11998
12100
|
return _react2.default.createElement(
|
|
11999
12101
|
'div',
|