@lingk/sync 0.0.50 → 0.0.51

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/main.js CHANGED
@@ -172,8 +172,6 @@ module.exports =
172
172
  phase: 'initial'
173
173
  };
174
174
 
175
- console.log(wizard.savedConfiguration);
176
-
177
175
  if (!formValues['resourceGroups']) {
178
176
 
179
177
  if (wizard.savedBundles && wizard.savedBundles.bundles) {
@@ -207,7 +205,8 @@ module.exports =
207
205
  return map.bundleIndex === index;
208
206
  }).map(function (m) {
209
207
  // HERE GET CORRECT SOURCE METADATA
210
- var sourceResource = wizard.sourceMetadata.find(function (rsc) {
208
+ var dataSourceMetadata = m.isDestinationResource ? wizard.destinationMetadata : wizard.sourceMetadata;
209
+ var sourceResource = dataSourceMetadata.find(function (rsc) {
211
210
  return rsc.type === m.resourceFromName;
212
211
  });
213
212
  var sourceProperty = sourceResource.properties.find(function (prop) {
@@ -223,8 +222,9 @@ module.exports =
223
222
  resourceFromName: sourceResource.name,
224
223
  propertyFromName: sourceProperty.label,
225
224
  resourceToName: destinationResource.name,
226
- propertyToName: destinationProperty.label
227
- }, m.transformations && { transformations: m.transformations });
225
+ propertyToName: destinationProperty.label,
226
+ transformations: m.transformations && m.transformations.length > 0 ? m.transformations : [{ type: 'none' }]
227
+ }, m.isDestinationResource && { dataSourceIsDestinationEntity: true });
228
228
  })
229
229
  };
230
230
  });
@@ -615,8 +615,8 @@ module.exports =
615
615
  isBundleStep ? _react2.default.createElement(
616
616
  'div',
617
617
  { style: { position: 'absolute', right: 0, top: -2, zIndex: 99 } },
618
- _react2.default.createElement(Select, { label: '+', type: 'brand', style: { height: 40 }, menuAlign: 'right', extraClass: true,
619
- onSelect: this.addDefaultResourceGroup, values: destinationSchema, title: 'Add Destination',
618
+ _react2.default.createElement(Select, { label: 'Destination', type: 'brand', style: { height: 40 }, menuAlign: 'right',
619
+ onSelect: this.addDefaultResourceGroup, values: destinationSchema, title: 'Add Sync Operation',
620
620
  minWidth: 260
621
621
  })
622
622
  ) : null
@@ -2556,7 +2556,7 @@ module.exports =
2556
2556
  _react2.default.createElement(
2557
2557
  'p',
2558
2558
  null,
2559
- 'Choose a default datasets as the starting point for your integration.'
2559
+ 'Choose a default dataset as the starting point for your integration.'
2560
2560
  ),
2561
2561
  _react2.default.createElement('br', null),
2562
2562
  _react2.default.createElement(
@@ -3296,7 +3296,9 @@ module.exports =
3296
3296
  _react2.default.createElement(
3297
3297
  'p',
3298
3298
  null,
3299
- 'Map data elements from data sources to Salesforce object fields one dataset at a time.'
3299
+ 'Map data elements from data sources to ',
3300
+ step.destinationProvider,
3301
+ ' object fields one dataset at a time.'
3300
3302
  ),
3301
3303
  _react2.default.createElement('br', null),
3302
3304
  _react2.default.createElement(
@@ -3946,7 +3948,7 @@ module.exports =
3946
3948
  null,
3947
3949
  _react2.default.createElement(
3948
3950
  _groupNav2.default,
3949
- { isBundleStep: true, style: { position: 'relative', width: 540, height: 69, zIndex: 9000 },
3951
+ { isBundleStep: true, style: { position: 'relative', width: 585, height: 69, zIndex: 9000 },
3950
3952
  resourceGroups: resourceGroups, removeGroup: this.removeGroup, addGroup: this.addGroup,
3951
3953
  destinationSchema: destinationSchema, changeGroupOrder: this.changeGroupOrder, step: step,
3952
3954
  inputs: inputs, customizable: step.customizable, addDefaultEntity: this.addDefaultEntity },
@@ -4740,7 +4742,7 @@ module.exports =
4740
4742
  _react2.default.createElement(
4741
4743
  Tooltip,
4742
4744
  { nubbin: 'left-top', popStyle: { width: 250 },
4743
- wrapStyle: { position: 'absolute', left: 96, top: 6, zIndex: 6001 } },
4745
+ wrapStyle: { position: 'absolute', left: 86, top: 6, zIndex: 6001 } },
4744
4746
  _react2.default.createElement(
4745
4747
  'p',
4746
4748
  null,
@@ -4754,7 +4756,7 @@ module.exports =
4754
4756
  _react2.default.createElement(
4755
4757
  'div',
4756
4758
  { style: {
4757
- background: 'white', width: 540, minHeight: 245, overflow: overflowHidden ? 'hidden' : 'visible',
4759
+ background: 'white', width: 580, minHeight: 245, overflow: overflowHidden ? 'hidden' : 'visible',
4758
4760
  border: '1px solid rgb(204, 205, 207)', position: 'relative',
4759
4761
  height: groupResourcesLength * 58 + 84
4760
4762
  } },
@@ -4800,7 +4802,7 @@ module.exports =
4800
4802
  ),
4801
4803
  _react2.default.createElement(
4802
4804
  'div',
4803
- { style: { padding: '7px 0px 0px 5px', fontSize: '14px', overflow: 'hidden', display: 'inline-block', width: 209, textOverflow: 'ellipsis', whiteSpace: 'nowrap' } },
4805
+ { style: { padding: '7px 0px 0px 5px', fontSize: '14px', overflow: 'hidden', display: 'inline-block', width: 229, textOverflow: 'ellipsis', whiteSpace: 'nowrap' } },
4804
4806
  rsc.provider === step.destinationProvider ? rsc.name + (' (' + step.destinationProvider + ')') : rsc.name
4805
4807
  ),
4806
4808
  _react2.default.createElement(
@@ -4919,12 +4921,11 @@ module.exports =
4919
4921
 
4920
4922
  _createClass(TransformModal, [{
4921
4923
  key: 'changeTrimCount',
4922
- value: function changeTrimCount(e, v) {
4924
+ value: function changeTrimCount(e, v, mappingIndex) {
4923
4925
  var _props = this.props,
4924
4926
  change = _props.change,
4925
4927
  resourceGroups = _props.resourceGroups,
4926
- resourceGroupIndex = _props.resourceGroupIndex,
4927
- mappingIndex = _props.mappingIndex;
4928
+ resourceGroupIndex = _props.resourceGroupIndex;
4928
4929
 
4929
4930
  var groups = [].concat(_toConsumableArray(resourceGroups));
4930
4931
  var trans = resourceGroups[resourceGroupIndex].mappings[mappingIndex].transformations[0];
@@ -4946,19 +4947,19 @@ module.exports =
4946
4947
 
4947
4948
  var MapModal = inputs.MapModal;
4948
4949
  var Input = inputs.Input;
4949
-
4950
4950
  var groups = [].concat(_toConsumableArray(resourceGroups));
4951
4951
  var group = groups[resourceGroupIndex];
4952
4952
 
4953
- var transformation = mapping.transformations && mapping.transformations[0];
4954
-
4955
4953
  var mappingIndex = 0;
4954
+ var updatedMapping = {};
4956
4955
  group && group.mappings.forEach(function (m, i) {
4957
4956
  if (mapping.propertyToName === m.propertyToName) {
4958
4957
  mappingIndex = i;
4958
+ updatedMapping = m;
4959
4959
  }
4960
4960
  });
4961
4961
 
4962
+ var transformation = updatedMapping.transformations && updatedMapping.transformations[0];
4962
4963
  var transformSelected = transformation && transformation.type || 'none';
4963
4964
  var transformArgs = transformation && transformation.args || [];
4964
4965
 
@@ -4980,7 +4981,7 @@ module.exports =
4980
4981
  'div',
4981
4982
  { style: { width: 150, display: 'inline-block', marginBottom: 20 } },
4982
4983
  _react2.default.createElement(_reduxForm.Field, { name: 'resourceGroups.' + resourceGroupIndex + '.mappings.' + mappingIndex + '.transformations.0.type',
4983
- component: inputs.rfRadioGroup, label: 'Deployment Type', options: this.transformOptions,
4984
+ component: inputs.rfRadioGroup, label: 'Transformation Type', options: this.transformOptions,
4984
4985
  onClickOption: function onClickOption() {} })
4985
4986
  ),
4986
4987
  _react2.default.createElement(
@@ -5011,7 +5012,9 @@ module.exports =
5011
5012
  { style: { marginBottom: 8 } },
5012
5013
  'Limit final field length:'
5013
5014
  ),
5014
- _react2.default.createElement(Input, { style: { width: 132 }, label: 'Character Count', onChange: this.changeTrimCount,
5015
+ _react2.default.createElement(Input, { style: { width: 132 }, label: 'Character Count', onChange: function onChange(e, v) {
5016
+ return _this2.changeTrimCount(e, v, mappingIndex);
5017
+ },
5015
5018
  defaultValue: transformArgs[1] || '' })
5016
5019
  ),
5017
5020
  transformSelected === 'date' && _react2.default.createElement(
@@ -5130,8 +5133,6 @@ module.exports =
5130
5133
 
5131
5134
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
5132
5135
 
5133
- function _toConsumableArray(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } else { return Array.from(arr); } }
5134
-
5135
5136
  function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
5136
5137
 
5137
5138
  function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
@@ -5203,7 +5204,7 @@ module.exports =
5203
5204
  //resources: Type is the real value, Name is the displayed value
5204
5205
  //properties: Name is the real value, Label is the displayed value
5205
5206
 
5206
- var bundles = [].concat(_toConsumableArray(formValues['resourceGroups'])) || [];
5207
+ var bundles = formValues['resourceGroups'] || [];
5207
5208
  var mappings = [];
5208
5209
  bundles.forEach(function (group, index) {
5209
5210
  var destinationResource = _this2.props.wizard.destinationMetadata ? _this2.props.wizard.destinationMetadata.find(function (rsc) {
@@ -5241,7 +5242,9 @@ module.exports =
5241
5242
  resourceToName: destinationResource.type,
5242
5243
  propertyToName: destinationProperty.name,
5243
5244
  bundleIndex: index
5244
- }, singleMapping.transformations && singleMapping.transformations.length > 0 && { transformations: singleMapping.transformations }));
5245
+ }, singleMapping.dataSourceIsDestinationEntity && { isDestinationResource: true }, singleMapping.transformations && singleMapping.transformations.length > 0 && !singleMapping.transformations.every(function (t) {
5246
+ return t.type === 'none';
5247
+ }) && { transformations: singleMapping.transformations }));
5245
5248
  }
5246
5249
  });
5247
5250
  delete group.mappings; // remove the mapping obj from a resourceGroup