@lingk/sync 0.0.54 → 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 +76 -46
- 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
|
}
|
|
@@ -18628,16 +18626,29 @@ module.exports =
|
|
|
18628
18626
|
_this.defaultResourceMapping = [{
|
|
18629
18627
|
name: 'Contact',
|
|
18630
18628
|
provider: 'Salesforce',
|
|
18629
|
+
lingkSourceKey: 'ExternalId',
|
|
18630
|
+
lingkSourceKeyObject: 'Applicants',
|
|
18631
18631
|
resources: [{
|
|
18632
|
-
name: '
|
|
18632
|
+
name: 'Applicants',
|
|
18633
18633
|
joinKeyName: '',
|
|
18634
18634
|
primaryKeyName: '',
|
|
18635
18635
|
provider: 'Banner'
|
|
18636
|
-
}
|
|
18637
|
-
|
|
18638
|
-
|
|
18639
|
-
|
|
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: '',
|
|
18640
18646
|
provider: 'Banner'
|
|
18647
|
+
}, {
|
|
18648
|
+
name: 'Contact',
|
|
18649
|
+
joinKeyName: 'externalId',
|
|
18650
|
+
primaryKeyName: 'StudentExternalId',
|
|
18651
|
+
provider: 'Salesforce'
|
|
18641
18652
|
}]
|
|
18642
18653
|
}];
|
|
18643
18654
|
_this.loadDefault = _this.loadDefault.bind(_this);
|
|
@@ -20335,8 +20346,6 @@ module.exports =
|
|
|
20335
20346
|
|
|
20336
20347
|
var _react2 = _interopRequireDefault(_react);
|
|
20337
20348
|
|
|
20338
|
-
var _reduxForm = __webpack_require__(4);
|
|
20339
|
-
|
|
20340
20349
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
20341
20350
|
|
|
20342
20351
|
var BundleTableSourceRow = exports.BundleTableSourceRow = function BundleTableSourceRow(props) {
|
|
@@ -20457,22 +20466,33 @@ module.exports =
|
|
|
20457
20466
|
group.mappings = group.mappings && group.mappings.filter(function (m) {
|
|
20458
20467
|
return !m.isExternalKeyMapping;
|
|
20459
20468
|
});
|
|
20460
|
-
|
|
20461
|
-
|
|
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
|
+
}
|
|
20482
|
+
});
|
|
20483
|
+
} else {
|
|
20484
|
+
if (group.lingkSourceKey) {
|
|
20462
20485
|
var map = {
|
|
20463
20486
|
isExternalKeyMapping: true,
|
|
20464
|
-
resourceFromName: group.
|
|
20465
|
-
propertyFromName:
|
|
20487
|
+
resourceFromName: group.lingkSourceKeyObject,
|
|
20488
|
+
propertyFromName: group.lingkSourceKey,
|
|
20466
20489
|
resourceToName: group.name,
|
|
20467
|
-
propertyToName:
|
|
20490
|
+
propertyToName: 'externalId'
|
|
20468
20491
|
};
|
|
20469
|
-
|
|
20470
|
-
|
|
20471
|
-
} else {
|
|
20472
|
-
group.mappings = [map];
|
|
20473
|
-
}
|
|
20492
|
+
group.mappings = group.mappings || [];
|
|
20493
|
+
group.mappings.push(map);
|
|
20474
20494
|
}
|
|
20475
|
-
}
|
|
20495
|
+
}
|
|
20476
20496
|
change('resourceGroups', rgs);
|
|
20477
20497
|
hideModal();
|
|
20478
20498
|
};
|
|
@@ -20506,8 +20526,8 @@ module.exports =
|
|
|
20506
20526
|
var selectSourceKeyForLingk = function selectSourceKeyForLingk(key, section) {
|
|
20507
20527
|
var rgs = [].concat(_toConsumableArray(resourceGroups));
|
|
20508
20528
|
var group = rgs[bundleIndex];
|
|
20509
|
-
group.
|
|
20510
|
-
group.
|
|
20529
|
+
group.lingkSourceKey = key;
|
|
20530
|
+
group.lingkSourceKeyObject = section;
|
|
20511
20531
|
change('resourceGroups', rgs);
|
|
20512
20532
|
props.update();
|
|
20513
20533
|
};
|
|
@@ -20555,6 +20575,7 @@ module.exports =
|
|
|
20555
20575
|
});
|
|
20556
20576
|
|
|
20557
20577
|
var sourceKeys = resourceGroups[bundleIndex].sourceKeys || [''];
|
|
20578
|
+
var destinationKeys = resourceGroups[bundleIndex].destinationKeys || [''];
|
|
20558
20579
|
|
|
20559
20580
|
return _react2.default.createElement(
|
|
20560
20581
|
Modal,
|
|
@@ -20653,7 +20674,9 @@ module.exports =
|
|
|
20653
20674
|
return defaultRsc.name === bundle.name;
|
|
20654
20675
|
}) && destinationSchema.find(function (defaultRsc) {
|
|
20655
20676
|
return defaultRsc.name === bundle.name;
|
|
20656
|
-
}).properties
|
|
20677
|
+
}).properties.filter(function (p) {
|
|
20678
|
+
return !p.readOnly;
|
|
20679
|
+
})],
|
|
20657
20680
|
sectionLabels: [bundle.name], sectionLabelSuffix: 'Fields', fieldPropLabel: 'label',
|
|
20658
20681
|
selectedValues: resourceGroups[bundleIndex].destinationKeys && resourceGroups[bundleIndex].destinationKeys.map(function (ks) {
|
|
20659
20682
|
return { label: ks };
|
|
@@ -20675,7 +20698,11 @@ module.exports =
|
|
|
20675
20698
|
)
|
|
20676
20699
|
);
|
|
20677
20700
|
}),
|
|
20678
|
-
sourceKeys && sourceKeys.length < 5 &&
|
|
20701
|
+
sourceKeys && sourceKeys.length < 5 && sourceKeys.every(function (sk) {
|
|
20702
|
+
return sk;
|
|
20703
|
+
}) && destinationKeys.every(function (dk) {
|
|
20704
|
+
return dk;
|
|
20705
|
+
}) && _react2.default.createElement(
|
|
20679
20706
|
'div',
|
|
20680
20707
|
{ style: { paddingTop: 10, width: '47%', textAlign: 'center' } },
|
|
20681
20708
|
_react2.default.createElement(
|
|
@@ -20726,14 +20753,13 @@ module.exports =
|
|
|
20726
20753
|
_react2.default.createElement(
|
|
20727
20754
|
'div',
|
|
20728
20755
|
{ className: 'external-keys-column' },
|
|
20729
|
-
_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' },
|
|
20730
20758
|
onSelect: function onSelect(v, i, rtid, section) {
|
|
20731
20759
|
return selectSourceKeyForLingk(v, section);
|
|
20732
20760
|
}, type: 'brand',
|
|
20733
20761
|
values: vals, sectionLabels: sectionLabels, sectionLabelSuffix: 'Fields', fieldPropLabel: 'label',
|
|
20734
|
-
selectedValues:
|
|
20735
|
-
return { label: ks };
|
|
20736
|
-
})
|
|
20762
|
+
selectedValues: [{ label: resourceGroups[bundleIndex].lingkSourceKey }]
|
|
20737
20763
|
})
|
|
20738
20764
|
),
|
|
20739
20765
|
_react2.default.createElement(
|
|
@@ -20948,20 +20974,16 @@ module.exports =
|
|
|
20948
20974
|
'div',
|
|
20949
20975
|
{ className: 'accordion-panel-collapse',
|
|
20950
20976
|
style: {
|
|
20951
|
-
height: schema && selectedEntity.name === rsc.name ? schema.
|
|
20977
|
+
height: schema && selectedEntity.name === rsc.name ? schema.find(function (r) {
|
|
20952
20978
|
return r.name === rsc.name;
|
|
20953
|
-
})
|
|
20979
|
+
}).properties.length * 18 + 19 : 0,
|
|
20954
20980
|
padding: '0 6px'
|
|
20955
20981
|
}
|
|
20956
20982
|
},
|
|
20957
20983
|
_react2.default.createElement('div', { style: { height: 9 } }),
|
|
20958
20984
|
schema && schema.find(function (r) {
|
|
20959
20985
|
return r.name === rsc.name;
|
|
20960
|
-
}).properties.
|
|
20961
|
-
if (a.label < b.label) return -1;
|
|
20962
|
-
if (a.label > b.label) return 1;
|
|
20963
|
-
return 0;
|
|
20964
|
-
}).map(function (field, ii) {
|
|
20986
|
+
}).properties.map(function (field, ii) {
|
|
20965
20987
|
var style = {
|
|
20966
20988
|
paddingLeft: 5,
|
|
20967
20989
|
background: selectedField && selectedField === field.label ? '#dfe0e0' : 'initial',
|
|
@@ -21011,10 +21033,8 @@ module.exports =
|
|
|
21011
21033
|
{ className: 'scrolly', style: { height: 256, padding: '8px 12px' } },
|
|
21012
21034
|
destinationSchema && destinationSchema.find(function (r) {
|
|
21013
21035
|
return r.name === group.name;
|
|
21014
|
-
}).properties.
|
|
21015
|
-
|
|
21016
|
-
if (a.label > b.label) return 1;
|
|
21017
|
-
return 0;
|
|
21036
|
+
}).properties.filter(function (p) {
|
|
21037
|
+
return !p.readOnly;
|
|
21018
21038
|
}).map(function (field, i) {
|
|
21019
21039
|
return _react2.default.createElement(
|
|
21020
21040
|
'div',
|
|
@@ -21555,13 +21575,13 @@ module.exports =
|
|
|
21555
21575
|
_react2.default.createElement(
|
|
21556
21576
|
'p',
|
|
21557
21577
|
null,
|
|
21558
|
-
'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 (',
|
|
21559
21579
|
group.resources[0].name,
|
|
21560
21580
|
')'
|
|
21561
21581
|
)
|
|
21562
21582
|
),
|
|
21563
21583
|
_react2.default.createElement(_reduxForm.Field, { component: inputs.rfSelect, type: 'input',
|
|
21564
|
-
defaultLabel: 'Choose Join Key', colorType: 'brand',
|
|
21584
|
+
defaultLabel: 'Choose ' + rsc.name + ' Join Key', colorType: 'brand',
|
|
21565
21585
|
selectedValue: group.resources[i].joinKeyName, onClick: function onClick() {
|
|
21566
21586
|
showOverflow();
|
|
21567
21587
|
},
|
|
@@ -21586,7 +21606,7 @@ module.exports =
|
|
|
21586
21606
|
'Primary Object Join Key'
|
|
21587
21607
|
),
|
|
21588
21608
|
_react2.default.createElement(_reduxForm.Field, { component: inputs.rfSelect, type: 'input',
|
|
21589
|
-
defaultLabel: 'Choose
|
|
21609
|
+
defaultLabel: 'Choose ' + group.resources[0].name + ' Join Key', colorType: 'brand',
|
|
21590
21610
|
selectedValue: group.resources[i].primaryKeyName, onClick: function onClick() {
|
|
21591
21611
|
showOverflow();
|
|
21592
21612
|
},
|
|
@@ -22005,6 +22025,12 @@ module.exports =
|
|
|
22005
22025
|
var mappings = [];
|
|
22006
22026
|
bundles.forEach(function (group, index) {
|
|
22007
22027
|
|
|
22028
|
+
if (!group.customExternalKeys) {
|
|
22029
|
+
group.sourceKeys = [group.lingkSourceKey];
|
|
22030
|
+
group.sourceKeysObjects = [group.lingkSourceKeyObject];
|
|
22031
|
+
group.destinationKeys = ['externalId'];
|
|
22032
|
+
}
|
|
22033
|
+
|
|
22008
22034
|
// get resource + name + destinationKeys
|
|
22009
22035
|
var destinationResource = _this2.props.wizard.destinationMetadata ? _this2.props.wizard.destinationMetadata.find(function (rsc) {
|
|
22010
22036
|
return rsc.name === group.name;
|
|
@@ -22014,6 +22040,8 @@ module.exports =
|
|
|
22014
22040
|
group.destinationKeys = group.destinationKeys.map(function (dk) {
|
|
22015
22041
|
return destinationResource && destinationResource.properties && destinationResource.properties.find(function (prop) {
|
|
22016
22042
|
return prop.label === dk;
|
|
22043
|
+
}) && destinationResource.properties.find(function (prop) {
|
|
22044
|
+
return prop.label === dk;
|
|
22017
22045
|
}).name || "lingk__externalId__c";
|
|
22018
22046
|
});
|
|
22019
22047
|
} else {
|
|
@@ -22080,6 +22108,8 @@ module.exports =
|
|
|
22080
22108
|
}
|
|
22081
22109
|
});
|
|
22082
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;
|
|
22083
22113
|
}
|
|
22084
22114
|
|
|
22085
22115
|
if (group.resources) {
|