@lingk/sync 0.0.53 → 0.0.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.map +1 -1
- package/build/lingk.js.map +1 -1
- package/build/main.js +96 -50
- package/build/main.js.map +1 -1
- package/build/reducer.js.map +1 -1
- package/package.json +1 -1
package/build/main.js
CHANGED
|
@@ -4553,12 +4553,10 @@ module.exports =
|
|
|
4553
4553
|
return sourceKeyProperty.label;
|
|
4554
4554
|
});
|
|
4555
4555
|
|
|
4556
|
-
return {
|
|
4556
|
+
return Object.assign({
|
|
4557
4557
|
name: bundleResource.name,
|
|
4558
|
-
|
|
4559
|
-
|
|
4560
|
-
destinationKeys: destinationKeys,
|
|
4561
|
-
customExternalKeys: bundle.customExternalKeys,
|
|
4558
|
+
customExternalKeys: bundle.customExternalKeys
|
|
4559
|
+
}, bundle.customExternalKeys === true && { sourceKeys: sourceKeys, sourceKeysObjects: sourceKeysObjects, destinationKeys: destinationKeys }, bundle.customExternalKeys === false && { lingkSourceKey: sourceKeys[0], lingkSourceKeyObject: sourceKeysObjects[0] }, {
|
|
4562
4560
|
provider: bundle.provider.charAt(0).toUpperCase() + bundle.provider.slice(1),
|
|
4563
4561
|
resources: bundle.resources && bundle.resources.map(function (rsc) {
|
|
4564
4562
|
|
|
@@ -4613,7 +4611,7 @@ module.exports =
|
|
|
4613
4611
|
transformations: m.transformations && m.transformations.length > 0 ? m.transformations : [{ type: 'none' }]
|
|
4614
4612
|
}, m.isDestinationResource && { dataSourceIsDestinationEntity: true }, m.isExternalKeyMapping && { isExternalKeyMapping: true });
|
|
4615
4613
|
})
|
|
4616
|
-
};
|
|
4614
|
+
});
|
|
4617
4615
|
});
|
|
4618
4616
|
change('resourceGroups', formValues['resourceGroups'] || resourceGroups);
|
|
4619
4617
|
}
|
|
@@ -18627,19 +18625,30 @@ module.exports =
|
|
|
18627
18625
|
|
|
18628
18626
|
_this.defaultResourceMapping = [{
|
|
18629
18627
|
name: 'Contact',
|
|
18630
|
-
sourceKey: 'ExternalId',
|
|
18631
|
-
destinationKey: 'Account ID',
|
|
18632
18628
|
provider: 'Salesforce',
|
|
18629
|
+
lingkSourceKey: 'ExternalId',
|
|
18630
|
+
lingkSourceKeyObject: 'Applicants',
|
|
18633
18631
|
resources: [{
|
|
18634
|
-
name: '
|
|
18632
|
+
name: 'Applicants',
|
|
18635
18633
|
joinKeyName: '',
|
|
18636
18634
|
primaryKeyName: '',
|
|
18637
18635
|
provider: 'Banner'
|
|
18638
|
-
}
|
|
18639
|
-
|
|
18640
|
-
|
|
18641
|
-
|
|
18636
|
+
}]
|
|
18637
|
+
}, {
|
|
18638
|
+
name: 'Admissions Application',
|
|
18639
|
+
provider: 'Salesforce',
|
|
18640
|
+
lingkSourceKey: 'StudentExternalId',
|
|
18641
|
+
lingkSourceKeyObject: 'Student Applications',
|
|
18642
|
+
resources: [{
|
|
18643
|
+
name: 'Student Applications',
|
|
18644
|
+
joinKeyName: '',
|
|
18645
|
+
primaryKeyName: '',
|
|
18642
18646
|
provider: 'Banner'
|
|
18647
|
+
}, {
|
|
18648
|
+
name: 'Contact',
|
|
18649
|
+
joinKeyName: 'externalId',
|
|
18650
|
+
primaryKeyName: 'StudentExternalId',
|
|
18651
|
+
provider: 'Salesforce'
|
|
18643
18652
|
}]
|
|
18644
18653
|
}];
|
|
18645
18654
|
_this.loadDefault = _this.loadDefault.bind(_this);
|
|
@@ -20337,8 +20346,6 @@ module.exports =
|
|
|
20337
20346
|
|
|
20338
20347
|
var _react2 = _interopRequireDefault(_react);
|
|
20339
20348
|
|
|
20340
|
-
var _reduxForm = __webpack_require__(4);
|
|
20341
|
-
|
|
20342
20349
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
20343
20350
|
|
|
20344
20351
|
var BundleTableSourceRow = exports.BundleTableSourceRow = function BundleTableSourceRow(props) {
|
|
@@ -20456,18 +20463,36 @@ module.exports =
|
|
|
20456
20463
|
var closeModal = function closeModal() {
|
|
20457
20464
|
var rgs = [].concat(_toConsumableArray(resourceGroups));
|
|
20458
20465
|
var group = rgs[bundleIndex];
|
|
20459
|
-
group.mappings = group.mappings.filter(function (m) {
|
|
20466
|
+
group.mappings = group.mappings && group.mappings.filter(function (m) {
|
|
20460
20467
|
return !m.isExternalKeyMapping;
|
|
20461
20468
|
});
|
|
20462
|
-
group.
|
|
20463
|
-
group.
|
|
20464
|
-
|
|
20465
|
-
|
|
20466
|
-
|
|
20467
|
-
|
|
20468
|
-
|
|
20469
|
+
if (group.customExternalKeys) {
|
|
20470
|
+
group.sourceKeys && group.sourceKeys.forEach(function (sk, i) {
|
|
20471
|
+
if (sk && group.destinationKeys && group.destinationKeys[i]) {
|
|
20472
|
+
var map = {
|
|
20473
|
+
isExternalKeyMapping: true,
|
|
20474
|
+
resourceFromName: group.sourceKeysObjects[i],
|
|
20475
|
+
propertyFromName: sk,
|
|
20476
|
+
resourceToName: group.name,
|
|
20477
|
+
propertyToName: group.destinationKeys[i]
|
|
20478
|
+
};
|
|
20479
|
+
group.mappings = group.mappings || [];
|
|
20480
|
+
group.mappings.push(map);
|
|
20481
|
+
}
|
|
20469
20482
|
});
|
|
20470
|
-
}
|
|
20483
|
+
} else {
|
|
20484
|
+
if (group.lingkSourceKey) {
|
|
20485
|
+
var map = {
|
|
20486
|
+
isExternalKeyMapping: true,
|
|
20487
|
+
resourceFromName: group.lingkSourceKeyObject,
|
|
20488
|
+
propertyFromName: group.lingkSourceKey,
|
|
20489
|
+
resourceToName: group.name,
|
|
20490
|
+
propertyToName: 'externalId'
|
|
20491
|
+
};
|
|
20492
|
+
group.mappings = group.mappings || [];
|
|
20493
|
+
group.mappings.push(map);
|
|
20494
|
+
}
|
|
20495
|
+
}
|
|
20471
20496
|
change('resourceGroups', rgs);
|
|
20472
20497
|
hideModal();
|
|
20473
20498
|
};
|
|
@@ -20501,8 +20526,8 @@ module.exports =
|
|
|
20501
20526
|
var selectSourceKeyForLingk = function selectSourceKeyForLingk(key, section) {
|
|
20502
20527
|
var rgs = [].concat(_toConsumableArray(resourceGroups));
|
|
20503
20528
|
var group = rgs[bundleIndex];
|
|
20504
|
-
group.
|
|
20505
|
-
group.
|
|
20529
|
+
group.lingkSourceKey = key;
|
|
20530
|
+
group.lingkSourceKeyObject = section;
|
|
20506
20531
|
change('resourceGroups', rgs);
|
|
20507
20532
|
props.update();
|
|
20508
20533
|
};
|
|
@@ -20510,8 +20535,13 @@ module.exports =
|
|
|
20510
20535
|
var selectCustomSourceKey = function selectCustomSourceKey(key, section, i) {
|
|
20511
20536
|
var rgs = [].concat(_toConsumableArray(resourceGroups));
|
|
20512
20537
|
var group = rgs[bundleIndex];
|
|
20513
|
-
|
|
20514
|
-
|
|
20538
|
+
if (i === 0) {
|
|
20539
|
+
group.sourceKeys = [key];
|
|
20540
|
+
group.sourceKeysObjects = [section];
|
|
20541
|
+
} else {
|
|
20542
|
+
group.sourceKeys[i] = key;
|
|
20543
|
+
group.sourceKeysObjects[i] = section;
|
|
20544
|
+
}
|
|
20515
20545
|
change('resourceGroups', rgs);
|
|
20516
20546
|
props.update();
|
|
20517
20547
|
};
|
|
@@ -20519,7 +20549,11 @@ module.exports =
|
|
|
20519
20549
|
var selectCustomDestinationKey = function selectCustomDestinationKey(key, i) {
|
|
20520
20550
|
var rgs = [].concat(_toConsumableArray(resourceGroups));
|
|
20521
20551
|
var group = rgs[bundleIndex];
|
|
20522
|
-
|
|
20552
|
+
if (i === 0) {
|
|
20553
|
+
group.destinationKeys = [key];
|
|
20554
|
+
} else {
|
|
20555
|
+
group.destinationKeys[i] = key;
|
|
20556
|
+
}
|
|
20523
20557
|
change('resourceGroups', rgs);
|
|
20524
20558
|
props.update();
|
|
20525
20559
|
};
|
|
@@ -20540,6 +20574,9 @@ module.exports =
|
|
|
20540
20574
|
}).properties;
|
|
20541
20575
|
});
|
|
20542
20576
|
|
|
20577
|
+
var sourceKeys = resourceGroups[bundleIndex].sourceKeys || [''];
|
|
20578
|
+
var destinationKeys = resourceGroups[bundleIndex].destinationKeys || [''];
|
|
20579
|
+
|
|
20543
20580
|
return _react2.default.createElement(
|
|
20544
20581
|
Modal,
|
|
20545
20582
|
{ opened: opened, hideModal: closeModal, title: 'Connect Source to Target' },
|
|
@@ -20602,7 +20639,7 @@ module.exports =
|
|
|
20602
20639
|
)
|
|
20603
20640
|
)
|
|
20604
20641
|
),
|
|
20605
|
-
|
|
20642
|
+
sourceKeys.map(function (sk, i) {
|
|
20606
20643
|
return _react2.default.createElement(
|
|
20607
20644
|
'div',
|
|
20608
20645
|
{ className: 'external-keys-row', key: i },
|
|
@@ -20637,7 +20674,9 @@ module.exports =
|
|
|
20637
20674
|
return defaultRsc.name === bundle.name;
|
|
20638
20675
|
}) && destinationSchema.find(function (defaultRsc) {
|
|
20639
20676
|
return defaultRsc.name === bundle.name;
|
|
20640
|
-
}).properties
|
|
20677
|
+
}).properties.filter(function (p) {
|
|
20678
|
+
return !p.readOnly;
|
|
20679
|
+
})],
|
|
20641
20680
|
sectionLabels: [bundle.name], sectionLabelSuffix: 'Fields', fieldPropLabel: 'label',
|
|
20642
20681
|
selectedValues: resourceGroups[bundleIndex].destinationKeys && resourceGroups[bundleIndex].destinationKeys.map(function (ks) {
|
|
20643
20682
|
return { label: ks };
|
|
@@ -20659,7 +20698,11 @@ module.exports =
|
|
|
20659
20698
|
)
|
|
20660
20699
|
);
|
|
20661
20700
|
}),
|
|
20662
|
-
|
|
20701
|
+
sourceKeys && sourceKeys.length < 5 && sourceKeys.every(function (sk) {
|
|
20702
|
+
return sk;
|
|
20703
|
+
}) && destinationKeys.every(function (dk) {
|
|
20704
|
+
return dk;
|
|
20705
|
+
}) && _react2.default.createElement(
|
|
20663
20706
|
'div',
|
|
20664
20707
|
{ style: { paddingTop: 10, width: '47%', textAlign: 'center' } },
|
|
20665
20708
|
_react2.default.createElement(
|
|
@@ -20710,14 +20753,13 @@ module.exports =
|
|
|
20710
20753
|
_react2.default.createElement(
|
|
20711
20754
|
'div',
|
|
20712
20755
|
{ className: 'external-keys-column' },
|
|
20713
|
-
_react2.default.createElement(Select, { label: resourceGroups[bundleIndex].
|
|
20756
|
+
_react2.default.createElement(Select, { label: resourceGroups[bundleIndex].lingkSourceKey || 'Choose Key',
|
|
20757
|
+
menuItemStyle: { height: 20, padding: '1px 8px' },
|
|
20714
20758
|
onSelect: function onSelect(v, i, rtid, section) {
|
|
20715
20759
|
return selectSourceKeyForLingk(v, section);
|
|
20716
20760
|
}, type: 'brand',
|
|
20717
20761
|
values: vals, sectionLabels: sectionLabels, sectionLabelSuffix: 'Fields', fieldPropLabel: 'label',
|
|
20718
|
-
selectedValues:
|
|
20719
|
-
return { label: ks };
|
|
20720
|
-
})
|
|
20762
|
+
selectedValues: [{ label: resourceGroups[bundleIndex].lingkSourceKey }]
|
|
20721
20763
|
})
|
|
20722
20764
|
),
|
|
20723
20765
|
_react2.default.createElement(
|
|
@@ -20932,20 +20974,16 @@ module.exports =
|
|
|
20932
20974
|
'div',
|
|
20933
20975
|
{ className: 'accordion-panel-collapse',
|
|
20934
20976
|
style: {
|
|
20935
|
-
height: schema && selectedEntity.name === rsc.name ? schema.
|
|
20977
|
+
height: schema && selectedEntity.name === rsc.name ? schema.find(function (r) {
|
|
20936
20978
|
return r.name === rsc.name;
|
|
20937
|
-
})
|
|
20979
|
+
}).properties.length * 18 + 19 : 0,
|
|
20938
20980
|
padding: '0 6px'
|
|
20939
20981
|
}
|
|
20940
20982
|
},
|
|
20941
20983
|
_react2.default.createElement('div', { style: { height: 9 } }),
|
|
20942
20984
|
schema && schema.find(function (r) {
|
|
20943
20985
|
return r.name === rsc.name;
|
|
20944
|
-
}).properties.
|
|
20945
|
-
if (a.label < b.label) return -1;
|
|
20946
|
-
if (a.label > b.label) return 1;
|
|
20947
|
-
return 0;
|
|
20948
|
-
}).map(function (field, ii) {
|
|
20986
|
+
}).properties.map(function (field, ii) {
|
|
20949
20987
|
var style = {
|
|
20950
20988
|
paddingLeft: 5,
|
|
20951
20989
|
background: selectedField && selectedField === field.label ? '#dfe0e0' : 'initial',
|
|
@@ -20995,10 +21033,8 @@ module.exports =
|
|
|
20995
21033
|
{ className: 'scrolly', style: { height: 256, padding: '8px 12px' } },
|
|
20996
21034
|
destinationSchema && destinationSchema.find(function (r) {
|
|
20997
21035
|
return r.name === group.name;
|
|
20998
|
-
}).properties.
|
|
20999
|
-
|
|
21000
|
-
if (a.label > b.label) return 1;
|
|
21001
|
-
return 0;
|
|
21036
|
+
}).properties.filter(function (p) {
|
|
21037
|
+
return !p.readOnly;
|
|
21002
21038
|
}).map(function (field, i) {
|
|
21003
21039
|
return _react2.default.createElement(
|
|
21004
21040
|
'div',
|
|
@@ -21539,13 +21575,13 @@ module.exports =
|
|
|
21539
21575
|
_react2.default.createElement(
|
|
21540
21576
|
'p',
|
|
21541
21577
|
null,
|
|
21542
|
-
'Choose a Join Key for this resource, whose value should equal the Join Key
|
|
21578
|
+
'Choose a Join Key for this resource, whose value should equal the Join Key for (',
|
|
21543
21579
|
group.resources[0].name,
|
|
21544
21580
|
')'
|
|
21545
21581
|
)
|
|
21546
21582
|
),
|
|
21547
21583
|
_react2.default.createElement(_reduxForm.Field, { component: inputs.rfSelect, type: 'input',
|
|
21548
|
-
defaultLabel: 'Choose Join Key', colorType: 'brand',
|
|
21584
|
+
defaultLabel: 'Choose ' + rsc.name + ' Join Key', colorType: 'brand',
|
|
21549
21585
|
selectedValue: group.resources[i].joinKeyName, onClick: function onClick() {
|
|
21550
21586
|
showOverflow();
|
|
21551
21587
|
},
|
|
@@ -21570,7 +21606,7 @@ module.exports =
|
|
|
21570
21606
|
'Primary Object Join Key'
|
|
21571
21607
|
),
|
|
21572
21608
|
_react2.default.createElement(_reduxForm.Field, { component: inputs.rfSelect, type: 'input',
|
|
21573
|
-
defaultLabel: 'Choose
|
|
21609
|
+
defaultLabel: 'Choose ' + group.resources[0].name + ' Join Key', colorType: 'brand',
|
|
21574
21610
|
selectedValue: group.resources[i].primaryKeyName, onClick: function onClick() {
|
|
21575
21611
|
showOverflow();
|
|
21576
21612
|
},
|
|
@@ -21989,6 +22025,12 @@ module.exports =
|
|
|
21989
22025
|
var mappings = [];
|
|
21990
22026
|
bundles.forEach(function (group, index) {
|
|
21991
22027
|
|
|
22028
|
+
if (!group.customExternalKeys) {
|
|
22029
|
+
group.sourceKeys = [group.lingkSourceKey];
|
|
22030
|
+
group.sourceKeysObjects = [group.lingkSourceKeyObject];
|
|
22031
|
+
group.destinationKeys = ['externalId'];
|
|
22032
|
+
}
|
|
22033
|
+
|
|
21992
22034
|
// get resource + name + destinationKeys
|
|
21993
22035
|
var destinationResource = _this2.props.wizard.destinationMetadata ? _this2.props.wizard.destinationMetadata.find(function (rsc) {
|
|
21994
22036
|
return rsc.name === group.name;
|
|
@@ -21998,6 +22040,8 @@ module.exports =
|
|
|
21998
22040
|
group.destinationKeys = group.destinationKeys.map(function (dk) {
|
|
21999
22041
|
return destinationResource && destinationResource.properties && destinationResource.properties.find(function (prop) {
|
|
22000
22042
|
return prop.label === dk;
|
|
22043
|
+
}) && destinationResource.properties.find(function (prop) {
|
|
22044
|
+
return prop.label === dk;
|
|
22001
22045
|
}).name || "lingk__externalId__c";
|
|
22002
22046
|
});
|
|
22003
22047
|
} else {
|
|
@@ -22064,6 +22108,8 @@ module.exports =
|
|
|
22064
22108
|
}
|
|
22065
22109
|
});
|
|
22066
22110
|
delete group.mappings; // remove the mapping obj from a resourceGroup
|
|
22111
|
+
if (group.lingkSourceKey) delete group.lingkSourceKey;
|
|
22112
|
+
if (group.lingkSourceKeyObject) delete group.lingkSourceKeyObject;
|
|
22067
22113
|
}
|
|
22068
22114
|
|
|
22069
22115
|
if (group.resources) {
|